[Mesa-dev] [PATCH v6 1/2] spirv: add/hookup SpvCapabilityStencilExportEXT
Caio Marcelo de Oliveira Filho
caio.oliveira at intel.com
Fri May 11 19:15:49 UTC 2018
From: Gustavo Lima Chaves <gustavo.lima.chaves at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
---
This is the original patch from Gustavo Lima Chaves rebased and
with the added R-b's.
src/compiler/shader_info.h | 1 +
src/compiler/spirv/spirv_to_nir.c | 4 ++++
src/compiler/spirv/vtn_variables.c | 4 ++++
3 files changed, 9 insertions(+)
diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h
index afc53a88405..81f844d36ae 100644
--- a/src/compiler/shader_info.h
+++ b/src/compiler/shader_info.h
@@ -56,6 +56,7 @@ struct spirv_supported_capabilities {
bool trinary_minmax;
bool descriptor_array_dynamic_indexing;
bool runtime_descriptor_array;
+ bool stencil_export;
};
typedef struct shader_info {
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 78437428aa7..6c0551603ea 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -3396,6 +3396,10 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
spv_check_supported(runtime_descriptor_array, cap);
break;
+ case SpvCapabilityStencilExportEXT:
+ spv_check_supported(stencil_export, cap);
+ break;
+
default:
vtn_fail("Unhandled capability");
}
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index fd8ab7f247a..53bee1b9288 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1354,6 +1354,10 @@ vtn_get_builtin_location(struct vtn_builder *b,
*location = SYSTEM_VALUE_SUBGROUP_LT_MASK,
set_mode_system_value(b, mode);
break;
+ case SpvBuiltInFragStencilRefEXT:
+ *location = FRAG_RESULT_STENCIL;
+ vtn_assert(*mode == nir_var_shader_out);
+ break;
default:
vtn_fail("unsupported builtin");
}
--
2.17.0
More information about the mesa-dev
mailing list