<div class="gmail_quote">On Wed, Nov 10, 2010 at 9:48 PM, José Fonseca <span dir="ltr"><<a href="mailto:jfonseca@vmware.com" target="_blank">jfonseca@vmware.com</a>></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>
> Required because ATI and NVIDIA DX9 GPUs do not support indirect addressing<br>
> of temps, inputs, outputs, and consts (FS-only) or the hw support is so<br>
> limited that we cannot use it.<br>
><br>
> This should make r300g and possibly nvfx more feature complete.<br>
><br>
> Signed-off-by: Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>><br>
> ---<br>
> src/gallium/include/pipe/p_defines.h | 5 +++++<br>
> src/mesa/state_tracker/st_extensions.c | 9 +++++++++<br>
> 2 files changed, 14 insertions(+), 0 deletions(-)<br>
><br>
> diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h<br>
> index 53f7b60..6cca301 100644<br>
> --- a/src/gallium/include/pipe/p_defines.h<br>
> +++ b/src/gallium/include/pipe/p_defines.h<br>
> @@ -483,7 +483,12 @@ enum pipe_shader_cap<br>
> PIPE_SHADER_CAP_MAX_TEMPS,<br>
> PIPE_SHADER_CAP_MAX_ADDRS,<br>
> PIPE_SHADER_CAP_MAX_PREDS,<br>
> + /* boolean caps */<br>
> PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED,<br>
> + PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR,<br>
> + PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR,<br>
> + PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR,<br>
> + PIPE_SHADER_CAP_INDIRECT_CONST_ADDR,<br>
> };<br>
><br>
> /**<br>
> diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c<br>
> index 2720f44..1327491 100644<br>
> --- a/src/mesa/state_tracker/st_extensions.c<br>
> +++ b/src/mesa/state_tracker/st_extensions.c<br>
> @@ -175,6 +175,15 @@ void st_init_limits(struct st_context *st)<br>
><br>
> options->EmitNoCont = !screen->get_shader_param(screen, i, PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED);<br>
><br>
> + options->EmitNoIndirectInput = !screen->get_shader_param(screen, i,<br>
> + PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR);<br>
> + options->EmitNoIndirectOutput = !screen->get_shader_param(screen, i,<br>
> + PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR);<br>
</div></div>> + options->EmitNoIndirectTemp = !screveryeen->get_shader_param(screen, i,<br>
<div>> + PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR);<br>
> + options->EmitNoIndirectUniform = !screen->get_shader_param(screen, i,<br>
> + PIPE_SHADER_CAP_INDIRECT_CONST_ADDR);<br>
> +<br>
> if(options->EmitNoLoops)<br>
> options->MaxUnrollIterations = MIN2(screen->get_shader_param(screen, i, PIPE_SHADER_CAP_MAX_INSTRUCTIONS), 65536);<br>
> }<br>
<br>
</div>Marek,<br>
<br>
I don'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's OK if you don'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'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>