Skip to content

[HLSL][DirectX] Validation error seen when compiling code using D3DCOLORtoUBYTE4 #150673

@spall

Description

@spall

Seeing validation error when compiling this code:

StructuredBuffer<float4> In0 : register(t0);

RWStructuredBuffer<uint4> Out0 : register(u1);


[numthreads(1,1,1)]
void main() {

Out0[0] = D3DCOLORtoUBYTE4(In0[0]);
Out0[1] = D3DCOLORtoUBYTE4(float4(0, 11.11, -50.5, 100));
}

https://godbolt.org/z/oEsfTrTMr

Function: main: error: Assignment of undefined values to UAV.
# | note: at 'call void @dx.op.rawBufferStore.i32(i32 140, %dx.types.Handle %1, i32 1, i32 0, i32 undef, i32 2833, i32 0, i32 25500, i8 15, i32 4)' in block 'entry' of function 'main'.
# | Validation failed.

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language Support

Type

Projects

Status

Active

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions