SPV: Use SampledImage with OpImageQueryLod

Khronos SPIR-V issue #74
This commit is contained in:
Maciej Jesionowski
2016-10-12 15:40:37 +02:00
parent 631f223b1b
commit 7208a974aa
3 changed files with 442 additions and 463 deletions

View File

@@ -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: