DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

dxc silently passes uninitialized value as undef

Open vcsharma opened this issue 4 years ago • 3 comments

Compiling the below hlsl generates dxil with undef passed to @dx.op.tertiary.i32 without generating any warnings/errors.

// dxc /E main /T vs_6_2

HLSL

int2x2 m;

int2 main (int a : IN) : OUT
{
 int2 b;
 b.x = a;
 return mul( b, m );
}

DXIL

define void @main() {
..
  %10 = call i32 @dx.op.tertiary.i32(i32 48, i32 undef, i32 %5, i32 %9)  ; IMad(a,b,c)
..
}

vcsharma avatar Jun 30 '20 02:06 vcsharma