gallium: add CAPs for indirect addressing and lower it in st/mesa when needed
authorMarek Olšák <maraeo@gmail.com>
Wed, 10 Nov 2010 19:41:55 +0000 (20:41 +0100)
committerMarek Olšák <maraeo@gmail.com>
Fri, 12 Nov 2010 02:13:22 +0000 (03:13 +0100)
Required because ATI and NVIDIA DX9 GPUs do not support indirect addressing
of temps, inputs, outputs, and consts (FS-only) or the hw support is so
limited that we cannot use it.

This should make r300g and possibly nvfx more feature complete.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index 53f7b601ad58a7a83d81f7c7c28741594852b57c..6cca301ccc4244ba0442d6f3abc72245c0708599 100644 (file)
@@ -483,7 +483,12 @@ enum pipe_shader_cap
    PIPE_SHADER_CAP_MAX_TEMPS,
    PIPE_SHADER_CAP_MAX_ADDRS,
    PIPE_SHADER_CAP_MAX_PREDS,
+   /* boolean caps */
    PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED,
+   PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR,
+   PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR,
+   PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR,
+   PIPE_SHADER_CAP_INDIRECT_CONST_ADDR,
 };
 
 /**
index 2720f446450ffd3612d1e7db37251e0149341a21..132749130af41f738ee180b9762a00811b11db5a 100644 (file)
@@ -175,6 +175,15 @@ void st_init_limits(struct st_context *st)
 
       options->EmitNoCont = !screen->get_shader_param(screen, i, PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED);
 
+      options->EmitNoIndirectInput = !screen->get_shader_param(screen, i,
+                                        PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR);
+      options->EmitNoIndirectOutput = !screen->get_shader_param(screen, i,
+                                        PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR);
+      options->EmitNoIndirectTemp = !screen->get_shader_param(screen, i,
+                                        PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR);
+      options->EmitNoIndirectUniform = !screen->get_shader_param(screen, i,
+                                        PIPE_SHADER_CAP_INDIRECT_CONST_ADDR);
+
       if(options->EmitNoLoops)
          options->MaxUnrollIterations = MIN2(screen->get_shader_param(screen, i, PIPE_SHADER_CAP_MAX_INSTRUCTIONS), 65536);
    }