You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at it in this CL, I don't love the name imageHeight - it's kind of confusing what it means. We can update that later in sketch.webidl though, it doesn't block this CL.
maybe imagePitchInRows? slicePitchInRows? slicePitchHeight? "slice" may sort of collide with the 2darray meaning of "slice", but that's technically correct (I think) and "image" seems worse.
Brandon Jones (Intel):
I agree. Above all I'd like consistency with rowPitch, so columnPitch?
Additionally, units should match (both in bytes, or both in texels).
rowPitchInTexels is weird because we still need to keep the 256 byte alignment and that wouldn't be possible to express for 3-byte formats if we ever support them (256 is 85.3333.. texels).
columnPitchInBytes is weird too because it has to be a multiple of rowPitchInBytes so why not just express it as columnPitchInRowPitches which is the same as columnPitchInTexels?
Anyway that's a good question, can you raise an issue / PR and we can discuss it in the next meeting.
To add on, I don't think "column" is the right name because the "spacing" from one column to the next is just the spacing from one texel to the next (within a row).
i.e. from (x, y, z),
column+1 is (x+1, y, z)
row+1 is (x, y+1, z)
slice+1 is (x, y, z+1)
It seems misleading to me to refer to a stride/pitch as a "height" or "row count". Doesn't "height" kind of make it sound like the BufferCopyView.height and the Extent3D.height have to be equal?
No, it doesn't have to be the same, I'm pretty sure. Just like the row pitch can be larger than the length of the actual data in a row, the image pitch can be larger than the height of an the actual data in an image. If it does have to be the same, we shouldn't have both.
imagePitch or slicePitch is okay with me, but I still don't love using the "image" terminology here because it feels unnecessarily overloaded (e.g. a VkImage is a texture, and can be 3d).
rowPitch describes the number of bytes between each row of texels in an image.
arrayPitch describes the number of bytes between each array layer of an image.
depthPitch describes the number of bytes between each slice of 3D image.
rowPitch describes the number of bytes between each row of texels in an image.
arrayPitch describes the number of bytes between each array layer of an image.
depthPitch describes the number of bytes between each slice of 3D image.
But, that's not what it uses when copying the buffer data.
bufferRowLength and bufferImageHeight specify in texels a subregion of a larger two- or three-dimensional image in buffer memory, and control the addressing calculations. If either of these values is zero, that aspect of the buffer memory is considered to be tightly packed according to the imageExtent.
As a non-expert, the suggested names in the previous comments are confusing. imageHeight is pretty straight forward. Having having rowPitch in bytes and imageHeight in texels is also super weird.
bufferRowLength must be 0, or greater than or equal to the width member of imageExtent
Changing rowPitch to rowLength and specifying in texels makes more sense to me than changing the imageHeight name. Again, I'm not an expert and I don't fully understand the alignment concerns, but conceptually it's much easier to understand when, in the typical case, these values translate to image width and height in pixels.
FWIW, rowPitch in bytes and imageHeight in rows-of-texels is what I'd expect them to be, and shouldn't be too confusing for those with experience from other APIs. (which is the primary expected audience)
flyby: I haven't yet been able to figure out how Vulkan/D3D12's texels-per-row works, given the problem quoted above:
rowPitchInTexels is weird because we still need to keep the 256 byte alignment and that wouldn't be possible to express for 3-byte formats if we ever support them (256 is 85.3333.. texels).
Activity
kainino0x commentedon Dec 11, 2018
To add on, I don't think "column" is the right name because the "spacing" from one column to the next is just the spacing from one texel to the next (within a row).
kvark commentedon Dec 13, 2018
How about
rowCount?litherum commentedon Dec 13, 2018
I vote for
height, meaning "a collection of rowPitches." This is how every other graphics API I've used describes it.kainino0x commentedon Dec 13, 2018
It seems misleading to me to refer to a stride/pitch as a "height" or "row count". Doesn't "height" kind of make it sound like the BufferCopyView.height and the Extent3D.height have to be equal?
litherum commentedon Dec 13, 2018
Isn't that what it is?
If not, then I change my vote to
imagePitchto matchrowPitch.kainino0x commentedon Dec 13, 2018
No, it doesn't have to be the same, I'm pretty sure. Just like the row pitch can be larger than the length of the actual data in a row, the image pitch can be larger than the height of an the actual data in an image. If it does have to be the same, we shouldn't have both.
imagePitch or slicePitch is okay with me, but I still don't love using the "image" terminology here because it feels unnecessarily overloaded (e.g. a VkImage is a texture, and can be 3d).
kainino0x commentedon Dec 13, 2018
Vulkan uses:aloucks commentedon Jun 9, 2019
But, that's not what it uses when copying the buffer data.
As a non-expert, the suggested names in the previous comments are confusing.
imageHeightis pretty straight forward. Having havingrowPitchin bytes andimageHeightin texels is also super weird.https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkBufferImageCopy-bufferRowLength-00195
Changing
rowPitchtorowLengthand specifying in texels makes more sense to me than changing theimageHeightname. Again, I'm not an expert and I don't fully understand the alignment concerns, but conceptually it's much easier to understand when, in the typical case, these values translate to image width and height in pixels.kdashg commentedon Jun 11, 2019
FWIW,
rowPitchin bytes andimageHeightin rows-of-texels is what I'd expect them to be, and shouldn't be too confusing for those with experience from other APIs. (which is the primary expected audience)That said, Vulkan's clearly using texel-per-row there, as does D3D12:
https://docs.microsoft.com/en-us/windows/desktop/api/d3d12/nf-d3d12-id3d12graphicscommandlist-copytextureregion
Metal appears to use bytes-per-row and even bytes-per-image:
https://developer.apple.com/documentation/metal/mtlblitcommandencoder
kainino0x commentedon Jun 11, 2019
flyby: I haven't yet been able to figure out how Vulkan/D3D12's texels-per-row works, given the problem quoted above:
Rename row_pitch to row_length to match its current implementation
kdashg commentedon Jun 13, 2019
Vulkan appears to require bytesPerRow to be tightly strided, that is N*bytesPerTexel/Block.
kainino0x commentedon Jun 25, 2019
That makes it seem like we need the same restriction, and we could represent row pitch the same way.
kainino0x commentedon Dec 14, 2019
I stumbled on this again (#517) and I want to do something about it.
How does
zPitchorzPitchInRowssound, where it's in units of "rowPitch bytes"? "z" encompasses both "layer" and "depth" elsewhere in the API already.I think we should stick with rowPitch being in bytes. I, at least, find it more intuitive since I'm already thinking about the buffer in bytes.
imageHeight -> zPitchInRows
imageHeight -> zPitch
imageHeight -> imagePitch
buffer binding range test: more cases (gpuweb#148)