nir/i965/anv/radv/gallium: make shader info a pointer
When restoring something from shader cache we won't have and don't want to create a nir_shader this change detaches the two. There are other advantages such as being able to reuse the shader info populated by GLSL IR. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
@@ -933,9 +933,9 @@ apply_var_decoration(struct vtn_builder *b, nir_variable *nir_var,
|
||||
nir_var->data.read_only = true;
|
||||
|
||||
nir_constant *c = rzalloc(nir_var, nir_constant);
|
||||
c->value.u[0] = b->shader->info.cs.local_size[0];
|
||||
c->value.u[1] = b->shader->info.cs.local_size[1];
|
||||
c->value.u[2] = b->shader->info.cs.local_size[2];
|
||||
c->value.u[0] = b->shader->info->cs.local_size[0];
|
||||
c->value.u[1] = b->shader->info->cs.local_size[1];
|
||||
c->value.u[2] = b->shader->info->cs.local_size[2];
|
||||
nir_var->constant_initializer = c;
|
||||
break;
|
||||
}
|
||||
@@ -1175,18 +1175,18 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
|
||||
case SpvStorageClassUniformConstant:
|
||||
if (without_array->block) {
|
||||
var->mode = vtn_variable_mode_ubo;
|
||||
b->shader->info.num_ubos++;
|
||||
b->shader->info->num_ubos++;
|
||||
} else if (without_array->buffer_block) {
|
||||
var->mode = vtn_variable_mode_ssbo;
|
||||
b->shader->info.num_ssbos++;
|
||||
b->shader->info->num_ssbos++;
|
||||
} else if (glsl_type_is_image(without_array->type)) {
|
||||
var->mode = vtn_variable_mode_image;
|
||||
nir_mode = nir_var_uniform;
|
||||
b->shader->info.num_images++;
|
||||
b->shader->info->num_images++;
|
||||
} else if (glsl_type_is_sampler(without_array->type)) {
|
||||
var->mode = vtn_variable_mode_sampler;
|
||||
nir_mode = nir_var_uniform;
|
||||
b->shader->info.num_textures++;
|
||||
b->shader->info->num_textures++;
|
||||
} else {
|
||||
assert(!"Invalid uniform variable type");
|
||||
}
|
||||
|
Reference in New Issue
Block a user