mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
i965: replace brw_fragment_program with brw_program
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
46a4e4257e
commit
13d0cf57bf
6 changed files with 13 additions and 36 deletions
|
|
@ -334,15 +334,8 @@ struct brw_program {
|
|||
};
|
||||
|
||||
|
||||
/** 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;
|
||||
|
|
@ -1690,18 +1683,6 @@ brw_program_const(const struct gl_program *p)
|
|||
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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -145,13 +145,13 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
@ -198,9 +198,9 @@ brwProgramStringNotify(struct gl_context *ctx,
|
|||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ assign_fs_binding_table_offsets(const struct gen_device_info *devinfo,
|
|||
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)
|
||||
{
|
||||
|
|
@ -438,8 +438,7 @@ brw_wm_populate_key(struct brw_context *brw, struct brw_wm_prog_key *key)
|
|||
{
|
||||
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;
|
||||
|
|
@ -574,8 +573,7 @@ brw_upload_wm_prog(struct brw_context *brw)
|
|||
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;
|
||||
|
|
@ -601,7 +599,7 @@ brw_fs_precompile(struct gl_context *ctx,
|
|||
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));
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ extern "C" {
|
|||
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,
|
||||
|
|
|
|||
|
|
@ -832,8 +832,7 @@ brw_upload_wm_pull_constants(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;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,7 @@ gen6_upload_wm_push_constants(struct brw_context *brw)
|
|||
{
|
||||
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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue