mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-21 23:09:01 +00:00
Enable mipmap extension pragmas (#1349)
* Enable mipmap pragmas where appopriate. * clang-format changes.
This commit is contained in:
@@ -39,24 +39,28 @@ static size_t reduceImageSizeRange(size_t maxDimSize) {
|
||||
}
|
||||
|
||||
const char *read2DKernelSourcePattern =
|
||||
"__kernel void sample_kernel( read_only %s input,%s __global float *xOffsets, __global float *yOffsets, __global %s%s *results %s)\n"
|
||||
"{\n"
|
||||
"%s"
|
||||
" int tidX = get_global_id(0), tidY = get_global_id(1);\n"
|
||||
"%s"
|
||||
"%s"
|
||||
" results[offset] = read_image%s( input, imageSampler, coords %s);\n"
|
||||
"}";
|
||||
"%s\n"
|
||||
"__kernel void sample_kernel( read_only %s input,%s __global float "
|
||||
"*xOffsets, __global float *yOffsets, __global %s%s *results %s)\n"
|
||||
"{\n"
|
||||
"%s"
|
||||
" int tidX = get_global_id(0), tidY = get_global_id(1);\n"
|
||||
"%s"
|
||||
"%s"
|
||||
" results[offset] = read_image%s( input, imageSampler, coords %s);\n"
|
||||
"}";
|
||||
|
||||
const char *read_write2DKernelSourcePattern =
|
||||
"__kernel void sample_kernel( read_write %s input,%s __global float *xOffsets, __global float *yOffsets, __global %s%s *results %s)\n"
|
||||
"{\n"
|
||||
"%s"
|
||||
" int tidX = get_global_id(0), tidY = get_global_id(1);\n"
|
||||
"%s"
|
||||
"%s"
|
||||
" results[offset] = read_image%s( input, coords %s);\n"
|
||||
"}";
|
||||
"%s\n"
|
||||
"__kernel void sample_kernel( read_write %s input,%s __global float "
|
||||
"*xOffsets, __global float *yOffsets, __global %s%s *results %s)\n"
|
||||
"{\n"
|
||||
"%s"
|
||||
" int tidX = get_global_id(0), tidY = get_global_id(1);\n"
|
||||
"%s"
|
||||
"%s"
|
||||
" results[offset] = read_image%s( input, coords %s);\n"
|
||||
"}";
|
||||
|
||||
const char *intCoordKernelSource =
|
||||
" int2 coords = (int2)( xOffsets[offset], yOffsets[offset]);\n";
|
||||
@@ -1691,16 +1695,18 @@ int test_read_image_set_2D(cl_device_id device, cl_context context,
|
||||
}
|
||||
|
||||
|
||||
sprintf( programSrc, KernelSourcePattern,
|
||||
(format->image_channel_order == CL_DEPTH) ? "image2d_depth_t" : "image2d_t",
|
||||
samplerArg, get_explicit_type_name( outputType ),
|
||||
sprintf(programSrc, KernelSourcePattern,
|
||||
gTestMipmaps
|
||||
? "#pragma OPENCL EXTENSION cl_khr_mipmap_image: enable"
|
||||
: "",
|
||||
(format->image_channel_order == CL_DEPTH) ? "image2d_depth_t"
|
||||
: "image2d_t",
|
||||
samplerArg, get_explicit_type_name(outputType),
|
||||
(format->image_channel_order == CL_DEPTH) ? "" : "4",
|
||||
gTestMipmaps?", float lod":" ",
|
||||
samplerVar,
|
||||
gTestMipmaps? lodOffsetSource : offsetSource,
|
||||
floatCoords ? floatKernelSource : intCoordKernelSource,
|
||||
readFormat,
|
||||
gTestMipmaps?", lod":" ");
|
||||
gTestMipmaps ? ", float lod" : " ", samplerVar,
|
||||
gTestMipmaps ? lodOffsetSource : offsetSource,
|
||||
floatCoords ? floatKernelSource : intCoordKernelSource, readFormat,
|
||||
gTestMipmaps ? ", lod" : " ");
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper(context, &program, &kernel, 1, &ptr,
|
||||
|
||||
Reference in New Issue
Block a user