summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-01-04 21:53:44 +0100
committerGitHub <noreply@github.com>2024-01-04 21:53:44 +0100
commit92a331af76cba638f01490eeb0045ca4d6d27df7 (patch)
tree2f66b3dad2ee7c47cb8be910e0cbbaeced97ce6d /src/shader_recompiler
parentMerge pull request #12575 from t895/inconsistent-settings-application (diff)
parentSettings: Indicate AMD's compatibility with SPIR-V on OGL (diff)
downloadyuzu-92a331af76cba638f01490eeb0045ca4d6d27df7.tar
yuzu-92a331af76cba638f01490eeb0045ca4d6d27df7.tar.gz
yuzu-92a331af76cba638f01490eeb0045ca4d6d27df7.tar.bz2
yuzu-92a331af76cba638f01490eeb0045ca4d6d27df7.tar.lz
yuzu-92a331af76cba638f01490eeb0045ca4d6d27df7.tar.xz
yuzu-92a331af76cba638f01490eeb0045ca4d6d27df7.tar.zst
yuzu-92a331af76cba638f01490eeb0045ca4d6d27df7.zip
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_image.cpp12
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_instructions.h2
-rw-r--r--src/shader_recompiler/backend/spirv/spirv_emit_context.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
index 6e940bd5a..ad39f44c3 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
@@ -449,7 +449,7 @@ void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& inde
}
void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
- std::string_view coords, std::string_view offset, std::string_view lod,
+ std::string_view coords, const IR::Value& offset, std::string_view lod,
std::string_view ms) {
const auto info{inst.Flags<IR::TextureInstInfo>()};
if (info.has_bias) {
@@ -470,9 +470,9 @@ void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
const auto int_coords{CoordsCastToInt(coords, info)};
if (!ms.empty()) {
ctx.Add("{}=texelFetch({},{},int({}));", texel, texture, int_coords, ms);
- } else if (!offset.empty()) {
+ } else if (!offset.IsEmpty()) {
ctx.Add("{}=texelFetchOffset({},{},int({}),{});", texel, texture, int_coords, lod,
- CoordsCastToInt(offset, info));
+ GetOffsetVec(ctx, offset));
} else {
if (info.type == TextureType::Buffer) {
ctx.Add("{}=texelFetch({},int({}));", texel, texture, coords);
@@ -485,10 +485,10 @@ void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
if (!ms.empty()) {
throw NotImplementedException("EmitImageFetch Sparse MSAA samples");
}
- if (!offset.empty()) {
+ if (!offset.IsEmpty()) {
ctx.AddU1("{}=sparseTexelsResidentARB(sparseTexelFetchOffsetARB({},{},int({}),{},{}));",
- *sparse_inst, texture, CastToIntVec(coords, info), lod,
- CastToIntVec(offset, info), texel);
+ *sparse_inst, texture, CastToIntVec(coords, info), lod, GetOffsetVec(ctx, offset),
+ texel);
} else {
ctx.AddU1("{}=sparseTexelsResidentARB(sparseTexelFetchARB({},{},int({}),{}));",
*sparse_inst, texture, CastToIntVec(coords, info), lod, texel);
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
index 8d0a65047..acebaa785 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h
@@ -651,7 +651,7 @@ void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& inde
std::string_view coords, const IR::Value& offset, const IR::Value& offset2,
std::string_view dref);
void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
- std::string_view coords, std::string_view offset, std::string_view lod,
+ std::string_view coords, const IR::Value& offset, std::string_view lod,
std::string_view ms);
void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string_view lod, const IR::Value& skip_mips);
diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
index 89ebab08e..0442adc83 100644
--- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
+++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
@@ -1440,7 +1440,7 @@ void EmitContext::DefineInputs(const IR::Program& program) {
if (profile.support_vertex_instance_id) {
instance_id = DefineInput(*this, U32[1], true, spv::BuiltIn::InstanceId);
if (loads[IR::Attribute::BaseInstance]) {
- base_instance = DefineInput(*this, U32[1], true, spv::BuiltIn::BaseVertex);
+ base_instance = DefineInput(*this, U32[1], true, spv::BuiltIn::BaseInstance);
}
} else {
instance_index = DefineInput(*this, U32[1], true, spv::BuiltIn::InstanceIndex);