summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-10-19 13:23:37 +1100
committerTimothy Arceri <[email protected]>2016-10-26 14:29:36 +1100
commit3423488d55b9c483fcdb3996eb89b424c1031d24 (patch)
tree270d90fe3fd4c090f2c8e59a3b20d0afe7d98e72 /src/mesa/drivers
parent17e28a1571b6141368fefc84cc8b0a3b4e52f8ee (diff)
st/mesa/r200/i915/i965: eliminate gl_fragment_program
Here we move OriginUpperLeft and PixelCenterInteger into gl_program all other fields have been replace by shader_info. V2: Don't use anonymous union/structs to hold vertex/fragment fields suggested by Ian. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/common/meta.c10
-rw-r--r--src/mesa/drivers/common/meta.h2
-rw-r--r--src/mesa/drivers/dri/i915/i915_context.h2
-rw-r--r--src/mesa/drivers/dri/i915/i915_fragprog.c40
-rw-r--r--src/mesa/drivers/dri/i915/i915_program.c16
-rw-r--r--src/mesa/drivers/dri/i915/i915_state.c2
-rw-r--r--src/mesa/drivers/dri/i915/intel_tris.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h8
-rw-r--r--src/mesa/drivers/dri/i965/brw_curbe.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c5
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c25
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_state.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c4
-rw-r--r--src/mesa/drivers/dri/i965/gen6_sf_state.c2
-rw-r--r--src/mesa/drivers/dri/i965/gen6_wm_state.c2
-rw-r--r--src/mesa/drivers/dri/i965/gen8_sf_state.c2
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.c4
21 files changed, 72 insertions, 74 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 6020507cbda..f7240f439c0 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -573,8 +573,8 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
if (ctx->Extensions.ARB_fragment_program) {
save->FragmentProgramEnabled = ctx->FragmentProgram.Enabled;
- _mesa_reference_fragprog(ctx, &save->FragmentProgram,
- ctx->FragmentProgram.Current);
+ _mesa_reference_program(ctx, &save->FragmentProgram,
+ ctx->FragmentProgram.Current);
_mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB, GL_FALSE);
}
@@ -953,9 +953,9 @@ _mesa_meta_end(struct gl_context *ctx)
if (ctx->Extensions.ARB_fragment_program) {
_mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB,
save->FragmentProgramEnabled);
- _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
- save->FragmentProgram);
- _mesa_reference_fragprog(ctx, &save->FragmentProgram, NULL);
+ _mesa_reference_program(ctx, &ctx->FragmentProgram.Current,
+ save->FragmentProgram);
+ _mesa_reference_program(ctx, &save->FragmentProgram, NULL);
}
if (ctx->Extensions.ATI_fragment_shader) {
diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h
index 4d3b8ec4252..a7018f5b08c 100644
--- a/src/mesa/drivers/common/meta.h
+++ b/src/mesa/drivers/common/meta.h
@@ -123,7 +123,7 @@ struct save_state
GLboolean VertexProgramEnabled;
struct gl_program *VertexProgram;
GLboolean FragmentProgramEnabled;
- struct gl_fragment_program *FragmentProgram;
+ struct gl_program *FragmentProgram;
GLboolean ATIFragmentShaderEnabled;
struct gl_shader_program *Shader[MESA_SHADER_STAGES];
struct gl_shader_program *ActiveShader;
diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h
index d8f592bcb9f..2046d78471d 100644
--- a/src/mesa/drivers/dri/i915/i915_context.h
+++ b/src/mesa/drivers/dri/i915/i915_context.h
@@ -140,7 +140,7 @@ enum {
*/
struct i915_fragment_program
{
- struct gl_fragment_program FragProg;
+ struct gl_program FragProg;
bool translated;
bool params_uptodate;
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index 4e1df738214..ae230711a7b 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -95,7 +95,7 @@ get_texcoord_mapping(struct i915_fragment_program *p, uint8_t texcoord)
static GLuint
src_vector(struct i915_fragment_program *p,
const struct prog_src_register *source,
- const struct gl_fragment_program *program)
+ const struct gl_program *program)
{
GLuint src;
unsigned unit;
@@ -186,7 +186,7 @@ src_vector(struct i915_fragment_program *p,
case PROGRAM_STATE_VAR:
case PROGRAM_UNIFORM:
src = i915_emit_param4fv(p,
- &program->Base.Parameters->ParameterValues[source->Index][0].f);
+ &program->Parameters->ParameterValues[source->Index][0].f);
break;
default:
@@ -278,8 +278,8 @@ translate_tex_src_target(struct i915_fragment_program *p, GLubyte bit)
#define EMIT_TEX( OP ) \
do { \
GLuint dim = translate_tex_src_target( p, inst->TexSrcTarget ); \
- const struct gl_fragment_program *program = &p->FragProg; \
- GLuint unit = program->Base.SamplerUnits[inst->TexSrcUnit]; \
+ const struct gl_program *program = &p->FragProg; \
+ GLuint unit = program->SamplerUnits[inst->TexSrcUnit]; \
GLuint sampler = i915_emit_decl(p, REG_TYPE_S, \
unit, dim); \
GLuint coord = src_vector( p, &inst->SrcReg[0], program); \
@@ -313,13 +313,13 @@ do { \
*/
static bool calc_live_regs( struct i915_fragment_program *p )
{
- const struct gl_fragment_program *program = &p->FragProg;
+ const struct gl_program *program = &p->FragProg;
GLuint regsUsed = ~((1 << I915_MAX_TEMPORARY) - 1);
uint8_t live_components[I915_MAX_TEMPORARY] = { 0, };
GLint i;
- for (i = program->Base.NumInstructions - 1; i >= 0; i--) {
- struct prog_instruction *inst = &program->Base.Instructions[i];
+ for (i = program->NumInstructions - 1; i >= 0; i--) {
+ struct prog_instruction *inst = &program->Instructions[i];
int opArgs = _mesa_num_inst_src_regs(inst->Opcode);
int a;
@@ -361,8 +361,8 @@ static bool calc_live_regs( struct i915_fragment_program *p )
static GLuint get_live_regs( struct i915_fragment_program *p,
const struct prog_instruction *inst )
{
- const struct gl_fragment_program *program = &p->FragProg;
- GLuint nr = inst - program->Base.Instructions;
+ const struct gl_program *program = &p->FragProg;
+ GLuint nr = inst - program->Instructions;
return p->usedRegs[nr];
}
@@ -382,11 +382,11 @@ static GLuint get_live_regs( struct i915_fragment_program *p,
static void
upload_program(struct i915_fragment_program *p)
{
- const struct gl_fragment_program *program = &p->FragProg;
- const struct prog_instruction *inst = program->Base.Instructions;
+ const struct gl_program *program = &p->FragProg;
+ const struct prog_instruction *inst = program->Instructions;
if (INTEL_DEBUG & DEBUG_WM)
- _mesa_print_program(&program->Base);
+ _mesa_print_program(program);
/* Is this a parse-failed program? Ensure a valid program is
* loaded, as the flagging of an error isn't sufficient to stop
@@ -402,9 +402,9 @@ upload_program(struct i915_fragment_program *p)
return;
}
- if (program->Base.NumInstructions > I915_MAX_INSN) {
+ if (program->NumInstructions > I915_MAX_INSN) {
i915_program_error(p, "Exceeded max instructions (%d out of %d)",
- program->Base.NumInstructions, I915_MAX_INSN);
+ program->NumInstructions, I915_MAX_INSN);
return;
}
@@ -1032,7 +1032,7 @@ fixup_depth_write(struct i915_fragment_program *p)
static void
check_texcoord_mapping(struct i915_fragment_program *p)
{
- GLbitfield64 inputs = p->FragProg.Base.InputsRead;
+ GLbitfield64 inputs = p->FragProg.InputsRead;
unsigned unit = 0;
for (unsigned i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) {
@@ -1059,7 +1059,7 @@ check_texcoord_mapping(struct i915_fragment_program *p)
static void
check_wpos(struct i915_fragment_program *p)
{
- GLbitfield64 inputs = p->FragProg.Base.InputsRead;
+ GLbitfield64 inputs = p->FragProg.InputsRead;
GLint i;
unsigned unit = 0;
@@ -1087,7 +1087,7 @@ translate_program(struct i915_fragment_program *p)
if (INTEL_DEBUG & DEBUG_WM) {
printf("fp:\n");
- _mesa_print_program(&p->FragProg.Base);
+ _mesa_print_program(&p->FragProg);
printf("\n");
}
@@ -1108,7 +1108,7 @@ track_params(struct i915_fragment_program *p)
GLint i;
if (p->nr_params)
- _mesa_load_state_parameters(p->ctx, p->FragProg.Base.Parameters);
+ _mesa_load_state_parameters(p->ctx, p->FragProg.Parameters);
for (i = 0; i < p->nr_params; i++) {
GLint reg = p->param[i].reg;
@@ -1158,7 +1158,7 @@ i915NewProgram(struct gl_context * ctx, GLenum target, GLuint id)
if (prog) {
i915_init_program(I915_CONTEXT(ctx), prog);
- return _mesa_init_gl_program(&prog->FragProg.Base, target, id);
+ return _mesa_init_gl_program(&prog->FragProg, target, id);
}
else
return NULL;
@@ -1257,7 +1257,7 @@ i915ValidateFragmentProgram(struct i915_context *i915)
struct i915_fragment_program *p =
(struct i915_fragment_program *) ctx->FragmentProgram._Current;
- const GLbitfield64 inputsRead = p->FragProg.Base.InputsRead;
+ const GLbitfield64 inputsRead = p->FragProg.InputsRead;
GLuint s4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_VFMT_MASK;
GLuint s2 = S2_TEXCOORD_NONE;
int i, offset = 0;
diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c
index 64b0b4ddb03..0abc7e208db 100644
--- a/src/mesa/drivers/dri/i915/i915_program.c
+++ b/src/mesa/drivers/dri/i915/i915_program.c
@@ -517,18 +517,18 @@ i915_fini_program(struct i915_fragment_program *p)
}
if (p->error) {
- p->FragProg.Base.NumNativeInstructions = 0;
- p->FragProg.Base.NumNativeAluInstructions = 0;
- p->FragProg.Base.NumNativeTexInstructions = 0;
- p->FragProg.Base.NumNativeTexIndirections = 0;
+ p->FragProg.NumNativeInstructions = 0;
+ p->FragProg.NumNativeAluInstructions = 0;
+ p->FragProg.NumNativeTexInstructions = 0;
+ p->FragProg.NumNativeTexIndirections = 0;
}
else {
- p->FragProg.Base.NumNativeInstructions = (p->nr_alu_insn +
+ p->FragProg.NumNativeInstructions = (p->nr_alu_insn +
p->nr_tex_insn +
p->nr_decl_insn);
- p->FragProg.Base.NumNativeAluInstructions = p->nr_alu_insn;
- p->FragProg.Base.NumNativeTexInstructions = p->nr_tex_insn;
- p->FragProg.Base.NumNativeTexIndirections = p->nr_tex_indirect;
+ p->FragProg.NumNativeAluInstructions = p->nr_alu_insn;
+ p->FragProg.NumNativeTexInstructions = p->nr_tex_insn;
+ p->FragProg.NumNativeTexIndirections = p->nr_tex_indirect;
}
p->declarations[0] |= program_size + decl_size - 2;
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index 39abe1b293d..5a0bb3d5777 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -650,7 +650,7 @@ i915_update_sprite_point_enable(struct gl_context *ctx)
/* _NEW_PROGRAM */
struct i915_fragment_program *p =
(struct i915_fragment_program *) ctx->FragmentProgram._Current;
- const GLbitfield64 inputsRead = p->FragProg.Base.InputsRead;
+ const GLbitfield64 inputsRead = p->FragProg.InputsRead;
struct i915_context *i915 = i915_context(ctx);
GLuint s4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_VFMT_MASK;
GLuint coord_replace_bits = 0x0;
diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c
index a093a0a7bd2..683d5a679c9 100644
--- a/src/mesa/drivers/dri/i915/intel_tris.c
+++ b/src/mesa/drivers/dri/i915/intel_tris.c
@@ -955,8 +955,8 @@ intelChooseRenderState(struct gl_context * ctx)
ctx->Polygon.OffsetFill) ? DD_TRI_OFFSET : 0) |
(ctx->Line.StippleFlag ? DD_LINE_STIPPLE : 0) |
(ctx->Point._Attenuated ? DD_POINT_ATTEN : 0);
- const struct gl_fragment_program *fprog = ctx->FragmentProgram._Current;
- bool have_wpos = (fprog && (fprog->Base.InputsRead & VARYING_BIT_POS));
+ const struct gl_program *fprog = ctx->FragmentProgram._Current;
+ bool have_wpos = (fprog && (fprog->InputsRead & VARYING_BIT_POS));
GLuint index = 0;
if (INTEL_DEBUG & DEBUG_STATE)
diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c
index 8646b9e0154..8560dd45996 100644
--- a/src/mesa/drivers/dri/i965/brw_clip.c
+++ b/src/mesa/drivers/dri/i965/brw_clip.c
@@ -149,7 +149,7 @@ brw_upload_clip_prog(struct brw_context *brw)
/* Populate the key:
*/
- const struct gl_fragment_program *fprog = brw->fragment_program;
+ const struct gl_program *fprog = brw->fragment_program;
if (fprog) {
assert(brw->gen < 6);
struct gen4_fragment_program *p = (struct gen4_fragment_program *) fprog;
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 2048beaaa57..af8ed2cc31a 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -305,7 +305,7 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)
/* Resolve color buffers for non-coherent framebuffer fetch. */
if (!ctx->Extensions.MESA_shader_framebuffer_fetch &&
ctx->FragmentProgram._Current &&
- ctx->FragmentProgram._Current->Base.info.outputs_read) {
+ ctx->FragmentProgram._Current->info.outputs_read) {
const struct gl_framebuffer *fb = ctx->DrawBuffer;
for (unsigned i = 0; i < fb->_NumColorDrawBuffers; i++) {
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 5af46051cf1..fa66e238ed4 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -356,7 +356,7 @@ struct brw_geometry_program {
/** Subclass of Mesa fragment program */
struct brw_fragment_program {
- struct gl_fragment_program program;
+ struct gl_program program;
GLuint id; /**< serial no. to identify frag progs, never re-used */
};
@@ -996,7 +996,7 @@ struct brw_context
const struct gl_program *geometry_program;
const struct gl_program *tess_ctrl_program;
const struct gl_program *tess_eval_program;
- const struct gl_fragment_program *fragment_program;
+ const struct gl_program *fragment_program;
const struct gl_program *compute_program;
/**
@@ -1729,13 +1729,13 @@ brw_geometry_program(struct gl_program *p)
}
static inline struct brw_fragment_program *
-brw_fragment_program(struct gl_fragment_program *p)
+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_fragment_program *p)
+brw_fragment_program_const(const struct gl_program *p)
{
return (const struct brw_fragment_program *) p;
}
diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c
index 0e94d156a6e..7d58efb622f 100644
--- a/src/mesa/drivers/dri/i965/brw_curbe.c
+++ b/src/mesa/drivers/dri/i965/brw_curbe.c
@@ -214,7 +214,7 @@ brw_upload_constant_buffer(struct brw_context *brw)
/* fragment shader constants */
if (brw->curbe.wm_size) {
- _mesa_load_state_parameters(ctx, brw->fragment_program->Base.Parameters);
+ _mesa_load_state_parameters(ctx, brw->fragment_program->Parameters);
/* BRW_NEW_CURBE_OFFSETS */
GLuint offset = brw->curbe.wm_start * 16;
@@ -325,7 +325,7 @@ emit:
* BRW_NEW_FRAGMENT_PROGRAM
*/
if (brw->gen == 4 && !brw->is_g4x &&
- (brw->fragment_program->Base.info.inputs_read & (1 << VARYING_SLOT_POS))) {
+ (brw->fragment_program->info.inputs_read & (1 << VARYING_SLOT_POS))) {
BEGIN_BATCH(2);
OUT_BATCH(_3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP << 16 | (2 - 2));
OUT_BATCH(0);
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index a9791287a88..26d0a6ae009 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -452,7 +452,7 @@ brw_try_draw_prims(struct gl_context *ctx,
* index.
*/
brw->wm.base.sampler_count =
- util_last_bit(ctx->FragmentProgram._Current->Base.SamplersUsed);
+ util_last_bit(ctx->FragmentProgram._Current->SamplersUsed);
brw->gs.base.sampler_count = ctx->GeometryProgram._Current ?
util_last_bit(ctx->GeometryProgram._Current->SamplersUsed) : 0;
brw->tes.base.sampler_count = ctx->TessEvalProgram._Current ?
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index 3176dc4ef28..08520a394a0 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -154,7 +154,7 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
if (prog) {
prog->id = get_new_program_id(brw->screen);
- return _mesa_init_gl_program(&prog->program.Base, target, id);
+ return _mesa_init_gl_program(&prog->program, target, id);
}
else
return NULL;
@@ -228,8 +228,7 @@ brwProgramStringNotify(struct gl_context *ctx,
switch (target) {
case GL_FRAGMENT_PROGRAM_ARB: {
- struct gl_fragment_program *fprog = (struct gl_fragment_program *) prog;
- struct brw_fragment_program *newFP = brw_fragment_program(fprog);
+ struct brw_fragment_program *newFP = brw_fragment_program(prog);
const struct brw_fragment_program *curFP =
brw_fragment_program_const(brw->fragment_program);
diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c
index cf512f8bbff..76faccde9d9 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -191,7 +191,7 @@ brw_upload_sf_prog(struct brw_context *brw)
if (key.do_point_sprite) {
key.point_sprite_coord_replace = ctx->Point.CoordReplace & 0xff;
}
- if (brw->fragment_program->Base.info.inputs_read &
+ if (brw->fragment_program->info.inputs_read &
BITFIELD64_BIT(VARYING_SLOT_PNTC)) {
key.do_point_coord = 1;
}
@@ -203,7 +203,7 @@ brw_upload_sf_prog(struct brw_context *brw)
if ((ctx->Point.SpriteOrigin == GL_LOWER_LEFT) != render_to_fbo)
key.sprite_origin_lower_left = true;
- const struct gl_fragment_program *fprog = brw->fragment_program;
+ const struct gl_program *fprog = brw->fragment_program;
if (fprog) {
assert(brw->gen < 6);
struct gen4_fragment_program *p = (struct gen4_fragment_program *) fprog;
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index ce815254d58..851ba102ad2 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -99,14 +99,14 @@ brw_codegen_wm_prog(struct brw_context *brw,
if (!prog)
prog_data.base.use_alt_mode = true;
- assign_fs_binding_table_offsets(devinfo, prog,
- &fp->program.Base, key, &prog_data);
+ assign_fs_binding_table_offsets(devinfo, prog, &fp->program, key,
+ &prog_data);
/* Allocate the references to the uniforms that will end up in the
* prog_data associated with the compiled program, and which will be freed
* by the state cache.
*/
- int param_count = fp->program.Base.nir->num_uniforms / 4;
+ int param_count = fp->program.nir->num_uniforms / 4;
if (fs)
prog_data.base.nr_image_params = fs->base.NumImages;
/* The backend also sometimes adds params for texture size. */
@@ -121,10 +121,10 @@ brw_codegen_wm_prog(struct brw_context *brw,
prog_data.base.nr_params = param_count;
if (prog) {
- brw_nir_setup_glsl_uniforms(fp->program.Base.nir, prog, &fp->program.Base,
+ brw_nir_setup_glsl_uniforms(fp->program.nir, prog, &fp->program,
&prog_data.base, true);
} else {
- brw_nir_setup_arb_uniforms(fp->program.Base.nir, &fp->program.Base,
+ brw_nir_setup_arb_uniforms(fp->program.nir, &fp->program,
&prog_data.base);
}
@@ -135,18 +135,18 @@ brw_codegen_wm_prog(struct brw_context *brw,
}
if (unlikely(INTEL_DEBUG & DEBUG_WM))
- brw_dump_ir("fragment", prog, fs ? &fs->base : NULL, &fp->program.Base);
+ brw_dump_ir("fragment", prog, fs ? &fs->base : NULL, &fp->program);
int st_index8 = -1, st_index16 = -1;
if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
- st_index8 = brw_get_shader_time_index(brw, prog, &fp->program.Base, ST_FS8);
- st_index16 = brw_get_shader_time_index(brw, prog, &fp->program.Base, ST_FS16);
+ st_index8 = brw_get_shader_time_index(brw, prog, &fp->program, ST_FS8);
+ st_index16 = brw_get_shader_time_index(brw, prog, &fp->program, ST_FS16);
}
char *error_str = NULL;
program = brw_compile_fs(brw->screen->compiler, brw, mem_ctx,
- key, &prog_data, fp->program.Base.nir,
- &fp->program.Base, st_index8, st_index16,
+ key, &prog_data, fp->program.nir,
+ &fp->program, st_index8, st_index16,
true, brw->use_rep_send, vue_map,
&program_size, &error_str);
@@ -601,8 +601,7 @@ brw_fs_precompile(struct gl_context *ctx,
struct brw_context *brw = brw_context(ctx);
struct brw_wm_prog_key key;
- struct gl_fragment_program *fp = (struct gl_fragment_program *) prog;
- struct brw_fragment_program *bfp = brw_fragment_program(fp);
+ struct brw_fragment_program *bfp = brw_fragment_program(prog);
memset(&key, 0, sizeof(key));
@@ -625,7 +624,7 @@ brw_fs_precompile(struct gl_context *ctx,
key.input_slots_valid = prog->info.inputs_read | VARYING_BIT_POS;
}
- brw_setup_tex_for_precompile(brw, &key.tex, &fp->Base);
+ brw_setup_tex_for_precompile(brw, &key.tex, prog);
key.nr_color_regions = _mesa_bitcount_64(outputs_written &
~(BITFIELD64_BIT(FRAG_RESULT_DEPTH) |
diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c
index 8808ac1d4d6..6f2ccabaa00 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_state.c
@@ -48,7 +48,7 @@ brw_color_buffer_write_enabled(struct brw_context *brw)
{
struct gl_context *ctx = &brw->ctx;
/* BRW_NEW_FRAGMENT_PROGRAM */
- const struct gl_program *fp = &brw->fragment_program->Base;
+ const struct gl_program *fp = brw->fragment_program;
unsigned i;
/* _NEW_BUFFERS */
@@ -79,7 +79,7 @@ brw_upload_wm_unit(struct brw_context *brw)
const struct gen_device_info *devinfo = &brw->screen->devinfo;
struct gl_context *ctx = &brw->ctx;
/* BRW_NEW_FRAGMENT_PROGRAM */
- const struct gl_program *fp = &brw->fragment_program->Base;
+ const struct gl_program *fp = brw->fragment_program;
/* BRW_NEW_FS_PROG_DATA */
const struct brw_wm_prog_data *prog_data =
brw_wm_prog_data(brw->wm.base.prog_data);
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index b64f1225a89..667d48c044a 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -839,7 +839,7 @@ brw_upload_wm_pull_constants(struct brw_context *brw)
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_FRAGMENT);
/* _NEW_PROGRAM_CONSTANTS */
- brw_upload_pull_constants(brw, BRW_NEW_SURFACES, &fp->program.Base,
+ brw_upload_pull_constants(brw, BRW_NEW_SURFACES, &fp->program,
stage_state, prog_data);
}
@@ -1146,7 +1146,7 @@ update_renderbuffer_read_surfaces(struct brw_context *brw)
/* BRW_NEW_FRAGMENT_PROGRAM */
if (!ctx->Extensions.MESA_shader_framebuffer_fetch &&
- brw->fragment_program && brw->fragment_program->Base.info.outputs_read) {
+ brw->fragment_program && brw->fragment_program->info.outputs_read) {
/* _NEW_BUFFERS */
const struct gl_framebuffer *fb = ctx->DrawBuffer;
diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c
index bb2498965b3..738e4f03cda 100644
--- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
@@ -177,7 +177,7 @@ calculate_attr_overrides(const struct brw_context *brw,
* - VARYING_SLOT_{PSIZ,LAYER} and VARYING_SLOT_POS on gen6+
*/
- bool fs_needs_vue_header = brw->fragment_program->Base.info.inputs_read &
+ bool fs_needs_vue_header = brw->fragment_program->info.inputs_read &
(VARYING_BIT_LAYER | VARYING_BIT_VIEWPORT);
*urb_entry_read_offset = fs_needs_vue_header ? 0 : 1;
diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c
index 711e2fd3f35..bd279ecebf2 100644
--- a/src/mesa/drivers/dri/i965/gen6_wm_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c
@@ -49,7 +49,7 @@ gen6_upload_wm_push_constants(struct brw_context *brw)
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_FRAGMENT);
- gen6_upload_push_constants(brw, &fp->program.Base, prog_data,
+ gen6_upload_push_constants(brw, &fp->program, prog_data,
stage_state, AUB_TRACE_WM_CONSTANTS);
if (brw->gen >= 7) {
diff --git a/src/mesa/drivers/dri/i965/gen8_sf_state.c b/src/mesa/drivers/dri/i965/gen8_sf_state.c
index 107c02bafa5..5d77b39819d 100644
--- a/src/mesa/drivers/dri/i965/gen8_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_sf_state.c
@@ -95,7 +95,7 @@ upload_sbe(struct brw_context *brw)
/* prepare the active component dwords */
int input_index = 0;
for (int attr = 0; attr < VARYING_SLOT_MAX; attr++) {
- if (!(brw->fragment_program->Base.info.inputs_read &
+ if (!(brw->fragment_program->info.inputs_read &
BITFIELD64_BIT(attr))) {
continue;
}
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c
index bf676028532..5f1b3b7c10f 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.c
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.c
@@ -1206,8 +1206,8 @@ r200NewProgram(struct gl_context *ctx, GLenum target, GLuint id)
return _mesa_init_gl_program(&vp->mesa_program, target, id);
}
case GL_FRAGMENT_PROGRAM_ARB: {
- struct gl_fragment_program *prog = CALLOC_STRUCT(gl_fragment_program);
- return _mesa_init_gl_program(&prog->Base, target, id);
+ struct gl_program *prog = CALLOC_STRUCT(gl_program);
+ return _mesa_init_gl_program(prog, target, id);
}
default:
_mesa_problem(ctx, "Bad target in r200NewProgram");