r300/compiler: emulate loops in vertex shaders
authorMarek Olšák <maraeo@gmail.com>
Wed, 23 Jun 2010 01:55:20 +0000 (03:55 +0200)
committerMarek Olšák <maraeo@gmail.com>
Wed, 23 Jun 2010 01:55:20 +0000 (03:55 +0200)
It is not perfect, but it is the best we got.

src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c

index 38312658d65ae6595be964b926346eb68d2f051e..bbdfa0d56f997b6f37344c95c1a08a7d6a6988a5 100644 (file)
@@ -105,14 +105,13 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c)
         * we don't have branching support for r5xx, we use the emulation
         * on all chipsets. */
        
-       if(c->Base.is_r500){
+       if (c->Base.is_r500) {
                rc_emulate_loops(&c->Base, R500_PFS_MAX_INST);
-       }
-       else{
+       } else {
                rc_emulate_loops(&c->Base, R300_PFS_MAX_ALU_INST);
        }
        debug_program_log(c, "after emulate loops");
-       
+
        rc_emulate_branches(&c->Base);
 
        debug_program_log(c, "after emulate branches");
index 507b2e532febea97ffe79971ba4634ce39794126..6a1e3e75a6873f88bab8bfb3b2bb582f19cf62d9 100644 (file)
@@ -30,6 +30,7 @@
 #include "radeon_program_alu.h"
 #include "radeon_swizzle.h"
 #include "radeon_emulate_branches.h"
+#include "radeon_emulate_loops.h"
 
 /*
  * Take an already-setup and valid source then swizzle it appropriately to
@@ -600,6 +601,13 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler)
        /* XXX Ideally this should be done only for r3xx, but since
         * we don't have branching support for r5xx, we use the emulation
         * on all chipsets. */
+       if (compiler->Base.is_r500){
+               rc_emulate_loops(&compiler->Base, R500_VS_MAX_ALU);
+       } else {
+               rc_emulate_loops(&compiler->Base, R300_VS_MAX_ALU);
+       }
+       debug_program_log(compiler, "after emulate loops");
+
        rc_emulate_branches(&compiler->Base);
 
        debug_program_log(compiler, "after emulate branches");