diff options
| -rw-r--r-- | source/slang/slang-ir-legalize-is-texture-access.cpp | 14 | ||||
| -rw-r--r-- | tests/bugs/interlocked-add-uint-int.slang | 2 |
2 files changed, 6 insertions, 10 deletions
diff --git a/source/slang/slang-ir-legalize-is-texture-access.cpp b/source/slang/slang-ir-legalize-is-texture-access.cpp index a3540e3f2..b9a0a7772 100644 --- a/source/slang/slang-ir-legalize-is-texture-access.cpp +++ b/source/slang/slang-ir-legalize-is-texture-access.cpp @@ -39,11 +39,9 @@ namespace Slang if (getTextureAccess(inst)) inst->replaceUsesWith(builder.getBoolValue(true)); else - { inst->replaceUsesWith(builder.getBoolValue(false)); - functionsToSCCP.add(func); - } inst->removeAndDeallocate(); + functionsToSCCP.add(func); continue; case kIROp_IsTextureArrayAccess: { @@ -51,11 +49,9 @@ namespace Slang if (textureAccess && as<IRTextureType>(textureAccess->getImage()->getDataType())->isArray()) inst->replaceUsesWith(builder.getBoolValue(true)); else - { inst->replaceUsesWith(builder.getBoolValue(false)); - functionsToSCCP.add(func); - } inst->removeAndDeallocate(); + functionsToSCCP.add(func); continue; } case kIROp_IsTextureScalarAccess: @@ -64,11 +60,9 @@ namespace Slang if (textureAccess && !as<IRVectorType>(as<IRTextureType>(textureAccess->getImage()->getDataType())->getElementType())) inst->replaceUsesWith(builder.getBoolValue(true)); else - { inst->replaceUsesWith(builder.getBoolValue(false)); - functionsToSCCP.add(func); - } inst->removeAndDeallocate(); + functionsToSCCP.add(func); continue; } } @@ -79,7 +73,7 @@ namespace Slang // and unresolved 'isTextureAccess' operations for when 'inst' is not a // 'IRTextureType'/`TextureAccessor` for (auto func : functionsToSCCP) - applySparseConditionalConstantPropagation(func, sink); + applySparseConditionalConstantPropagation(func, sink); } } diff --git a/tests/bugs/interlocked-add-uint-int.slang b/tests/bugs/interlocked-add-uint-int.slang index 4396a3dc5..ed399165f 100644 --- a/tests/bugs/interlocked-add-uint-int.slang +++ b/tests/bugs/interlocked-add-uint-int.slang @@ -1,4 +1,6 @@ //TEST:SIMPLE(filecheck=CHECK): -target spirv -profile glsl_450 -stage compute -entry MainCs -line-directive-mode none +//TEST:SIMPLE(filecheck=CHECK): -target spirv -profile glsl_450 -stage compute -entry MainCs -line-directive-mode none -minimum-slang-optimization + //CHECK: {{.*}} OpAtomicIAdd RWBuffer<uint> g_InterlockTest; |
