Skip to content

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

Closed

Description

@llvm-beanz

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

Activity

  1. added
    bug
    needs-triage
    on Aug 3, 2023
  2. added
    correctness
    and removed
    needs-triage
    on Aug 3, 2023
  3. damyanp commented on Oct 9, 2024

    @damyanp
    Member

    Fixed in HLSL 202x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcorrectnessdxil

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions