KhronosGroup / KhronosGroup/glslang

In Vulkan, OpTypeStruct must not contain an opaque type.

Open
#2,931 6 comments 0 reactions 0 assignees View on GitHub
enhancement GLSL/ESSL SPIR-V
Dominant language
C++
Stars
3.6k
Forks
989
Avg merge
1d 2h
Merged PRs (30d)
31

Description

Hello,

We have a fair amount of shader code running on OpenGL, that we want to reuse on our Vulkan backend. The Vulkan relaxed rules help a lot, but we have a remaining issue with texture samplers declared in a structure. For example:

`struct TexUnit
{
sampler2D smp;
vec4 blah;
};

uniform TexUnit myTex;`

is valid in OpenGL, but not in Vulkan.

While I fully understand the rationale behind this limitation, I would be interested to know if there is a way to get a valid Vulkan SPIRV binary out of this GLSL code, without touching shader code.

Thanks a lot for your help.

Contributor guide

Open the contributing guide

Research direction

The issue names no file, test, or entry point. Start by investigating how glslang handles the shown GLSL structure when targeting Vulkan and SPIR-V, then determine whether a valid binary can be produced without changing the shader source; completion should be a documented, reproducible answer or a clearly scoped implementation plan.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.