aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915
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/dri/i915
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/dri/i915')
-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
5 files changed, 32 insertions, 32 deletions
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)