From 4582341ea74a076c981c962f1a01311bfa3bf991 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 15 Oct 2014 16:01:04 -0700 Subject: i965/fs_nir: Add support for sample_pos and sample_id --- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/mesa') 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: -- cgit v1.2.3