Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
if (nir->info.stage == MESA_SHADER_FRAGMENT)
info->ps.writes_memory = true;
break;
+ case nir_intrinsic_load_var:
+ if (nir->info.stage == MESA_SHADER_VERTEX) {
+ nir_deref_var *dvar = instr->variables[0];
+ nir_variable *var = dvar->var;
+
+ if (var->data.mode == nir_var_shader_in) {
+ unsigned idx = var->data.location;
+ uint8_t mask =
+ nir_ssa_def_components_read(&instr->dest.ssa);
+ info->vs.input_usage_mask[idx] |= mask;
+ }
+ }
+ break;
default:
break;
}
#ifndef AC_SHADER_INFO_H
#define AC_SHADER_INFO_H
+#include "compiler/shader_enums.h"
+
struct nir_shader;
struct ac_nir_compiler_options;
bool uses_invocation_id;
bool uses_prim_id;
struct {
+ uint8_t input_usage_mask[VERT_ATTRIB_MAX];
bool has_vertex_buffers; /* needs vertex buffers and base/start */
bool needs_draw_id;
bool needs_instance_id;