};
-/** Subclass of Mesa fragment program */
-struct brw_fragment_program {
- struct gl_program program;
- GLuint id; /**< serial no. to identify frag progs, never re-used */
-};
-
-
struct gen4_fragment_program {
- struct brw_fragment_program base;
+ struct brw_program base;
bool contains_flat_varying;
bool contains_noperspective_varying;
return (const struct brw_program *) p;
}
-static inline struct brw_fragment_program *
-brw_fragment_program(struct gl_program *p)
-{
- return (struct brw_fragment_program *) p;
-}
-
-static inline const struct brw_fragment_program *
-brw_fragment_program_const(const struct gl_program *p)
-{
- return (const struct brw_fragment_program *) p;
-}
-
static inline struct brw_compute_program *
brw_compute_program(struct gl_program *p)
{
}
case GL_FRAGMENT_PROGRAM_ARB: {
- struct brw_fragment_program *prog;
+ struct brw_program *prog;
if (brw->gen < 6) {
struct gen4_fragment_program *g4_prog =
CALLOC_STRUCT(gen4_fragment_program);
prog = &g4_prog->base;
} else {
- prog = CALLOC_STRUCT(brw_fragment_program);
+ prog = CALLOC_STRUCT(brw_program);
}
if (prog) {
switch (target) {
case GL_FRAGMENT_PROGRAM_ARB: {
- struct brw_fragment_program *newFP = brw_fragment_program(prog);
- const struct brw_fragment_program *curFP =
- brw_fragment_program_const(brw->fragment_program);
+ struct brw_program *newFP = brw_program(prog);
+ const struct brw_program *curFP =
+ brw_program_const(brw->fragment_program);
if (newFP == curFP)
brw->ctx.NewDriverState |= BRW_NEW_FRAGMENT_PROGRAM;
bool
brw_codegen_wm_prog(struct brw_context *brw,
struct gl_shader_program *prog,
- struct brw_fragment_program *fp,
+ struct brw_program *fp,
struct brw_wm_prog_key *key,
struct brw_vue_map *vue_map)
{
{
struct gl_context *ctx = &brw->ctx;
/* BRW_NEW_FRAGMENT_PROGRAM */
- const struct brw_fragment_program *fp =
- (struct brw_fragment_program *) brw->fragment_program;
+ const struct brw_program *fp = brw_program_const(brw->fragment_program);
const struct gl_program *prog = (struct gl_program *) brw->fragment_program;
GLuint lookup = 0;
GLuint line_aa;
struct gl_context *ctx = &brw->ctx;
struct gl_shader_program *current = ctx->_Shader->_CurrentFragmentProgram;
struct brw_wm_prog_key key;
- struct brw_fragment_program *fp = (struct brw_fragment_program *)
- brw->fragment_program;
+ struct brw_program *fp = (struct brw_program *) brw->fragment_program;
if (!brw_wm_state_dirty(brw))
return;
struct brw_context *brw = brw_context(ctx);
struct brw_wm_prog_key key;
- struct brw_fragment_program *bfp = brw_fragment_program(prog);
+ struct brw_program *bfp = brw_program(prog);
memset(&key, 0, sizeof(key));
bool brw_color_buffer_write_enabled(struct brw_context *brw);
bool brw_codegen_wm_prog(struct brw_context *brw,
struct gl_shader_program *prog,
- struct brw_fragment_program *fp,
+ struct brw_program *fp,
struct brw_wm_prog_key *key,
struct brw_vue_map *vue_map);
void brw_wm_debug_recompile(struct brw_context *brw,
{
struct brw_stage_state *stage_state = &brw->wm.base;
/* BRW_NEW_FRAGMENT_PROGRAM */
- struct brw_fragment_program *fp =
- (struct brw_fragment_program *) brw->fragment_program;
+ struct brw_program *fp = (struct brw_program *) brw->fragment_program;
/* BRW_NEW_FS_PROG_DATA */
struct brw_stage_prog_data *prog_data = brw->wm.base.prog_data;
{
struct brw_stage_state *stage_state = &brw->wm.base;
/* BRW_NEW_FRAGMENT_PROGRAM */
- const struct brw_fragment_program *fp =
- brw_fragment_program_const(brw->fragment_program);
+ const struct brw_program *fp = brw_program_const(brw->fragment_program);
/* BRW_NEW_FS_PROG_DATA */
const struct brw_stage_prog_data *prog_data = brw->wm.base.prog_data;