I found a bug in the D3D compiler when working on a shader program. Then I reduced the program to a minimal bug-triggering one. Could you ask the GPU compiler developer to check what's wrong with the compiler?
Explanation:
Chrome browser by default used Direct3D for executing OpenGL ES shader programs on Windows systems. We can utilize Chrome to quickly reproduce the bug in HLSL compiler. The source code of our used OpenGL ES program and the meaning of each line is provided in https://www.shadertoy.com/view/fttyRB
float4 PS(VertexOut pIn): SV_Target {
float4 fragColor;
float t;
for (int i = 0; i < 2; i++)
for (int j = 0; j < 2; j++) {
t = iTime + 0.4;
fragColor = (frac(t) == 0.0) ? float4(0.0, 0.0, 0.0, 1.0) : float4(1.0, 1.0, 1.0, 1.0);
}
return fragColor;
}
mov o0.xyz, l(0, 0, 0, 0)
Hi @Saniajuneor ,
Thank you for reporting it. I have whitelisted you for the Devgurus community and moved the post to the appropriate forum.
2. AMD Radeon RX 6400, with driver version 30.0.15021.11005 (used during the experiment)
It looks like a new driver is available here: https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-7-1 . Could you please try this driver to see if the issue is reproducible or not?
Thanks.
I have updated the driver to your provided one. The bug still exists.
Thanks for testing with the latest driver and sharing the observation. I will report the issue to DirectX team.
Just FYI, a ticket has been created to investigate the issue. I will let you know once I get any update on this.
Thanks.
I posted another post yesterday reporting a different compiler bug. But somehow I cannot find that post on the forum today. The detailed descriptions, code, and reproduction steps for that bug are provided in this file: https://www.dropbox.com/s/k2sj75yii818y9i/another_bug_report.md?dl=0
The post was wrongly marked as spam by the auto spam-filter. I have removed it from the spam folder. Please check here: https://community.amd.com/t5/opengl-vulkan/another-d3d-compiler-bug/m-p/540059#M4277
Thanks.
Thanks! Could you check that bug as well?
I have reported the bug to the DirectX team.
Thanks.
Hi @Saniajuneor
Here is an update. The DX team investigated this issue. It appeared to be a MS runtime bug, so they submitted a bug report to MS. The related MS support team has informed us that they will not fix this bug.
Thanks.