mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-21 23:09:01 +00:00
Make it possible to run kernel_read_write on a 1.x implementation (#615)
Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
19
test_conformance/images/kernel_read_write/test_common.cpp
Normal file
19
test_conformance/images/kernel_read_write/test_common.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
#include "test_common.h"
|
||||
|
||||
cl_sampler create_sampler(cl_context context, image_sampler_data *sdata, bool test_mipmaps, cl_int *error) {
|
||||
cl_sampler sampler = nullptr;
|
||||
if (test_mipmaps) {
|
||||
cl_sampler_properties properties[] = {
|
||||
CL_SAMPLER_NORMALIZED_COORDS, sdata->normalized_coords,
|
||||
CL_SAMPLER_ADDRESSING_MODE, sdata->addressing_mode,
|
||||
CL_SAMPLER_FILTER_MODE, sdata->filter_mode,
|
||||
CL_SAMPLER_MIP_FILTER_MODE, sdata->filter_mode,
|
||||
0};
|
||||
sampler = clCreateSamplerWithProperties(context, properties, error);
|
||||
} else {
|
||||
sampler = clCreateSampler(context, sdata->normalized_coords, sdata->addressing_mode, sdata->filter_mode, error);
|
||||
}
|
||||
return sampler;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user