summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-10-15 16:01:04 -0700
committerJason Ekstrand <[email protected]>2015-01-15 07:18:59 -0800
commit4582341ea74a076c981c962f1a01311bfa3bf991 (patch)
tree9c4684f0321a88ea999aba19ee7f2e7acf77bc89 /src/mesa
parent7cd1537aae28b9189b1251688ac1a5dc9d36cc80 (diff)
i965/fs_nir: Add support for sample_pos and sample_id
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_nir.cpp17
1 files 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 350cf3fd5fa..aab74298fae 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -1325,9 +1325,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: