summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-04-17 08:19:54 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:28 +0200
commitc9e4609d87570fc407014cd4b34a60611ad63fac (patch)
treeb0249d79349ff6e3b54948755750f61dea8fd0bf /src/shader_recompiler
parentspirv: Use explicit lods outside of fragment shaders (diff)
downloadyuzu-c9e4609d87570fc407014cd4b34a60611ad63fac.tar
yuzu-c9e4609d87570fc407014cd4b34a60611ad63fac.tar.gz
yuzu-c9e4609d87570fc407014cd4b34a60611ad63fac.tar.bz2
yuzu-c9e4609d87570fc407014cd4b34a60611ad63fac.tar.lz
yuzu-c9e4609d87570fc407014cd4b34a60611ad63fac.tar.xz
yuzu-c9e4609d87570fc407014cd4b34a60611ad63fac.tar.zst
yuzu-c9e4609d87570fc407014cd4b34a60611ad63fac.zip
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_context.h4
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_image.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.h b/src/shader_recompiler/backend/spirv/emit_context.h
index 9db2b0c94..7567fdcac 100644
--- a/src/shader_recompiler/backend/spirv/emit_context.h
+++ b/src/shader_recompiler/backend/spirv/emit_context.h
@@ -101,6 +101,10 @@ public:
return Constant(U32[1], value);
}
+ Id Const(f32 value) {
+ return Constant(F32[1], value);
+ }
+
Id Const(u32 element_1, u32 element_2) {
return ConstantComposite(U32[2], Const(element_1), Const(element_2));
}
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp
index fea3bc112..7a4388e7e 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp
@@ -320,7 +320,7 @@ Id EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value&
// We can't use implicit lods on non-fragment stages on SPIR-V. Maxwell hardware behaves as
// if the lod was explicitly zero. This may change on Turing with implicit compute
// derivatives
- const Id lod{ctx.Const(0)};
+ const Id lod{ctx.Const(0.0f)};
const ImageOperands operands(ctx, false, true, info.has_lod_clamp != 0, lod, offset);
return Emit(&EmitContext::OpImageSparseSampleExplicitLod,
&EmitContext::OpImageSampleExplicitLod, ctx, inst, ctx.F32[4],