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 19:55:07 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:36 +0200
commit453cd25da57e4088826cb6df48b5b6856affe109 (patch)
tree4bd46945e30e5bfaddbf95acf68fae913ac2dcb4 /src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
parentglsl: WIP var forward declaration (diff)
downloadyuzu-453cd25da57e4088826cb6df48b5b6856affe109.tar
yuzu-453cd25da57e4088826cb6df48b5b6856affe109.tar.gz
yuzu-453cd25da57e4088826cb6df48b5b6856affe109.tar.bz2
yuzu-453cd25da57e4088826cb6df48b5b6856affe109.tar.lz
yuzu-453cd25da57e4088826cb6df48b5b6856affe109.tar.xz
yuzu-453cd25da57e4088826cb6df48b5b6856affe109.tar.zst
yuzu-453cd25da57e4088826cb6df48b5b6856affe109.zip
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_image.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_image.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
index c070fba0e..1a34fe9b3 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
@@ -46,7 +46,20 @@ void EmitImageSampleExplicitLod([[maybe_unused]] EmitContext& ctx, [[maybe_unuse
[[maybe_unused]] std::string_view coords,
[[maybe_unused]] std::string_view lod_lc,
[[maybe_unused]] const IR::Value& offset) {
- throw NotImplementedException("GLSL Instruction");
+ const auto info{inst.Flags<IR::TextureInstInfo>()};
+ if (info.has_bias) {
+ throw NotImplementedException("Bias texture samples");
+ }
+ if (info.has_lod_clamp) {
+ throw NotImplementedException("Lod clamp samples");
+ }
+ const auto texture{Texture(ctx, info, index)};
+ if (!offset.IsEmpty()) {
+ ctx.AddF32x4("{}=textureLodOffset({},{},{},ivec2({}));", inst, texture, coords, lod_lc,
+ ctx.reg_alloc.Consume(offset));
+ } else {
+ ctx.AddF32x4("{}=textureLod({},{},{});", inst, texture, coords, lod_lc);
+ }
}
void EmitImageSampleDrefImplicitLod([[maybe_unused]] EmitContext& ctx,