ctx->type->members[member]);
ctx->type->members[member]->is_builtin = true;
ctx->type->members[member]->builtin = dec->literals[0];
+ ctx->type->builtin_block = true;
break;
case SpvDecorationOffset:
ctx->type->offsets[member] = dec->literals[0];
{
struct vtn_value *val = vtn_push_value(b, w[1], vtn_value_type_type);
- val->type = ralloc(b, struct vtn_type);
+ val->type = rzalloc(b, struct vtn_type);
val->type->is_builtin = false;
switch (opcode) {
var->type = type->type;
var->name = ralloc_strdup(var, val->name);
- if (type->block)
+ bool builtin_block = false;
+ if (type->block) {
var->interface_type = type->type;
- else if (glsl_type_is_array(type->type) &&
- (type->array_element->block || type->array_element->buffer_block))
+ builtin_block = type->builtin_block;
+ } else if (glsl_type_is_array(type->type) &&
+ (type->array_element->block ||
+ type->array_element->buffer_block)) {
var->interface_type = type->array_element->type;
- else
+ builtin_block = type->array_element->builtin_block;
+ } else {
var->interface_type = NULL;
+ }
switch ((SpvStorageClass)w[3]) {
case SpvStorageClassUniform:
if (var->data.mode == nir_var_uniform && var->interface_type)
break;
+ /* Builtin blocks are lowered to individual variables during SPIR-V ->
+ * NIR, so don't declare them either.
+ */
+ if (builtin_block)
+ break;
+
switch (var->data.mode) {
case nir_var_shader_in:
exec_list_push_tail(&b->shader->inputs, &var->node);
}
foreach_list_typed(nir_variable, var, node, &shader->outputs) {
- /* XXX glslang gives us this but we never use it */
- if (!strcmp(var->name, "gl_PerVertex"))
- continue;
-
prog->OutputsWritten |= BITFIELD64_BIT(var->data.location);
}
}