diff --git a/test_conformance/images/samplerlessReads/test_iterations.cpp b/test_conformance/images/samplerlessReads/test_iterations.cpp index e2f89aad14..29e8846ee2 100644 --- a/test_conformance/images/samplerlessReads/test_iterations.cpp +++ b/test_conformance/images/samplerlessReads/test_iterations.cpp @@ -89,6 +89,10 @@ int test_read_image_2D( cl_context context, cl_command_queue queue, cl_kernel ke if(gTestReadWrite) { + // We need to reset this because gEnablePitch might be true and + // specifying a pitch on an image without a parent or host_ptr is + // invalid. + image_desc.image_row_pitch = 0; read_write_image = clCreateImage(context, CL_MEM_READ_WRITE, imageInfo->format, diff --git a/test_conformance/images/samplerlessReads/test_read_1D.cpp b/test_conformance/images/samplerlessReads/test_read_1D.cpp index 6ed9910a1c..33ebaa20f8 100644 --- a/test_conformance/images/samplerlessReads/test_read_1D.cpp +++ b/test_conformance/images/samplerlessReads/test_read_1D.cpp @@ -91,6 +91,10 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke if(gTestReadWrite) { + // We need to reset this because gEnablePitch might be true and + // specifying a pitch on an image without a parent or host_ptr is + // invalid. + image_desc.image_row_pitch = 0; read_write_image = clCreateImage(context, CL_MEM_READ_WRITE, imageInfo->format, diff --git a/test_conformance/images/samplerlessReads/test_read_1D_array.cpp b/test_conformance/images/samplerlessReads/test_read_1D_array.cpp index a751ad08d7..b06eed94d2 100644 --- a/test_conformance/images/samplerlessReads/test_read_1D_array.cpp +++ b/test_conformance/images/samplerlessReads/test_read_1D_array.cpp @@ -91,6 +91,10 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker if(gTestReadWrite) { + // We need to reset this because gEnablePitch might be true and + // specifying a pitch on an image without a parent or host_ptr is + // invalid. + image_desc.image_row_pitch = 0; read_write_image = clCreateImage(context, CL_MEM_READ_WRITE, imageInfo->format, diff --git a/test_conformance/images/samplerlessReads/test_read_2D_array.cpp b/test_conformance/images/samplerlessReads/test_read_2D_array.cpp index 8273f5388e..f310101f71 100644 --- a/test_conformance/images/samplerlessReads/test_read_2D_array.cpp +++ b/test_conformance/images/samplerlessReads/test_read_2D_array.cpp @@ -80,6 +80,11 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker if(gTestReadWrite) { + // We need to reset this because gEnablePitch might be true and + // specifying a pitch on an image without a parent or host_ptr is + // invalid. + image_desc.image_row_pitch = 0; + image_desc.image_slice_pitch = 0; read_write_image = clCreateImage(context, CL_MEM_READ_WRITE, imageInfo->format, diff --git a/test_conformance/images/samplerlessReads/test_read_3D.cpp b/test_conformance/images/samplerlessReads/test_read_3D.cpp index 1facc79459..079bd7e1c7 100644 --- a/test_conformance/images/samplerlessReads/test_read_3D.cpp +++ b/test_conformance/images/samplerlessReads/test_read_3D.cpp @@ -79,6 +79,11 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke if(gTestReadWrite) { + // We need to reset this because gEnablePitch might be true and + // specifying a pitch on an image without a parent or host_ptr is + // invalid. + image_desc.image_row_pitch = 0; + image_desc.image_slice_pitch = 0; read_write_image = clCreateImage(context, CL_MEM_READ_WRITE, imageInfo->format,