mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
spirv: Add an execution environment to the options
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>
This commit is contained in:
parent
dacb11a585
commit
15012077bc
2 changed files with 9 additions and 0 deletions
|
|
@ -50,7 +50,15 @@ enum nir_spirv_debug_level {
|
|||
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.
|
||||
|
|
|
|||
|
|
@ -211,6 +211,7 @@ _mesa_spirv_to_nir(struct gl_context *ctx,
|
|||
}
|
||||
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue