summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-05-28 04:28:33 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:36 +0200
commit2a713337165df4d5c4228458999a680e9ab65369 (patch)
tree0e820cbfcedaaffafc34b334bd04107a51e2a24d /src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
parentglsl: remove unused headers (diff)
downloadyuzu-2a713337165df4d5c4228458999a680e9ab65369.tar
yuzu-2a713337165df4d5c4228458999a680e9ab65369.tar.gz
yuzu-2a713337165df4d5c4228458999a680e9ab65369.tar.bz2
yuzu-2a713337165df4d5c4228458999a680e9ab65369.tar.lz
yuzu-2a713337165df4d5c4228458999a680e9ab65369.tar.xz
yuzu-2a713337165df4d5c4228458999a680e9ab65369.tar.zst
yuzu-2a713337165df4d5c4228458999a680e9ab65369.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_image.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
index 6b7f1eaad..c070fba0e 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
@@ -32,14 +32,13 @@ void EmitImageSampleImplicitLod([[maybe_unused]] EmitContext& ctx, [[maybe_unuse
if (info.has_lod_clamp) {
throw NotImplementedException("Lod clamp samples");
}
+ const auto texture{Texture(ctx, info, index)};
if (!offset.IsEmpty()) {
- throw NotImplementedException("Offset");
- }
- if (info.type != TextureType::Color2D) {
- throw NotImplementedException("Texture type: {}", info.type.Value());
+ ctx.AddF32x4("{}=textureOffset({},{},ivec2({}));", inst, texture, coords,
+ ctx.reg_alloc.Consume(offset));
+ } else {
+ ctx.AddF32x4("{}=texture({},{});", inst, texture, coords);
}
- const auto texture{Texture(ctx, info, index)};
- ctx.AddF32x4("{}=texture({},{});", inst, texture, coords);
}
void EmitImageSampleExplicitLod([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,