SpvId GLSL_std_450;
gl_shader_stage stage;
- int var_location;
SpvId ubos[128];
size_t num_ubos;
spirv_builder_emit_name(&ctx->builder, var_id, var->name);
if (ctx->stage == MESA_SHADER_FRAGMENT) {
- if (var->data.location >= VARYING_SLOT_VAR0 ||
- (var->data.location >= VARYING_SLOT_COL0 &&
- var->data.location <= VARYING_SLOT_TEX7)) {
+ if (var->data.location >= VARYING_SLOT_VAR0)
spirv_builder_emit_location(&ctx->builder, var_id,
- ctx->var_location++);
+ var->data.location - VARYING_SLOT_VAR0);
+ else if (var->data.location >= VARYING_SLOT_COL0 &&
+ var->data.location <= VARYING_SLOT_TEX7) {
+ spirv_builder_emit_location(&ctx->builder, var_id,
+ var->data.location);
} else {
switch (var->data.location) {
case VARYING_SLOT_POS:
if (ctx->stage == MESA_SHADER_VERTEX) {
- if (var->data.location >= VARYING_SLOT_VAR0 ||
- (var->data.location >= VARYING_SLOT_COL0 &&
- var->data.location <= VARYING_SLOT_TEX7)) {
+ if (var->data.location >= VARYING_SLOT_VAR0)
+ spirv_builder_emit_location(&ctx->builder, var_id,
+ var->data.location - VARYING_SLOT_VAR0);
+ else if (var->data.location >= VARYING_SLOT_COL0 &&
+ var->data.location <= VARYING_SLOT_TEX7) {
spirv_builder_emit_location(&ctx->builder, var_id,
- ctx->var_location++);
+ var->data.location);
} else {
switch (var->data.location) {
case VARYING_SLOT_POS: