<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [radeonsi] playing back videos with VDPAU exhibits deinterlacing/anti-aliasing issues not visible with VA-API"
href="https://bugs.freedesktop.org/show_bug.cgi?id=97988#c11">Comment # 11</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [radeonsi] playing back videos with VDPAU exhibits deinterlacing/anti-aliasing issues not visible with VA-API"
href="https://bugs.freedesktop.org/show_bug.cgi?id=97988">bug 97988</a>
from <span class="vcard"><a class="email" href="mailto:maraeo@gmail.com" title="Marek Olšák <maraeo@gmail.com>"> <span class="fn">Marek Olšák</span></a>
</span></b>
<pre>Thanks Grigori.
GLSL:
color = fract(gl_FragCoord.y / 2) < 0.5 ?
texture(texture0, texcoord0) :
texture(texture1, texcoord0);
texture0 and texture1 are SMEM loads.
LLVM (SimplifyCFG) transforms it to:
color = texture(fract(gl_FragCoord.y / 2) < 0.5 ? texture0 : texture1,
texcoord0);
That's a nice transformation. You don't have to use 2 SMEM loads, you can just
use one SMEM load depending on the result of the condition.
The problem is gl_FragCoord.y is a VGPR and texture0/1 are SGPRs, therefore
flat VMEM loads are used to load the descriptors. However, image_sample
requires descriptors in SGPRs, so v_readfirstlane is used. That effectively
uses the result of the condition from the first active lane, discarding the
results from all other lanes. The result would be exactly the same if the
compiler did: v_readfirstlane s0, gl_FragCoord.y;
The test case seems pretty trivial I wonder how many other apps are affected.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>