KhronosGroup / KhronosGroup/glslang
Can I set different set offset based on the resource type?
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
Hello guys. I have some trouble supporting Vulkan.
My shader is below.
layout(binding = 0) uniform Colors {
vec4 color0;
vec4 color1;
vec4 color2;
};
layout(binding = 1) uniform Geometry {
vec4 translate;
vec4 rotate;
vec4 scale;
};
layout(binding = 0) uniform sampler2D base_texture0;
layout(binding = 1) uniform sampler2D base_texture1;
layout(binding = 2) uniform sampler2D base_texture2;
The problem is here that all set index is 0. When I reflect, the result is below.
"textures" : [
{
"type" : "sampler2D",
"name" : "base_texture0",
"set" : 0,
"binding" : 0
},
{
"type" : "sampler2D",
"name" : "base_texture1",
"set" : 0,
"binding" : 1
},
{
"type" : "sampler2D",
"name" : "base_texture2",
"set" : 0,
"binding" : 2
}
],
"ubos" : [
{
"type" : "_37",
"name" : "Colors",
"block_size" : 48,
"set" : 0,
"binding" : 0
},
{
"type" : "_67",
"name" : "Geometry",
"block_size" : 64,
"set" : 0,
"binding" : 1
}
]
I just want to shift set based on the resource type. I try to find the API for this but I can't. I can only find setShiftBinding(...). Is there any similar functionality setShiftSet(...)?
Contributor guide
Research direction
The issue names setShiftBinding(...) as the existing API but no source files or tests. Start by locating that API and the Vulkan resource reflection path, then determine whether resource-type-specific set shifting is supported or needs a defined design; done should include a documented answer or an implemented, tested behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100