Do not add NonWritable/NonReadable decorations for regular images.

This commit is contained in:
Hans-Kristian Arntzen 2020-04-03 12:26:13 +02:00
parent 14f24d71ab
commit b691b7d1e3

View File

@ -2543,7 +2543,7 @@ void CompilerGLSL::fixup_image_load_store_access()
ir.for_each_typed_id<SPIRVariable>([&](uint32_t var, const SPIRVariable &) {
auto &vartype = expression_type(var);
if (vartype.basetype == SPIRType::Image)
if (vartype.basetype == SPIRType::Image && vartype.image.sampled == 2)
{
// Very old glslangValidator and HLSL compilers do not emit required qualifiers here.
// Solve this by making the image access as restricted as possible and loosen up if we need to.