summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_image.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_image.cpp24
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
351void EmitImageQueryDimensions([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 351void EmitImageQueryDimensions([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
352 [[maybe_unused]] const IR::Value& index, 352 [[maybe_unused]] const IR::Value& index,
353 [[maybe_unused]] std::string_view lod) { 353 [[maybe_unused]] std::string_view lod) {
354 throw NotImplementedException("GLSL Instruction"); 354 const auto info{inst.Flags<IR::TextureInstInfo>()};
355 const auto texture{Texture(ctx, info, index)};
356 switch (info.type) {
357 case TextureType::Color1D:
358 return ctx.AddU32x4(
359 "{}=uvec4(uint(textureSize({},int({}))),0u,0u,uint(textureQueryLevels({})));", inst,
360 texture, lod, texture);
361 case TextureType::ColorArray1D:
362 case TextureType::Color2D:
363 case TextureType::ColorCube:
364 return ctx.AddU32x4(
365 "{}=uvec4(uvec2(textureSize({},int({}))),0u,uint(textureQueryLevels({})));", inst,
366 texture, lod, texture);
367 case TextureType::ColorArray2D:
368 case TextureType::Color3D:
369 case TextureType::ColorArrayCube:
370 return ctx.AddU32x4(
371 "{}=uvec4(uvec3(textureSize({},int({}))),uint(textureQueryLevels({})));", inst, texture,
372 lod, texture);
373 case TextureType::Buffer:
374 throw NotImplementedException("Texture buffers");
375 }
376 throw LogicError("Unspecified image type {}", info.type.Value());
355} 377}
356 378
357void EmitImageQueryLod([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, 379void EmitImageQueryLod([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,