You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use of "float1" can cause assert/missing switch case #6861
Description
Compiling the below code hits an assert (a missing case in SemaHLSL.cpp's FlattenedTypeIterator::pushTrackerForType).
"objectKind" is ArTypeObjectKind::AR_TOBJ_POINTER, which is missing from the switch.
Welp, I had two reports from PIX users. They were both apparently a different issue, wherein the 2212 compiler emitted a dbg.declare that the current compiler flagged as containing a bad bit-piece (an assert fired that the bit-piece was covering the entire variable). I hit the current issue while attempting to repro the bit-piece issue on the current compiler, which I could not.
So... I guess it's not huge?
I also note that it's quite easy to tweak this repro so that nothing bad happens.
I guess I'll tell the pix users to upgrade their compiler and/or make a whitespace edit in PIX so that the new compiler is used.
Jeff Noyle (@jeffnn) - we're marking this as dormant since there are several easy workarounds for this. We've not been able to reproduce the assert though, but we get a compile error about being unable to find an overload for the array access operator.
Gregory Roth (@pow2clk) is trying to repro this to get a sense of whether or not it is a recent regression.
<source>:11:14: error: no viable overloaded operator[] for type 'RWByteAddressBuffer []'
bufferArray[dynamicBufferIndex].Store(0, 1);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
Note that the "Store" line has an extra ) at the end of it. Godbolt generates the same error regardless though.
Ach, yes, that ) is a typo on my part. I get the same error with it removed, though:
D:\DirectXShaderCompiler>type test.hlsl
ByteAddressBuffer inBuffer : register(t0);
RWByteAddressBuffer bufferArray[] : register(u0);
Activity
damyanp commentedon Aug 14, 2024
Thanks Jeff. Do you have any additional information that may help us prioritize this?
jeffnn commentedon Aug 14, 2024
Welp, I had two reports from PIX users. They were both apparently a different issue, wherein the 2212 compiler emitted a dbg.declare that the current compiler flagged as containing a bad bit-piece (an assert fired that the bit-piece was covering the entire variable). I hit the current issue while attempting to repro the bit-piece issue on the current compiler, which I could not.
So... I guess it's not huge?
I also note that it's quite easy to tweak this repro so that nothing bad happens.
I guess I'll tell the pix users to upgrade their compiler and/or make a whitespace edit in PIX so that the new compiler is used.
damyanp commentedon Aug 15, 2024
Jeff Noyle (@jeffnn) - we're marking this as dormant since there are several easy workarounds for this. We've not been able to reproduce the assert though, but we get a compile error about being unable to find an overload for the array access operator.
Gregory Roth (@pow2clk) is trying to repro this to get a sense of whether or not it is a recent regression.
pow2clk commentedon Aug 15, 2024
I synced the latest code and ran with asserts enabled and I didn't get any asserts here.
jeffnn commentedon Aug 15, 2024
Huh. Top of tree debug build:
D:\DirectXShaderCompiler>copy con test.hlsl
ByteAddressBuffer inBuffer : register(t0);
RWByteAddressBuffer bufferArray[] : register(u0);
[numthreads(1, 1, 1)]
void main()
{
// Simple read
float1 dynamicBufferIndex = inBuffer.Load(0);
// Dynamically indexed write
bufferArray[dynamicBufferIndex].Store(0, 1));
}
^Z
1 file(s) copied.
D:\DirectXShaderCompiler>d:\hlsl.bin\Debug\bin\dxc.exe -Tcs_6_6 test.hlsl
Internal compiler error: Terminal Error 0x80000003
damyanp commentedon Aug 15, 2024
Godbolt link: https://godbolt.org/z/fY6P53Yfa
Note that the "Store" line has an extra
)at the end of it. Godbolt generates the same error regardless though.jeffnn commentedon Aug 15, 2024
Ach, yes, that ) is a typo on my part. I get the same error with it removed, though:
D:\DirectXShaderCompiler>type test.hlsl
ByteAddressBuffer inBuffer : register(t0);
RWByteAddressBuffer bufferArray[] : register(u0);
[numthreads(1, 1, 1)]
void main()
{
// Simple read
float1 dynamicBufferIndex = inBuffer.Load(0);
// Dynamically indexed write
bufferArray[dynamicBufferIndex].Store(0, 1);
}
D:\DirectXShaderCompiler>d:\hlsl.bin\Debug\bin\dxc.exe -Tcs_6_6 test.hlsl
Internal compiler error: Terminal Error 0x80000003
Update submodules: DirectX-Headers to 61c77189, SPIRV-Headers to 5c60…
Update submodules: DirectX-Headers to 61c77189, SPIRV-Headers to 5c60…