<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 10, 2014, at 5:08 PM, Marek Olšák <<a href="mailto:maraeo@gmail.com" class="">maraeo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" class="">marek.olsak@amd.com</a>><br class=""><br class="">This fixes incorrect rendering in Unreal Engine demos.<br class="">I don't know why it's called "dx10 clamp mode". MSDN doesn't mention it.<br class=""><br class="">Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=83510" class="">https://bugs.freedesktop.org/show_bug.cgi?id=83510</a><br class=""></div></blockquote><div><br class=""></div>This should be set from the program binary, and not hardcoded this way. The compiler should probably change the default based on the shader type</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">---<br class=""> src/gallium/drivers/radeonsi/si_state_shaders.c | 12 ++++++++----<br class=""> 1 file changed, 8 insertions(+), 4 deletions(-)<br class=""><br class="">diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c<br class="">index 3a5b0ae..355f8aa 100644<br class="">--- a/src/gallium/drivers/radeonsi/si_state_shaders.c<br class="">+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c<br class="">@@ -64,7 +64,8 @@ static void si_shader_es(struct si_shader *shader)<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>si_pm4_set_reg(pm4, R_00B328_SPI_SHADER_PGM_RSRC1_ES,<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B328_VGPRS((shader->num_vgprs - 1) / 4) |<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B328_SGPRS((num_sgprs - 1) / 8) |<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B328_VGPR_COMP_CNT(vgpr_comp_cnt));<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B328_VGPR_COMP_CNT(vgpr_comp_cnt) |<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B328_DX10_CLAMP(1));<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>si_pm4_set_reg(pm4, R_00B32C_SPI_SHADER_PGM_RSRC2_ES,<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B32C_USER_SGPR(num_user_sgprs));<br class=""> }<br class="">@@ -132,7 +133,8 @@ static void si_shader_gs(struct si_shader *shader)<br class=""><br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>si_pm4_set_reg(pm4, R_00B228_SPI_SHADER_PGM_RSRC1_GS,<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B228_VGPRS((shader->num_vgprs - 1) / 4) |<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B228_SGPRS((num_sgprs - 1) / 8));<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B228_SGPRS((num_sgprs - 1) / 8) |<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B228_DX10_CLAMP(1));<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>si_pm4_set_reg(pm4, R_00B22C_SPI_SHADER_PGM_RSRC2_GS,<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B22C_USER_SGPR(num_user_sgprs));<br class=""> }<br class="">@@ -206,7 +208,8 @@ static void si_shader_vs(struct si_shader *shader)<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>si_pm4_set_reg(pm4, R_00B128_SPI_SHADER_PGM_RSRC1_VS,<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B128_VGPRS((shader->num_vgprs - 1) / 4) |<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B128_SGPRS((num_sgprs - 1) / 8) |<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B128_VGPR_COMP_CNT(vgpr_comp_cnt));<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B128_VGPR_COMP_CNT(vgpr_comp_cnt) |<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B128_DX10_CLAMP(1));<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>si_pm4_set_reg(pm4, R_00B12C_SPI_SHADER_PGM_RSRC2_VS,<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B12C_USER_SGPR(num_user_sgprs) |<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B12C_SO_BASE0_EN(!!shader->selector->so.stride[0]) |<br class="">@@ -304,7 +307,8 @@ static void si_shader_ps(struct si_shader *shader)<br class=""><br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>si_pm4_set_reg(pm4, R_00B028_SPI_SHADER_PGM_RSRC1_PS,<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B028_VGPRS((shader->num_vgprs - 1) / 4) |<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B028_SGPRS((num_sgprs - 1) / 8));<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B028_SGPRS((num_sgprs - 1) / 8) |<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B028_DX10_CLAMP(1));<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>si_pm4_set_reg(pm4, R_00B02C_SPI_SHADER_PGM_RSRC2_PS,<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B02C_EXTRA_LDS_SIZE(shader->lds_size) |<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> S_00B02C_USER_SGPR(num_user_sgprs));<br class="">-- <br class="">2.1.0<br class=""><br class="">_______________________________________________<br class="">mesa-dev mailing list<br class=""><a href="mailto:mesa-dev@lists.freedesktop.org" class="">mesa-dev@lists.freedesktop.org</a><br class="">http://lists.freedesktop.org/mailman/listinfo/mesa-dev<br class=""></div></blockquote></div><br class=""></body></html>