summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-09-23 18:59:57 -0700
committerKenneth Graunke <[email protected]>2015-10-21 14:27:56 -0700
commitc5ae34f38f239d346090212a9f33a947a3b7642e (patch)
tree7b3669211f5509a9381d5c60179f229d383a1b97 /src
parentb3ebf03b8406f9f1cd215b98ebdd3fc751f73559 (diff)
i965: Implement nir_intrinsic_load_primitive.
Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_nir.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index 792663f2644..123e86eca37 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -30,6 +30,7 @@
#include "brw_fs_surface_builder.h"
#include "brw_nir.h"
#include "brw_fs_surface_builder.h"
+#include "brw_vec4_gs_visitor.h"
using namespace brw;
using namespace brw::surface_access;
@@ -1367,6 +1368,13 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
case nir_intrinsic_load_vertex_id:
unreachable("should be lowered by lower_vertex_id()");
+ case nir_intrinsic_load_primitive_id:
+ assert(stage == MESA_SHADER_GEOMETRY);
+ assert(((struct brw_gs_prog_data *)prog_data)->include_primitive_id);
+ bld.MOV(retype(dest, BRW_REGISTER_TYPE_UD),
+ retype(fs_reg(brw_vec8_grf(2, 0)), BRW_REGISTER_TYPE_UD));
+ break;
+
case nir_intrinsic_load_vertex_id_zero_base:
case nir_intrinsic_load_base_vertex:
case nir_intrinsic_load_instance_id: