clc: add support for more image related extensions

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30834>
This commit is contained in:
Karol Herbst 2024-08-23 20:39:19 +02:00 committed by Marge Bot
parent 2fda0db66f
commit 9982568fa8
2 changed files with 20 additions and 0 deletions

View file

@ -54,6 +54,11 @@ struct clc_optional_features {
bool fp64;
bool int64;
bool images;
bool images_depth;
bool images_gl_depth;
bool images_gl_msaa;
bool images_mipmap;
bool images_mipmap_writes;
bool images_read_write;
bool images_write_3d;
bool integer_dot_product;

View file

@ -945,6 +945,21 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_3d_image_writes");
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+__opencl_c_3d_image_writes");
}
if (args->features.images_depth) {
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_depth_images");
}
if (args->features.images_gl_depth) {
c->getPreprocessorOpts().addMacroDef("cl_khr_gl_depth_images=1");
}
if (args->features.images_mipmap) {
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_mipmap_image");
}
if (args->features.images_mipmap_writes) {
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_mipmap_image_writes");
}
if (args->features.images_gl_msaa) {
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_khr_gl_msaa_sharing");
}
if (args->features.intel_subgroups) {
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("+cl_intel_subgroups");
needs_opencl_c_h = true;