[Mesa-dev] [PATCH 029/133] i965/fs_nir: Add support for sample_pos and sample_id
Connor Abbott
cwabbott0 at gmail.com
Tue Dec 16 22:15:41 PST 2014
On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> ---
> 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;
> + }
I mentioned this before, but we should be calling emit_*_setup() at
the beginning of the shader and then just emit a MOV here... I trust
DCE much more than CSE to Do The Right Thing here.
>
> case nir_intrinsic_load_uniform_vec1:
> case nir_intrinsic_load_uniform_vec2:
> --
> 2.2.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list