diff options
author | Maciej Jesionowski <maciej.jesionowski@mobica.com> | 2016-10-12 15:40:37 +0200 |
---|---|---|
committer | Maciej Jesionowski <maciej.jesionowski@mobica.com> | 2016-10-12 16:16:24 +0200 |
commit | 7208a974aa4912a2323af897ad299facb23ba79a (patch) | |
tree | 357cbd164b193e67e24aa9bf61e3ed02469d17a7 /SPIRV/GlslangToSpv.cpp | |
parent | 631f223b1bfd5114e96747a1ff15b15d088ab926 (diff) | |
download | glslang-7208a974aa4912a2323af897ad299facb23ba79a.tar.gz |
SPV: Use SampledImage with OpImageQueryLod
Khronos SPIR-V issue #74
Diffstat (limited to 'SPIRV/GlslangToSpv.cpp')
-rwxr-xr-x | SPIRV/GlslangToSpv.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 9c8b8b93..245715fc 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -2745,9 +2745,10 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO // Check for queries if (cracked.query) { - // a sampled image needs to have the image extracted first - if (builder.isSampledImage(params.sampler)) + // OpImageQueryLod works on a sampled image, for other queries the image has to be extracted first + if (node->getOp() != glslang::EOpTextureQueryLod && builder.isSampledImage(params.sampler)) params.sampler = builder.createUnaryOp(spv::OpImage, builder.getImageType(params.sampler), params.sampler); + switch (node->getOp()) { case glslang::EOpImageQuerySize: case glslang::EOpTextureQuerySize: |