This more closely matches what the Vulkan docs say to do.
}
if (qual->flags.q.vk_set) {
- if (!qual->flags.q.explicit_index)
+ if (!qual->flags.q.explicit_binding)
_mesa_glsl_error(loc, state,
- "Vulkan descriptor set layout requires both group and index "
- "qualifiers");
+ "Vulkan descriptor set layout requires both set "
+ "and binding qualifiers");
var->data.vk_set = true;
var->data.set = qual->set;
- var->data.index = qual->index;
+ var->data.binding = qual->binding;
} else if (qual->flags.q.explicit_location) {
validate_explicit_location(qual, var, state, loc);
} else if (qual->flags.q.explicit_index) {
var->data.vk_set = this->layout.flags.q.vk_set;
var->data.set = this->layout.set;
- var->data.index = this->layout.index;
+ var->data.binding = this->layout.binding;
state->symbols->add_variable(var);
instructions->push_tail(var);
var->data.vk_set = this->layout.flags.q.vk_set;
var->data.set = this->layout.set;
- var->data.index = this->layout.index;
+ var->data.binding = this->layout.binding;
state->symbols->add_variable(var);
instructions->push_tail(var);
if (q.flags.q.vk_set) {
this->set = q.set;
- this->index = q.index;
+ this->binding = q.binding;
}
return true;
}
}
- if ((state->ARB_shading_language_420pack_enable ||
- state->has_atomic_counters()) &&
- match_layout_qualifier("binding", $1, state) == 0) {
+ if (match_layout_qualifier("binding", $1, state) == 0) {
$$.flags.q.explicit_binding = 1;
$$.binding = $3;
}
VkShader fs = GLSL_VK_SHADER(device, FRAGMENT,
out vec4 f_color;
in vec4 v_tex_coord;
- layout(set = 0, index = 0) uniform sampler2D u_tex;
+ layout(set = 0, binding = 0) uniform sampler2D u_tex;
void main()
{
f_color = texture2D(u_tex, v_tex_coord.xy);
static const char vs_source[] = GLSL(
layout(location = 0) in vec4 a_position;
layout(location = 1) in vec4 a_color;
- layout(set = 0, index = 0) uniform block1 {
+ layout(set = 0, binding = 0) uniform block1 {
vec4 color;
} u1;
- layout(set = 0, index = 1) uniform block2 {
+ layout(set = 0, binding = 1) uniform block2 {
vec4 color;
} u2;
- layout(set = 1, index = 0) uniform block3 {
+ layout(set = 1, binding = 0) uniform block3 {
vec4 color;
} u3;
out vec4 v_color;
static const char fs_source[] = GLSL(
out vec4 f_color;
in vec4 v_color;
- layout(set = 0, index = 0) uniform sampler2D tex;
+ layout(set = 0, binding = 0) uniform sampler2D tex;
void main()
{
f_color = v_color + texture2D(tex, vec2(0.1, 0.1));