Also updates gl_spirv to pick the right one. At the moment nothing
uses it, but upcoming functionality part of ARB_gl_spirv will use it,
and we also later can be more assertful when handling certain features
for each of the execution environments.
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
NIR_SPIRV_DEBUG_LEVEL_ERROR,
};
+enum nir_spirv_execution_environment {
+ NIR_SPIRV_VULKAN = 0,
+ NIR_SPIRV_OPENCL,
+ NIR_SPIRV_OPENGL,
+};
+
struct spirv_to_nir_options {
+ enum nir_spirv_execution_environment environment;
+
/* Whether or not to lower all workgroup variable access to offsets
* up-front. This means you will _shared intrinsics instead of _var
* for workgroup data access.
}
const struct spirv_to_nir_options spirv_options = {
+ .environment = NIR_SPIRV_OPENGL,
.lower_workgroup_access_to_offsets = true,
.lower_ubo_ssbo_access_to_offsets = true,
.caps = ctx->Const.SpirVCapabilities