diff options
author | Jason Ekstrand <[email protected]> | 2017-05-03 16:53:40 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-05-09 15:07:47 -0700 |
commit | ca4d1928023755d099578b7354bf763b8fa4a0f8 (patch) | |
tree | cad0a2c1183a6590ad94321386f2c545874b5109 /src/intel/compiler/brw_fs_nir.cpp | |
parent | 24e6fba50010d9d1efce0d9d3cbcf61dc3aebf0e (diff) |
i965/fs: Lower gl_VertexID and friends to inputs at the NIR level
NIR calls these system values but they come in from the VF unit as
vertex data. It's terribly convenient to just be able to treat them as
such in the back-end.
Reviewed-by: Alejandro PiƱeiro <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_fs_nir.cpp')
-rw-r--r-- | src/intel/compiler/brw_fs_nir.cpp | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index d90eaad32ba..779d74d915d 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -89,39 +89,11 @@ emit_system_values_block(nir_block *block, fs_visitor *v) unreachable("should be lowered by lower_vertex_id()."); case nir_intrinsic_load_vertex_id_zero_base: - assert(v->stage == MESA_SHADER_VERTEX); - reg = &v->nir_system_values[SYSTEM_VALUE_VERTEX_ID_ZERO_BASE]; - if (reg->file == BAD_FILE) - *reg = *v->emit_vs_system_value(SYSTEM_VALUE_VERTEX_ID_ZERO_BASE); - break; - case nir_intrinsic_load_base_vertex: - assert(v->stage == MESA_SHADER_VERTEX); - reg = &v->nir_system_values[SYSTEM_VALUE_BASE_VERTEX]; - if (reg->file == BAD_FILE) - *reg = *v->emit_vs_system_value(SYSTEM_VALUE_BASE_VERTEX); - break; - case nir_intrinsic_load_instance_id: - assert(v->stage == MESA_SHADER_VERTEX); - reg = &v->nir_system_values[SYSTEM_VALUE_INSTANCE_ID]; - if (reg->file == BAD_FILE) - *reg = *v->emit_vs_system_value(SYSTEM_VALUE_INSTANCE_ID); - break; - case nir_intrinsic_load_base_instance: - assert(v->stage == MESA_SHADER_VERTEX); - reg = &v->nir_system_values[SYSTEM_VALUE_BASE_INSTANCE]; - if (reg->file == BAD_FILE) - *reg = *v->emit_vs_system_value(SYSTEM_VALUE_BASE_INSTANCE); - break; - case nir_intrinsic_load_draw_id: - assert(v->stage == MESA_SHADER_VERTEX); - reg = &v->nir_system_values[SYSTEM_VALUE_DRAW_ID]; - if (reg->file == BAD_FILE) - *reg = *v->emit_vs_system_value(SYSTEM_VALUE_DRAW_ID); - break; + unreachable("should be lowered by brw_nir_lower_vs_inputs()."); case nir_intrinsic_load_invocation_id: if (v->stage == MESA_SHADER_TESS_CTRL) |