summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-05-21 07:12:32 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:33 +0200
commit9e7b6622c25aa858b96bf0f1c7f94223a2f449a2 (patch)
tree48c62889aeb79d6f0f01a467ba0d1ac01dec512b /src/shader_recompiler/backend/spirv/emit_spirv_special.cpp
parentemit_glasm_context_get_and_set.cpp: Add missing semicolons (diff)
downloadyuzu-9e7b6622c25aa858b96bf0f1c7f94223a2f449a2.tar
yuzu-9e7b6622c25aa858b96bf0f1c7f94223a2f449a2.tar.gz
yuzu-9e7b6622c25aa858b96bf0f1c7f94223a2f449a2.tar.bz2
yuzu-9e7b6622c25aa858b96bf0f1c7f94223a2f449a2.tar.lz
yuzu-9e7b6622c25aa858b96bf0f1c7f94223a2f449a2.tar.xz
yuzu-9e7b6622c25aa858b96bf0f1c7f94223a2f449a2.tar.zst
yuzu-9e7b6622c25aa858b96bf0f1c7f94223a2f449a2.zip
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_special.cpp')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_special.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp
index ba948f3c9..072a3b1bd 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp
@@ -18,8 +18,8 @@ void ConvertDepthMode(EmitContext& ctx) {
}
void SetFixedPipelinePointSize(EmitContext& ctx) {
- if (ctx.profile.fixed_state_point_size) {
- const float point_size{*ctx.profile.fixed_state_point_size};
+ if (ctx.runtime_info.fixed_state_point_size) {
+ const float point_size{*ctx.runtime_info.fixed_state_point_size};
ctx.OpStore(ctx.output_point_size, ctx.Const(point_size));
}
}
@@ -62,7 +62,10 @@ Id ComparisonFunction(EmitContext& ctx, CompareFunction comparison, Id operand_1
}
void AlphaTest(EmitContext& ctx) {
- const auto comparison{*ctx.profile.alpha_test_func};
+ if (!ctx.runtime_info.alpha_test_func) {
+ return;
+ }
+ const auto comparison{*ctx.runtime_info.alpha_test_func};
if (comparison == CompareFunction::Always) {
return;
}
@@ -76,7 +79,7 @@ void AlphaTest(EmitContext& ctx) {
const Id true_label{ctx.OpLabel()};
const Id discard_label{ctx.OpLabel()};
- const Id alpha_reference{ctx.Const(ctx.profile.alpha_test_reference)};
+ const Id alpha_reference{ctx.Const(ctx.runtime_info.alpha_test_reference)};
const Id condition{ComparisonFunction(ctx, comparison, alpha, alpha_reference)};
ctx.OpSelectionMerge(true_label, spv::SelectionControlMask::MaskNone);
@@ -113,7 +116,7 @@ void EmitPrologue(EmitContext& ctx) {
}
void EmitEpilogue(EmitContext& ctx) {
- if (ctx.stage == Stage::VertexB && ctx.profile.convert_depth_mode) {
+ if (ctx.stage == Stage::VertexB && ctx.runtime_info.convert_depth_mode) {
ConvertDepthMode(ctx);
}
if (ctx.stage == Stage::Fragment) {
@@ -122,7 +125,7 @@ void EmitEpilogue(EmitContext& ctx) {
}
void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) {
- if (ctx.profile.convert_depth_mode) {
+ if (ctx.runtime_info.convert_depth_mode) {
ConvertDepthMode(ctx);
}
if (stream.IsImmediate()) {