From: Jason Ekstrand Date: Wed, 15 Oct 2014 23:01:04 +0000 (-0700) Subject: i965/fs_nir: Add support for sample_pos and sample_id X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4582341ea74a076c981c962f1a01311bfa3bf991;p=mesa.git i965/fs_nir: Add support for sample_pos and sample_id --- 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: