diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-05-30 00:08:19 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:36 +0200 |
commit | 3047eb66889a9782fadfbe479c33e6a8bfc5bf53 (patch) | |
tree | 9491643b07576e354844b39d5dffb321491aadf9 /src/shader_recompiler/backend/glsl/emit_glsl_image.cpp | |
parent | glsl: TLD4 implementation (diff) | |
download | yuzu-3047eb66889a9782fadfbe479c33e6a8bfc5bf53.tar yuzu-3047eb66889a9782fadfbe479c33e6a8bfc5bf53.tar.gz yuzu-3047eb66889a9782fadfbe479c33e6a8bfc5bf53.tar.bz2 yuzu-3047eb66889a9782fadfbe479c33e6a8bfc5bf53.tar.lz yuzu-3047eb66889a9782fadfbe479c33e6a8bfc5bf53.tar.xz yuzu-3047eb66889a9782fadfbe479c33e6a8bfc5bf53.tar.zst yuzu-3047eb66889a9782fadfbe479c33e6a8bfc5bf53.zip |
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_image.cpp')
-rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_image.cpp | 24 |
1 files changed, 23 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 e12d7b850..9213375b4 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp @@ -351,7 +351,29 @@ void EmitImageFetch([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst void EmitImageQueryDimensions([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, [[maybe_unused]] const IR::Value& index, [[maybe_unused]] std::string_view lod) { - throw NotImplementedException("GLSL Instruction"); + const auto info{inst.Flags<IR::TextureInstInfo>()}; + const auto texture{Texture(ctx, info, index)}; + switch (info.type) { + case TextureType::Color1D: + return ctx.AddU32x4( + "{}=uvec4(uint(textureSize({},int({}))),0u,0u,uint(textureQueryLevels({})));", inst, + texture, lod, texture); + case TextureType::ColorArray1D: + case TextureType::Color2D: + case TextureType::ColorCube: + return ctx.AddU32x4( + "{}=uvec4(uvec2(textureSize({},int({}))),0u,uint(textureQueryLevels({})));", inst, + texture, lod, texture); + case TextureType::ColorArray2D: + case TextureType::Color3D: + case TextureType::ColorArrayCube: + return ctx.AddU32x4( + "{}=uvec4(uvec3(textureSize({},int({}))),uint(textureQueryLevels({})));", inst, texture, + lod, texture); + case TextureType::Buffer: + throw NotImplementedException("Texture buffers"); + } + throw LogicError("Unspecified image type {}", info.type.Value()); } void EmitImageQueryLod([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |