<div class="gmail_quote">On Wed, Nov 10, 2010 at 9:48 PM, José Fonseca <span dir="ltr">&lt;<a href="mailto:jfonseca@vmware.com" target="_blank">jfonseca@vmware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div><div></div><div>On Wed, 2010-11-10 at 12:29 -0800, Marek Olšák wrote:<br>
&gt; Required because ATI and NVIDIA DX9 GPUs do not support indirect addressing<br>
&gt; of temps, inputs, outputs, and consts (FS-only) or the hw support is so<br>
&gt; limited that we cannot use it.<br>
&gt;<br>
&gt; This should make r300g and possibly nvfx more feature complete.<br>
&gt;<br>
&gt; Signed-off-by: Marek Olšák &lt;<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>&gt;<br>
&gt; ---<br>
&gt;  src/gallium/include/pipe/p_defines.h   |    5 +++++<br>
&gt;  src/mesa/state_tracker/st_extensions.c |    9 +++++++++<br>
&gt;  2 files changed, 14 insertions(+), 0 deletions(-)<br>
&gt;<br>
&gt; diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h<br>
&gt; index 53f7b60..6cca301 100644<br>
&gt; --- a/src/gallium/include/pipe/p_defines.h<br>
&gt; +++ b/src/gallium/include/pipe/p_defines.h<br>
&gt; @@ -483,7 +483,12 @@ enum pipe_shader_cap<br>
&gt;     PIPE_SHADER_CAP_MAX_TEMPS,<br>
&gt;     PIPE_SHADER_CAP_MAX_ADDRS,<br>
&gt;     PIPE_SHADER_CAP_MAX_PREDS,<br>
&gt; +   /* boolean caps */<br>
&gt;     PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED,<br>
&gt; +   PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR,<br>
&gt; +   PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR,<br>
&gt; +   PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR,<br>
&gt; +   PIPE_SHADER_CAP_INDIRECT_CONST_ADDR,<br>
&gt;  };<br>
&gt;<br>
&gt;  /**<br>
&gt; diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c<br>
&gt; index 2720f44..1327491 100644<br>
&gt; --- a/src/mesa/state_tracker/st_extensions.c<br>
&gt; +++ b/src/mesa/state_tracker/st_extensions.c<br>
&gt; @@ -175,6 +175,15 @@ void st_init_limits(struct st_context *st)<br>
&gt;<br>
&gt;        options-&gt;EmitNoCont = !screen-&gt;get_shader_param(screen, i, PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED);<br>
&gt;<br>
&gt; +      options-&gt;EmitNoIndirectInput = !screen-&gt;get_shader_param(screen, i,<br>
&gt; +                                        PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR);<br>
&gt; +      options-&gt;EmitNoIndirectOutput = !screen-&gt;get_shader_param(screen, i,<br>
&gt; +                                        PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR);<br>
</div></div>&gt; +      options-&gt;EmitNoIndirectTemp = !screveryeen-&gt;get_shader_param(screen, i,<br>
<div>&gt; +                                        PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR);<br>
&gt; +      options-&gt;EmitNoIndirectUniform = !screen-&gt;get_shader_param(screen, i,<br>
&gt; +                                        PIPE_SHADER_CAP_INDIRECT_CONST_ADDR);<br>
&gt; +<br>
&gt;        if(options-&gt;EmitNoLoops)<br>
&gt;           options-&gt;MaxUnrollIterations = MIN2(screen-&gt;get_shader_param(screen, i, PIPE_SHADER_CAP_MAX_INSTRUCTIONS), 65536);<br>
&gt;     }<br>
<br>
</div>Marek,<br>
<br>
I don&#39;t object the caps per se -- they seem unavoidable -- but this will<br>
change the current behavior for all existing drivers.  So either this<br>
change is immediately followed with one to implement handle these new<br>
caps on all pipe drivers (it&#39;s OK if you don&#39;t even build them), or the<br>
caps semantics should be negated, e.g,<br>
PIPE_SHADER_CAP_NO_INDIRECT_INPUT_ADDR.<br>
<br>
I don&#39;t feel strongly either way, but it has happened too often for<br>
drivers nobody is currently looking at become broken due to new caps.<br><br></blockquote><div><br></div></div>I was going to fix get_shader_param in all the drivers afterwards to match the current behavior. I am well aware of the consequences the patch would have.<br>


<br>Marek<br>