Commit a5c33d6f by John Kessenich

SPV: Fix issue #320: Fetch needs to extract the image.

GLSL takes a traditional sampler, but SPIR-V wants just the sampled image, not the combined sampler and image.
parent 98f2b3bf
......@@ -2558,6 +2558,13 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
bias = true;
}
// See if the sampler param should really be just the SPV image part
if (cracked.fetch) {
// a fetch needs to have the image extracted first
if (builder.isSampledImage(params.sampler))
params.sampler = builder.createUnaryOp(spv::OpImage, builder.getImageType(params.sampler), params.sampler);
}
// set the rest of the arguments
params.coords = arguments[1];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment