KhronosGroup / KhronosGroup/glslang

Buffer aliasing (local buffer assignment) not supported

Open
#1,176 8 comments 0 reactions 0 assignees View on GitHub
HLSL Missing Functionality
Dominant language
C++
Stars
3.6k
Forks
989
Avg merge
1d 2h
Merged PRs (30d)
31

Description

Declaring a buffer block, for example a RWStructuredBuffer with an assignment, ignores the right hand side. Making the following code compile without errors or warnings.
The assignment should clearly validate the assigned type and also copy over any applicable layout specifications, such as `binding` and `set`.

```hlsl
static const float TestValue = 1;

void main()
{
RWStructuredBuffer values = TestValue;
values[0] = 0;
}
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the HLSL example with glslang and trace how buffer declarations and local assignments are handled. The work is done when the assigned type is validated and applicable layout specifications such as binding and set are copied without errors or warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
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.