Skip to content

Discuss diagnostic behavior for statically-known out of bounds access in HLSL #429

Description

@bob80905

Consider this shader:

RWByteAddressBuffer gBufArray[4] : register(u0);

[numthreads(1,1,1)]
void main(uint3 tid : SV_DispatchThreadID) {
    RWByteAddressBuffer buf = gBufArray[5];    
    buf.Store(tid.x * 4, 42);
}

There is a statically known out of bounds access.
Currently, clang emits a warning.
This issue tracks the team discussing the diagnostic behavior upon detecting statically-known out of bounds access in HLSL.
Should the diagnostic be a warning? an error? A default error-warning? Does it depend on what is being accessed out of bounds?
This will interact and impact local resource specification.
Should the behavior depend on language version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions