[Mesa-dev] [PATCH 029/133] i965/fs_nir: Add support for sample_pos and sample_id
Jason Ekstrand
jason at jlekstrand.net
Mon Dec 15 22:04:39 PST 2014
---
src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index 22f4c0f..677bd8f 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -1328,9 +1328,20 @@ fs_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
break;
}
- case nir_intrinsic_load_sample_pos:
- case nir_intrinsic_load_sample_id:
- assert(!"TODO");
+ case nir_intrinsic_load_sample_pos: {
+ fs_reg *reg = emit_samplepos_setup();
+ dest.type = reg->type;
+ emit(MOV(dest, *reg));
+ emit(MOV(offset(dest, 1), offset(*reg, 1)));
+ break;
+ }
+
+ case nir_intrinsic_load_sample_id: {
+ fs_reg *reg = emit_sampleid_setup();
+ dest.type = reg->type;
+ emit(MOV(dest, *reg));
+ break;
+ }
case nir_intrinsic_load_uniform_vec1:
case nir_intrinsic_load_uniform_vec2:
--
2.2.0
More information about the mesa-dev
mailing list