KhronosGroup / KhronosGroup/glslang

[Question] How to differ redeclare block with default block ?

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

Description

the ogl spec says:

**It will also be a link-time error if some shaders in a program redeclare a specific **built-in interface block** while another shader in that program does not redeclare that interface block yet still uses a member of that interface block.**

The linker want will validate the rule , but it didn't know redeclare block at ast. Can we add some flags to indicate the "redeclared block"? Thanks.

**shader:**
```
#version 410

layout (points) in;
layout (points, max_vertices = 4) out;

in gl_PerVertex
{
float gl_ClipDistance[];
} gl_in[];

out gl_PerVertex
{
float gl_ClipDistance[];
};
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing how redeclared built-in interface blocks are represented in the AST and how the linker currently validates interface-block usage. Compare the shader example with the GLSL rule, then add coverage that distinguishes redeclared blocks from default blocks and verifies the expected link-time result.

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.