KhronosGroup / KhronosGroup/glslang

glslangValidator does not output an error when gl_WorkGroupSize is used before layout(local_size*=...)

Open
#3,856 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug GLSL/ESSL
Dominant language
C++
Stars
3.6k
Forks
990
Avg merge
1d 2h
Merged PRs (30d)
31

Description

The glsl spec states

> It is a compile-time error to use gl_WorkGroupSize in a shader that does not declare a fixed
workgroup size, or before that shader has declared a fixed workgroup size, using local_size_x,
local_size_y, and local_size_z.

As of version 11:15.1.0, glslangValidator silently replaces the `gl_WorkGroupSize` with `ivec3(1, 1, 1)` instead of printing an error which can cause issues that are hard to debug.

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 reproducing the shader case with glslangValidator and inspect how gl_WorkGroupSize is handled before a fixed local size declaration. Done means the validator reports a compile-time error instead of silently replacing it with ivec3(1, 1, 1).

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.