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
Description
There is an issue with a divide by zero when gathering reflection data. In particular, GetPartReflection() is causing a divide by zero exception.
When looking at the shader code, it looks like there was a bug in the raw shader data, with a zero sized array. The compilation was succeeding, but crashing with divide by zero when getting reflection. There was a struct that looked like this:
Description
There is an issue with a divide by zero when gathering reflection data. In particular, GetPartReflection() is causing a divide by zero exception.
When looking at the shader code, it looks like there was a bug in the raw shader data, with a zero sized array. The compilation was succeeding, but crashing with divide by zero when getting reflection. There was a struct that looked like this:
struct MaterialData
{
float3 diffuseColor;
...
uint4 srv_info[0];
};
ConstantBuffer s_MaterialCb : register(b0,space2);
Removing the srv_info struct fixed it. After discussion, it appears that this line was causing the divide by zero:
https://github.com/microsoft/DirectXShaderCompiler/blob/main/lib/HLSL/DxilContainerReflection.cpp#L997
Steps to Reproduce
While I don't have a full repro case, I can share the specific shader privately if it would help.
Actual Behavior
The output is a divide by zero exception in GetPartReflection().
Environment
The text was updated successfully, but these errors were encountered: