[Mesa-dev] [PATCH 09/10] r300g: claim control flow support since the driver emulates it
luca at luca-barbieri.com
Sun Sep 5 18:30:51 PDT 2010
This purpose of this is so that loop/if emulation in the glsl compiler
doesn't get enabled in the next change.
Note that doing such emulation in driver-specific code is probably
a bad idea, especially since the result won't be exposed to further
generic optimizations, and the driver-specific code doesn't get
improved by the wider community that cares about GLSL.
Thus, it might be a good idea to revert this commit once/if r300g
works well with the glsl compiler loop/if emulation, and possibly
remove some of the emulation from the r300 compiler.
The only part that makes sense to have in the driver is emulation of
loops with an unknown number of iterations, since here the goal is to unroll
as much as possible while staying in the instruction limits, and the glsl
compiler cannot do this because it has no idea of how many instructions
some IR will generate.
src/gallium/drivers/r300/r300_screen.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 7f41ff0..8deb9d9 100644
@@ -182,7 +182,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
return is_r500 ? 511 : 4;
- return is_r500 ? 64 : 0; /* Actually unlimited on r500. */
+ return is_r500 ? 64 : 1; /* Actually unlimited on r500. */
/* Fragment shader limits. */
/* 2 colors + 8 texcoords are always supported
@@ -216,7 +216,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
- return is_r500 ? 4 : 0; /* For loops; not sure about conditionals. */
+ return is_r500 ? 4 : 1; /* For loops; not sure about conditionals. */
More information about the mesa-dev