microsoft / microsoft/DirectXShaderCompiler

RasterizerOrderedByteAddressBuffer doesn't accept templated Load/Store

Open
#4,605 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

The admittedly terse documentation of ROV types indicates that they can be used just like their RW* counterparts: https://docs.microsoft.com/en-us/windows/win32/direct3d11/rasterizer-order-views#implementation-details
"Use these objects in the same manner as other UAV objects (such as RWBuffer etc.)."

Even though "similar" might be doing a lot of extra work here, it seems reasonable to expect that just as RWByteAddressBuffer can make use of templated Load<> and Store<>, these should as well. Yet, they produce an error when it is attempted

For example, with this shader:

// RUN: %dxc -T ps_6_0 %s | FileCheck %s
RasterizerOrderedByteAddressBuffer buf;
float4 main(uint idx1 : IDX1) : SV_Target {
  return buf.Load<float4>(idx1);
}

This error results:

error: Explicit template arguments on intrinsic Load are not supported
  r.x += buf1.Load<float>(idx1, status);

Similar attempts yield similar results.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided dxc command and comparing the RasterizerOrderedByteAddressBuffer case with the stated RWByteAddressBuffer behavior. The change is done when templated Load and Store calls for ROV byte-address buffers compile successfully and the accompanying FileCheck test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.