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
Add copyBufferToTexture and copyTextureToBuffer validation tests (#4420)
In particular test that for copyBufferToTexture, and copyTextureToBuffer
* bytesPerRow must be a multiple of 256
* offset must be a multiple of bytesPerBlock
* the last row does not need to be a multiple of 256
In other words, If the copy size is 4x2 of a r8unorm texture that's 4 bytes per row.
To get from row 0 to row 1 in the buffer, bytesPerRow must be a multiple of 256.
But, the size requirement for the buffer is only 256 + 4, not 256 * 2
* origin.x must be a multiple of blockWidth
* origin.y must be a multiple of blockHeight
* copySize.width must be a multiple of blockWidth
* copySize.height must be a multiple of blockHeight
{xInBlocks: 1,yInBlocks: 1,copyWidthInBlocks: 64,copyHeightInBlocks: 2,offsetInBlocks: 1,bytesPerRowAlign: 256},// good
482
+
{xInBlocks: 0,yInBlocks: 0,copyWidthInBlocks: 64,copyHeightInBlocks: 2,offsetInBlocks: 1.5,bytesPerRowAlign: 256},// bad as offset is not blockSize
483
+
{xInBlocks: 0,yInBlocks: 0,copyWidthInBlocks: 64,copyHeightInBlocks: 2,offsetInBlocks: 0,bytesPerRowAlign: 128},// bad as bytesPerBlock is not multiple of 256
484
+
{xInBlocks: 0,yInBlocks: 0,copyWidthInBlocks: 64,copyHeightInBlocks: 2,offsetInBlocks: 0,bytesPerRowAlign: 384},// bad as bytesPerBlock is not multiple of 256
485
+
{xInBlocks: 1.5,yInBlocks: 0,copyWidthInBlocks: 64,copyHeightInBlocks: 2,offsetInBlocks: 0,bytesPerRowAlign: 256},// bad as origin.x is not multiple of blockSize
486
+
{xInBlocks: 0,yInBlocks: 1.5,copyWidthInBlocks: 64,copyHeightInBlocks: 2,offsetInBlocks: 0,bytesPerRowAlign: 256},// bad as origin.y is not multiple of blockSize
487
+
{xInBlocks: 0,yInBlocks: 0,copyWidthInBlocks: 64.5,copyHeightInBlocks: 2,offsetInBlocks: 0,bytesPerRowAlign: 256},// bad as copySize.width is not multiple of blockSize
488
+
{xInBlocks: 0,yInBlocks: 0,copyWidthInBlocks: 64,copyHeightInBlocks: 2.5,offsetInBlocks: 0,bytesPerRowAlign: 256},// bad as copySize.height is not multiple of blockSize
489
+
]asconst
490
+
)
491
+
// Remove non-integer offsetInBlocks, copyWidthInBlocks, copyHeightInBlocks if bytesPerBlock === 1
0 commit comments