Skip to content

StructureByteStride of UAV in create_graphics_buffer and Inference.compute mismatch #7

@NealLou

Description

@NealLou

I have noticed an inconsistency in the stride values of m_GBuffer used in the following files:

m_GBuffer = graphics::resources::create_graphics_buffer(m_Device, numPixels * sizeof(uint16_t) * numChannels, sizeof(uint16_t), GraphicsBufferType::Default);
The elementSize (stride) in create_graphics_buffer is written as sizeof(uint16_t) = 2 bytes.

RWStructuredBuffer<uint4> _OutputBufferRW: register(OUTPUT_BUFFER_BINDING);
But the format used for m_GBuffer as outputBuffer in Inference shader is uint4, and its stride is 16 bytes.

https://microsoft.github.io/DirectX-Specs/d3d/ResourceBinding.html#unordered-access-view Spec requires StructureByteStride for UAV.

The stride values in those places are different, which might lead to unexpected behavior or quality issues.
Could you please verify if this is intentional or if it needs to be corrected?

How about using RWByteAddressBuffer instead, like Cooperative Vector does?

Thank you for your attention to this matter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions