[Mesa-dev] [PATCH v2 5/8] i965/fs: Plumb separate surfaces and samplers through from NIR

Kenneth Graunke kenneth at whitecape.org
Mon Feb 8 23:30:36 UTC 2016


On Saturday, February 6, 2016 10:19:49 AM PST Jason Ekstrand wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp |  2 +-
>  src/mesa/drivers/dri/i965/brw_fs.cpp            | 29 ++++++++++++++++---------
>  src/mesa/drivers/dri/i965/brw_fs.h              |  3 +++
>  src/mesa/drivers/dri/i965/brw_fs_generator.cpp  |  2 +-
>  src/mesa/drivers/dri/i965/brw_fs_nir.cpp        | 17 ++++++++++-----
>  src/mesa/drivers/dri/i965/brw_fs_visitor.cpp    | 11 ++++++----
>  6 files changed, 43 insertions(+), 21 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
> index c6ae3d8..fd23e23 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
> @@ -85,7 +85,7 @@ brw_blorp_eu_emitter::emit_texture_lookup(const struct brw_reg &dst,
>                                            unsigned msg_length)
>  {
>     fs_inst *inst = new (mem_ctx) fs_inst(op, 16, dst, brw_message_reg(base_mrf),
> -                                         brw_imm_ud(0u));
> +                                         brw_imm_ud(0u), brw_imm_ud(0u));
>  
>     inst->base_mrf = base_mrf;
>     inst->mlen = msg_length;
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 8f4a7c1..72fe472 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -3653,6 +3653,7 @@ lower_sampler_logical_send_gen4(const fs_builder &bld, fs_inst *inst, opcode op,
>                                  const fs_reg &coordinate,
>                                  const fs_reg &shadow_c,
>                                  const fs_reg &lod, const fs_reg &lod2,
> +                                const fs_reg &surface,
>                                  const fs_reg &sampler,
>                                  unsigned coord_components,
>                                  unsigned grad_components)
> @@ -3745,8 +3746,9 @@ lower_sampler_logical_send_gen4(const fs_builder &bld, fs_inst *inst, opcode op,
>  
>     inst->opcode = op;
>     inst->src[0] = reg_undef;
> -   inst->src[1] = sampler;
> -   inst->resize_sources(2);
> +   inst->src[1] = surface;
> +   inst->src[2] = sampler;
> +   inst->resize_sources(3);
>     inst->base_mrf = msg_begin.nr;
>     inst->mlen = msg_end.nr - msg_begin.nr;
>     inst->header_size = 1;
> @@ -3758,6 +3760,7 @@ lower_sampler_logical_send_gen5(const fs_builder &bld, fs_inst *inst, opcode op,
>                                  const fs_reg &shadow_c,
>                                  fs_reg lod, fs_reg lod2,
>                                  const fs_reg &sample_index,
> +                                const fs_reg &surface,
>                                  const fs_reg &sampler,
>                                  const fs_reg &offset_value,
>                                  unsigned coord_components,
> @@ -3840,8 +3843,9 @@ lower_sampler_logical_send_gen5(const fs_builder &bld, fs_inst *inst, opcode op,
>  
>     inst->opcode = op;
>     inst->src[0] = reg_undef;
> -   inst->src[1] = sampler;
> -   inst->resize_sources(2);
> +   inst->src[1] = surface;
> +   inst->src[2] = sampler;
> +   inst->resize_sources(3);
>     inst->base_mrf = message.nr;
>     inst->mlen = msg_end.nr - message.nr;
>     inst->header_size = header_size;
> @@ -3865,7 +3869,9 @@ lower_sampler_logical_send_gen7(const fs_builder &bld, fs_inst *inst, opcode op,
>                                  const fs_reg &shadow_c,
>                                  fs_reg lod, fs_reg lod2,
>                                  const fs_reg &sample_index,
> -                                const fs_reg &mcs, const fs_reg &sampler,
> +                                const fs_reg &mcs,
> +                                const fs_reg &surface,
> +                                const fs_reg &sampler,
>                                  fs_reg offset_value,
>                                  unsigned coord_components,
>                                  unsigned grad_components)
> @@ -4068,8 +4074,9 @@ lower_sampler_logical_send_gen7(const fs_builder &bld, fs_inst *inst, opcode op,
>     /* Generate the SEND. */
>     inst->opcode = op;
>     inst->src[0] = src_payload;
> -   inst->src[1] = sampler;
> -   inst->resize_sources(2);
> +   inst->src[1] = surface;
> +   inst->src[2] = sampler;
> +   inst->resize_sources(3);
>     inst->base_mrf = -1;
>     inst->mlen = mlen;
>     inst->header_size = header_size;
> @@ -4088,6 +4095,7 @@ lower_sampler_logical_send(const fs_builder &bld, fs_inst *inst, opcode op)
>     const fs_reg &lod2 = inst->src[FS_TEX_SRC_LOD2];
>     const fs_reg &sample_index = inst->src[FS_TEX_SRC_SAMPLE_INDEX];
>     const fs_reg &mcs = inst->src[FS_TEX_SRC_MCS];
> +   const fs_reg &surface = inst->src[FS_TEX_SRC_SAMPLER];

This is wrong, it should be FS_TEX_SRC_SURFACE.

With that fixed, this is:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

The rest of the series that I didn't comment on is also R-b.

>     const fs_reg &sampler = inst->src[FS_TEX_SRC_SAMPLER];
>     const fs_reg &offset_value = inst->src[FS_TEX_SRC_OFFSET_VALUE];
>     assert(inst->src[FS_TEX_SRC_COORD_COMPONENTS].file == IMM);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160208/123e705f/attachment.sig>


More information about the mesa-dev mailing list