r300/compiler: emulate SIN/COS/SCS in r3xx-r4xx vertex shaders
authorMarek Olšák <maraeo@gmail.com>
Tue, 13 Jul 2010 04:38:30 +0000 (06:38 +0200)
committerMarek Olšák <maraeo@gmail.com>
Tue, 13 Jul 2010 13:06:22 +0000 (15:06 +0200)
Despite the docs, the corresponding hardware instructions are r5xx-only.

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

index bd8d63246a20fdc56c14639960a14a8fd95df6dc..276f4cb6b677c6f38a5e2362d45f6390b35d52f9 100644 (file)
@@ -619,12 +619,18 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler)
 
        debug_program_log(compiler, "after emulate branches");
 
-       {
+       if (compiler->Base.is_r500) {
                struct radeon_program_transformation transformations[] = {
                        { &r300_transform_vertex_alu, 0 },
                        { &r300_transform_trig_scale_vertex, 0 }
                };
                radeonLocalTransform(&compiler->Base, 2, transformations);
+       } else {
+               struct radeon_program_transformation transformations[] = {
+                       { &r300_transform_vertex_alu, 0 },
+                       { &radeonTransformTrigSimple, 0 }
+               };
+               radeonLocalTransform(&compiler->Base, 2, transformations);
        }
 
        debug_program_log(compiler, "after native rewrite");