7 #include "r300_context.h"
8 #include "r300_fragprog.h"
10 static struct gl_program
*r300NewProgram(GLcontext
* ctx
, GLenum target
,
13 struct r300_vertex_program_cont
*vp
;
14 struct r300_fragment_program
*fp
;
17 case GL_VERTEX_STATE_PROGRAM_NV
:
18 case GL_VERTEX_PROGRAM_ARB
:
19 vp
= CALLOC_STRUCT(r300_vertex_program_cont
);
20 return _mesa_init_vertex_program(ctx
, &vp
->mesa_program
,
22 case GL_FRAGMENT_PROGRAM_ARB
:
23 fp
= CALLOC_STRUCT(r300_fragment_program
);
25 return _mesa_init_fragment_program(ctx
, &fp
->mesa_program
,
27 case GL_FRAGMENT_PROGRAM_NV
:
28 fp
= CALLOC_STRUCT(r300_fragment_program
);
29 return _mesa_init_fragment_program(ctx
, &fp
->mesa_program
,
32 _mesa_problem(ctx
, "Bad target in r300NewProgram");
38 static void r300DeleteProgram(GLcontext
* ctx
, struct gl_program
*prog
)
40 _mesa_delete_program(ctx
, prog
);
44 r300ProgramStringNotify(GLcontext
* ctx
, GLenum target
, struct gl_program
*prog
)
46 struct r300_vertex_program_cont
*vp
= (void *)prog
;
47 struct r300_fragment_program
*fp
= (struct r300_fragment_program
*)prog
;
50 case GL_VERTEX_PROGRAM_ARB
:
53 case GL_FRAGMENT_PROGRAM_ARB
:
54 fp
->translated
= GL_FALSE
;
58 /* need this for tcl fallbacks */
59 _tnl_program_string(ctx
, target
, prog
);
63 r300IsProgramNative(GLcontext
* ctx
, GLenum target
, struct gl_program
*prog
)
68 void r300InitShaderFuncs(struct dd_function_table
*functions
)
70 functions
->NewProgram
= r300NewProgram
;
71 functions
->DeleteProgram
= r300DeleteProgram
;
72 functions
->ProgramStringNotify
= r300ProgramStringNotify
;
73 functions
->IsProgramNative
= r300IsProgramNative
;