summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2021-04-18 09:07:48 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:28 +0200
commitf69d0b91ffad7d9ab827f55a9297b8f6da815cc9 (patch)
tree5b75418c9ca3fa934f68fe0772ae4e876f802a5b
parentshader: Add coarse derivatives (diff)
downloadyuzu-f69d0b91ffad7d9ab827f55a9297b8f6da815cc9.tar
yuzu-f69d0b91ffad7d9ab827f55a9297b8f6da815cc9.tar.gz
yuzu-f69d0b91ffad7d9ab827f55a9297b8f6da815cc9.tar.bz2
yuzu-f69d0b91ffad7d9ab827f55a9297b8f6da815cc9.tar.lz
yuzu-f69d0b91ffad7d9ab827f55a9297b8f6da815cc9.tar.xz
yuzu-f69d0b91ffad7d9ab827f55a9297b8f6da815cc9.tar.zst
yuzu-f69d0b91ffad7d9ab827f55a9297b8f6da815cc9.zip
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv.cpp2
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp5
-rw-r--r--src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp2
-rw-r--r--src/shader_recompiler/shader_info.h2
4 files changed, 4 insertions, 7 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
index c4d5874ca..5d6fdeb65 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
@@ -341,7 +341,7 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct
if (!ctx.profile.xfb_varyings.empty()) {
ctx.AddCapability(spv::Capability::TransformFeedback);
}
- if (info.uses_derivates) {
+ if (info.uses_derivatives) {
ctx.AddCapability(spv::Capability::DerivativeControl);
}
// TODO: Track this usage
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 1030404c0..ed57e44a2 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
@@ -404,10 +404,7 @@ Id EmitIsHelperInvocation(EmitContext& ctx) {
}
Id EmitYDirection(EmitContext& ctx) {
- if (ctx.profile.y_negate) {
- return ctx.Constant(ctx.F32[1], -1.0f);
- }
- return ctx.Constant(ctx.F32[1], 1.0f);
+ return ctx.Constant(ctx.F32[1], ctx.profile.y_negate ? -1.0f : 1.0f);
}
Id EmitLoadLocal(EmitContext& ctx, Id word_offset) {
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 7473e0bc2..0500a5141 100644
--- a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
+++ b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
@@ -534,7 +534,7 @@ void VisitUsages(Info& info, IR::Inst& inst) {
case IR::Opcode::DPdyFine:
case IR::Opcode::DPdxCoarse:
case IR::Opcode::DPdyCoarse:
- info.uses_derivates = true;
+ info.uses_derivatives = true;
break;
case IR::Opcode::LoadStorageU8:
case IR::Opcode::LoadStorageS8:
diff --git a/src/shader_recompiler/shader_info.h b/src/shader_recompiler/shader_info.h
index 3f22958e8..f808adeba 100644
--- a/src/shader_recompiler/shader_info.h
+++ b/src/shader_recompiler/shader_info.h
@@ -147,7 +147,7 @@ struct Info {
bool uses_subgroup_vote{};
bool uses_subgroup_mask{};
bool uses_fswzadd{};
- bool uses_derivates{};
+ bool uses_derivatives{};
bool uses_typeless_image_reads{};
bool uses_typeless_image_writes{};
bool uses_shared_increment{};