unsigned explicit_stream:1; /**< stream value assigned explicitly by shader code */
/** \} */
- /** \name Vulkan qualifiers */
- unsigned vk_set:1;
-
/** \name Layout qualifiers for GL_ARB_tessellation_shader */
/** \{ */
/* tess eval input layout */
*/
glsl_base_type image_base_type;
- /**
- * Vulkan descriptor set
- */
- int set;
-
/**
* Return true if and only if an interpolation qualifier is present.
*/
state->fs_redeclares_gl_fragcoord_with_no_layout_qualifiers;
}
- if (qual->flags.q.vk_set) {
- if (!qual->flags.q.explicit_binding)
- _mesa_glsl_error(loc, state,
- "Vulkan descriptor set layout requires both set "
- "and binding qualifiers");
-
- var->data.vk_set = true;
- var->data.set = qual->set;
- var->data.binding = qual->binding;
- } else if (qual->flags.q.explicit_location) {
+ if (qual->flags.q.explicit_location) {
validate_explicit_location(qual, var, state, loc);
} else if (qual->flags.q.explicit_index) {
_mesa_glsl_error(loc, state, "explicit index requires explicit location");
var->data.explicit_binding = this->layout.flags.q.explicit_binding;
var->data.binding = this->layout.binding;
- var->data.vk_set = this->layout.flags.q.vk_set;
- var->data.set = this->layout.set;
- var->data.binding = this->layout.binding;
-
state->symbols->add_variable(var);
instructions->push_tail(var);
}
var->data.explicit_binding = this->layout.flags.q.explicit_binding;
var->data.binding = this->layout.binding;
- var->data.vk_set = this->layout.flags.q.vk_set;
- var->data.set = this->layout.set;
- var->data.binding = this->layout.binding;
-
state->symbols->add_variable(var);
instructions->push_tail(var);
}
this->image_base_type = q.image_base_type;
}
- if (q.flags.q.vk_set) {
- this->set = q.set;
- this->binding = q.binding;
- }
-
return true;
}
}
}
- if (match_layout_qualifier("binding", $1, state) == 0) {
+ if ((state->has_420pack() ||
+ state->has_atomic_counters() ||
+ state->has_shader_storage_buffer_objects()) &&
+ match_layout_qualifier("binding", $1, state) == 0) {
$$.flags.q.explicit_binding = 1;
$$.binding = $3;
}
- if (match_layout_qualifier("set", $1, state) == 0) {
- $$.flags.q.vk_set = 1;
- $$.set = $3;
- }
-
if (state->has_atomic_counters() &&
match_layout_qualifier("offset", $1, state) == 0) {
$$.flags.q.explicit_offset = 1;
unsigned explicit_location:1;
unsigned explicit_index:1;
- /**
- * Do we have a Vulkan (group, index) qualifier for this variable?
- */
- unsigned vk_set:1;
-
/**
* Was an initial binding explicitly set in the shader?
*
* \note
* The GLSL spec only allows the values 0 or 1 for the index in \b dual
* source blending.
- *
- * This is now also used for the Vulkan descriptor set index.
*/
- int16_t index;
+ unsigned index:1;
/**
* \brief Layout qualifier for gl_FragDepth.
*/
int16_t binding;
- /**
- * Vulkan descriptor set for the resource.
- */
- int16_t set;
-
/**
* Storage location of the base of this variable
*
b->binding = 0;
}
- if (var->data.vk_set) {
- b->set = var->data.set;
- b->index = var->data.index;
- }
-
_mesa_hash_table_insert(ht, var->get_interface_type()->name, (void *) b);
return b;
} else {
unsigned num_array_elements;
unsigned binding;
- unsigned set;
- unsigned index;
bool has_instance_name;
bool has_binding;
blocks[i].NumUniforms =
(unsigned)(ptrdiff_t)(&variables[parcel.index] - blocks[i].Uniforms);
- blocks[i].Set = b->set;
- blocks[i].Binding = b->binding;
blocks[i].IsShaderStorage = b->is_shader_storage;
i++;
blocks[i].NumUniforms =
(unsigned)(ptrdiff_t)(&variables[parcel.index] - blocks[i].Uniforms);
- blocks[i].Set = b->set;
- blocks[i].Binding = b->binding;
blocks[i].IsShaderStorage = b->is_shader_storage;
i++;
}
var->data.index = ir->data.index;
- var->data.descriptor_set = ir->data.set;
+ var->data.descriptor_set = 0;
var->data.binding = ir->data.binding;
/* XXX Get rid of buffer_index */
var->data.atomic.buffer_index = ir->data.binding;
op = nir_intrinsic_load_ubo_indirect;
}
- ir_constant *const_block = ir->operands[0]->as_constant();
- assert(const_block && "can't figure out descriptor set index");
- unsigned index = const_block->value.u[0];
- unsigned set = sh->UniformBlocks[index].Set;
- unsigned binding = sh->UniformBlocks[index].Binding;
-
nir_intrinsic_instr *load = nir_intrinsic_instr_create(this->shader, op);
load->num_components = ir->type->vector_elements;
- load->const_index[0] = set;
- load->const_index[1] = const_index ? const_index->value.u[0] : 0; /* base offset */
- nir_load_const_instr *load_binding = nir_load_const_instr_create(shader, 1);
- load_binding->value.u[0] = binding;
- nir_instr_insert_after_cf_list(this->cf_node_list, &load_binding->instr);
- load->src[0] = nir_src_for_ssa(&load_binding->def);
+ load->const_index[0] = const_index ? const_index->value.u[0] : 0; /* base offset */
+ load->const_index[1] = 1; /* number of vec4's */
+ load->src[0] = evaluate_rvalue(ir->operands[0]);
if (!const_index)
load->src[1] = evaluate_rvalue(ir->operands[1]);
add_instr(&load->instr, ir->type->vector_elements);