summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/spirv/emit_context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_context.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp
index c8ce58254..2e3e3346d 100644
--- a/src/shader_recompiler/backend/spirv/emit_context.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_context.cpp
@@ -176,6 +176,9 @@ void EmitContext::DefineCommonTypes(const Info& info) {
AddCapability(spv::Capability::Float64);
F64.Define(*this, TypeFloat(64), "f64");
}
+ if (info.stores_clip_distance) {
+ Array8F32 = Name(TypeArray(F32[1], Constant(U32[1], 8)), "array_8_f32");
+ }
}
void EmitContext::DefineCommonConstants() {
@@ -502,6 +505,12 @@ void EmitContext::DefineOutputs(const Info& info) {
}
output_point_size = DefineOutput(*this, F32[1], spv::BuiltIn::PointSize);
}
+ if (info.stores_clip_distance) {
+ if (stage == Stage::Fragment) {
+ throw NotImplementedException("Storing PointSize in Fragment stage");
+ }
+ clip_distances = DefineOutput(*this, Array8F32, spv::BuiltIn::ClipDistance);
+ }
for (size_t i = 0; i < info.stores_generics.size(); ++i) {
if (info.stores_generics[i]) {
output_generics[i] = DefineOutput(*this, F32[4]);