<div dir="ltr">I pushed it. Thanks Nicholas.<div><br></div><div>Stéphane</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 22, 2016 at 9:40 AM, Roland Scheidegger <span dir="ltr"><<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.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="">Am 22.09.2016 um 17:40 schrieb Emil Velikov:<br>
> Hi Nicholas,<br>
><br>
> On 26 August 2016 at 00:31, Nicholas Bishop <<a href="mailto:nbishop@neverware.com">nbishop@neverware.com</a>> wrote:<br>
>> From: Nicholas Bishop <<a href="mailto:nicholasbishop@gmail.com">nicholasbishop@gmail.com</a>><br>
>><br>
>> On Intel Pineview M hardware, the i915 gallium driver doesn't output<br>
>> the correct gl_FragCoord. It seems to always have an X coord of 0.0<br>
>> and a Y coord of the window's height in pixels, e.g. 600.0f or such.<br>
>><br>
>> I believe this is a regression caused in part by this commit:<br>
>> afa035031ff9e0c07a2297d864e46c<wbr>76f7bfff58<br>
>><br>
>> The old behavior used the output at index zero, while the new behavior<br>
>> uses actual zeroes. In the case of gl_FragCoord the output at index<br>
>> zero happened to be the correct one, so the behavior appeared correct<br>
>> although the code already had a bug.<br>
>><br>
>> Fixed by checking for I915_SEMANTIC_POS when setting up texCoords. If<br>
>> the generic_mapping is I915_SEMANTIC_POS, look for the<br>
>> TGSI_SEMANTIC_POSITION instead of a TGSI_SEMANTIC_GENERIC output.<br>
>><br>
</span>>> <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D97477&d=CwIFaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Vjtt0vs_iqoI31UfJxBl7yv9I2FeiaeAYgMTLKRBc_I&m=Mt7V3FvGsInekgNmMd2jOoCYRJDl4If-uvNtbOhGkRQ&s=JlfHHRDgBQvDfacPpT-qFUmY4drEprImNSdf1L6ch3c&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.<wbr>com/v2/url?u=https-3A__bugs.<wbr>freedesktop.org_show-5Fbug.<wbr>cgi-3Fid-3D97477&d=CwIFaQ&c=<wbr>Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-<wbr>YihVMNtXt-uEs&r=Vjtt0vs_<wbr>iqoI31UfJxBl7yv9I2FeiaeAYgMTLK<wbr>RBc_I&m=<wbr>Mt7V3FvGsInekgNmMd2jOoCYRJDl4I<wbr>f-uvNtbOhGkRQ&s=<wbr>JlfHHRDgBQvDfacPpT-<wbr>qFUmY4drEprImNSdf1L6ch3c&e=</a><br>
<span class="">>> ---<br>
>>  src/gallium/drivers/i915/i915_<wbr>state_derived.c | 7 ++++++-<br>
>>  1 file changed, 6 insertions(+), 1 deletion(-)<br>
>><br>
>> diff --git a/src/gallium/drivers/i915/<wbr>i915_state_derived.c b/src/gallium/drivers/i915/<wbr>i915_state_derived.c<br>
>> index 177b854..dbfbc84 100644<br>
>> --- a/src/gallium/drivers/i915/<wbr>i915_state_derived.c<br>
>> +++ b/src/gallium/drivers/i915/<wbr>i915_state_derived.c<br>
>> @@ -145,7 +145,12 @@ static void calculate_vertex_layout(struct i915_context *i915)<br>
>>        uint hwtc;<br>
>>        if (texCoords[i]) {<br>
>>           hwtc = TEXCOORDFMT_4D;<br>
>> -         src = draw_find_shader_output(i915-><wbr>draw, TGSI_SEMANTIC_GENERIC, fs->generic_mapping[i]);<br>
>> +         if (fs->generic_mapping[i] == I915_SEMANTIC_POS) {<br>
>> +            src = draw_find_shader_output(i915-><wbr>draw, TGSI_SEMANTIC_POSITION, 0);<br>
>> +         }<br>
>> +         else {<br>
>> +            src = draw_find_shader_output(i915-><wbr>draw, TGSI_SEMANTIC_GENERIC, fs->generic_mapping[i]);<br>
>> +         }<br>
><br>
> Personally I'm unfamiliar with the i915g driver, so I've Cc'd Roland<br>
> (the author of the commit 'breaking' this) and Stéphane (the author of<br>
> this driver).<br>
><br>
> Gents, any input on the above ?<br>
<br>
</span>Oh, I wasn't aware I broke this...<br>
This looks to me like before my patch there i915g was indeed just<br>
relying on draw code redirecting undefined inputs to 0, which near<br>
certainly was unspecified behavior.<br>
I don't really know i915g, but this looks like it should be correct.<br>
<br>
Reviewed-by: Roland Scheidegger <<a href="mailto:sroland@vmware.com">sroland@vmware.com</a>><br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> That said, please drop the unneeded brackets and add the following<br>
> line in the commit message for v2.<br>
> Cc: <a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.<wbr>org</a><br>
><br>
> Thanks,<br>
> Emil<br>
><br>
<br>
______________________________<wbr>_________________<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/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div>