summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
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_fragprog.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h8
-rw-r--r--src/mesa/drivers/dri/i965/brw_curbe.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c7
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c40
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_surface_state.c2
-rw-r--r--src/mesa/drivers/dri/i965/gen6_vs_state.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.h2
-rw-r--r--src/mesa/drivers/dri/r200/r200_state_init.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_tcl.c2
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.c82
14 files changed, 85 insertions, 88 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 890e98a06b6..6020507cbda 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -566,8 +566,8 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
if (ctx->Extensions.ARB_vertex_program) {
save->VertexProgramEnabled = ctx->VertexProgram.Enabled;
- _mesa_reference_vertprog(ctx, &save->VertexProgram,
- ctx->VertexProgram.Current);
+ _mesa_reference_program(ctx, &save->VertexProgram,
+ ctx->VertexProgram.Current);
_mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB, GL_FALSE);
}
@@ -945,9 +945,9 @@ _mesa_meta_end(struct gl_context *ctx)
if (ctx->Extensions.ARB_vertex_program) {
_mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB,
save->VertexProgramEnabled);
- _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
- save->VertexProgram);
- _mesa_reference_vertprog(ctx, &save->VertexProgram, NULL);
+ _mesa_reference_program(ctx, &ctx->VertexProgram.Current,
+ save->VertexProgram);
+ _mesa_reference_program(ctx, &save->VertexProgram, NULL);
}
if (ctx->Extensions.ARB_fragment_program) {
diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h
index ba83a6dc21b..4d3b8ec4252 100644
--- a/src/mesa/drivers/common/meta.h
+++ b/src/mesa/drivers/common/meta.h
@@ -121,7 +121,7 @@ struct save_state
/** MESA_META_SHADER */
GLboolean VertexProgramEnabled;
- struct gl_vertex_program *VertexProgram;
+ struct gl_program *VertexProgram;
GLboolean FragmentProgramEnabled;
struct gl_fragment_program *FragmentProgram;
GLboolean ATIFragmentShaderEnabled;
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index 1944b3db0a2..4e1df738214 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -1148,8 +1148,8 @@ i915NewProgram(struct gl_context * ctx, GLenum target, GLuint id)
{
switch (target) {
case GL_VERTEX_PROGRAM_ARB: {
- struct gl_vertex_program *prog = CALLOC_STRUCT(gl_vertex_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);
}
case GL_FRAGMENT_PROGRAM_ARB:{
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 5e68c501aaa..c1d6e08fea5 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -330,7 +330,7 @@ struct brw_state_flags {
/** Subclass of Mesa vertex program */
struct brw_vertex_program {
- struct gl_vertex_program program;
+ struct gl_program program;
GLuint id;
};
@@ -1006,7 +1006,7 @@ struct brw_context
/* Active vertex program:
*/
- const struct gl_vertex_program *vertex_program;
+ const struct gl_program *vertex_program;
const struct gl_program *geometry_program;
const struct gl_program *tess_ctrl_program;
const struct gl_program *tess_eval_program;
@@ -1718,13 +1718,13 @@ brw_context( struct gl_context *ctx )
}
static inline struct brw_vertex_program *
-brw_vertex_program(struct gl_vertex_program *p)
+brw_vertex_program(struct gl_program *p)
{
return (struct brw_vertex_program *) p;
}
static inline const struct brw_vertex_program *
-brw_vertex_program_const(const struct gl_vertex_program *p)
+brw_vertex_program_const(const struct gl_program *p)
{
return (const struct brw_vertex_program *) p;
}
diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c
index e88f4bb9f9f..f3f5a800ae1 100644
--- a/src/mesa/drivers/dri/i965/brw_curbe.c
+++ b/src/mesa/drivers/dri/i965/brw_curbe.c
@@ -256,7 +256,7 @@ brw_upload_constant_buffer(struct brw_context *brw)
/* vertex shader constants */
if (brw->curbe.vs_size) {
- _mesa_load_state_parameters(ctx, brw->vertex_program->Base.Parameters);
+ _mesa_load_state_parameters(ctx, brw->vertex_program->Parameters);
GLuint offset = brw->curbe.vs_start * 16;
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 92a500cfc00..a9791287a88 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -302,7 +302,7 @@ brw_merge_inputs(struct brw_context *brw,
}
if (brw->gen < 8 && !brw->is_haswell) {
- uint64_t mask = ctx->VertexProgram._Current->Base.info.inputs_read;
+ uint64_t mask = ctx->VertexProgram._Current->info.inputs_read;
/* Prior to Haswell, the hardware can't natively support GL_FIXED or
* 2_10_10_10_REV vertex formats. Set appropriate workaround flags.
*/
@@ -460,7 +460,7 @@ brw_try_draw_prims(struct gl_context *ctx,
brw->tcs.base.sampler_count = ctx->TessCtrlProgram._Current ?
util_last_bit(ctx->TessCtrlProgram._Current->SamplersUsed) : 0;
brw->vs.base.sampler_count =
- util_last_bit(ctx->VertexProgram._Current->Base.SamplersUsed);
+ util_last_bit(ctx->VertexProgram._Current->SamplersUsed);
intel_prepare_render(brw);
brw_predraw_set_aux_buffers(brw);
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index 7151558a01b..6804f3122da 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -135,7 +135,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;
@@ -213,6 +213,8 @@ brwProgramStringNotify(struct gl_context *ctx,
GLenum target,
struct gl_program *prog)
{
+ assert(target == GL_VERTEX_PROGRAM_ARB || !prog->IsPositionInvariant);
+
struct brw_context *brw = brw_context(ctx);
const struct brw_compiler *compiler = brw->screen->compiler;
@@ -235,8 +237,7 @@ brwProgramStringNotify(struct gl_context *ctx,
break;
}
case GL_VERTEX_PROGRAM_ARB: {
- struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog;
- struct brw_vertex_program *newVP = brw_vertex_program(vprog);
+ struct brw_vertex_program *newVP = brw_vertex_program(prog);
const struct brw_vertex_program *curVP =
brw_vertex_program_const(brw->vertex_program);
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index a7f89f390dd..5d1c8e0c707 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -112,16 +112,15 @@ brw_codegen_vs_prog(struct brw_context *brw,
mem_ctx = ralloc_context(NULL);
- brw_assign_common_binding_table_offsets(MESA_SHADER_VERTEX,
- devinfo,
- prog, &vp->program.Base,
- &prog_data.base.base, 0);
+ brw_assign_common_binding_table_offsets(MESA_SHADER_VERTEX, devinfo, prog,
+ &vp->program, &prog_data.base.base,
+ 0);
/* 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 = vp->program.Base.nir->num_uniforms / 4;
+ int param_count = vp->program.nir->num_uniforms / 4;
if (vs)
prog_data.base.base.nr_image_params = vs->base.NumImages;
@@ -141,25 +140,25 @@ brw_codegen_vs_prog(struct brw_context *brw,
stage_prog_data->nr_params = param_count;
if (prog) {
- brw_nir_setup_glsl_uniforms(vp->program.Base.nir, prog, &vp->program.Base,
+ brw_nir_setup_glsl_uniforms(vp->program.nir, prog, &vp->program,
&prog_data.base.base,
compiler->scalar_stage[MESA_SHADER_VERTEX]);
} else {
- brw_nir_setup_arb_uniforms(vp->program.Base.nir, &vp->program.Base,
+ brw_nir_setup_arb_uniforms(vp->program.nir, &vp->program,
&prog_data.base.base);
}
uint64_t outputs_written =
- brw_vs_outputs_written(brw, key, vp->program.Base.info.outputs_written);
- prog_data.inputs_read = vp->program.Base.info.inputs_read;
+ brw_vs_outputs_written(brw, key, vp->program.info.outputs_written);
+ prog_data.inputs_read = vp->program.info.inputs_read;
if (key->copy_edgeflag) {
prog_data.inputs_read |= VERT_BIT_EDGEFLAG;
}
prog_data.base.cull_distance_mask =
- ((1 << vp->program.Base.CullDistanceArraySize) - 1) <<
- vp->program.Base.ClipDistanceArraySize;
+ ((1 << vp->program.CullDistanceArraySize) - 1) <<
+ vp->program.ClipDistanceArraySize;
brw_compute_vue_map(devinfo,
&prog_data.base.vue_map, outputs_written,
@@ -168,8 +167,7 @@ brw_codegen_vs_prog(struct brw_context *brw,
: false);
if (0) {
- _mesa_fprint_program_opt(stderr, &vp->program.Base, PROG_PRINT_DEBUG,
- true);
+ _mesa_fprint_program_opt(stderr, &vp->program, PROG_PRINT_DEBUG, true);
}
if (unlikely(brw->perf_debug)) {
@@ -179,7 +177,7 @@ brw_codegen_vs_prog(struct brw_context *brw,
}
if (unlikely(INTEL_DEBUG & DEBUG_VS)) {
- brw_dump_ir("vertex", prog, vs ? &vs->base : NULL, &vp->program.Base);
+ brw_dump_ir("vertex", prog, vs ? &vs->base : NULL, &vp->program);
fprintf(stderr, "VS Output ");
brw_print_vue_map(stderr, &prog_data.base.vue_map);
@@ -187,13 +185,13 @@ brw_codegen_vs_prog(struct brw_context *brw,
int st_index = -1;
if (INTEL_DEBUG & DEBUG_SHADER_TIME)
- st_index = brw_get_shader_time_index(brw, prog, &vp->program.Base, ST_VS);
+ st_index = brw_get_shader_time_index(brw, prog, &vp->program, ST_VS);
/* Emit GEN4 code.
*/
char *error_str;
- program = brw_compile_vs(compiler, brw, mem_ctx, key,
- &prog_data, vp->program.Base.nir,
+ program = brw_compile_vs(compiler, brw, mem_ctx, key, &prog_data,
+ vp->program.nir,
brw_select_clip_planes(&brw->ctx),
!_mesa_is_gles3(&brw->ctx),
st_index, &program_size, &error_str);
@@ -321,9 +319,8 @@ brw_vs_populate_key(struct brw_context *brw,
key->program_string_id = vp->id;
if (ctx->Transform.ClipPlanesEnabled != 0 &&
- (ctx->API == API_OPENGL_COMPAT ||
- ctx->API == API_OPENGLES) &&
- vp->program.Base.ClipDistanceArraySize == 0) {
+ (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) &&
+ vp->program.ClipDistanceArraySize == 0) {
key->nr_userclip_plane_consts =
_mesa_logbase2(ctx->Transform.ClipPlanesEnabled) + 1;
}
@@ -392,8 +389,7 @@ brw_vs_precompile(struct gl_context *ctx,
struct brw_stage_prog_data *old_prog_data = brw->vs.base.prog_data;
bool success;
- struct gl_vertex_program *vp = (struct gl_vertex_program *) prog;
- struct brw_vertex_program *bvp = brw_vertex_program(vp);
+ struct brw_vertex_program *bvp = brw_vertex_program(prog);
memset(&key, 0, sizeof(key));
diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
index f8c72180fd7..a5a5a756226 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
@@ -121,7 +121,7 @@ brw_upload_vs_pull_constants(struct brw_context *brw)
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_VERTEX);
/* _NEW_PROGRAM_CONSTANTS */
- brw_upload_pull_constants(brw, BRW_NEW_VS_CONSTBUF, &vp->program.Base,
+ brw_upload_pull_constants(brw, BRW_NEW_VS_CONSTBUF, &vp->program,
stage_state, prog_data);
}
diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c
index 780b1639c79..17ccd327ed5 100644
--- a/src/mesa/drivers/dri/i965/gen6_vs_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c
@@ -46,8 +46,8 @@ gen6_upload_vs_push_constants(struct brw_context *brw)
const struct brw_stage_prog_data *prog_data = brw->vs.base.prog_data;
_mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_VERTEX);
- gen6_upload_push_constants(brw, &vp->program.Base, prog_data,
- stage_state, AUB_TRACE_VS_CONSTANTS);
+ gen6_upload_push_constants(brw, &vp->program, prog_data, stage_state,
+ AUB_TRACE_VS_CONSTANTS);
if (brw->gen >= 7) {
if (brw->gen == 7 && !brw->is_haswell && !brw->is_baytrail)
diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h
index 7c6f48008a1..07eae232c3d 100644
--- a/src/mesa/drivers/dri/r200/r200_context.h
+++ b/src/mesa/drivers/dri/r200/r200_context.h
@@ -59,7 +59,7 @@ typedef struct r200_context *r200ContextPtr;
#include "main/mm.h"
struct r200_vertex_program {
- struct gl_vertex_program mesa_program; /* Must be first */
+ struct gl_program mesa_program; /* Must be first */
int translated;
/* need excess instr: 1 for late loop checking, 2 for
additional instr due to instr/attr, 3 for fog */
diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c
index 8cffa92c10b..f31a19150df 100644
--- a/src/mesa/drivers/dri/r200/r200_state_init.c
+++ b/src/mesa/drivers/dri/r200/r200_state_init.c
@@ -271,8 +271,8 @@ TCL_OR_VP_CHECK( tcl_or_vp, GL_TRUE, 0 )
TCL_OR_VP_CHECK( tcl_or_vp_add2, GL_TRUE, 2 )
VP_CHECK( tcl_vp, GL_TRUE, 0 )
VP_CHECK( tcl_vp_add4, GL_TRUE, 4 )
-VP_CHECK( tcl_vp_size_add4, ctx->VertexProgram.Current->Base.NumNativeInstructions > 64, 4 )
-VP_CHECK( tcl_vpp_size_add4, ctx->VertexProgram.Current->Base.NumNativeParameters > 96, 4 )
+VP_CHECK( tcl_vp_size_add4, ctx->VertexProgram.Current->NumNativeInstructions > 64, 4 )
+VP_CHECK( tcl_vpp_size_add4, ctx->VertexProgram.Current->NumNativeParameters > 96, 4 )
#define OUT_VEC(hdr, data) do { \
drm_radeon_cmd_header_t h; \
diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c
index c042aae0ef3..b556c866503 100644
--- a/src/mesa/drivers/dri/r200/r200_tcl.c
+++ b/src/mesa/drivers/dri/r200/r200_tcl.c
@@ -427,7 +427,7 @@ static GLboolean r200_run_tcl_render( struct gl_context *ctx,
We only need to change compsel. */
GLuint out_compsel = 0;
const GLbitfield64 vp_out =
- rmesa->curr_vp_hw->mesa_program.Base.OutputsWritten;
+ rmesa->curr_vp_hw->mesa_program.OutputsWritten;
vimap_rev = &rmesa->curr_vp_hw->inputmap_rev[0];
assert(vp_out & BITFIELD64_BIT(VARYING_SLOT_POS));
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c
index 628c5708090..bf676028532 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.c
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.c
@@ -104,15 +104,15 @@ static GLboolean r200VertexProgUpdateParams(struct gl_context *ctx, struct r200_
r200ContextPtr rmesa = R200_CONTEXT( ctx );
GLfloat *fcmd = (GLfloat *)&rmesa->hw.vpp[0].cmd[VPP_CMD_0 + 1];
int pi;
- struct gl_vertex_program *mesa_vp = &vp->mesa_program;
+ struct gl_program *mesa_vp = &vp->mesa_program;
struct gl_program_parameter_list *paramList;
drm_radeon_cmd_header_t tmp;
R200_STATECHANGE( rmesa, vpp[0] );
R200_STATECHANGE( rmesa, vpp[1] );
- assert(mesa_vp->Base.Parameters);
- _mesa_load_state_parameters(ctx, mesa_vp->Base.Parameters);
- paramList = mesa_vp->Base.Parameters;
+ assert(mesa_vp->Parameters);
+ _mesa_load_state_parameters(ctx, mesa_vp->Parameters);
+ paramList = mesa_vp->Parameters;
if(paramList->NumParameters > R200_VSF_MAX_PARAM){
fprintf(stderr, "%s:Params exhausted\n", __func__);
@@ -392,7 +392,7 @@ static unsigned long op_operands(enum prog_opcode opcode)
*/
static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r200_vertex_program *vp)
{
- struct gl_vertex_program *mesa_vp = &vp->mesa_program;
+ struct gl_program *mesa_vp = &vp->mesa_program;
struct prog_instruction *vpi;
int i;
VERTEX_SHADER_INSTRUCTION *o_inst;
@@ -409,30 +409,30 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2
vp->translated = GL_TRUE;
vp->fogmode = ctx->Fog.Mode;
- if (mesa_vp->Base.NumInstructions == 0)
+ if (mesa_vp->NumInstructions == 0)
return GL_FALSE;
#if 0
- if ((mesa_vp->Base.InputsRead &
+ if ((mesa_vp->InputsRead &
~(VERT_BIT_POS | VERT_BIT_NORMAL | VERT_BIT_COLOR0 | VERT_BIT_COLOR1 |
VERT_BIT_FOG | VERT_BIT_TEX0 | VERT_BIT_TEX1 | VERT_BIT_TEX2 |
VERT_BIT_TEX3 | VERT_BIT_TEX4 | VERT_BIT_TEX5)) != 0) {
if (R200_DEBUG & RADEON_FALLBACKS) {
fprintf(stderr, "can't handle vert prog inputs 0x%x\n",
- mesa_vp->Base.InputsRead);
+ mesa_vp->InputsRead);
}
return GL_FALSE;
}
#endif
- if ((mesa_vp->Base.OutputsWritten &
+ if ((mesa_vp->OutputsWritten &
~((1 << VARYING_SLOT_POS) | (1 << VARYING_SLOT_COL0) | (1 << VARYING_SLOT_COL1) |
(1 << VARYING_SLOT_FOGC) | (1 << VARYING_SLOT_TEX0) | (1 << VARYING_SLOT_TEX1) |
(1 << VARYING_SLOT_TEX2) | (1 << VARYING_SLOT_TEX3) | (1 << VARYING_SLOT_TEX4) |
(1 << VARYING_SLOT_TEX5) | (1 << VARYING_SLOT_PSIZ))) != 0) {
if (R200_DEBUG & RADEON_FALLBACKS) {
fprintf(stderr, "can't handle vert prog outputs 0x%llx\n",
- (unsigned long long) mesa_vp->Base.OutputsWritten);
+ (unsigned long long) mesa_vp->OutputsWritten);
}
return GL_FALSE;
}
@@ -447,25 +447,25 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2
/* FIXME: is changing the prog safe to do here? */
if (mesa_vp->IsPositionInvariant &&
/* make sure we only do this once */
- !(mesa_vp->Base.OutputsWritten & (1 << VARYING_SLOT_POS))) {
+ !(mesa_vp->OutputsWritten & (1 << VARYING_SLOT_POS))) {
_mesa_insert_mvp_code(ctx, mesa_vp);
}
/* for fogc, can't change mesa_vp, as it would hose swtnl, and exp with
base e isn't directly available neither. */
- if ((mesa_vp->Base.OutputsWritten & (1 << VARYING_SLOT_FOGC)) && !vp->fogpidx) {
+ if ((mesa_vp->OutputsWritten & (1 << VARYING_SLOT_FOGC)) && !vp->fogpidx) {
struct gl_program_parameter_list *paramList;
gl_state_index tokens[STATE_LENGTH] = { STATE_FOG_PARAMS, 0, 0, 0, 0 };
- paramList = mesa_vp->Base.Parameters;
+ paramList = mesa_vp->Parameters;
vp->fogpidx = _mesa_add_state_reference(paramList, tokens);
}
vp->pos_end = 0;
- mesa_vp->Base.NumNativeInstructions = 0;
- if (mesa_vp->Base.Parameters)
- mesa_vp->Base.NumNativeParameters = mesa_vp->Base.Parameters->NumParameters;
+ mesa_vp->NumNativeInstructions = 0;
+ if (mesa_vp->Parameters)
+ mesa_vp->NumNativeParameters = mesa_vp->Parameters->NumParameters;
else
- mesa_vp->Base.NumNativeParameters = 0;
+ mesa_vp->NumNativeParameters = 0;
for(i = 0; i < VERT_ATTRIB_MAX; i++)
vp->inputs[i] = -1;
@@ -491,42 +491,42 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2
Haven't seen attr 14 used, maybe that's for the hw pointsize vec1 (which is
not possibe to use with vertex progs as it is lacking in vert prog specification) */
/* may look different when using idx buf / input_route instead of se_vtx_fmt? */
- if (mesa_vp->Base.InputsRead & VERT_BIT_POS) {
+ if (mesa_vp->InputsRead & VERT_BIT_POS) {
vp->inputs[VERT_ATTRIB_POS] = 0;
vp->inputmap_rev[0] = VERT_ATTRIB_POS;
free_inputs &= ~(1 << 0);
array_count++;
}
- if (mesa_vp->Base.InputsRead & VERT_BIT_WEIGHT) {
+ if (mesa_vp->InputsRead & VERT_BIT_WEIGHT) {
vp->inputs[VERT_ATTRIB_WEIGHT] = 12;
vp->inputmap_rev[1] = VERT_ATTRIB_WEIGHT;
array_count++;
}
- if (mesa_vp->Base.InputsRead & VERT_BIT_NORMAL) {
+ if (mesa_vp->InputsRead & VERT_BIT_NORMAL) {
vp->inputs[VERT_ATTRIB_NORMAL] = 1;
vp->inputmap_rev[2] = VERT_ATTRIB_NORMAL;
array_count++;
}
- if (mesa_vp->Base.InputsRead & VERT_BIT_COLOR0) {
+ if (mesa_vp->InputsRead & VERT_BIT_COLOR0) {
vp->inputs[VERT_ATTRIB_COLOR0] = 2;
vp->inputmap_rev[4] = VERT_ATTRIB_COLOR0;
free_inputs &= ~(1 << 2);
array_count++;
}
- if (mesa_vp->Base.InputsRead & VERT_BIT_COLOR1) {
+ if (mesa_vp->InputsRead & VERT_BIT_COLOR1) {
vp->inputs[VERT_ATTRIB_COLOR1] = 3;
vp->inputmap_rev[5] = VERT_ATTRIB_COLOR1;
free_inputs &= ~(1 << 3);
array_count++;
}
- if (mesa_vp->Base.InputsRead & VERT_BIT_FOG) {
+ if (mesa_vp->InputsRead & VERT_BIT_FOG) {
vp->inputs[VERT_ATTRIB_FOG] = 15; array_count++;
vp->inputmap_rev[3] = VERT_ATTRIB_FOG;
array_count++;
}
/* VERT_ATTRIB_TEX0-5 */
for (i = 0; i <= 5; i++) {
- if (mesa_vp->Base.InputsRead & VERT_BIT_TEX(i)) {
+ if (mesa_vp->InputsRead & VERT_BIT_TEX(i)) {
vp->inputs[VERT_ATTRIB_TEX(i)] = i + 6;
vp->inputmap_rev[8 + i] = VERT_ATTRIB_TEX(i);
free_inputs &= ~(1 << (i + 6));
@@ -535,7 +535,7 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2
}
/* using VERT_ATTRIB_TEX6/7 would be illegal */
for (; i < VERT_ATTRIB_TEX_MAX; i++) {
- if (mesa_vp->Base.InputsRead & VERT_BIT_TEX(i)) {
+ if (mesa_vp->InputsRead & VERT_BIT_TEX(i)) {
if (R200_DEBUG & RADEON_FALLBACKS) {
fprintf(stderr, "texture attribute %d in vert prog\n", i);
}
@@ -546,7 +546,7 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2
for (i = 0; i < VERT_ATTRIB_GENERIC_MAX; i++) {
int j;
/* completely ignore aliasing? */
- if (mesa_vp->Base.InputsRead & VERT_BIT_GENERIC(i)) {
+ if (mesa_vp->InputsRead & VERT_BIT_GENERIC(i)) {
array_count++;
if (array_count > 12) {
if (R200_DEBUG & RADEON_FALLBACKS) {
@@ -575,7 +575,7 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2
}
}
- if (!(mesa_vp->Base.OutputsWritten & (1 << VARYING_SLOT_POS))) {
+ if (!(mesa_vp->OutputsWritten & (1 << VARYING_SLOT_POS))) {
if (R200_DEBUG & RADEON_FALLBACKS) {
fprintf(stderr, "can't handle vert prog without position output\n");
}
@@ -589,7 +589,7 @@ static GLboolean r200_translate_vertex_program(struct gl_context *ctx, struct r2
}
o_inst = vp->instr;
- for (vpi = mesa_vp->Base.Instructions; vpi->Opcode != OPCODE_END; vpi++, o_inst++){
+ for (vpi = mesa_vp->Instructions; vpi->Opcode != OPCODE_END; vpi++, o_inst++){
operands = op_operands(vpi->Opcode);
are_srcs_scalar = operands & SCALAR_FLAG;
operands &= OP_MASK;
@@ -1069,20 +1069,20 @@ else {
}
u_temp_used = (R200_VSF_MAX_TEMPS - 1) - u_temp_i;
- if (mesa_vp->Base.NumNativeTemporaries <
- (mesa_vp->Base.NumTemporaries + u_temp_used)) {
- mesa_vp->Base.NumNativeTemporaries =
- mesa_vp->Base.NumTemporaries + u_temp_used;
+ if (mesa_vp->NumNativeTemporaries <
+ (mesa_vp->NumTemporaries + u_temp_used)) {
+ mesa_vp->NumNativeTemporaries =
+ mesa_vp->NumTemporaries + u_temp_used;
}
- if ((mesa_vp->Base.NumTemporaries + u_temp_used) > R200_VSF_MAX_TEMPS) {
+ if ((mesa_vp->NumTemporaries + u_temp_used) > R200_VSF_MAX_TEMPS) {
if (R200_DEBUG & RADEON_FALLBACKS) {
- fprintf(stderr, "Ran out of temps, num temps %d, us %d\n", mesa_vp->Base.NumTemporaries, u_temp_used);
+ fprintf(stderr, "Ran out of temps, num temps %d, us %d\n", mesa_vp->NumTemporaries, u_temp_used);
}
return GL_FALSE;
}
u_temp_i = R200_VSF_MAX_TEMPS - 1;
if(o_inst - vp->instr >= R200_VSF_MAX_INST) {
- mesa_vp->Base.NumNativeInstructions = 129;
+ mesa_vp->NumNativeInstructions = 129;
if (R200_DEBUG & RADEON_FALLBACKS) {
fprintf(stderr, "more than 128 native instructions\n");
}
@@ -1094,7 +1094,7 @@ else {
}
vp->native = GL_TRUE;
- mesa_vp->Base.NumNativeInstructions = (o_inst - vp->instr);
+ mesa_vp->NumNativeInstructions = (o_inst - vp->instr);
#if 0
fprintf(stderr, "hw program:\n");
for(i=0; i < vp->program.length; i++)
@@ -1126,10 +1126,10 @@ void r200SetupVertexProg( struct gl_context *ctx ) {
R200_STATECHANGE( rmesa, pvs );
rmesa->hw.pvs.cmd[PVS_CNTL_1] = (0 << R200_PVS_CNTL_1_PROGRAM_START_SHIFT) |
- ((vp->mesa_program.Base.NumNativeInstructions - 1) << R200_PVS_CNTL_1_PROGRAM_END_SHIFT) |
+ ((vp->mesa_program.NumNativeInstructions - 1) << R200_PVS_CNTL_1_PROGRAM_END_SHIFT) |
(vp->pos_end << R200_PVS_CNTL_1_POS_END_SHIFT);
rmesa->hw.pvs.cmd[PVS_CNTL_2] = (0 << R200_PVS_CNTL_2_PARAM_OFFSET_SHIFT) |
- (vp->mesa_program.Base.NumNativeParameters << R200_PVS_CNTL_2_PARAM_COUNT_SHIFT);
+ (vp->mesa_program.NumNativeParameters << R200_PVS_CNTL_2_PARAM_COUNT_SHIFT);
/* maybe user clip planes just work with vertex progs... untested */
if (ctx->Transform.ClipPlanesEnabled) {
@@ -1143,7 +1143,7 @@ void r200SetupVertexProg( struct gl_context *ctx ) {
}
if (vp != rmesa->curr_vp_hw) {
- GLuint count = vp->mesa_program.Base.NumNativeInstructions;
+ GLuint count = vp->mesa_program.NumNativeInstructions;
drm_radeon_cmd_header_t tmp;
R200_STATECHANGE( rmesa, vpi[0] );
@@ -1203,7 +1203,7 @@ r200NewProgram(struct gl_context *ctx, GLenum target, GLuint id)
switch(target){
case GL_VERTEX_PROGRAM_ARB: {
struct r200_vertex_program *vp = CALLOC_STRUCT(r200_vertex_program);
- return _mesa_init_gl_program(&vp->mesa_program.Base, target, 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);
@@ -1232,7 +1232,7 @@ r200ProgramStringNotify(struct gl_context *ctx, GLenum target, struct gl_program
case GL_VERTEX_PROGRAM_ARB:
vp->translated = GL_FALSE;
vp->fogpidx = 0;
-/* memset(&vp->translated, 0, sizeof(struct r200_vertex_program) - sizeof(struct gl_vertex_program));*/
+/* memset(&vp->translated, 0, sizeof(struct r200_vertex_program) - sizeof(struct gl_program));*/
r200_translate_vertex_program(ctx, vp);
rmesa->curr_vp_hw = NULL;
break;