LLVMValueRef ret;
unsigned const_index;
unsigned stride = 4;
- int mode = nir_var_shared;
+ int mode = nir_var_mem_shared;
if (var) {
bool vs_in = ctx->stage == MESA_SHADER_VERTEX &&
}
}
break;
- case nir_var_shared: {
+ case nir_var_mem_shared: {
LLVMValueRef address = get_src(ctx, instr->src[0]);
LLVMValueRef val = LLVMBuildLoad(ctx->ac.builder, address, "");
return LLVMBuildBitCast(ctx->ac.builder, val,
}
}
break;
- case nir_var_shared: {
+ case nir_var_mem_shared: {
int writemask = instr->const_index[0];
LLVMValueRef address = get_src(ctx, instr->src[0]);
LLVMValueRef val = get_src(ctx, instr->src[1]);
static void visit_deref(struct ac_nir_context *ctx,
nir_deref_instr *instr)
{
- if (instr->mode != nir_var_shared)
+ if (instr->mode != nir_var_mem_shared)
return;
LLVMValueRef result = NULL;
if (var->data.mode != nir_var_uniform &&
var->data.mode != nir_var_mem_ssbo &&
- var->data.mode != nir_var_shared)
+ var->data.mode != nir_var_mem_shared)
return false; /* atomics passed as function arguments can't be lowered */
const unsigned uniform_loc = var->data.location;
exec_list_push_tail(&shader->uniforms, &var->node);
break;
- case nir_var_shared:
+ case nir_var_mem_shared:
assert(shader->info.stage == MESA_SHADER_COMPUTE);
exec_list_push_tail(&shader->shared, &var->node);
break;
nir_var_mem_ubo = (1 << 5),
nir_var_system_value = (1 << 6),
nir_var_mem_ssbo = (1 << 7),
- nir_var_shared = (1 << 8),
+ nir_var_mem_shared = (1 << 8),
nir_var_all = ~0,
} nir_variable_mode;
case nir_var_uniform:
op = nir_intrinsic_load_uniform;
break;
- case nir_var_shared:
+ case nir_var_mem_shared:
op = nir_intrinsic_load_shared;
break;
default:
nir_variable_mode mode = var->data.mode;
nir_intrinsic_op op;
- if (mode == nir_var_shared) {
+ if (mode == nir_var_mem_shared) {
op = nir_intrinsic_store_shared;
} else {
assert(mode == nir_var_shader_out);
lower_atomic(nir_intrinsic_instr *intrin, struct lower_io_state *state,
nir_variable *var, nir_ssa_def *offset)
{
- assert(var->data.mode == nir_var_shared);
+ assert(var->data.mode == nir_var_mem_shared);
nir_intrinsic_op op;
switch (intrin->intrinsic) {
if (mode != nir_var_shader_in &&
mode != nir_var_shader_out &&
- mode != nir_var_shared &&
+ mode != nir_var_mem_shared &&
mode != nir_var_uniform)
continue;
nir_var_shader_temp |
nir_var_function_temp |
nir_var_mem_ssbo |
- nir_var_shared;
+ nir_var_mem_shared;
continue;
}
case nir_intrinsic_memory_barrier:
written->modes |= nir_var_shader_out |
nir_var_mem_ssbo |
- nir_var_shared;
+ nir_var_mem_shared;
break;
case nir_intrinsic_emit_vertex:
nir_var_shader_temp |
nir_var_function_temp |
nir_var_mem_ssbo |
- nir_var_shared);
+ nir_var_mem_shared);
continue;
}
case nir_intrinsic_memory_barrier:
apply_barrier_for_modes(copies, nir_var_shader_out |
nir_var_mem_ssbo |
- nir_var_shared);
+ nir_var_mem_shared);
break;
case nir_intrinsic_emit_vertex:
nir_var_shader_temp |
nir_var_function_temp |
nir_var_mem_ssbo |
- nir_var_shared);
+ nir_var_mem_shared);
continue;
}
case nir_intrinsic_memory_barrier: {
clear_unused_for_modes(&unused_writes, nir_var_shader_out |
nir_var_mem_ssbo |
- nir_var_shared);
+ nir_var_mem_shared);
break;
}
return "system";
case nir_var_mem_ssbo:
return "ssbo";
- case nir_var_shared:
+ case nir_var_mem_shared:
return "shared";
case nir_var_shader_temp:
return want_local_global_mode ? "shader_temp" : "";
* all means we need to keep it alive.
*/
assert(deref->mode == deref->var->data.mode);
- if (!(deref->mode & (nir_var_function_temp | nir_var_shader_temp | nir_var_shared)) ||
+ if (!(deref->mode & (nir_var_function_temp | nir_var_shader_temp | nir_var_mem_shared)) ||
deref_used_for_not_store(deref))
_mesa_set_add(live, deref->var);
}
if (modes & nir_var_system_value)
progress = remove_dead_vars(&shader->system_values, live) || progress;
- if (modes & nir_var_shared)
+ if (modes & nir_var_mem_shared)
progress = remove_dead_vars(&shader->shared, live) || progress;
if (modes & nir_var_function_temp) {
case nir_deref_type_array_wildcard:
if (instr->mode == nir_var_mem_ubo ||
instr->mode == nir_var_mem_ssbo ||
- instr->mode == nir_var_shared) {
+ instr->mode == nir_var_mem_shared) {
/* Shared variables and UBO/SSBOs have a bit more relaxed rules
* because we need to be able to handle array derefs on vectors.
* Fortunately, nir_lower_io handles these just fine.
break;
case SpvStorageClassWorkgroup:
mode = vtn_variable_mode_workgroup;
- nir_mode = nir_var_shared;
+ nir_mode = nir_var_mem_shared;
break;
case SpvStorageClassAtomicCounter:
mode = vtn_variable_mode_uniform;
* SPIR-V.
*/
var->var->type = glsl_get_bare_type(var->type->type);
- var->var->data.mode = nir_var_shared;
+ var->var->data.mode = nir_var_mem_shared;
}
break;