KhronosGroup / KhronosGroup/glslang

Should `GLSL_EXT_structured_descriptor_heap` blocks allow omitting block/instance names?

Open
#4,367 1 comment 0 reactions 0 assignees View on GitHub
Descriptor Heaps question
Dominant language
C++
Stars
3.6k
Forks
989
Avg merge
1d 2h
Merged PRs (30d)
31

Description

1. Block names

The extension spec gives examples such as:

```glsl
resourceheap {
accelerationStructureKHR myAccelerationStructure;
} myResourceHeapView;
```

The GLSL spec does not allow omitting the `block-name` of an `interface-block`. Current `glslang` behavior agrees with the base spec but diverges from some of the examples given in the extension spec, producing the following output:
```
ERROR: :5: '' : syntax error, unexpected LEFT_BRACE
```
Are the examples in the extension spec intended to work as-is?

2. Instance names

It seems that `resourceheap` and `samplerheap` blocks currently require an instance name. If no instance name is provided, the following error is printed:
```
ERROR: :5: 'ResourceHeap' : layout(descriptor_heap) decorated block should be explicitly declared with a run-time sized array type.
```
Is this intended behavior? I think it would stand to reason to allow omitting the instance name, thus making the following two lines more or less equivalent:

```glsl
layout(descriptor_heap) uniform texture2D textures[];
resourceheap TextureHeap { texture2D textures[]; };
```

Contributor guide

Open the contributing guide

Research direction

Start by running the block-name and instance-name examples from the issue through glslang and compare the diagnostics with the GLSL_EXT_structured_descriptor_heap specification. Determine whether each omission is intended, then define the expected compiler behavior and checks needed to confirm the decision.

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
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.