microsoft / microsoft/DirectXShaderCompiler

An issue with template type deduction and globallycoherent?

Open
#5,999 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug hlsl2021 shader-linking type-system
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

We have a variable of type ‘globallycoherent RWByteAddressBuffer’. When this is passed to a templated function where the buffer is a templated parameter, the globallycoherent part seems to be missed?
Now, I don’t know if the compiled out dxil is actually correct and the warning/error is a false positive. We hadn’t noticed any visual artifacts in the June GDK.

I’ve distilled the hlsl into bare bones to repro this issue. This is obviously not a shader that does anything. It’s just stripped down to illustrate the issue and trigger the error/warning.

I am able to reproduce this in shader playground:
https://shader-playground.timjones.io/98b958c232fe4b88326d5be6b2570013

The error output there matches the ones I get in the GDK

Environment
dxcompiler_xs.dll!DxcCreateInstance: 1.7 - 2310.2310.11301.10016

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 with the minimal HLSL reproduction in the linked Shader Playground and compare its diagnostics with the reported GDK output from dxcompiler_xs.dll version 1.7. Trace how template type deduction handles globallycoherent on RWByteAddressBuffer and verify whether the generated DXIL preserves the qualifier; done means the diagnostic and compiled output are confirmed correct or the issue is fixed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.