r300: further r300/r500 merge preparation
authorMaciej Cencora <m.cencora@gmail.com>
Sat, 18 Apr 2009 01:44:36 +0000 (03:44 +0200)
committerDave Airlie <airlied@linux.ie>
Sun, 19 Apr 2009 12:14:50 +0000 (22:14 +1000)
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/r300/r300_fragprog.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r500_fragprog.c

index ff59ae7ecf4f39e401d30bd0e330b9abd36edacc..41417f3122fbe4983b404b60963e4f949f215377 100644 (file)
@@ -614,7 +614,8 @@ struct r300_swtcl_info {
 struct r300_vtable {
        void (* SetupRSUnit)(GLcontext *ctx);
        void (* SetupFragmentShaderTextures)(GLcontext *ctx, int *tmu_mappings);
-       void ( *TranslateFragmentShader)(GLcontext *ctx, struct gl_fragment_program *fp);
+       void (* TranslateFragmentShader)(GLcontext *ctx, struct gl_fragment_program *fp);
+       GLboolean (* FragmentProgramEmit)(struct r300_fragment_program_compiler *compiler);
        GLboolean (* SetupPixelShader)(GLcontext *ctx);
 };
 
index eae4c46f694cbab5cbc3605f52e2b325dbc091fe..d58b0921224033b1d870b4dbedfec57e5f11d400 100644 (file)
@@ -452,7 +452,7 @@ void r300TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp)
                        _mesa_print_program(compiler.program);
                }
 
-               if (!r300FragmentProgramEmit(&compiler))
+               if (!r300->vtbl.FragmentProgramEmit(&compiler))
                        r300_fp->error = GL_TRUE;
 
                /* Subtle: Rescue any parameters that have been added during transformations */
index 493c4be6a0064d37ca5100a077325138315988bc..95380a2870efe4a43298ee7f26d95b1443daaf7e 100644 (file)
@@ -2583,10 +2583,12 @@ void r300InitShaderFunctions(r300ContextPtr r300)
                r300->vtbl.SetupPixelShader = r500SetupPixelShader;
                r300->vtbl.SetupFragmentShaderTextures = r500SetupFragmentShaderTextures;
                r300->vtbl.TranslateFragmentShader = r500TranslateFragmentShader;
+               r300->vtbl.FragmentProgramEmit = r500FragmentProgramEmit;
        } else {
                r300->vtbl.SetupRSUnit = r300SetupRSUnit;
                r300->vtbl.SetupPixelShader = r300SetupPixelShader;
                r300->vtbl.SetupFragmentShaderTextures = r300SetupFragmentShaderTextures;
                r300->vtbl.TranslateFragmentShader = r300TranslateFragmentShader;
+               r300->vtbl.FragmentProgramEmit = r300FragmentProgramEmit;
        }
 }
index 526a0ea928fa82dfc8396c8828d3a9ab485dd3ef..3e21e0f4975c177276134f7e7825fcee3416189e 100644 (file)
@@ -491,7 +491,7 @@ void r500TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp)
                        _mesa_print_program(compiler.program);
                }
 
-               if (!r500FragmentProgramEmit(&compiler))
+               if (!r300->vtbl.FragmentProgramEmit(&compiler))
                        r300_fp->error = GL_TRUE;
 
                r300_fp->translated = GL_TRUE;