summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-03-26 23:52:06 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:25 +0200
commitb7589fe1154d9e810e83f6c609dad1d646ec0359 (patch)
treef8b79ef7529b80f0322b0d84a88e3a7df225e3f0
parentshader: Store type of phi nodes in flags (diff)
downloadyuzu-b7589fe1154d9e810e83f6c609dad1d646ec0359.tar
yuzu-b7589fe1154d9e810e83f6c609dad1d646ec0359.tar.gz
yuzu-b7589fe1154d9e810e83f6c609dad1d646ec0359.tar.bz2
yuzu-b7589fe1154d9e810e83f6c609dad1d646ec0359.tar.lz
yuzu-b7589fe1154d9e810e83f6c609dad1d646ec0359.tar.xz
yuzu-b7589fe1154d9e810e83f6c609dad1d646ec0359.tar.zst
yuzu-b7589fe1154d9e810e83f6c609dad1d646ec0359.zip
-rw-r--r--src/shader_recompiler/backend/spirv/emit_context.cpp6
-rw-r--r--src/shader_recompiler/backend/spirv/emit_context.h1
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp2
-rw-r--r--src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp3
-rw-r--r--src/shader_recompiler/shader_info.h1
5 files changed, 13 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp
index 7531f8b21..ecee1220e 100644
--- a/src/shader_recompiler/backend/spirv/emit_context.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_context.cpp
@@ -492,6 +492,12 @@ void EmitContext::DefineOutputs(const Info& info) {
if (info.stores_position || stage == Stage::VertexB) {
output_position = DefineOutput(*this, F32[4], spv::BuiltIn::Position);
}
+ if (info.stores_point_size) {
+ if (stage == Stage::Fragment) {
+ throw NotImplementedException("Storing PointSize in Fragment stage");
+ }
+ output_point_size = DefineOutput(*this, F32[1], spv::BuiltIn::PointSize);
+ }
for (size_t i = 0; i < info.stores_generics.size(); ++i) {
if (info.stores_generics[i]) {
output_generics[i] = DefineOutput(*this, F32[4]);
diff --git a/src/shader_recompiler/backend/spirv/emit_context.h b/src/shader_recompiler/backend/spirv/emit_context.h
index ffac39c4f..97e055db4 100644
--- a/src/shader_recompiler/backend/spirv/emit_context.h
+++ b/src/shader_recompiler/backend/spirv/emit_context.h
@@ -120,6 +120,7 @@ public:
Id input_position{};
std::array<Id, 32> input_generics{};
+ Id output_point_size{};
Id output_position{};
std::array<Id, 32> output_generics{};
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
index 4a267b16c..c870fac47 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
@@ -37,6 +37,8 @@ Id OutputAttrPointer(EmitContext& ctx, IR::Attribute attr) {
return ctx.OpAccessChain(ctx.output_f32, ctx.output_generics.at(index), element_id());
}
switch (attr) {
+ case IR::Attribute::PointSize:
+ return ctx.output_point_size;
case IR::Attribute::PositionX:
case IR::Attribute::PositionY:
case IR::Attribute::PositionZ:
diff --git a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
index 81090335f..a47d54b9c 100644
--- a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
+++ b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
@@ -58,6 +58,9 @@ void SetAttribute(Info& info, IR::Attribute attribute) {
return;
}
switch (attribute) {
+ case IR::Attribute::PointSize:
+ info.stores_point_size = true;
+ break;
case IR::Attribute::PositionX:
case IR::Attribute::PositionY:
case IR::Attribute::PositionZ:
diff --git a/src/shader_recompiler/shader_info.h b/src/shader_recompiler/shader_info.h
index 4b4006b7f..3d8e08909 100644
--- a/src/shader_recompiler/shader_info.h
+++ b/src/shader_recompiler/shader_info.h
@@ -79,6 +79,7 @@ struct Info {
bool stores_frag_depth{};
std::array<bool, 32> stores_generics{};
bool stores_position{};
+ bool stores_point_size{};
bool uses_fp16{};
bool uses_fp64{};