<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 4, 2016 at 11:04 PM, Jordan Justen <span dir="ltr"><<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.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 2016-04-04 15:51:13, Jason Ekstrand wrote:<br>
> In the Vulkan driver we use a single flat input instead of a uniform<br>
> because setting up push constants is more disruptive to the pipeline than<br>
> setting up another vertex input. This uses the number of uniforms as a key<br>
> to keep it working for the GL driver.<br>
<br>
</span>How about "This uses the number of uniforms to distinguish the uniform<br>
vs attribute methods."<br>
<span class=""><br>
> ---<br>
> src/mesa/drivers/dri/i965/brw_fs.cpp | 25 ++++++++++++++++++++-----<br>
> 1 file changed, 20 insertions(+), 5 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> index 1a6a229..b138c15 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> @@ -2787,10 +2787,23 @@ fs_visitor::emit_repclear_shader()<br>
> brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;<br>
> int base_mrf = 1;<br>
> int color_mrf = base_mrf + 2;<br>
> + fs_inst *mov;<br>
><br>
> - fs_inst *mov = bld.exec_all().group(4, 0)<br>
> - .MOV(brw_message_reg(color_mrf),<br>
> - fs_reg(UNIFORM, 0, BRW_REGISTER_TYPE_F));<br>
> + if (uniforms > 0) {<br>
<br>
</span>On the vulkan branch, we have '== 1', and you do below as well. Should<br>
we move both to '> 0'?<br></blockquote><div><br></div><div>Good catch. They should both be > 0. I'll get that fixed.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Jordan<br>
<div><div class="h5"><br>
> + mov = bld.exec_all().group(4, 0)<br>
> + .MOV(brw_message_reg(color_mrf),<br>
> + fs_reg(UNIFORM, 0, BRW_REGISTER_TYPE_F));<br>
> + } else {<br>
> + struct brw_reg reg =<br>
> + brw_reg(BRW_GENERAL_REGISTER_FILE,<br>
> + 2, 3, 0, 0, BRW_REGISTER_TYPE_F,<br>
> + BRW_VERTICAL_STRIDE_8,<br>
> + BRW_WIDTH_2,<br>
> + BRW_HORIZONTAL_STRIDE_4, BRW_SWIZZLE_XYZW, WRITEMASK_XYZW);<br>
> +<br>
> + mov = bld.exec_all().group(4, 0)<br>
> + .MOV(vec4(brw_message_reg(color_mrf)), fs_reg(reg));<br>
> + }<br>
><br>
> fs_inst *write;<br>
> if (key->nr_color_regions == 1) {<br>
> @@ -2819,8 +2832,10 @@ fs_visitor::emit_repclear_shader()<br>
> assign_curb_setup();<br>
><br>
> /* Now that we have the uniform assigned, go ahead and force it to a vec4. */<br>
> - assert(mov->src[0].file == FIXED_GRF);<br>
> - mov->src[0] = brw_vec4_grf(mov->src[0].nr, 0);<br>
> + if (uniforms == 1) {<br>
> + assert(mov->src[0].file == FIXED_GRF);<br>
> + mov->src[0] = brw_vec4_grf(mov->src[0].nr, 0);<br>
> + }<br>
> }<br>
><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>