diff options
author | Antia Puentes <[email protected]> | 2018-04-28 14:09:20 +0200 |
---|---|---|
committer | Antia Puentes <[email protected]> | 2018-05-02 11:23:34 +0200 |
commit | 0cbf29fa5592b7feba6a307d597915cc07be828c (patch) | |
tree | 6f7c343c7326b9ca9dedbc69cf1554d0f0da62ef /src/intel/compiler/brw_nir.c | |
parent | 6ba9088d9c692bfdafdf354ee96f662166582a79 (diff) |
intel: emit is_indexed_draw in the same VE than gl_DrawID
The Vertex Elements are now:
* VE 1: <BaseVertex/firstvertex, BaseInstance, VertexID, InstanceID>
* VE 2: <DrawID, is-indexed-draw, 0, 0>
VE1 is it kept as it was before, VE2 additionally contains the new
system value.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_nir.c')
-rw-r--r-- | src/intel/compiler/brw_nir.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index 16b0d86814f..a624deb6d2a 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -266,6 +266,7 @@ brw_nir_lower_vs_inputs(nir_shader *nir, case nir_intrinsic_load_base_instance: case nir_intrinsic_load_vertex_id_zero_base: case nir_intrinsic_load_instance_id: + case nir_intrinsic_load_is_indexed_draw: case nir_intrinsic_load_draw_id: { b.cursor = nir_after_instr(&intrin->instr); @@ -293,11 +294,15 @@ brw_nir_lower_vs_inputs(nir_shader *nir, nir_intrinsic_set_component(load, 3); break; case nir_intrinsic_load_draw_id: - /* gl_DrawID is stored right after gl_VertexID and friends - * if any of them exist. + case nir_intrinsic_load_is_indexed_draw: + /* gl_DrawID and IsIndexedDraw are stored right after + * gl_VertexID and friends if any of them exist. */ nir_intrinsic_set_base(load, num_inputs + has_sgvs); - nir_intrinsic_set_component(load, 0); + if (intrin->intrinsic == nir_intrinsic_load_draw_id) + nir_intrinsic_set_component(load, 0); + else + nir_intrinsic_set_component(load, 1); break; default: unreachable("Invalid system value intrinsic"); |