<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 6, 2016 at 11:14 AM, Rob Clark <span dir="ltr"><<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Feb 6, 2016 at 1:19 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> Previously, NIR only provided a single sampler_index which was doubled as<br>
> the texture index. Now, it provides separate sampler and texture indices<br>
> which we can use. For both GLSL and TGSI they should usually be the same.<br>
> The one exception is quaries where the sampler isn't needed.<br>
<br>
</span>hmm, for border-color we need a bit of a hack which assumes<br>
texture:sampler is 1:1.. since the border-color needs to be swizzled<br>
according to the texture format..<br>
<br>
so while hw does support specifying sampler and texture independently,<br>
I'm not sure it is practical in real life.. :-(<br></blockquote><div><br></div><div>Alright. I'll drop this patch so we don't end up with too many lies. Coming out of GLSL or TGSI, you should be fine to just use texture_index as it's the same as sampler_index for now.<br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
BR,<br>
-R<br>
<div><div class="h5"><br>
> Cc: Rob Clark <<a href="mailto:robclark@gmail.com">robclark@gmail.com</a>><br>
> ---<br>
> src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 6 +++---<br>
> 1 file changed, 3 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c<br>
> index 922a9a6..b1c2b2d 100644<br>
> --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c<br>
> +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c<br>
> @@ -1544,7 +1544,7 @@ emit_tex(struct ir3_compile *ctx, nir_tex_instr *tex)<br>
> type = TYPE_U32;<br>
><br>
> sam = ir3_SAM(b, opc, type, TGSI_WRITEMASK_XYZW,<br>
> - flags, tex->texture_index, tex->texture_index,<br>
> + flags, tex->sampler_index, tex->texture_index,<br>
> create_collect(b, src0, nsrc0),<br>
> create_collect(b, src1, nsrc1));<br>
><br>
> @@ -1571,7 +1571,7 @@ emit_tex_query_levels(struct ir3_compile *ctx, nir_tex_instr *tex)<br>
> dst = get_dst(ctx, &tex->dest, 1);<br>
><br>
> sam = ir3_SAM(b, OPC_GETINFO, TYPE_U32, TGSI_WRITEMASK_Z, 0,<br>
> - tex->texture_index, tex->texture_index, NULL, NULL);<br>
> + tex->sampler_index, tex->texture_index, NULL, NULL);<br>
><br>
> /* even though there is only one component, since it ends<br>
> * up in .z rather than .x, we need a split_dest()<br>
> @@ -1608,7 +1608,7 @@ emit_tex_txs(struct ir3_compile *ctx, nir_tex_instr *tex)<br>
> lod = get_src(ctx, &tex->src[0].src)[0];<br>
><br>
> sam = ir3_SAM(b, OPC_GETSIZE, TYPE_U32, TGSI_WRITEMASK_XYZW, flags,<br>
> - tex->texture_index, tex->texture_index, lod, NULL);<br>
> + tex->sampler_index, tex->texture_index, lod, NULL);<br>
><br>
> split_dest(b, dst, sam, 4);<br>
><br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
</div></div>> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div></div>