Skip to content

FXC vs DXC automatic resource binding register assignment behavior difference #1660

Description

@kayru

Consider the following example shader:

Texture2D Tex0 : register(t0);
Texture2D Tex1;
RWTexture2D<float4> Output;
[numthreads(1,1,1)]
void main()
{
	Output[(uint2)0] = Tex1.Load((uint3)0);
}

Tex0 has an explicit register assignment t0 and FXC avoids using it when auto-assigning registers for other resources:

> fxc (10.0.17763.0) /T cs_5_0 shader.hlsl
// Resource Bindings:
//
// Name                                 Type  Format         Dim      HLSL Bind  Count
// ------------------------------ ---------- ------- ----------- -------------- ------
// Tex1                              texture  float4          2d             t1      1
// Output                                UAV  float4          2d             u0      1

However, DXC seems to auto-assign t0 in this case:

> dxc (bc9ad948) /T cs_5_0 shader.hlsl
; Resource Bindings:
;
; Name                                 Type  Format         Dim      ID      HLSL Bind  Count
; ------------------------------ ---------- ------- ----------- ------- -------------- ------
; Tex1                              texture     f32          2d      T0             t0     1
; Output                                UAV     f32          2d      U0             u0     1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugBug, regression, crash

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions