Mesa (master): spirv: Add an execution environment to the options
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Mar 23 17:05:06 UTC 2019
Module: Mesa
Branch: master
Commit: 15012077bceda24cbf38afeda7723c47e1b0d3c3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=15012077bceda24cbf38afeda7723c47e1b0d3c3
Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date: Thu Mar 21 22:37:50 2019 -0700
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 at igalia.com>
Acked-by: Karol Herbst <kherbst at redhat.com>
---
src/compiler/spirv/nir_spirv.h | 8 ++++++++
src/mesa/main/glspirv.c | 1 +
2 files changed, 9 insertions(+)
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index d8ccbb48ff8..7a16422b291 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -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.
diff --git a/src/mesa/main/glspirv.c b/src/mesa/main/glspirv.c
index 227971091e1..84550e96ff6 100644
--- a/src/mesa/main/glspirv.c
+++ b/src/mesa/main/glspirv.c
@@ -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
More information about the mesa-commit
mailing list