Skip to content

DXC allows and ignores nested semantics #1774

Closed

Description

Repro:

struct Inner
{
    float a;
    float b : COLOR0;
};

struct Outer
{
    float a;
    Inner b : NORMAL0;
};

float main(Outer input : TEXCOORD0) : SV_Target { return 1; }

FXC does something weird here: it outputs a warning and then produces somewhat unexpected semantics:

warning X3576: semantics in type overridden by variable/function or enclosing type
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float
// TEXCOORD                 1   x           1     NONE   float
//

DXC doesn't report anything, ignores the nested semantics and produces:

; Name                 Index   Mask Register SysValue  Format   Used
; -------------------- ----- ------ -------- -------- ------- ------
; TEXCOORD                 0   x           0     NONE   float
; TEXCOORD                 1    y          0     NONE   float
; TEXCOORD                 2     z         0     NONE   float
;

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions