Skip to content

FXC vs DXC padding issue #1647

Description

@jirzynek

Hi,

I'm currently experiencing some FXC vs DXC differences in the padding when compiling some of our shaders. Shouldn't FXC and DXC padding behavior be the same when packing elements in the structure?

Here is an example (.asm) produced by FXC:

struct MatTest
{   
    float4x4 mat0;                 // Offset:    0
    row_major float4x3 mat1;       // Offset:   64
    row_major float3x4 mat2;       // Offset:  128
    float3x4 mat3;                 // Offset:  176
    row_major float3x4 mat4;       // Offset:  240
    float4 someParam;              // Offset:  288
} matTest;                         // Offset:    0 Size:   304

vs DXC

; cbuffer $Globals
; {
;
;   struct dx.alignment.legacy.$Globals
;   {
;
;       struct dx.alignment.legacy.struct.MatTest
;       {
;
;           column_major float4x4 mat0;               ; Offset:    0
;           row_major float4x3 mat1;                  ; Offset:   64
;           row_major float3x4 mat2;                  ; Offset:  128
;           column_major float3x4 mat3;               ; Offset:  192
;           row_major float3x4 mat4;                  ; Offset:  256
;           float4 someParam;                         ; Offset:  304
;       
;       } matTest                                     ; Offset:    0
;
;   
;   } $Globals                                        ; Offset:    0 Size:   320
;
; }

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