<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"></p>
<p style="font-family: Calibri, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
For the series,</p>
<p style="font-family: Calibri, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
<br>
</p>
<p style="font-family: Calibri, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
Reviewed-by: Neha Bhende<bhenden@vmware.com></p>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif, Helvetica, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p>Regards,</p>
<p>Neha<br>
</p>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Brian Paul <brianp@vmware.com><br>
<b>Sent:</b> Sunday, December 24, 2017 2:40:28 PM<br>
<b>To:</b> mesa-dev@lists.freedesktop.org<br>
<b>Cc:</b> Charmaine Lee; Neha Bhende<br>
<b>Subject:</b> [PATCH 2/2] svga: use tgsi_util_get_shadow_ref_src_index() in a couple place</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">No piglit changes.<br>
---<br>
src/gallium/drivers/svga/svga_tgsi_vgpu10.c | 29 +++++++----------------------<br>
1 file changed, 7 insertions(+), 22 deletions(-)<br>
<br>
diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c<br>
index 31149dd..3e4a6ed 100644<br>
--- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c<br>
+++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c<br>
@@ -4782,16 +4782,12 @@ emit_tex_compare_refcoord(struct svga_shader_emitter_v10 *emit,<br>
const struct tgsi_full_src_register *coord)<br>
{<br>
struct tgsi_full_src_register coord_src_ref;<br>
- unsigned component;<br>
+ int component;<br>
<br>
assert(tgsi_is_shadow_target(target));<br>
<br>
- assert(target != TGSI_TEXTURE_SHADOWCUBE_ARRAY); /* XXX not implemented */<br>
- if (target == TGSI_TEXTURE_SHADOW2D_ARRAY ||<br>
- target == TGSI_TEXTURE_SHADOWCUBE)<br>
- component = TGSI_SWIZZLE_W;<br>
- else<br>
- component = TGSI_SWIZZLE_Z;<br>
+ component = tgsi_util_get_shadow_ref_src_index(target) % 4;<br>
+ assert(component >= 0);<br>
<br>
coord_src_ref = scalar_src(coord, component);<br>
<br>
@@ -4895,21 +4891,10 @@ end_tex_swizzle(struct svga_shader_emitter_v10 *emit,<br>
<br>
assert(emit->unit == PIPE_SHADER_FRAGMENT);<br>
<br>
- switch (swz->texture_target) {<br>
- case TGSI_TEXTURE_SHADOW2D:<br>
- case TGSI_TEXTURE_SHADOWRECT:<br>
- case TGSI_TEXTURE_SHADOW1D:<br>
- case TGSI_TEXTURE_SHADOW1D_ARRAY:<br>
- coord_src = scalar_src(swz->coord_src, TGSI_SWIZZLE_Z);<br>
- break;<br>
- case TGSI_TEXTURE_SHADOWCUBE:<br>
- case TGSI_TEXTURE_SHADOW2D_ARRAY:<br>
- coord_src = scalar_src(swz->coord_src, TGSI_SWIZZLE_W);<br>
- break;<br>
- default:<br>
- assert(!"Unexpected texture target in end_tex_swizzle()");<br>
- coord_src = scalar_src(swz->coord_src, TGSI_SWIZZLE_Z);<br>
- }<br>
+ int component =<br>
+ tgsi_util_get_shadow_ref_src_index(swz->texture_target) % 4;<br>
+ assert(component >= 0);<br>
+ coord_src = scalar_src(swz->coord_src, component);<br>
<br>
/* COMPARE tmp, coord, texel */<br>
emit_comparison(emit, compare_func,<br>
-- <br>
1.9.1<br>
<br>
</div>
</span></font></div>
</body>
</html>