Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vector<literal int, 4> used with RWByteAddressBuffer::Store4 generates incorrect codegen. #5493

Closed
llvm-beanz opened this issue Aug 3, 2023 · 1 comment
Labels
bug Bug, regression, crash correctness Bugs that impact shader correctness dxil

Comments

@llvm-beanz
Copy link
Collaborator

Description
RWByteAddressBuffer::Store4 argument should be a uint4.

Steps to Reproduce

See: https://godbolt.org/z/3enjTsPEP

RWByteAddressBuffer buffer : register(u0, space0); 
[numthreads(1, 1, 1)]
void main() {
    buffer.Store4(0, 1.xxxx);
}

Actual Behavior

This results in two buffer stores, treating the value as 64-bit integers:

call void @dx.op.bufferStore.i32(i32 69, %dx.types.Handle %buffer_UAV_rawbuf, i32 0, i32 undef, i32 1, i32 0, i32 1, i32 0, i8 15), !dbg !28 ; line:4 col:5  ; BufferStore(uav,coord0,coord1,value0,value1,value2,value3,mask)
call void @dx.op.bufferStore.i32(i32 69, %dx.types.Handle %buffer_UAV_rawbuf, i32 16, i32 undef, i32 1, i32 0, i32 1, i32 0, i8 15), !dbg !28 ; line:4 col:5  ; BufferStore(uav,coord0,coord1,value0,value1,value2,value3,mask)

Environment

  • DXC version: 1.7.2207, 1.7.2212, & main
  • Host Operating System: N/A
@damyanp
Copy link
Member

damyanp commented Oct 9, 2024

Fixed in HLSL 202x.

@damyanp damyanp closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash correctness Bugs that impact shader correctness dxil
Projects
Archived in project
Development

No branches or pull requests

2 participants