Skip to content

Commit

Permalink
fix initialization of 2d and 3d image (#618)
Browse files Browse the repository at this point in the history
After #612 the cts started to regress on swiftshader.
It is because in the cts, the height and depth can be set to zero when
the dimension is not used.
  • Loading branch information
rjodinchr authored Oct 12, 2023
1 parent 6546d6d commit 7c824fe
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,21 @@ cvk_command_image_init::build_batchable_inner(cvk_command_buffer& cmdbuf) {
extent.height = m_image->height();
extent.depth = m_image->depth();

switch (m_image->type()) {
case CL_MEM_OBJECT_IMAGE2D:
case CL_MEM_OBJECT_IMAGE2D_ARRAY:
extent.depth = 1;
break;
case CL_MEM_OBJECT_IMAGE1D_BUFFER:
case CL_MEM_OBJECT_IMAGE1D:
case CL_MEM_OBJECT_IMAGE1D_ARRAY:
extent.height = 1;
extent.depth = 1;
break;
default:
break;
}

VkBufferImageCopy copy = {
0, // bufferOffset
row_length, // bufferRowLength
Expand Down

0 comments on commit 7c824fe

Please sign in to comment.