DiligentGraphics / DiligentEngine

A modern cross-platform low-level graphics library and rendering framework
http://diligentgraphics.com/diligent-engine/
Apache License 2.0
3.63k stars 331 forks source link

Some random errors occurred in DX Shader Compiler version 1.6 #167

Closed DarlingZeroX closed 3 years ago

DarlingZeroX commented 3 years ago

I successfully created some compute shaders, But some random errors occurred in DX Shader Compiler version 1.6 when i use CreateShaderResourceBinding method.

Diligent Engine: ERROR in Diligent::`anonymous-namespace'::DXCompilerImpl::PatchResourceHandle::<lambda_c372ec904acf3ba58ea50259846db979>::operator ()() (DXCompiler.cpp, 1573): Failed to find resource in ResourceMap
Diligent Engine: ERROR in Diligent::`anonymous-namespace'::DXCompilerImpl::RemapResourceBindings() (DXCompiler.cpp, 986): Failed to patch resource bindings
Diligent Engine: ERROR in Diligent::PipelineStateD3D12Impl::InitRootSignature() (PipelineStateD3D12Impl.cpp, 503): Failed to remap resource bindings in shader 'ClassifyTiles.fxh'.
Diligent Engine: ERROR in Diligent::RenderDeviceBase<struct Diligent::EngineD3D12ImplTraits>::CreateDeviceObject() (RenderDeviceBase.hpp, 502): Failed to create Pipeline State object 'CLASSIFY_TILES'

Test code:


cbuffer Constants
{
    float4x4 u_Projection;

    float2 u_NoiseScale;
    float u_Radius;
    float u_Bias;

    float2 u_LinMAD;
    uint u_SampleCount;
    float u_Fov;

    float2 u_InvRes;
    float2 u_FocalLen;

    float2 u_InvFocalLen;
    float2 pad3;
}

[numthreads(16, 16, 1)]
void main(uint2 dispatchThreadID : SV_DispatchThreadID, uint2 groupThreadID : SV_GroupThreadID)
{
    for (int i = 0; i < u_SampleCount; ++i);

    float sum = 1.0f;
    sum = sum / u_SampleCount;
}