diff options
Diffstat (limited to 'src/mesa/drivers/dri/r600')
39 files changed, 429 insertions, 412 deletions
diff --git a/src/mesa/drivers/dri/r600/evergreen_blit.c b/src/mesa/drivers/dri/r600/evergreen_blit.c index 1ed8a08b78..fc9fa9d22c 100644 --- a/src/mesa/drivers/dri/r600/evergreen_blit.c +++ b/src/mesa/drivers/dri/r600/evergreen_blit.c @@ -423,7 +423,7 @@ eg_set_render_target(context_t *context, struct radeon_bo *bo, gl_format mesa_fo } -static inline void eg_load_shaders(GLcontext * ctx) +static inline void eg_load_shaders(struct gl_context * ctx) { radeonContextPtr radeonctx = RADEON_CONTEXT(ctx); @@ -1688,7 +1688,7 @@ static GLboolean eg_validate_buffers(context_t *rmesa, return GL_TRUE; } -unsigned evergreen_blit(GLcontext *ctx, +unsigned evergreen_blit(struct gl_context *ctx, struct radeon_bo *src_bo, intptr_t src_offset, gl_format src_mesaformat, diff --git a/src/mesa/drivers/dri/r600/evergreen_blit.h b/src/mesa/drivers/dri/r600/evergreen_blit.h index 68d072ecb0..783f83f089 100644 --- a/src/mesa/drivers/dri/r600/evergreen_blit.h +++ b/src/mesa/drivers/dri/r600/evergreen_blit.h @@ -30,7 +30,7 @@ unsigned evergreen_check_blit(gl_format mesa_format); -unsigned evergreen_blit(GLcontext *ctx, +unsigned evergreen_blit(struct gl_context *ctx, struct radeon_bo *src_bo, intptr_t src_offset, gl_format src_mesaformat, diff --git a/src/mesa/drivers/dri/r600/evergreen_chip.c b/src/mesa/drivers/dri/r600/evergreen_chip.c index 1050c776bf..2c9e4e2b84 100644 --- a/src/mesa/drivers/dri/r600/evergreen_chip.c +++ b/src/mesa/drivers/dri/r600/evergreen_chip.c @@ -60,7 +60,7 @@ do { \ insert_at_tail(&context->radeon.hw.atomlist, &context->evergreen_atoms.ATOM); \ } while (0) -static int check_queryobj(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_queryobj(struct gl_context *ctx, struct radeon_state_atom *atom) { radeonContextPtr radeon = RADEON_CONTEXT(ctx); struct radeon_query_object *query = radeon->query.current; @@ -74,7 +74,7 @@ static int check_queryobj(GLcontext *ctx, struct radeon_state_atom *atom) return count; } -static void evergreenSendQueryBegin(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendQueryBegin(struct gl_context *ctx, struct radeon_state_atom *atom) { radeonContextPtr radeon = RADEON_CONTEXT(ctx); struct radeon_query_object *query = radeon->query.current; @@ -114,12 +114,12 @@ static void evergreen_init_query_stateobj(radeonContextPtr radeon, int SZ) } -static int check_always(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_always(struct gl_context *ctx, struct radeon_state_atom *atom) { return atom->cmd_size; } -static void evergreenSendTexState(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendTexState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -221,7 +221,7 @@ static void evergreenSendTexState(GLcontext *ctx, struct radeon_state_atom *atom } } -static int check_evergreen_tx(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_evergreen_tx(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); unsigned int i, count = 0; @@ -238,7 +238,7 @@ static int check_evergreen_tx(GLcontext *ctx, struct radeon_state_atom *atom) return count * 37 + 6; } -static void evergreenSendSQConfig(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendSQConfig(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -269,13 +269,12 @@ static void evergreenSendSQConfig(GLcontext *ctx, struct radeon_state_atom *atom } extern int evergreen_getTypeSize(GLenum type); -static void evergreenSetupVTXConstants(GLcontext * ctx, +static void evergreenSetupVTXConstants(struct gl_context * ctx, void * pAos, StreamDesc * pStreamDesc) { context_t *context = EVERGREEN_CONTEXT(ctx); struct radeon_aos * paos = (struct radeon_aos *)pAos; - unsigned int nVBsize; BATCH_LOCALS(&context->radeon); unsigned int uSQ_VTX_CONSTANT_WORD0_0; @@ -289,21 +288,11 @@ static void evergreenSetupVTXConstants(GLcontext * ctx, r700SyncSurf(context, paos->bo, RADEON_GEM_DOMAIN_GTT, 0, VC_ACTION_ENA_bit); - if(0 == pStreamDesc->stride) - { - nVBsize = paos->count * pStreamDesc->size * getTypeSize(pStreamDesc->type); - } - else - { - nVBsize = (paos->count - 1) * pStreamDesc->stride - + pStreamDesc->size * getTypeSize(pStreamDesc->type); - } - //uSQ_VTX_CONSTANT_WORD0_0 uSQ_VTX_CONSTANT_WORD0_0 = paos->offset; //uSQ_VTX_CONSTANT_WORD1_0 - uSQ_VTX_CONSTANT_WORD1_0 = nVBsize; + uSQ_VTX_CONSTANT_WORD1_0 = paos->bo->size - paos->offset - 1; //uSQ_VTX_CONSTANT_WORD2_0 SETfield(uSQ_VTX_CONSTANT_WORD2_0, @@ -368,7 +357,7 @@ static void evergreenSetupVTXConstants(GLcontext * ctx, COMMIT_BATCH(); } -static int check_evergreen_vtx(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_evergreen_vtx(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); int count = context->radeon.tcl.aos_count * 12; @@ -380,7 +369,7 @@ static int check_evergreen_vtx(GLcontext *ctx, struct radeon_state_atom *atom) return count; } -static void evergreenSendVTX(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendVTX(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); struct evergreen_vertex_program *vp = (struct evergreen_vertex_program *)(context->selected_vp); @@ -391,17 +380,6 @@ static void evergreenSendVTX(GLcontext *ctx, struct radeon_state_atom *atom) if (context->radeon.tcl.aos_count == 0) return; - BEGIN_BATCH_NO_AUTOSTATE(6); - R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CTL_CONST, 1)); - R600_OUT_BATCH(mmSQ_VTX_BASE_VTX_LOC - ASIC_CTL_CONST_BASE_INDEX); - R600_OUT_BATCH(0); - - R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CTL_CONST, 1)); - R600_OUT_BATCH(mmSQ_VTX_START_INST_LOC - ASIC_CTL_CONST_BASE_INDEX); - R600_OUT_BATCH(0); - END_BATCH(); - COMMIT_BATCH(); - for(i=0; i<VERT_ATTRIB_MAX; i++) { if(vp->mesa_program->Base.InputsRead & (1 << i)) { @@ -410,9 +388,9 @@ static void evergreenSendVTX(GLcontext *ctx, struct radeon_state_atom *atom) &(context->stream_desc[j])); j++; } - } + } } -static void evergreenSendPA(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendPA(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -533,7 +511,7 @@ static void evergreenSendPA(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void evergreenSendTP(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendTP(struct gl_context *ctx, struct radeon_state_atom *atom) { /* context_t *context = EVERGREEN_CONTEXT(ctx); @@ -545,7 +523,7 @@ static void evergreenSendTP(GLcontext *ctx, struct radeon_state_atom *atom) */ } -static void evergreenSendPSresource(GLcontext *ctx) +static void evergreenSendPSresource(struct gl_context *ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -600,7 +578,7 @@ static void evergreenSendPSresource(GLcontext *ctx) COMMIT_BATCH(); } -static void evergreenSendVSresource(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendVSresource(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -656,7 +634,7 @@ static void evergreenSendVSresource(GLcontext *ctx, struct radeon_state_atom *at COMMIT_BATCH(); } -static void evergreenSendSQ(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendSQ(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -771,7 +749,7 @@ static void evergreenSendSQ(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void evergreenSendSPI(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendSPI(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -843,7 +821,7 @@ static void evergreenSendSPI(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void evergreenSendSX(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendSX(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -865,7 +843,7 @@ static void evergreenSetDepthTarget(context_t *context) { EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); struct radeon_renderbuffer *rrb; - unsigned int nPitchInPixel, height; + unsigned int nPitchInPixel, height, offtostencil; rrb = radeon_get_depthbuffer(&context->radeon); if (!rrb) @@ -898,22 +876,28 @@ static void evergreenSetDepthTarget(context_t *context) if(4 == rrb->cpp) { - SETfield(evergreen->DB_Z_INFO.u32All, DEPTH_8_24, + SETfield(evergreen->DB_Z_INFO.u32All, EG_Z_24, EG_DB_Z_INFO__FORMAT_shift, EG_DB_Z_INFO__FORMAT_mask); } else { - SETfield(evergreen->DB_Z_INFO.u32All, DEPTH_16, + SETfield(evergreen->DB_Z_INFO.u32All, EG_Z_16, EG_DB_Z_INFO__FORMAT_shift, EG_DB_Z_INFO__FORMAT_mask); } SETfield(evergreen->DB_Z_INFO.u32All, ARRAY_1D_TILED_THIN1, EG_DB_Z_INFO__ARRAY_MODE_shift, EG_DB_Z_INFO__ARRAY_MODE_mask); + + + offtostencil = ((height * rrb->pitch) + 255) & ~255; + evergreen->DB_STENCIL_WRITE_BASE.u32All = offtostencil >> 8; + evergreen->DB_STENCIL_READ_BASE.u32All = offtostencil >> 8; + } -static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendDB(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -971,17 +955,18 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) END_BATCH(); rrb = radeon_get_depthbuffer(&context->radeon); + if( (rrb != NULL) && (rrb->bo != NULL) ) { /* make the hw happy */ BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_HTILE_DATA_BASE, evergreen->DB_HTILE_DATA_BASE.u32All); - R600_OUT_BATCH_RELOC(evergreen->DB_HTILE_DATA_BASE.u32All, + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_HTILE_DATA_BASE, evergreen->DB_HTILE_DATA_BASE.u32All); + R600_OUT_BATCH_RELOC(evergreen->DB_HTILE_DATA_BASE.u32All, rrb->bo, evergreen->DB_HTILE_DATA_BASE.u32All, 0, RADEON_GEM_DOMAIN_VRAM, 0); - END_BATCH(); + END_BATCH(); //5 BEGIN_BATCH_NO_AUTOSTATE(3 + 2); @@ -1015,26 +1000,35 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) END_BATCH(); } } -/* + if (ctx->DrawBuffer) { rrb = radeon_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL); if((rrb != NULL) && (rrb->bo != NULL)) - { + { //5 BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_INFO, evergreen->DB_Z_INFO.u32All); + EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_INFO, evergreen->DB_STENCIL_INFO.u32All); R600_OUT_BATCH_RELOC(evergreen->DB_STENCIL_INFO.u32All, rrb->bo, evergreen->DB_STENCIL_INFO.u32All, 0, RADEON_GEM_DOMAIN_VRAM, 0); END_BATCH(); + + //4 + BEGIN_BATCH_NO_AUTOSTATE(4); + R600_OUT_BATCH_REGSEQ(DB_STENCILREFMASK, 2); + R600_OUT_BATCH(evergreen->DB_STENCILREFMASK.u32All); + R600_OUT_BATCH(evergreen->DB_STENCILREFMASK_BF.u32All); + END_BATCH(); + //------------------------ //10 if((evergreen->DB_DEPTH_CONTROL.u32All & STENCIL_ENABLE_bit) > 0) { - BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); EVERGREEN_OUT_BATCH_REGVAL(EG_DB_STENCIL_READ_BASE, evergreen->DB_STENCIL_READ_BASE.u32All); R600_OUT_BATCH_RELOC(evergreen->DB_STENCIL_READ_BASE.u32All, rrb->bo, @@ -1052,7 +1046,7 @@ static void evergreenSendDB(GLcontext *ctx, struct radeon_state_atom *atom) } } } -*/ + COMMIT_BATCH(); } @@ -1372,7 +1366,7 @@ static void evergreenSetRenderTarget(context_t *context, int id) evergreen->render_target[id].enabled = GL_TRUE; } -static void evergreenSendCB(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendCB(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -1415,9 +1409,17 @@ static void evergreenSendCB(GLcontext *ctx, struct radeon_state_atom *atom) R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_VIEW.u32All); END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(4); - EVERGREEN_OUT_BATCH_REGSEQ(EG_CB_COLOR0_ATTRIB, 2); + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + EVERGREEN_OUT_BATCH_REGSEQ(EG_CB_COLOR0_ATTRIB, 1); R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_ATTRIB.u32All); + R600_OUT_BATCH_RELOC(0, + rrb->bo, + 0, + 0, RADEON_GEM_DOMAIN_VRAM, 0); + END_BATCH(); + + BEGIN_BATCH_NO_AUTOSTATE(3); + EVERGREEN_OUT_BATCH_REGSEQ(EG_CB_COLOR0_DIM, 1); R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_DIM.u32All); /* R600_OUT_BATCH(evergreen->render_target[id].CB_COLOR0_CMASK.u32All); @@ -1449,7 +1451,7 @@ static void evergreenSendCB(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void evergreenSendVGT(GLcontext *ctx, struct radeon_state_atom *atom) +static void evergreenSendVGT(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -1514,7 +1516,7 @@ void evergreenInitAtoms(context_t *context) context->radeon.hw.atomlist.name = "atom-list"; EVERGREEN_ALLOC_STATE(init, always, 19, evergreenSendSQConfig); - EVERGREEN_ALLOC_STATE(vtx, evergreen_vtx, (6 + (VERT_ATTRIB_MAX * 12)), evergreenSendVTX); + EVERGREEN_ALLOC_STATE(vtx, evergreen_vtx, (VERT_ATTRIB_MAX * 12), evergreenSendVTX); EVERGREEN_ALLOC_STATE(pa, always, 124, evergreenSendPA); EVERGREEN_ALLOC_STATE(tp, always, 0, evergreenSendTP); EVERGREEN_ALLOC_STATE(sq, always, 86, evergreenSendSQ); /* 85 */ @@ -1522,8 +1524,8 @@ void evergreenInitAtoms(context_t *context) EVERGREEN_ALLOC_STATE(spi, always, 59, evergreenSendSPI); EVERGREEN_ALLOC_STATE(sx, always, 9, evergreenSendSX); EVERGREEN_ALLOC_STATE(tx, evergreen_tx, (R700_TEXTURE_NUMBERUNITS * (21+5) + 6), evergreenSendTexState); /* 21 for resource, 5 for sampler */ - EVERGREEN_ALLOC_STATE(db, always, 65, evergreenSendDB); - EVERGREEN_ALLOC_STATE(cb, always, 33, evergreenSendCB); + EVERGREEN_ALLOC_STATE(db, always, 69, evergreenSendDB); + EVERGREEN_ALLOC_STATE(cb, always, 37, evergreenSendCB); EVERGREEN_ALLOC_STATE(vgt, always, 29, evergreenSendVGT); evergreen_init_query_stateobj(&context->radeon, 6 * 2); diff --git a/src/mesa/drivers/dri/r600/evergreen_context.c b/src/mesa/drivers/dri/r600/evergreen_context.c index fff7c20031..911775f590 100644 --- a/src/mesa/drivers/dri/r600/evergreen_context.c +++ b/src/mesa/drivers/dri/r600/evergreen_context.c @@ -61,7 +61,7 @@ static void evergreen_vtbl_pre_emit_atoms(radeonContextPtr radeon) r700Start3D((context_t *)radeon); } -static void evergreen_fallback(GLcontext *ctx, GLuint bit, GLboolean mode) +static void evergreen_fallback(struct gl_context *ctx, GLuint bit, GLboolean mode) { context_t *context = EVERGREEN_CONTEXT(ctx); if (mode) diff --git a/src/mesa/drivers/dri/r600/evergreen_fragprog.c b/src/mesa/drivers/dri/r600/evergreen_fragprog.c index 0e7edf4fbe..cfb923efdd 100644 --- a/src/mesa/drivers/dri/r600/evergreen_fragprog.c +++ b/src/mesa/drivers/dri/r600/evergreen_fragprog.c @@ -44,7 +44,7 @@ #include "evergreen_vertprog.h" #include "evergreen_fragprog.h" -void evergreen_insert_wpos_code(GLcontext *ctx, struct gl_fragment_program *fprog) +void evergreen_insert_wpos_code(struct gl_context *ctx, struct gl_fragment_program *fprog) { static const gl_state_index winstate[STATE_LENGTH] = { STATE_INTERNAL, STATE_FB_SIZE, 0, 0, 0}; @@ -95,7 +95,7 @@ void evergreen_insert_wpos_code(GLcontext *ctx, struct gl_fragment_program *fpro //TODO : Validate FP input with VP output. void evergreen_Map_Fragment_Program(r700_AssemblerBase *pAsm, struct gl_fragment_program *mesa_fp, - GLcontext *ctx) + struct gl_context *ctx) { unsigned int unBit; unsigned int i; @@ -354,7 +354,7 @@ GLboolean evergreen_Find_Instruction_Dependencies_fp(struct evergreen_fragment_p GLboolean evergreenTranslateFragmentShader(struct evergreen_fragment_program *fp, struct gl_fragment_program *mesa_fp, - GLcontext *ctx) + struct gl_context *ctx) { GLuint number_of_colors_exported; GLboolean z_enabled = GL_FALSE; @@ -457,7 +457,7 @@ GLboolean evergreenTranslateFragmentShader(struct evergreen_fragment_program *fp return GL_TRUE; } -void evergreenSelectFragmentShader(GLcontext *ctx) +void evergreenSelectFragmentShader(struct gl_context *ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); struct evergreen_fragment_program *fp = (struct evergreen_fragment_program *) @@ -471,7 +471,7 @@ void evergreenSelectFragmentShader(GLcontext *ctx) evergreenTranslateFragmentShader(fp, &(fp->mesa_program), ctx); } -void * evergreenGetActiveFpShaderBo(GLcontext * ctx) +void * evergreenGetActiveFpShaderBo(struct gl_context * ctx) { struct evergreen_fragment_program *fp = (struct evergreen_fragment_program *) (ctx->FragmentProgram._Current); @@ -479,7 +479,7 @@ void * evergreenGetActiveFpShaderBo(GLcontext * ctx) return fp->shaderbo; } -void * evergreenGetActiveFpShaderConstBo(GLcontext * ctx) +void * evergreenGetActiveFpShaderConstBo(struct gl_context * ctx) { struct evergreen_fragment_program *fp = (struct evergreen_fragment_program *) (ctx->FragmentProgram._Current); @@ -487,7 +487,7 @@ void * evergreenGetActiveFpShaderConstBo(GLcontext * ctx) return fp->constbo0; } -GLboolean evergreenSetupFragmentProgram(GLcontext * ctx) +GLboolean evergreenSetupFragmentProgram(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -737,7 +737,7 @@ GLboolean evergreenSetupFragmentProgram(GLcontext * ctx) return GL_TRUE; } -GLboolean evergreenSetupFPconstants(GLcontext * ctx) +GLboolean evergreenSetupFPconstants(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); diff --git a/src/mesa/drivers/dri/r600/evergreen_fragprog.h b/src/mesa/drivers/dri/r600/evergreen_fragprog.h index 0e200bf383..97f06a75fc 100644 --- a/src/mesa/drivers/dri/r600/evergreen_fragprog.h +++ b/src/mesa/drivers/dri/r600/evergreen_fragprog.h @@ -51,27 +51,27 @@ struct evergreen_fragment_program }; /* Internal */ -void evergreen_insert_wpos_code(GLcontext *ctx, struct gl_fragment_program *fprog); +void evergreen_insert_wpos_code(struct gl_context *ctx, struct gl_fragment_program *fprog); void evergreen_Map_Fragment_Program(r700_AssemblerBase *pAsm, struct gl_fragment_program *mesa_fp, - GLcontext *ctx); + struct gl_context *ctx); GLboolean evergreen_Find_Instruction_Dependencies_fp(struct evergreen_fragment_program *fp, struct gl_fragment_program *mesa_fp); GLboolean evergreenTranslateFragmentShader(struct evergreen_fragment_program *fp, struct gl_fragment_program *mesa_vp, - GLcontext *ctx); + struct gl_context *ctx); /* Interface */ -extern void evergreenSelectFragmentShader(GLcontext *ctx); +extern void evergreenSelectFragmentShader(struct gl_context *ctx); -extern GLboolean evergreenSetupFragmentProgram(GLcontext * ctx); +extern GLboolean evergreenSetupFragmentProgram(struct gl_context * ctx); -extern GLboolean evergreenSetupFPconstants(GLcontext * ctx); +extern GLboolean evergreenSetupFPconstants(struct gl_context * ctx); -extern void * evergreenGetActiveFpShaderBo(GLcontext * ctx); +extern void * evergreenGetActiveFpShaderBo(struct gl_context * ctx); -extern void * evergreenGetActiveFpShaderConstBo(GLcontext * ctx); +extern void * evergreenGetActiveFpShaderConstBo(struct gl_context * ctx); #endif /*_EVERGREEN_FRAGPROG_H_*/ diff --git a/src/mesa/drivers/dri/r600/evergreen_ioctl.c b/src/mesa/drivers/dri/r600/evergreen_ioctl.c index 5c1270790d..19f8e6b3ec 100644 --- a/src/mesa/drivers/dri/r600/evergreen_ioctl.c +++ b/src/mesa/drivers/dri/r600/evergreen_ioctl.c @@ -40,7 +40,7 @@ #include "r700_clear.h" -void evergreenClear(GLcontext * ctx, GLbitfield mask) +void evergreenClear(struct gl_context * ctx, GLbitfield mask) { r700Clear(ctx, mask); } diff --git a/src/mesa/drivers/dri/r600/evergreen_ioctl.h b/src/mesa/drivers/dri/r600/evergreen_ioctl.h index 3c663a7083..a41b5b6033 100644 --- a/src/mesa/drivers/dri/r600/evergreen_ioctl.h +++ b/src/mesa/drivers/dri/r600/evergreen_ioctl.h @@ -30,7 +30,7 @@ #include "r600_context.h" #include "radeon_drm.h" -extern void evergreenClear(GLcontext * ctx, GLbitfield mask); +extern void evergreenClear(struct gl_context * ctx, GLbitfield mask); extern void evergreenInitIoctlFuncs(struct dd_function_table *functions); #endif /* _EVERGREEN_IOCTL_H_ */ diff --git a/src/mesa/drivers/dri/r600/evergreen_oglprog.c b/src/mesa/drivers/dri/r600/evergreen_oglprog.c index 9fe523234c..a2a361f32e 100644 --- a/src/mesa/drivers/dri/r600/evergreen_oglprog.c +++ b/src/mesa/drivers/dri/r600/evergreen_oglprog.c @@ -40,7 +40,7 @@ #include "evergreen_vertprog.h" -static void evergreen_freeVertProgCache(GLcontext *ctx, struct r700_vertex_program_cont *cache) +static void evergreen_freeVertProgCache(struct gl_context *ctx, struct r700_vertex_program_cont *cache) { struct evergreen_vertex_program *tmp, *vp = cache->progs; @@ -64,7 +64,7 @@ static void evergreen_freeVertProgCache(GLcontext *ctx, struct r700_vertex_progr } } -static struct gl_program *evergreenNewProgram(GLcontext * ctx, +static struct gl_program *evergreenNewProgram(struct gl_context * ctx, GLenum target, GLuint id) { @@ -109,7 +109,7 @@ static struct gl_program *evergreenNewProgram(GLcontext * ctx, return pProgram; } -static void evergreenDeleteProgram(GLcontext * ctx, struct gl_program *prog) +static void evergreenDeleteProgram(struct gl_context * ctx, struct gl_program *prog) { struct evergreen_vertex_program_cont *vpc = (struct evergreen_vertex_program_cont *)prog; struct evergreen_fragment_program * fp; @@ -147,7 +147,7 @@ static void evergreenDeleteProgram(GLcontext * ctx, struct gl_program *prog) } static GLboolean -evergreenProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog) +evergreenProgramStringNotify(struct gl_context * ctx, GLenum target, struct gl_program *prog) { struct evergreen_vertex_program_cont *vpc = (struct evergreen_vertex_program_cont *)prog; struct evergreen_fragment_program * fp = (struct evergreen_fragment_program*)prog; @@ -178,7 +178,7 @@ evergreenProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program * return GL_TRUE; } -static GLboolean evergreenIsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog) +static GLboolean evergreenIsProgramNative(struct gl_context * ctx, GLenum target, struct gl_program *prog) { return GL_TRUE; diff --git a/src/mesa/drivers/dri/r600/evergreen_render.c b/src/mesa/drivers/dri/r600/evergreen_render.c index 85b2f9d6ab..0c0eeca1fc 100644 --- a/src/mesa/drivers/dri/r600/evergreen_render.c +++ b/src/mesa/drivers/dri/r600/evergreen_render.c @@ -148,7 +148,8 @@ static int evergreenNumVerts(int num_verts, int prim) //same return num_verts - verts_off; } -static void evergreenRunRenderPrimitive(GLcontext * ctx, int start, int end, int prim) //same +static void evergreenRunRenderPrimitive(struct gl_context * ctx, int start, int end, int prim, + GLint basevertex) //same { context_t *context = EVERGREEN_CONTEXT(ctx); BATCH_LOCALS(&context->radeon); @@ -186,6 +187,7 @@ static void evergreenRunRenderPrimitive(GLcontext * ctx, int start, int end, int total_emit = 3 /* VGT_PRIMITIVE_TYPE */ + 2 /* VGT_INDEX_TYPE */ + 2 /* NUM_INSTANCES */ + + 4 /* VTX_BASE_VTX_LOC + VTX_START_INST_LOC */ + 5 + 2; /* DRAW_INDEX */ BEGIN_BATCH_NO_AUTOSTATE(total_emit); @@ -198,6 +200,11 @@ static void evergreenRunRenderPrimitive(GLcontext * ctx, int start, int end, int // num instances R600_OUT_BATCH(CP_PACKET3(R600_IT_NUM_INSTANCES, 0)); R600_OUT_BATCH(1); + /* offset */ + R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CTL_CONST, 2)); + R600_OUT_BATCH(mmSQ_VTX_BASE_VTX_LOC - ASIC_CTL_CONST_BASE_INDEX); + R600_OUT_BATCH(basevertex); //VTX_BASE_VTX_LOC + R600_OUT_BATCH(0); //VTX_START_INST_LOC // draw packet R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX, 3)); R600_OUT_BATCH(context->ind_buf.bo_offset); @@ -212,7 +219,7 @@ static void evergreenRunRenderPrimitive(GLcontext * ctx, int start, int end, int COMMIT_BATCH(); } -static void evergreenRunRenderPrimitiveImmediate(GLcontext * ctx, int start, int end, int prim) //same +static void evergreenRunRenderPrimitiveImmediate(struct gl_context * ctx, int start, int end, int prim) //same { context_t *context = EVERGREEN_CONTEXT(ctx); BATCH_LOCALS(&context->radeon); @@ -268,6 +275,7 @@ static void evergreenRunRenderPrimitiveImmediate(GLcontext * ctx, int start, int total_emit += 3 /* VGT_PRIMITIVE_TYPE */ + 2 /* VGT_INDEX_TYPE */ + 2 /* NUM_INSTANCES */ + + 4 /* VTX_BASE_VTX_LOC + VTX_START_INST_LOC */ + 3; /* DRAW */ BEGIN_BATCH_NO_AUTOSTATE(total_emit); @@ -280,6 +288,11 @@ static void evergreenRunRenderPrimitiveImmediate(GLcontext * ctx, int start, int // num instances R600_OUT_BATCH(CP_PACKET3(R600_IT_NUM_INSTANCES, 0)); R600_OUT_BATCH(1); + /* offset */ + R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CTL_CONST, 2)); + R600_OUT_BATCH(mmSQ_VTX_BASE_VTX_LOC - ASIC_CTL_CONST_BASE_INDEX); + R600_OUT_BATCH(0); //VTX_BASE_VTX_LOC + R600_OUT_BATCH(0); //VTX_START_INST_LOC // draw packet if(start == 0) { @@ -350,7 +363,7 @@ static void evergreenRunRenderPrimitiveImmediate(GLcontext * ctx, int start, int * Convert attribute data type to float * If the attribute uses named buffer object replace the bo with newly allocated bo */ -static void evergreenConvertAttrib(GLcontext *ctx, int count, +static void evergreenConvertAttrib(struct gl_context *ctx, int count, const struct gl_client_array *input, struct StreamDesc *attr) { @@ -429,7 +442,7 @@ static void evergreenConvertAttrib(GLcontext *ctx, int count, } } -static void evergreenFixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer *mesa_ind_buf) +static void evergreenFixupIndexBuffer(struct gl_context *ctx, const struct _mesa_index_buffer *mesa_ind_buf) { context_t *context = EVERGREEN_CONTEXT(ctx); GLvoid *src_ptr; @@ -504,7 +517,7 @@ static void evergreenFixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_b } } -static GLboolean evergreen_check_fallbacks(GLcontext *ctx) //same +static GLboolean evergreen_check_fallbacks(struct gl_context *ctx) //same { if (ctx->RenderMode != GL_RENDER) return GL_TRUE; @@ -515,7 +528,7 @@ static GLboolean evergreen_check_fallbacks(GLcontext *ctx) //same /* start 3d, idle, cb/db flush */ #define PRE_EMIT_STATE_BUFSZ 5 + 5 + 14 -static GLuint evergreenPredictRenderSize(GLcontext* ctx, +static GLuint evergreenPredictRenderSize(struct gl_context* ctx, const struct _mesa_prim *prim, const struct _mesa_index_buffer *ib, GLuint nr_prims) @@ -527,16 +540,16 @@ static GLuint evergreenPredictRenderSize(GLcontext* ctx, dwords = PRE_EMIT_STATE_BUFSZ; if (ib) - dwords += nr_prims * 14; + dwords += nr_prims * 18; else { for (i = 0; i < nr_prims; ++i) { if (prim[i].start == 0) - dwords += 10; + dwords += 14; else if (prim[i].count > 0xffff) - dwords += prim[i].count + 10; + dwords += prim[i].count + 14; else - dwords += ((prim[i].count + 1) / 2) + 10; + dwords += ((prim[i].count + 1) / 2) + 14; } } @@ -554,7 +567,7 @@ static GLuint evergreenPredictRenderSize(GLcontext* ctx, } -static void evergreenSetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer *mesa_ind_buf) +static void evergreenSetupIndexBuffer(struct gl_context *ctx, const struct _mesa_index_buffer *mesa_ind_buf) { context_t *context = EVERGREEN_CONTEXT(ctx); @@ -607,7 +620,7 @@ static void evergreenSetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_b } } -static void evergreenAlignDataToDword(GLcontext *ctx, +static void evergreenAlignDataToDword(struct gl_context *ctx, const struct gl_client_array *input, int count, struct StreamDesc *attr) @@ -649,7 +662,7 @@ static void evergreenAlignDataToDword(GLcontext *ctx, attr->stride = dst_stride; } -static void evergreenSetupStreams(GLcontext *ctx, const struct gl_client_array *input[], int count) +static void evergreenSetupStreams(struct gl_context *ctx, const struct gl_client_array *input[], int count) { context_t *context = EVERGREEN_CONTEXT(ctx); GLuint stride; @@ -665,11 +678,11 @@ static void evergreenSetupStreams(GLcontext *ctx, const struct gl_client_array * stride = (input[i]->StrideB == 0) ? getTypeSize(input[i]->Type) * input[i]->Size : input[i]->StrideB; - if (input[i]->Type == GL_DOUBLE || input[i]->Type == GL_UNSIGNED_INT || input[i]->Type == GL_INT || + if (input[i]->Type == GL_DOUBLE || input[i]->Type == GL_UNSIGNED_INT || input[i]->Type == GL_INT #if MESA_BIG_ENDIAN - getTypeSize(input[i]->Type) != 4 || + || getTypeSize(input[i]->Type) != 4 #endif - stride < 4) + ) { evergreenConvertAttrib(ctx, count, input[i], &context->stream_desc[index]); } @@ -677,19 +690,10 @@ static void evergreenSetupStreams(GLcontext *ctx, const struct gl_client_array * { if (input[i]->BufferObj->Name) { - if (stride % 4 != 0) - { - assert(((intptr_t) input[i]->Ptr) % input[i]->StrideB == 0); - evergreenAlignDataToDword(ctx, input[i], count, &context->stream_desc[index]); - context->stream_desc[index].is_named_bo = GL_FALSE; - } - else - { - context->stream_desc[index].stride = input[i]->StrideB; - context->stream_desc[index].bo_offset = (intptr_t) input[i]->Ptr; - context->stream_desc[index].bo = get_radeon_buffer_object(input[i]->BufferObj)->bo; - context->stream_desc[index].is_named_bo = GL_TRUE; - } + context->stream_desc[index].stride = input[i]->StrideB; + context->stream_desc[index].bo_offset = (intptr_t) input[i]->Ptr; + context->stream_desc[index].bo = get_radeon_buffer_object(input[i]->BufferObj)->bo; + context->stream_desc[index].is_named_bo = GL_TRUE; } else { @@ -759,7 +763,7 @@ static void evergreenSetupStreams(GLcontext *ctx, const struct gl_client_array * RADEON_GEM_DOMAIN_GTT, 0); } -static void evergreenFreeData(GLcontext *ctx) +static void evergreenFreeData(struct gl_context *ctx) { /* Need to zero tcl.aos[n].bo and tcl.elt_dma_bo * to prevent double unref in radeonReleaseArrays @@ -795,7 +799,7 @@ static void evergreenFreeData(GLcontext *ctx) } } -static GLboolean evergreenTryDrawPrims(GLcontext *ctx, +static GLboolean evergreenTryDrawPrims(struct gl_context *ctx, const struct gl_client_array *arrays[], const struct _mesa_prim *prim, GLuint nr_prims, @@ -857,7 +861,8 @@ static GLboolean evergreenTryDrawPrims(GLcontext *ctx, evergreenRunRenderPrimitive(ctx, prim[i].start, prim[i].start + prim[i].count, - prim[i].mode); + prim[i].mode, + prim[i].basevertex); else evergreenRunRenderPrimitiveImmediate(ctx, prim[i].start, @@ -893,7 +898,7 @@ static GLboolean evergreenTryDrawPrims(GLcontext *ctx, return GL_TRUE; } -static void evergreenDrawPrims(GLcontext *ctx, +static void evergreenDrawPrims(struct gl_context *ctx, const struct gl_client_array *arrays[], const struct _mesa_prim *prim, GLuint nr_prims, @@ -907,15 +912,16 @@ static void evergreenDrawPrims(GLcontext *ctx, /* This check should get folded into just the places that * min/max index are really needed. */ - if (!index_bounds_valid) { - vbo_get_minmax_index(ctx, prim, ib, &min_index, &max_index); - } - - if (min_index) { - vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, min_index, max_index, evergreenDrawPrims ); - return; + if (!vbo_all_varyings_in_vbos(arrays)) { + if (!index_bounds_valid) + vbo_get_minmax_index(ctx, prim, ib, &min_index, &max_index); + /* do we want to rebase, minimizes the + * amount of data to upload? */ + if (min_index) { + vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, min_index, max_index, evergreenDrawPrims ); + return; + } } - /* Make an attempt at drawing */ retval = evergreenTryDrawPrims(ctx, arrays, prim, nr_prims, ib, min_index, max_index); @@ -926,7 +932,7 @@ static void evergreenDrawPrims(GLcontext *ctx, } } -void evergreenInitDraw(GLcontext *ctx) +void evergreenInitDraw(struct gl_context *ctx) { struct vbo_context *vbo = vbo_context(ctx); diff --git a/src/mesa/drivers/dri/r600/evergreen_state.c b/src/mesa/drivers/dri/r600/evergreen_state.c index 931478caa5..a77be183a1 100644 --- a/src/mesa/drivers/dri/r600/evergreen_state.c +++ b/src/mesa/drivers/dri/r600/evergreen_state.c @@ -53,9 +53,9 @@ #include "evergreen_fragprog.h" #include "evergreen_tex.h" -void evergreenUpdateStateParameters(GLcontext * ctx, GLuint new_state); //same +void evergreenUpdateStateParameters(struct gl_context * ctx, GLuint new_state); //same -void evergreenUpdateShaders(GLcontext * ctx) +void evergreenUpdateShaders(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); @@ -73,7 +73,7 @@ void evergreenUpdateShaders(GLcontext * ctx) context->radeon.NewGLState = 0; } -void evergreeUpdateShaders(GLcontext * ctx) +void evergreeUpdateShaders(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); @@ -94,7 +94,7 @@ void evergreeUpdateShaders(GLcontext * ctx) /* * To correctly position primitives: */ -void evergreenUpdateViewportOffset(GLcontext * ctx) //------------------ +void evergreenUpdateViewportOffset(struct gl_context * ctx) //------------------ { context_t *context = R700_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -120,7 +120,7 @@ void evergreenUpdateViewportOffset(GLcontext * ctx) //------------------ radeonUpdateScissor(ctx); } -void evergreenUpdateStateParameters(GLcontext * ctx, GLuint new_state) //same +void evergreenUpdateStateParameters(struct gl_context * ctx, GLuint new_state) //same { struct evergreen_fragment_program *fp = (struct evergreen_fragment_program *)ctx->FragmentProgram._Current; @@ -144,7 +144,7 @@ void evergreenUpdateStateParameters(GLcontext * ctx, GLuint new_state) //same /** * Called by Mesa after an internal state update. */ -static void evergreenInvalidateState(GLcontext * ctx, GLuint new_state) //same +static void evergreenInvalidateState(struct gl_context * ctx, GLuint new_state) //same { context_t *context = EVERGREEN_CONTEXT(ctx); @@ -212,7 +212,7 @@ static void evergreenInvalidateState(GLcontext * ctx, GLuint new_state) //same context->radeon.NewGLState |= new_state; } -static void evergreenSetAlphaState(GLcontext * ctx) //same +static void evergreenSetAlphaState(struct gl_context * ctx) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -259,14 +259,14 @@ static void evergreenSetAlphaState(GLcontext * ctx) //same } } -static void evergreenAlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref) //same +static void evergreenAlphaFunc(struct gl_context * ctx, GLenum func, GLfloat ref) //same { (void)func; (void)ref; evergreenSetAlphaState(ctx); } -static void evergreenBlendColor(GLcontext * ctx, const GLfloat cf[4]) //same +static void evergreenBlendColor(struct gl_context * ctx, const GLfloat cf[4]) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -334,7 +334,7 @@ static int evergreenblend_factor(GLenum factor, GLboolean is_src) //same } } -static void evergreenSetBlendState(GLcontext * ctx) //diff : CB_COLOR_CONTROL, CB_BLEND0_CONTROL bits +static void evergreenSetBlendState(struct gl_context * ctx) //diff : CB_COLOR_CONTROL, CB_BLEND0_CONTROL bits { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -459,13 +459,13 @@ static void evergreenSetBlendState(GLcontext * ctx) //diff : CB_COLOR_CONTROL, C evergreen->CB_BLEND0_CONTROL.u32All = blend_reg; } -static void evergreenBlendEquationSeparate(GLcontext * ctx, +static void evergreenBlendEquationSeparate(struct gl_context * ctx, GLenum modeRGB, GLenum modeA) //same { evergreenSetBlendState(ctx); } -static void evergreenBlendFuncSeparate(GLcontext * ctx, +static void evergreenBlendFuncSeparate(struct gl_context * ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA) //same { @@ -513,7 +513,7 @@ static GLuint evergreen_translate_logicop(GLenum logicop) //same } } -static void evergreenSetLogicOpState(GLcontext *ctx) //diff : CB_COLOR_CONTROL.ROP3 is actually same bits. +static void evergreenSetLogicOpState(struct gl_context *ctx) //diff : CB_COLOR_CONTROL.ROP3 is actually same bits. { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -531,7 +531,7 @@ static void evergreenSetLogicOpState(GLcontext *ctx) //diff : CB_COLOR_CONTROL.R EG_CB_COLOR_CONTROL__ROP3_mask); } -static void evergreenClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq ) //same , but PA_CL_UCP_0_ offset diff +static void evergreenClipPlane( struct gl_context *ctx, GLenum plane, const GLfloat *eq ) //same , but PA_CL_UCP_0_ offset diff { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -549,7 +549,7 @@ static void evergreenClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq evergreen->ucp[p].PA_CL_UCP_0_W.u32All = ip[3]; } -static void evergreenSetClipPlaneState(GLcontext * ctx, GLenum cap, GLboolean state) //diff in func calls +static void evergreenSetClipPlaneState(struct gl_context * ctx, GLenum cap, GLboolean state) //diff in func calls { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -569,7 +569,7 @@ static void evergreenSetClipPlaneState(GLcontext * ctx, GLenum cap, GLboolean st } } -static void evergreenSetDBRenderState(GLcontext * ctx) +static void evergreenSetDBRenderState(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -629,13 +629,13 @@ static void evergreenSetDBRenderState(GLcontext * ctx) } } -void evergreenUpdateShaderStates(GLcontext * ctx) +void evergreenUpdateShaderStates(struct gl_context * ctx) { evergreenSetDBRenderState(ctx); evergreenUpdateTextureState(ctx); } -static void evergreenSetDepthState(GLcontext * ctx) //same +static void evergreenSetDepthState(struct gl_context * ctx) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -701,29 +701,30 @@ static void evergreenSetDepthState(GLcontext * ctx) //same } } -static void evergreenSetStencilState(GLcontext * ctx, GLboolean state) //same +static void evergreenSetStencilState(struct gl_context * ctx, GLboolean state) //same { - context_t *context = EVERGREEN_CONTEXT(ctx); - EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); - GLboolean hw_stencil = GL_FALSE; + context_t *context = EVERGREEN_CONTEXT(ctx); + EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); + GLboolean hw_stencil = GL_FALSE; - if (ctx->DrawBuffer) { - struct radeon_renderbuffer *rrbStencil - = radeon_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL); - hw_stencil = (rrbStencil && rrbStencil->bo); - } + if (ctx->DrawBuffer) { + struct radeon_renderbuffer *rrbStencil + = radeon_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL); + hw_stencil = (rrbStencil && rrbStencil->bo); + } - if (hw_stencil) { - EVERGREEN_STATECHANGE(context, db); - if (state) { - SETbit(evergreen->DB_DEPTH_CONTROL.u32All, STENCIL_ENABLE_bit); - SETbit(evergreen->DB_DEPTH_CONTROL.u32All, BACKFACE_ENABLE_bit); - } else - CLEARbit(evergreen->DB_DEPTH_CONTROL.u32All, STENCIL_ENABLE_bit); - } + if (hw_stencil) { + EVERGREEN_STATECHANGE(context, db); + if (state) { + SETbit(evergreen->DB_DEPTH_CONTROL.u32All, STENCIL_ENABLE_bit); + SETbit(evergreen->DB_DEPTH_CONTROL.u32All, BACKFACE_ENABLE_bit); + SETbit(evergreen->DB_STENCIL_INFO.u32All, EG_DB_STENCIL_INFO__FORMAT_bit); + } else + CLEARbit(evergreen->DB_DEPTH_CONTROL.u32All, STENCIL_ENABLE_bit); + } } -static void evergreenUpdateCulling(GLcontext * ctx) //same +static void evergreenUpdateCulling(struct gl_context * ctx) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -775,7 +776,7 @@ static void evergreenUpdateCulling(GLcontext * ctx) //same evergreen->PA_SU_SC_MODE_CNTL.u32All ^= FACE_bit; } -static void evergreenSetPolygonOffsetState(GLcontext * ctx, GLboolean state) //same +static void evergreenSetPolygonOffsetState(struct gl_context * ctx, GLboolean state) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -793,7 +794,7 @@ static void evergreenSetPolygonOffsetState(GLcontext * ctx, GLboolean state) //s } } -static void evergreenUpdateLineStipple(GLcontext * ctx) //diff +static void evergreenUpdateLineStipple(struct gl_context * ctx) //diff { /* TODO */ } @@ -912,7 +913,7 @@ void evergreenSetScissor(context_t *context) //diff evergreen->viewport[id].enabled = GL_TRUE; } -static void evergreenUpdateWindow(GLcontext * ctx, int id) //diff in calling evergreenSetScissor +static void evergreenUpdateWindow(struct gl_context * ctx, int id) //diff in calling evergreenSetScissor { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -968,7 +969,7 @@ static void evergreenUpdateWindow(GLcontext * ctx, int id) //diff in calling eve evergreenSetScissor(context); } -static void evergreenEnable(GLcontext * ctx, GLenum cap, GLboolean state) //diff in func calls +static void evergreenEnable(struct gl_context * ctx, GLenum cap, GLboolean state) //diff in func calls { context_t *context = EVERGREEN_CONTEXT(ctx); @@ -1029,7 +1030,7 @@ static void evergreenEnable(GLcontext * ctx, GLenum cap, GLboolean state) //diff } -static void evergreenColorMask(GLcontext * ctx, +static void evergreenColorMask(struct gl_context * ctx, GLboolean r, GLboolean g, GLboolean b, GLboolean a) //same { context_t *context = EVERGREEN_CONTEXT(ctx); @@ -1045,26 +1046,26 @@ static void evergreenColorMask(GLcontext * ctx, } } -static void evergreenDepthFunc(GLcontext * ctx, GLenum func) //same +static void evergreenDepthFunc(struct gl_context * ctx, GLenum func) //same { evergreenSetDepthState(ctx); } -static void evergreenDepthMask(GLcontext * ctx, GLboolean mask) //same +static void evergreenDepthMask(struct gl_context * ctx, GLboolean mask) //same { evergreenSetDepthState(ctx); } -static void evergreenCullFace(GLcontext * ctx, GLenum mode) //same +static void evergreenCullFace(struct gl_context * ctx, GLenum mode) //same { evergreenUpdateCulling(ctx); } -static void evergreenFogfv(GLcontext * ctx, GLenum pname, const GLfloat * param) //same +static void evergreenFogfv(struct gl_context * ctx, GLenum pname, const GLfloat * param) //same { } -static void evergreenUpdatePolygonMode(GLcontext * ctx) //same +static void evergreenUpdatePolygonMode(struct gl_context * ctx) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -1119,13 +1120,13 @@ static void evergreenUpdatePolygonMode(GLcontext * ctx) //same } } -static void evergreenFrontFace(GLcontext * ctx, GLenum mode) //same +static void evergreenFrontFace(struct gl_context * ctx, GLenum mode) //same { evergreenUpdateCulling(ctx); evergreenUpdatePolygonMode(ctx); } -static void evergreenShadeModel(GLcontext * ctx, GLenum mode) //same +static void evergreenShadeModel(struct gl_context * ctx, GLenum mode) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -1145,13 +1146,13 @@ static void evergreenShadeModel(GLcontext * ctx, GLenum mode) //same } } -static void evergreenLogicOpcode(GLcontext *ctx, GLenum logicop) //diff +static void evergreenLogicOpcode(struct gl_context *ctx, GLenum logicop) //diff { if (RGBA_LOGICOP_ENABLED(ctx)) evergreenSetLogicOpState(ctx); } -static void evergreenPointSize(GLcontext * ctx, GLfloat size) //same +static void evergreenPointSize(struct gl_context * ctx, GLfloat size) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -1173,7 +1174,7 @@ static void evergreenPointSize(GLcontext * ctx, GLfloat size) //same } -static void evergreenPointParameter(GLcontext * ctx, GLenum pname, const GLfloat * param) //same +static void evergreenPointParameter(struct gl_context * ctx, GLenum pname, const GLfloat * param) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -1224,7 +1225,7 @@ static int evergreen_translate_stencil_func(int func) //same return 0; } -static void evergreenStencilFuncSeparate(GLcontext * ctx, GLenum face, +static void evergreenStencilFuncSeparate(struct gl_context * ctx, GLenum face, GLenum func, GLint ref, GLuint mask) //same { context_t *context = EVERGREEN_CONTEXT(ctx); @@ -1253,7 +1254,7 @@ static void evergreenStencilFuncSeparate(GLcontext * ctx, GLenum face, STENCILFUNC_BF_shift, STENCILFUNC_BF_mask); } -static void evergreenStencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask) //same +static void evergreenStencilMaskSeparate(struct gl_context * ctx, GLenum face, GLuint mask) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -1297,7 +1298,7 @@ static int evergreen_translate_stencil_op(int op) //same return 0; } -static void evergreenStencilOpSeparate(GLcontext * ctx, GLenum face, +static void evergreenStencilOpSeparate(struct gl_context * ctx, GLenum face, GLenum fail, GLenum zfail, GLenum zpass) //same { context_t *context = EVERGREEN_CONTEXT(ctx); @@ -1321,7 +1322,7 @@ static void evergreenStencilOpSeparate(GLcontext * ctx, GLenum face, STENCILZPASS_BF_shift, STENCILZPASS_BF_mask); } -static void evergreenViewport(GLcontext * ctx, +static void evergreenViewport(struct gl_context * ctx, GLint x, GLint y, GLsizei width, @@ -1332,12 +1333,12 @@ static void evergreenViewport(GLcontext * ctx, radeon_viewport(ctx, x, y, width, height); } -static void evergreenDepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) //diff in evergreenUpdateWindow +static void evergreenDepthRange(struct gl_context * ctx, GLclampd nearval, GLclampd farval) //diff in evergreenUpdateWindow { evergreenUpdateWindow(ctx, 0); } -static void evergreenLineWidth(GLcontext * ctx, GLfloat widthf) //same +static void evergreenLineWidth(struct gl_context * ctx, GLfloat widthf) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -1351,7 +1352,7 @@ static void evergreenLineWidth(GLcontext * ctx, GLfloat widthf) //same PA_SU_LINE_CNTL__WIDTH_shift, PA_SU_LINE_CNTL__WIDTH_mask); } -static void evergreenLineStipple(GLcontext *ctx, GLint factor, GLushort pattern) //same +static void evergreenLineStipple(struct gl_context *ctx, GLint factor, GLushort pattern) //same { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -1363,7 +1364,7 @@ static void evergreenLineStipple(GLcontext *ctx, GLint factor, GLushort pattern) SETfield(evergreen->PA_SC_LINE_STIPPLE.u32All, 1, AUTO_RESET_CNTL_shift, AUTO_RESET_CNTL_mask); } -static void evergreenPolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) //diff : +static void evergreenPolygonOffset(struct gl_context * ctx, GLfloat factor, GLfloat units) //diff : //all register here offset diff, bits same { context_t *context = EVERGREEN_CONTEXT(ctx); @@ -1394,7 +1395,7 @@ static void evergreenPolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat unit evergreen->PA_SU_POLY_OFFSET_BACK_OFFSET.f32All = constant; } -static void evergreenPolygonMode(GLcontext * ctx, GLenum face, GLenum mode) //same +static void evergreenPolygonMode(struct gl_context * ctx, GLenum face, GLenum mode) //same { (void)face; (void)mode; @@ -1402,12 +1403,12 @@ static void evergreenPolygonMode(GLcontext * ctx, GLenum face, GLenum mode) //sa evergreenUpdatePolygonMode(ctx); } -static void evergreenRenderMode(GLcontext * ctx, GLenum mode) //same +static void evergreenRenderMode(struct gl_context * ctx, GLenum mode) //same { } //TODO : move to kernel. -static void evergreenInitSQConfig(GLcontext * ctx) +static void evergreenInitSQConfig(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -1607,7 +1608,7 @@ static void evergreenInitSQConfig(GLcontext * ctx) NUM_CLIP_SEQ_mask); } -void evergreenInitState(GLcontext * ctx) //diff +void evergreenInitState(struct gl_context * ctx) //diff { context_t *context = R700_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -1699,7 +1700,7 @@ void evergreenInitState(GLcontext * ctx) //diff evergreen->DB_STENCIL_INFO.u32All = 0; CLEARbit(evergreen->DB_STENCIL_INFO.u32All, EG_DB_STENCIL_INFO__FORMAT_bit); - SETfield(evergreen->DB_STENCIL_INFO.u32All, EG_ADDR_SURF_TILE_SPLIT_256B, + SETfield(evergreen->DB_STENCIL_INFO.u32All, 0, EG_DB_STENCIL_INFO__TILE_SPLIT_shift, EG_DB_STENCIL_INFO__TILE_SPLIT_mask); evergreen->DB_RENDER_CONTROL.u32All = 0; @@ -1709,6 +1710,15 @@ void evergreenInitState(GLcontext * ctx) //diff SETfield(evergreen->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE0_shift, FORCE_HIS_ENABLE0_mask); SETfield(evergreen->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE1_shift, FORCE_HIS_ENABLE1_mask); + /* stencil */ + evergreenEnable(ctx, GL_STENCIL_TEST, ctx->Stencil._Enabled); + evergreenStencilMaskSeparate(ctx, 0, ctx->Stencil.WriteMask[0]); + evergreenStencilFuncSeparate(ctx, 0, ctx->Stencil.Function[0], + ctx->Stencil.Ref[0], ctx->Stencil.ValueMask[0]); + evergreenStencilOpSeparate(ctx, 0, ctx->Stencil.FailFunc[0], + ctx->Stencil.ZFailFunc[0], + ctx->Stencil.ZPassFunc[0]); + // Disable ROP3 modes by setting src to dst copy: SETfield(evergreen->CB_COLOR_CONTROL.u32All, 0xCC, EG_CB_COLOR_CONTROL__ROP3_shift, diff --git a/src/mesa/drivers/dri/r600/evergreen_state.h b/src/mesa/drivers/dri/r600/evergreen_state.h index ffdb56b38a..2f350e90fa 100644 --- a/src/mesa/drivers/dri/r600/evergreen_state.h +++ b/src/mesa/drivers/dri/r600/evergreen_state.h @@ -31,15 +31,15 @@ #include "r600_context.h" -extern void evergreenUpdateStateParameters(GLcontext * ctx, GLuint new_state); -extern void evergreenUpdateShaders(GLcontext * ctx); -extern void evergreenUpdateShaderStates(GLcontext * ctx); +extern void evergreenUpdateStateParameters(struct gl_context * ctx, GLuint new_state); +extern void evergreenUpdateShaders(struct gl_context * ctx); +extern void evergreenUpdateShaderStates(struct gl_context * ctx); -extern void evergreeUpdateShaders(GLcontext * ctx); +extern void evergreeUpdateShaders(struct gl_context * ctx); -extern void evergreenUpdateViewportOffset(GLcontext * ctx); +extern void evergreenUpdateViewportOffset(struct gl_context * ctx); -extern void evergreenInitState(GLcontext * ctx); +extern void evergreenInitState(struct gl_context * ctx); extern void evergreenInitStateFuncs (radeonContextPtr radeon, struct dd_function_table *functions); extern void evergreenSetScissor(context_t *context); diff --git a/src/mesa/drivers/dri/r600/evergreen_tex.c b/src/mesa/drivers/dri/r600/evergreen_tex.c index 8b42045ebb..58420ed123 100644 --- a/src/mesa/drivers/dri/r600/evergreen_tex.c +++ b/src/mesa/drivers/dri/r600/evergreen_tex.c @@ -934,7 +934,7 @@ EG_S_FIXED(float value, uint32_t frac_bits) return value * (1 << frac_bits); } -static GLboolean evergreen_setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texObj, int unit) +static GLboolean evergreen_setup_hardware_state(struct gl_context * ctx, struct gl_texture_object *texObj, int unit) { context_t *context = EVERGREEN_CONTEXT(ctx); radeonTexObj *t = radeon_tex_obj(texObj); @@ -1289,7 +1289,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur return; } -void evergreenUpdateTextureState(GLcontext * ctx) +void evergreenUpdateTextureState(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT * evergreen = GET_EVERGREEN_CHIP(context); @@ -1311,7 +1311,7 @@ void evergreenUpdateTextureState(GLcontext * ctx) } } -static GLboolean evergreen_validate_texture(GLcontext * ctx, struct gl_texture_object *texObj, int unit) +static GLboolean evergreen_validate_texture(struct gl_context * ctx, struct gl_texture_object *texObj, int unit) { radeonTexObj *t = radeon_tex_obj(texObj); @@ -1327,7 +1327,7 @@ static GLboolean evergreen_validate_texture(GLcontext * ctx, struct gl_texture_o return GL_TRUE; } -GLboolean evergreenValidateBuffers(GLcontext * ctx) +GLboolean evergreenValidateBuffers(struct gl_context * ctx) { context_t *rmesa = EVERGREEN_CONTEXT(ctx); struct radeon_renderbuffer *rrb; @@ -1403,7 +1403,7 @@ GLboolean evergreenValidateBuffers(GLcontext * ctx) return GL_TRUE; } -static struct gl_texture_object *evergreenNewTextureObject(GLcontext * ctx, +static struct gl_texture_object *evergreenNewTextureObject(struct gl_context * ctx, GLuint name, GLenum target) { @@ -1426,7 +1426,7 @@ static struct gl_texture_object *evergreenNewTextureObject(GLcontext * ctx, return &t->base; } -static void evergreenDeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj) +static void evergreenDeleteTexture(struct gl_context * ctx, struct gl_texture_object *texObj) { context_t * rmesa = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT * evergreen = GET_EVERGREEN_CHIP(rmesa); @@ -1456,7 +1456,7 @@ static void evergreenDeleteTexture(GLcontext * ctx, struct gl_texture_object *te _mesa_delete_texture_object(ctx, texObj); } -static void evergreenTexParameter(GLcontext * ctx, GLenum target, +static void evergreenTexParameter(struct gl_context * ctx, GLenum target, struct gl_texture_object *texObj, GLenum pname, const GLfloat * params) { diff --git a/src/mesa/drivers/dri/r600/evergreen_tex.h b/src/mesa/drivers/dri/r600/evergreen_tex.h index b43508a9ea..982a087f8e 100644 --- a/src/mesa/drivers/dri/r600/evergreen_tex.h +++ b/src/mesa/drivers/dri/r600/evergreen_tex.h @@ -27,9 +27,9 @@ #ifndef _EVERGREEN_TEX_H_ #define _EVERGREEN_TEX_H_ -extern GLboolean evergreenValidateBuffers(GLcontext * ctx); +extern GLboolean evergreenValidateBuffers(struct gl_context * ctx); -extern void evergreenUpdateTextureState(GLcontext * ctx); +extern void evergreenUpdateTextureState(struct gl_context * ctx); extern void evergreenInitTextureFuncs(radeonContextPtr radeon, struct dd_function_table *functions); extern void evergreenSetTexOffset(__DRIcontext * pDRICtx, GLint texname, unsigned long long offset, GLint depth, GLuint pitch); diff --git a/src/mesa/drivers/dri/r600/evergreen_vertprog.c b/src/mesa/drivers/dri/r600/evergreen_vertprog.c index 6840fa3c86..b3371f20b1 100644 --- a/src/mesa/drivers/dri/r600/evergreen_vertprog.c +++ b/src/mesa/drivers/dri/r600/evergreen_vertprog.c @@ -169,7 +169,7 @@ GLboolean evergreen_Process_Vertex_Program_Vfetch_Instructions( } GLboolean evergreen_Process_Vertex_Program_Vfetch_Instructions2( - GLcontext *ctx, + struct gl_context *ctx, struct evergreen_vertex_program *vp, struct gl_vertex_program *mesa_vp) { @@ -196,7 +196,7 @@ GLboolean evergreen_Process_Vertex_Program_Vfetch_Instructions2( return GL_TRUE; } -void evergreen_Map_Vertex_Program(GLcontext *ctx, +void evergreen_Map_Vertex_Program(struct gl_context *ctx, struct evergreen_vertex_program *vp, struct gl_vertex_program *mesa_vp) { @@ -292,7 +292,7 @@ GLboolean evergreen_Find_Instruction_Dependencies_vp(struct evergreen_vertex_pro return GL_TRUE; } -struct evergreen_vertex_program* evergreenTranslateVertexShader(GLcontext *ctx, +struct evergreen_vertex_program* evergreenTranslateVertexShader(struct gl_context *ctx, struct gl_vertex_program *mesa_vp) { context_t *context = EVERGREEN_CONTEXT(ctx); @@ -374,7 +374,7 @@ struct evergreen_vertex_program* evergreenTranslateVertexShader(GLcontext *ctx, return vp; } -void evergreenSelectVertexShader(GLcontext *ctx) +void evergreenSelectVertexShader(struct gl_context *ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); struct evergreen_vertex_program_cont *vpc; @@ -448,7 +448,7 @@ int evergreen_getTypeSize(GLenum type) } } -static void evergreenTranslateAttrib(GLcontext *ctx, GLuint unLoc, int count, const struct gl_client_array *input) +static void evergreenTranslateAttrib(struct gl_context *ctx, GLuint unLoc, int count, const struct gl_client_array *input) { context_t *context = EVERGREEN_CONTEXT(ctx); @@ -459,11 +459,11 @@ static void evergreenTranslateAttrib(GLcontext *ctx, GLuint unLoc, int count, co stride = (input->StrideB == 0) ? evergreen_getTypeSize(input->Type) * input->Size : input->StrideB; - if (input->Type == GL_DOUBLE || input->Type == GL_UNSIGNED_INT || input->Type == GL_INT || + if (input->Type == GL_DOUBLE || input->Type == GL_UNSIGNED_INT || input->Type == GL_INT #if MESA_BIG_ENDIAN - evergreen_getTypeSize(input->Type) != 4 || + || evergreen_getTypeSize(input->Type) != 4 #endif - stride < 4) + ) { pStreamDesc->type = GL_FLOAT; @@ -534,7 +534,7 @@ static void evergreenTranslateAttrib(GLcontext *ctx, GLuint unLoc, int count, co context->nNumActiveAos++; } -void evergreenSetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], int count) +void evergreenSetVertexFormat(struct gl_context *ctx, const struct gl_client_array *arrays[], int count) { context_t *context = EVERGREEN_CONTEXT(ctx); struct evergreen_vertex_program *vpc @@ -563,7 +563,7 @@ void evergreenSetVertexFormat(GLcontext *ctx, const struct gl_client_array *arra context->radeon.tcl.aos_count = context->nNumActiveAos; } -void * evergreenGetActiveVpShaderBo(GLcontext * ctx) +void * evergreenGetActiveVpShaderBo(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); struct evergreen_vertex_program *vp = context->selected_vp;; @@ -574,7 +574,7 @@ void * evergreenGetActiveVpShaderBo(GLcontext * ctx) return NULL; } -void * evergreenGetActiveVpShaderConstBo(GLcontext * ctx) +void * evergreenGetActiveVpShaderConstBo(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); struct evergreen_vertex_program *vp = context->selected_vp;; @@ -585,7 +585,7 @@ void * evergreenGetActiveVpShaderConstBo(GLcontext * ctx) return NULL; } -GLboolean evergreenSetupVertexProgram(GLcontext * ctx) +GLboolean evergreenSetupVertexProgram(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); @@ -646,7 +646,7 @@ GLboolean evergreenSetupVertexProgram(GLcontext * ctx) return GL_TRUE; } -GLboolean evergreenSetupVPconstants(GLcontext * ctx) +GLboolean evergreenSetupVPconstants(struct gl_context * ctx) { context_t *context = EVERGREEN_CONTEXT(ctx); EVERGREEN_CHIP_CONTEXT *evergreen = GET_EVERGREEN_CHIP(context); diff --git a/src/mesa/drivers/dri/r600/evergreen_vertprog.h b/src/mesa/drivers/dri/r600/evergreen_vertprog.h index 5853902115..8163e36927 100644 --- a/src/mesa/drivers/dri/r600/evergreen_vertprog.h +++ b/src/mesa/drivers/dri/r600/evergreen_vertprog.h @@ -80,29 +80,29 @@ GLboolean evergreen_Process_Vertex_Program_Vfetch_Instructions( struct evergreen_vertex_program *vp, struct gl_vertex_program *mesa_vp); GLboolean evergreen_Process_Vertex_Program_Vfetch_Instructions2( - GLcontext *ctx, + struct gl_context *ctx, struct evergreen_vertex_program *vp, struct gl_vertex_program *mesa_vp); -void evergreen_Map_Vertex_Program(GLcontext *ctx, +void evergreen_Map_Vertex_Program(struct gl_context *ctx, struct evergreen_vertex_program *vp, struct gl_vertex_program *mesa_vp); GLboolean evergreen_Find_Instruction_Dependencies_vp(struct evergreen_vertex_program *vp, struct gl_vertex_program *mesa_vp); -struct evergreen_vertex_program* evergreenTranslateVertexShader(GLcontext *ctx, +struct evergreen_vertex_program* evergreenTranslateVertexShader(struct gl_context *ctx, struct gl_vertex_program *mesa_vp); /* Interface */ -extern void evergreenSelectVertexShader(GLcontext *ctx); -extern void evergreenSetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], int count); +extern void evergreenSelectVertexShader(struct gl_context *ctx); +extern void evergreenSetVertexFormat(struct gl_context *ctx, const struct gl_client_array *arrays[], int count); -extern GLboolean evergreenSetupVertexProgram(GLcontext * ctx); +extern GLboolean evergreenSetupVertexProgram(struct gl_context * ctx); -extern GLboolean evergreenSetupVPconstants(GLcontext * ctx); +extern GLboolean evergreenSetupVPconstants(struct gl_context * ctx); -extern void * evergreenGetActiveVpShaderBo(GLcontext * ctx); +extern void * evergreenGetActiveVpShaderBo(struct gl_context * ctx); -extern void * evergreenGetActiveVpShaderConstBo(GLcontext * ctx); +extern void * evergreenGetActiveVpShaderConstBo(struct gl_context * ctx); extern int evergreen_getTypeSize(GLenum type); diff --git a/src/mesa/drivers/dri/r600/r600_blit.c b/src/mesa/drivers/dri/r600/r600_blit.c index 3090c9f613..31c32d62f9 100644 --- a/src/mesa/drivers/dri/r600/r600_blit.c +++ b/src/mesa/drivers/dri/r600/r600_blit.c @@ -408,7 +408,7 @@ set_render_target(context_t *context, struct radeon_bo *bo, gl_format mesa_forma } -static inline void load_shaders(GLcontext * ctx) +static inline void load_shaders(struct gl_context * ctx) { radeonContextPtr radeonctx = RADEON_CONTEXT(ctx); @@ -1566,7 +1566,7 @@ static GLboolean validate_buffers(context_t *rmesa, return GL_TRUE; } -unsigned r600_blit(GLcontext *ctx, +unsigned r600_blit(struct gl_context *ctx, struct radeon_bo *src_bo, intptr_t src_offset, gl_format src_mesaformat, diff --git a/src/mesa/drivers/dri/r600/r600_blit.h b/src/mesa/drivers/dri/r600/r600_blit.h index d56b21ba9b..9dc8e2fec6 100644 --- a/src/mesa/drivers/dri/r600/r600_blit.h +++ b/src/mesa/drivers/dri/r600/r600_blit.h @@ -30,7 +30,7 @@ unsigned r600_check_blit(gl_format mesa_format); -unsigned r600_blit(GLcontext *ctx, +unsigned r600_blit(struct gl_context *ctx, struct radeon_bo *src_bo, intptr_t src_offset, gl_format src_mesaformat, diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.c b/src/mesa/drivers/dri/r600/r600_cmdbuf.c index b3331fc8b8..ce2f777956 100644 --- a/src/mesa/drivers/dri/r600/r600_cmdbuf.c +++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.c @@ -47,7 +47,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_reg.h" #include "r600_cmdbuf.h" #include "radeon_bocs_wrapper.h" -#include "radeon_reg.h" #ifdef HAVE_LIBDRM_RADEON #include "radeon_cs_int.h" diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 9c8fe2a24f..c882a9cce9 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -146,7 +146,6 @@ static const struct dri_extension card_extensions[] = { {"GL_MESAX_texture_float", NULL}, {"GL_NV_blend_square", NULL}, {"GL_NV_vertex_program", GL_NV_vertex_program_functions}, - {"GL_SGIS_generate_mipmap", NULL}, {"GL_ARB_pixel_buffer_object", NULL}, {"GL_ARB_draw_elements_base_vertex", GL_ARB_draw_elements_base_vertex_functions }, {NULL, NULL} @@ -166,7 +165,6 @@ static const struct dri_extension mm_extensions[] = { static const struct dri_extension gl_20_extension[] = { #ifdef R600_ENABLE_GLSL_TEST {"GL_ARB_shading_language_100", GL_VERSION_2_0_functions }, - {"GL_ARB_shading_language_120", GL_VERSION_2_1_functions }, #else {"GL_VERSION_2_0", GL_VERSION_2_0_functions }, #endif /* R600_ENABLE_GLSL_TEST */ @@ -210,7 +208,7 @@ static void r600_vtbl_pre_emit_atoms(radeonContextPtr radeon) r700Start3D((context_t *)radeon); } -static void r600_fallback(GLcontext *ctx, GLuint bit, GLboolean mode) +static void r600_fallback(struct gl_context *ctx, GLuint bit, GLboolean mode) { context_t *context = R700_CONTEXT(ctx); if (mode) @@ -251,7 +249,7 @@ static void r600_init_vtbl(radeonContextPtr radeon) radeon->vtbl.is_format_renderable = r600IsFormatRenderable; } -static void r600InitConstValues(GLcontext *ctx, radeonScreenPtr screen) +static void r600InitConstValues(struct gl_context *ctx, radeonScreenPtr screen) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -266,6 +264,8 @@ static void r600InitConstValues(GLcontext *ctx, radeonScreenPtr screen) r700->bShaderUseMemConstant = GL_FALSE; } + ctx->Const.GLSLVersion = 120; + ctx->Const.MaxTextureImageUnits = 16; /* 8 per clause on r6xx, 16 on r7xx * but I think mesa only supports 8 at the moment @@ -335,7 +335,7 @@ static void r600ParseOptions(context_t *r600, radeonScreenPtr screen) } -static void r600InitGLExtensions(GLcontext *ctx) +static void r600InitGLExtensions(struct gl_context *ctx) { context_t *r600 = R700_CONTEXT(ctx); #ifdef R600_ENABLE_GLSL_TEST @@ -380,7 +380,7 @@ static void r600InitGLExtensions(GLcontext *ctx) /* Create the device specific rendering context. */ GLboolean r600CreateContext(gl_api api, - const __GLcontextModes * glVisual, + const struct gl_config * glVisual, __DRIcontext * driContextPriv, void *sharedContextPrivate) { @@ -388,7 +388,7 @@ GLboolean r600CreateContext(gl_api api, radeonScreenPtr screen = (radeonScreenPtr) (sPriv->private); struct dd_function_table functions; context_t *r600; - GLcontext *ctx; + struct gl_context *ctx; assert(glVisual); assert(driContextPriv); diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index 6a83196648..d3dc901acf 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -188,12 +188,12 @@ struct r600_context { #define EVERGREEN_CONTEXT(ctx) ((context_t *)(ctx->DriverCtx)) #define R700_CONTEXT(ctx) ((context_t *)(ctx->DriverCtx)) -#define GL_CONTEXT(context) ((GLcontext *)(context->radeon.glCtx)) +#define GL_CONTEXT(context) ((struct gl_context *)(context->radeon.glCtx)) #define GET_EVERGREEN_CHIP(context) ((EVERGREEN_CHIP_CONTEXT*)(context->pChip)) extern GLboolean r600CreateContext(gl_api api, - const __GLcontextModes * glVisual, + const struct gl_config * glVisual, __DRIcontext * driContextPriv, void *sharedContextPrivate); @@ -232,10 +232,10 @@ extern void r700WaitForIdleClean(context_t *context); extern void r700Start3D(context_t *context); extern void r600InitAtoms(context_t *context); -extern void r700InitDraw(GLcontext *ctx); +extern void r700InitDraw(struct gl_context *ctx); extern void evergreenInitAtoms(context_t *context); -extern void evergreenInitDraw(GLcontext *ctx); +extern void evergreenInitDraw(struct gl_context *ctx); #define RADEON_D_CAPTURE 0 #define RADEON_D_PLAYBACK 1 diff --git a/src/mesa/drivers/dri/r600/r600_emit.c b/src/mesa/drivers/dri/r600/r600_emit.c index a840106c14..53ece9a350 100644 --- a/src/mesa/drivers/dri/r600/r600_emit.c +++ b/src/mesa/drivers/dri/r600/r600_emit.c @@ -49,7 +49,7 @@ void r600EmitCacheFlush(context_t *rmesa) { } -GLboolean r600AllocShaderConsts(GLcontext * ctx, +GLboolean r600AllocShaderConsts(struct gl_context * ctx, void ** constbo, int sizeinBYTE, char * szShaderUsage) @@ -93,7 +93,7 @@ shader_again_alloc: return GL_TRUE; } -GLboolean r600EmitShaderConsts(GLcontext * ctx, +GLboolean r600EmitShaderConsts(struct gl_context * ctx, void * constbo, int bo_offset, GLvoid * data, @@ -114,7 +114,7 @@ GLboolean r600EmitShaderConsts(GLcontext * ctx, return GL_TRUE; } -GLboolean r600EmitShader(GLcontext * ctx, +GLboolean r600EmitShader(struct gl_context * ctx, void ** shaderbo, GLvoid * data, int sizeinDWORD, @@ -163,7 +163,7 @@ shader_again_alloc: return GL_TRUE; } -GLboolean r600DeleteShader(GLcontext * ctx, +GLboolean r600DeleteShader(struct gl_context * ctx, void * shaderbo) { struct radeon_bo * pbo = (struct radeon_bo *)shaderbo; diff --git a/src/mesa/drivers/dri/r600/r600_emit.h b/src/mesa/drivers/dri/r600/r600_emit.h index 259561539f..c50b6060ca 100644 --- a/src/mesa/drivers/dri/r600/r600_emit.h +++ b/src/mesa/drivers/dri/r600/r600_emit.h @@ -43,20 +43,20 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. void r600EmitCacheFlush(context_t *rmesa); -extern GLboolean r600EmitShader(GLcontext * ctx, +extern GLboolean r600EmitShader(struct gl_context * ctx, void ** shaderbo, GLvoid * data, int sizeinDWORD, char * szShaderUsage); -extern GLboolean r600DeleteShader(GLcontext * ctx, +extern GLboolean r600DeleteShader(struct gl_context * ctx, void * shaderbo); -extern GLboolean r600AllocShaderConsts(GLcontext * ctx, +extern GLboolean r600AllocShaderConsts(struct gl_context * ctx, void ** constbo, int sizeinBYTE, char * szShaderUsage); -GLboolean r600EmitShaderConsts(GLcontext * ctx, +GLboolean r600EmitShaderConsts(struct gl_context * ctx, void * constbo, int bo_offset, GLvoid * data, diff --git a/src/mesa/drivers/dri/r600/r600_tex.c b/src/mesa/drivers/dri/r600/r600_tex.c index 512a52ede3..d6a58f410c 100644 --- a/src/mesa/drivers/dri/r600/r600_tex.c +++ b/src/mesa/drivers/dri/r600/r600_tex.c @@ -276,7 +276,7 @@ static void r600SetTexBorderColor(radeonTexObjPtr t, const GLfloat color[4]) * next UpdateTextureState */ -static void r600TexParameter(GLcontext * ctx, GLenum target, +static void r600TexParameter(struct gl_context * ctx, GLenum target, struct gl_texture_object *texObj, GLenum pname, const GLfloat * params) { @@ -332,7 +332,7 @@ static void r600TexParameter(GLcontext * ctx, GLenum target, } } -static void r600DeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj) +static void r600DeleteTexture(struct gl_context * ctx, struct gl_texture_object *texObj) { context_t* rmesa = R700_CONTEXT(ctx); radeonTexObj* t = radeon_tex_obj(texObj); @@ -368,7 +368,7 @@ static void r600DeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj) * allocate the default texture objects. * Fixup MaxAnisotropy according to user preference. */ -static struct gl_texture_object *r600NewTextureObject(GLcontext * ctx, +static struct gl_texture_object *r600NewTextureObject(struct gl_context * ctx, GLuint name, GLenum target) { diff --git a/src/mesa/drivers/dri/r600/r600_tex.h b/src/mesa/drivers/dri/r600/r600_tex.h index 771affdfa6..256588429e 100644 --- a/src/mesa/drivers/dri/r600/r600_tex.h +++ b/src/mesa/drivers/dri/r600/r600_tex.h @@ -56,7 +56,7 @@ extern void r600SetTexOffset(__DRIcontext *pDRICtx, GLint texname, unsigned long long offset, GLint depth, GLuint pitch); -extern GLboolean r600ValidateBuffers(GLcontext * ctx); +extern GLboolean r600ValidateBuffers(struct gl_context * ctx); extern void r600InitTextureFuncs(radeonContextPtr radeon, struct dd_function_table *functions); diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index fd928cfe5d..3869768bf0 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -52,9 +52,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "evergreen_tex.h" -void r600UpdateTextureState(GLcontext * ctx); +void r600UpdateTextureState(struct gl_context * ctx); -void r600UpdateTextureState(GLcontext * ctx) +void r600UpdateTextureState(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -707,7 +707,7 @@ void r600SetDepthTexMode(struct gl_texture_object *tObj) * \param rmesa Context pointer * \param t the r300 texture object */ -static GLboolean setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texObj, int unit) +static GLboolean setup_hardware_state(struct gl_context * ctx, struct gl_texture_object *texObj, int unit) { context_t *rmesa = R700_CONTEXT(ctx); radeonTexObj *t = radeon_tex_obj(texObj); @@ -803,7 +803,7 @@ static GLboolean setup_hardware_state(GLcontext * ctx, struct gl_texture_object * * Mostly this means populating the texture object's mipmap tree. */ -static GLboolean r600_validate_texture(GLcontext * ctx, struct gl_texture_object *texObj, int unit) +static GLboolean r600_validate_texture(struct gl_context * ctx, struct gl_texture_object *texObj, int unit) { radeonTexObj *t = radeon_tex_obj(texObj); @@ -822,7 +822,7 @@ static GLboolean r600_validate_texture(GLcontext * ctx, struct gl_texture_object /** * Ensure all enabled and complete textures are uploaded along with any buffers being used. */ -GLboolean r600ValidateBuffers(GLcontext * ctx) +GLboolean r600ValidateBuffers(struct gl_context * ctx) { context_t *rmesa = R700_CONTEXT(ctx); struct radeon_renderbuffer *rrb; diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 3bb194eb6d..4ec2845ab4 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -39,7 +39,7 @@ #include "radeon_mipmap_tree.h" -static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendTexState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -104,7 +104,7 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom) #define SAMPLER_STRIDE 3 -static void r700SendTexSamplerState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendTexSamplerState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -141,7 +141,7 @@ static void r700SendTexSamplerState(GLcontext *ctx, struct radeon_state_atom *at } } -static void r700SendTexBorderColorState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendTexBorderColorState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -167,7 +167,7 @@ static void r700SendTexBorderColorState(GLcontext *ctx, struct radeon_state_atom } extern int getTypeSize(GLenum type); -static void r700SetupVTXConstants(GLcontext * ctx, +static void r700SetupVTXConstants(struct gl_context * ctx, void * pAos, StreamDesc * pStreamDesc) { @@ -243,7 +243,7 @@ static void r700SetupVTXConstants(GLcontext * ctx, } -static void r700SendVTXState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendVTXState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); struct r700_vertex_program *vp = context->selected_vp; @@ -599,7 +599,7 @@ static void r700SetDepthTarget(context_t *context) /* r700->DB_PREFETCH_LIMIT.bits.DEPTH_HEIGHT_TILE_MAX = (context->currentDraw->h >> 3) - 1; */ /* z buffer sie may much bigger than what need, so use actual used h. */ } -static void r700SendDepthTargetState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendDepthTargetState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -646,7 +646,7 @@ static void r700SendDepthTargetState(GLcontext *ctx, struct radeon_state_atom *a } -static void r700SendRenderTargetState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendRenderTargetState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -724,7 +724,7 @@ static void r700SendRenderTargetState(GLcontext *ctx, struct radeon_state_atom * } -static void r700SendPSState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendPSState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -766,7 +766,7 @@ static void r700SendPSState(GLcontext *ctx, struct radeon_state_atom *atom) } -static void r700SendVSState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendVSState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -827,7 +827,7 @@ static void r700SendVSState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendFSState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendFSState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -869,7 +869,7 @@ static void r700SendFSState(GLcontext *ctx, struct radeon_state_atom *atom) } -static void r700SendViewportState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendViewportState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -903,7 +903,7 @@ static void r700SendViewportState(GLcontext *ctx, struct radeon_state_atom *atom } -static void r700SendSQConfig(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendSQConfig(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -940,7 +940,7 @@ static void r700SendSQConfig(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendUCPState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendUCPState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -962,7 +962,7 @@ static void r700SendUCPState(GLcontext *ctx, struct radeon_state_atom *atom) } } -static void r700SendSPIState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendSPIState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1037,7 +1037,7 @@ static void r700SendSPIState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendVGTState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendVGTState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1083,7 +1083,7 @@ static void r700SendVGTState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendSXState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendSXState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1098,7 +1098,7 @@ static void r700SendSXState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendDBState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendDBState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1124,7 +1124,7 @@ static void r700SendDBState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendStencilState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendStencilState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1138,7 +1138,7 @@ static void r700SendStencilState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendCBState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendCBState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1168,7 +1168,7 @@ static void r700SendCBState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendCBCLRCMPState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendCBCLRCMPState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1184,7 +1184,7 @@ static void r700SendCBCLRCMPState(GLcontext *ctx, struct radeon_state_atom *atom COMMIT_BATCH(); } -static void r700SendCBBlendState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendCBBlendState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1216,7 +1216,7 @@ static void r700SendCBBlendState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendCBBlendColorState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendCBBlendColorState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1233,7 +1233,7 @@ static void r700SendCBBlendColorState(GLcontext *ctx, struct radeon_state_atom * COMMIT_BATCH(); } -static void r700SendSUState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendSUState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1251,7 +1251,7 @@ static void r700SendSUState(GLcontext *ctx, struct radeon_state_atom *atom) } -static void r700SendPolyState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendPolyState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1271,7 +1271,7 @@ static void r700SendPolyState(GLcontext *ctx, struct radeon_state_atom *atom) } -static void r700SendCLState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendCLState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1287,7 +1287,7 @@ static void r700SendCLState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendGBState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendGBState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1303,7 +1303,7 @@ static void r700SendGBState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendScissorState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendScissorState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1336,7 +1336,7 @@ static void r700SendScissorState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendSCState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendSCState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1353,7 +1353,7 @@ static void r700SendSCState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendAAState(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendAAState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1368,7 +1368,7 @@ static void r700SendAAState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendPSConsts(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendPSConsts(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1392,7 +1392,7 @@ static void r700SendPSConsts(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendVSConsts(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendVSConsts(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); @@ -1417,7 +1417,7 @@ static void r700SendVSConsts(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } -static void r700SendQueryBegin(GLcontext *ctx, struct radeon_state_atom *atom) +static void r700SendQueryBegin(struct gl_context *ctx, struct radeon_state_atom *atom) { radeonContextPtr radeon = RADEON_CONTEXT(ctx); struct radeon_query_object *query = radeon->query.current; @@ -1443,12 +1443,12 @@ static void r700SendQueryBegin(GLcontext *ctx, struct radeon_state_atom *atom) query->emitted_begin = GL_TRUE; } -static int check_always(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_always(struct gl_context *ctx, struct radeon_state_atom *atom) { return atom->cmd_size; } -static int check_cb(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_cb(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); int count = 7; @@ -1460,7 +1460,7 @@ static int check_cb(GLcontext *ctx, struct radeon_state_atom *atom) return count; } -static int check_blnd(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_blnd(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1485,7 +1485,7 @@ static int check_blnd(GLcontext *ctx, struct radeon_state_atom *atom) return count; } -static int check_ucp(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_ucp(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1500,7 +1500,7 @@ static int check_ucp(GLcontext *ctx, struct radeon_state_atom *atom) return count; } -static int check_vtx(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_vtx(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); int count = context->radeon.tcl.aos_count * 18; @@ -1509,7 +1509,7 @@ static int check_vtx(GLcontext *ctx, struct radeon_state_atom *atom) return count; } -static int check_tx(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_tx(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); unsigned int i, count = 0; @@ -1526,7 +1526,7 @@ static int check_tx(GLcontext *ctx, struct radeon_state_atom *atom) return count * 31; } -static int check_ps_consts(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_ps_consts(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1539,7 +1539,7 @@ static int check_ps_consts(GLcontext *ctx, struct radeon_state_atom *atom) return count; } -static int check_vs_consts(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_vs_consts(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1552,7 +1552,7 @@ static int check_vs_consts(GLcontext *ctx, struct radeon_state_atom *atom) return count; } -static int check_queryobj(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_queryobj(struct gl_context *ctx, struct radeon_state_atom *atom) { radeonContextPtr radeon = RADEON_CONTEXT(ctx); struct radeon_query_object *query = radeon->query.current; diff --git a/src/mesa/drivers/dri/r600/r700_clear.c b/src/mesa/drivers/dri/r600/r700_clear.c index d1008f28b9..853dec9233 100644 --- a/src/mesa/drivers/dri/r600/r700_clear.c +++ b/src/mesa/drivers/dri/r600/r700_clear.c @@ -45,7 +45,7 @@ static GLboolean r700ClearFast(context_t *context, GLbitfield mask) return GL_FALSE; } -void r700Clear(GLcontext * ctx, GLbitfield mask) +void r700Clear(struct gl_context * ctx, GLbitfield mask) { context_t *context = R700_CONTEXT(ctx); radeonContextPtr radeon = &context->radeon; diff --git a/src/mesa/drivers/dri/r600/r700_clear.h b/src/mesa/drivers/dri/r600/r700_clear.h index bed1d3a90e..de372ee303 100644 --- a/src/mesa/drivers/dri/r600/r700_clear.h +++ b/src/mesa/drivers/dri/r600/r700_clear.h @@ -28,6 +28,6 @@ #ifndef __r700_CLEAR_H__ #define __r700_CLEAR_H__ -extern void r700Clear(GLcontext * ctx, GLbitfield mask); +extern void r700Clear(struct gl_context * ctx, GLbitfield mask); #endif /* __r700_CLEAR_H__ */ diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 217b0e27a4..2a6a39dfba 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -44,7 +44,7 @@ #include "r700_debug.h" -void insert_wpos_code(GLcontext *ctx, struct gl_fragment_program *fprog) +void insert_wpos_code(struct gl_context *ctx, struct gl_fragment_program *fprog) { static const gl_state_index winstate[STATE_LENGTH] = { STATE_INTERNAL, STATE_FB_SIZE, 0, 0, 0}; @@ -95,7 +95,7 @@ void insert_wpos_code(GLcontext *ctx, struct gl_fragment_program *fprog) //TODO : Validate FP input with VP output. void Map_Fragment_Program(r700_AssemblerBase *pAsm, struct gl_fragment_program *mesa_fp, - GLcontext *ctx) + struct gl_context *ctx) { unsigned int unBit; unsigned int i; @@ -353,7 +353,7 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, struct gl_fragment_program *mesa_fp, - GLcontext *ctx) + struct gl_context *ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -466,7 +466,7 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, return GL_TRUE; } -void r700SelectFragmentShader(GLcontext *ctx) +void r700SelectFragmentShader(struct gl_context *ctx) { context_t *context = R700_CONTEXT(ctx); struct r700_fragment_program *fp = (struct r700_fragment_program *) @@ -480,7 +480,7 @@ void r700SelectFragmentShader(GLcontext *ctx) r700TranslateFragmentShader(fp, &(fp->mesa_program), ctx); } -void * r700GetActiveFpShaderBo(GLcontext * ctx) +void * r700GetActiveFpShaderBo(struct gl_context * ctx) { struct r700_fragment_program *fp = (struct r700_fragment_program *) (ctx->FragmentProgram._Current); @@ -488,7 +488,7 @@ void * r700GetActiveFpShaderBo(GLcontext * ctx) return fp->shaderbo; } -void * r700GetActiveFpShaderConstBo(GLcontext * ctx) +void * r700GetActiveFpShaderConstBo(struct gl_context * ctx) { struct r700_fragment_program *fp = (struct r700_fragment_program *) (ctx->FragmentProgram._Current); @@ -496,7 +496,7 @@ void * r700GetActiveFpShaderConstBo(GLcontext * ctx) return fp->constbo0; } -GLboolean r700SetupFragmentProgram(GLcontext * ctx) +GLboolean r700SetupFragmentProgram(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.h b/src/mesa/drivers/dri/r600/r700_fragprog.h index aaa6043d5d..bdb95ff0e7 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.h +++ b/src/mesa/drivers/dri/r600/r700_fragprog.h @@ -51,25 +51,25 @@ struct r700_fragment_program }; /* Internal */ -void insert_wpos_code(GLcontext *ctx, struct gl_fragment_program *fprog); +void insert_wpos_code(struct gl_context *ctx, struct gl_fragment_program *fprog); void Map_Fragment_Program(r700_AssemblerBase *pAsm, struct gl_fragment_program *mesa_fp, - GLcontext *ctx); + struct gl_context *ctx); GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, struct gl_fragment_program *mesa_fp); GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, struct gl_fragment_program *mesa_vp, - GLcontext *ctx); + struct gl_context *ctx); /* Interface */ -extern void r700SelectFragmentShader(GLcontext *ctx); +extern void r700SelectFragmentShader(struct gl_context *ctx); -extern GLboolean r700SetupFragmentProgram(GLcontext * ctx); +extern GLboolean r700SetupFragmentProgram(struct gl_context * ctx); -extern void * r700GetActiveFpShaderBo(GLcontext * ctx); +extern void * r700GetActiveFpShaderBo(struct gl_context * ctx); -extern void * r700GetActiveFpShaderConstBo(GLcontext * ctx); +extern void * r700GetActiveFpShaderConstBo(struct gl_context * ctx); #endif /*_R700_FRAGPROG_H_*/ diff --git a/src/mesa/drivers/dri/r600/r700_oglprog.c b/src/mesa/drivers/dri/r600/r700_oglprog.c index e0c9179004..6ca7458003 100644 --- a/src/mesa/drivers/dri/r600/r700_oglprog.c +++ b/src/mesa/drivers/dri/r600/r700_oglprog.c @@ -40,7 +40,7 @@ #include "r700_vertprog.h" -static void freeVertProgCache(GLcontext *ctx, struct r700_vertex_program_cont *cache) +static void freeVertProgCache(struct gl_context *ctx, struct r700_vertex_program_cont *cache) { struct r700_vertex_program *tmp, *vp = cache->progs; @@ -64,7 +64,7 @@ static void freeVertProgCache(GLcontext *ctx, struct r700_vertex_program_cont *c } } -static struct gl_program *r700NewProgram(GLcontext * ctx, +static struct gl_program *r700NewProgram(struct gl_context * ctx, GLenum target, GLuint id) { @@ -109,7 +109,7 @@ static struct gl_program *r700NewProgram(GLcontext * ctx, return pProgram; } -static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog) +static void r700DeleteProgram(struct gl_context * ctx, struct gl_program *prog) { struct r700_vertex_program_cont *vpc = (struct r700_vertex_program_cont *)prog; struct r700_fragment_program * fp; @@ -147,7 +147,7 @@ static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog) } static GLboolean -r700ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog) +r700ProgramStringNotify(struct gl_context * ctx, GLenum target, struct gl_program *prog) { struct r700_vertex_program_cont *vpc = (struct r700_vertex_program_cont *)prog; struct r700_fragment_program * fp = (struct r700_fragment_program*)prog; @@ -178,7 +178,7 @@ r700ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog) return GL_TRUE; } -static GLboolean r700IsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog) +static GLboolean r700IsProgramNative(struct gl_context * ctx, GLenum target, struct gl_program *prog) { return GL_TRUE; diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index f90c69c416..bb14a239b7 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -244,7 +244,7 @@ static int r700NumVerts(int num_verts, int prim) return num_verts - verts_off; } -static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, +static void r700RunRenderPrimitive(struct gl_context * ctx, int start, int end, int prim, GLint basevertex) { context_t *context = R700_CONTEXT(ctx); @@ -315,7 +315,7 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, COMMIT_BATCH(); } -static void r700RunRenderPrimitiveImmediate(GLcontext * ctx, int start, int end, int prim) +static void r700RunRenderPrimitiveImmediate(struct gl_context * ctx, int start, int end, int prim) { context_t *context = R700_CONTEXT(ctx); BATCH_LOCALS(&context->radeon); @@ -434,7 +434,7 @@ static void r700RunRenderPrimitiveImmediate(GLcontext * ctx, int start, int end, /* start 3d, idle, cb/db flush */ #define PRE_EMIT_STATE_BUFSZ 5 + 5 + 14 -static GLuint r700PredictRenderSize(GLcontext* ctx, +static GLuint r700PredictRenderSize(struct gl_context* ctx, const struct _mesa_prim *prim, const struct _mesa_index_buffer *ib, GLuint nr_prims) @@ -501,7 +501,7 @@ static GLuint r700PredictRenderSize(GLcontext* ctx, * Convert attribute data type to float * If the attribute uses named buffer object replace the bo with newly allocated bo */ -static void r700ConvertAttrib(GLcontext *ctx, int count, +static void r700ConvertAttrib(struct gl_context *ctx, int count, const struct gl_client_array *input, struct StreamDesc *attr) { @@ -580,7 +580,7 @@ static void r700ConvertAttrib(GLcontext *ctx, int count, } } -static void r700AlignDataToDword(GLcontext *ctx, +static void r700AlignDataToDword(struct gl_context *ctx, const struct gl_client_array *input, int count, struct StreamDesc *attr) @@ -622,7 +622,7 @@ static void r700AlignDataToDword(GLcontext *ctx, attr->stride = dst_stride; } -static void r700SetupStreams(GLcontext *ctx, const struct gl_client_array *input[], int count) +static void r700SetupStreams(struct gl_context *ctx, const struct gl_client_array *input[], int count) { context_t *context = R700_CONTEXT(ctx); GLuint stride; @@ -723,7 +723,7 @@ static void r700SetupStreams(GLcontext *ctx, const struct gl_client_array *input RADEON_GEM_DOMAIN_GTT, 0); } -static void r700FreeData(GLcontext *ctx) +static void r700FreeData(struct gl_context *ctx) { /* Need to zero tcl.aos[n].bo and tcl.elt_dma_bo * to prevent double unref in radeonReleaseArrays @@ -748,7 +748,7 @@ static void r700FreeData(GLcontext *ctx) } } -static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer *mesa_ind_buf) +static void r700FixupIndexBuffer(struct gl_context *ctx, const struct _mesa_index_buffer *mesa_ind_buf) { context_t *context = R700_CONTEXT(ctx); GLvoid *src_ptr; @@ -823,7 +823,7 @@ static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer } } -static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer *mesa_ind_buf) +static void r700SetupIndexBuffer(struct gl_context *ctx, const struct _mesa_index_buffer *mesa_ind_buf) { context_t *context = R700_CONTEXT(ctx); @@ -876,7 +876,7 @@ static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer } } -static GLboolean check_fallbacks(GLcontext *ctx) +static GLboolean check_fallbacks(struct gl_context *ctx) { if (ctx->RenderMode != GL_RENDER) return GL_TRUE; @@ -884,7 +884,7 @@ static GLboolean check_fallbacks(GLcontext *ctx) return GL_FALSE; } -static GLboolean r700TryDrawPrims(GLcontext *ctx, +static GLboolean r700TryDrawPrims(struct gl_context *ctx, const struct gl_client_array *arrays[], const struct _mesa_prim *prim, GLuint nr_prims, @@ -972,7 +972,7 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, return GL_TRUE; } -static void r700DrawPrims(GLcontext *ctx, +static void r700DrawPrims(struct gl_context *ctx, const struct gl_client_array *arrays[], const struct _mesa_prim *prim, GLuint nr_prims, @@ -1011,7 +1011,7 @@ static void r700DrawPrims(GLcontext *ctx, } } -void r700InitDraw(GLcontext *ctx) +void r700InitDraw(struct gl_context *ctx) { struct vbo_context *vbo = vbo_context(ctx); diff --git a/src/mesa/drivers/dri/r600/r700_shader.c b/src/mesa/drivers/dri/r600/r700_shader.c index 8b3ed5cd82..cbbfaed31c 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.c +++ b/src/mesa/drivers/dri/r600/r700_shader.c @@ -38,7 +38,7 @@ #include "r700_shader.h" -void r700ShaderInit(GLcontext * ctx) +void r700ShaderInit(struct gl_context * ctx) { } diff --git a/src/mesa/drivers/dri/r600/r700_shader.h b/src/mesa/drivers/dri/r600/r700_shader.h index 0599ffd901..183dd33525 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.h +++ b/src/mesa/drivers/dri/r600/r700_shader.h @@ -33,7 +33,7 @@ #include "r700_shaderinst.h" -void r700ShaderInit(GLcontext * ctx); +void r700ShaderInit(struct gl_context * ctx); typedef enum R700ShaderType { diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 925b4ffe6d..bd04a633b4 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -52,14 +52,14 @@ #include "r700_fragprog.h" #include "r700_vertprog.h" -void r600UpdateTextureState(GLcontext * ctx); -static void r700SetClipPlaneState(GLcontext * ctx, GLenum cap, GLboolean state); -static void r700UpdatePolygonMode(GLcontext * ctx); -static void r700SetPolygonOffsetState(GLcontext * ctx, GLboolean state); -static void r700SetStencilState(GLcontext * ctx, GLboolean state); -static void r700UpdateWindow(GLcontext * ctx, int id); - -void r700UpdateShaders(GLcontext * ctx) +void r600UpdateTextureState(struct gl_context * ctx); +static void r700SetClipPlaneState(struct gl_context * ctx, GLenum cap, GLboolean state); +static void r700UpdatePolygonMode(struct gl_context * ctx); +static void r700SetPolygonOffsetState(struct gl_context * ctx, GLboolean state); +static void r700SetStencilState(struct gl_context * ctx, GLboolean state); +static void r700UpdateWindow(struct gl_context * ctx, int id); + +void r700UpdateShaders(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); @@ -80,7 +80,7 @@ void r700UpdateShaders(GLcontext * ctx) /* * To correctly position primitives: */ -void r700UpdateViewportOffset(GLcontext * ctx) //------------------ +void r700UpdateViewportOffset(struct gl_context * ctx) //------------------ { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -106,7 +106,7 @@ void r700UpdateViewportOffset(GLcontext * ctx) //------------------ radeonUpdateScissor(ctx); } -void r700UpdateStateParameters(GLcontext * ctx, GLuint new_state) //-------------------- +void r700UpdateStateParameters(struct gl_context * ctx, GLuint new_state) //-------------------- { struct r700_fragment_program *fp = (struct r700_fragment_program *)ctx->FragmentProgram._Current; @@ -130,7 +130,7 @@ void r700UpdateStateParameters(GLcontext * ctx, GLuint new_state) //------------ /** * Called by Mesa after an internal state update. */ -static void r700InvalidateState(GLcontext * ctx, GLuint new_state) //------------------- +static void r700InvalidateState(struct gl_context * ctx, GLuint new_state) //------------------- { context_t *context = R700_CONTEXT(ctx); @@ -190,7 +190,7 @@ static void r700InvalidateState(GLcontext * ctx, GLuint new_state) //----------- context->radeon.NewGLState |= new_state; } -static void r700SetDBRenderState(GLcontext * ctx) +static void r700SetDBRenderState(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -245,13 +245,13 @@ static void r700SetDBRenderState(GLcontext * ctx) } } -void r700UpdateShaderStates(GLcontext * ctx) +void r700UpdateShaderStates(struct gl_context * ctx) { r700SetDBRenderState(ctx); r600UpdateTextureState(ctx); } -static void r700SetDepthState(GLcontext * ctx) +static void r700SetDepthState(struct gl_context * ctx) { struct radeon_renderbuffer *rrb; context_t *context = R700_CONTEXT(ctx); @@ -320,7 +320,7 @@ static void r700SetDepthState(GLcontext * ctx) } } -static void r700SetAlphaState(GLcontext * ctx) +static void r700SetAlphaState(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -368,7 +368,7 @@ static void r700SetAlphaState(GLcontext * ctx) } -static void r700AlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref) //--------------- +static void r700AlphaFunc(struct gl_context * ctx, GLenum func, GLfloat ref) //--------------- { (void)func; (void)ref; @@ -376,7 +376,7 @@ static void r700AlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref) //--------- } -static void r700BlendColor(GLcontext * ctx, const GLfloat cf[4]) //---------------- +static void r700BlendColor(struct gl_context * ctx, const GLfloat cf[4]) //---------------- { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -444,7 +444,7 @@ static int blend_factor(GLenum factor, GLboolean is_src) } } -static void r700SetBlendState(GLcontext * ctx) +static void r700SetBlendState(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -576,13 +576,13 @@ static void r700SetBlendState(GLcontext * ctx) } -static void r700BlendEquationSeparate(GLcontext * ctx, +static void r700BlendEquationSeparate(struct gl_context * ctx, GLenum modeRGB, GLenum modeA) //----------------- { r700SetBlendState(ctx); } -static void r700BlendFuncSeparate(GLcontext * ctx, +static void r700BlendFuncSeparate(struct gl_context * ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA) //------------------------ { @@ -637,7 +637,7 @@ static GLuint translate_logicop(GLenum logicop) * Used internally to update the r300->hw hardware state to match the * current OpenGL state. */ -static void r700SetLogicOpState(GLcontext *ctx) +static void r700SetLogicOpState(struct gl_context *ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&R700_CONTEXT(ctx)->hw); @@ -655,13 +655,13 @@ static void r700SetLogicOpState(GLcontext *ctx) * Called by Mesa when an application program changes the LogicOp state * via glLogicOp. */ -static void r700LogicOpcode(GLcontext *ctx, GLenum logicop) +static void r700LogicOpcode(struct gl_context *ctx, GLenum logicop) { if (RGBA_LOGICOP_ENABLED(ctx)) r700SetLogicOpState(ctx); } -static void r700UpdateCulling(GLcontext * ctx) +static void r700UpdateCulling(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&R700_CONTEXT(ctx)->hw); @@ -713,7 +713,7 @@ static void r700UpdateCulling(GLcontext * ctx) r700->PA_SU_SC_MODE_CNTL.u32All ^= FACE_bit; } -static void r700UpdateLineStipple(GLcontext * ctx) +static void r700UpdateLineStipple(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&R700_CONTEXT(ctx)->hw); @@ -730,7 +730,7 @@ static void r700UpdateLineStipple(GLcontext * ctx) } } -static void r700Enable(GLcontext * ctx, GLenum cap, GLboolean state) //------------------ +static void r700Enable(struct gl_context * ctx, GLenum cap, GLboolean state) //------------------ { context_t *context = R700_CONTEXT(ctx); @@ -794,7 +794,7 @@ static void r700Enable(GLcontext * ctx, GLenum cap, GLboolean state) //--------- /** * Handle glColorMask() */ -static void r700ColorMask(GLcontext * ctx, +static void r700ColorMask(struct gl_context * ctx, GLboolean r, GLboolean g, GLboolean b, GLboolean a) //------------------ { context_t *context = R700_CONTEXT(ctx); @@ -815,7 +815,7 @@ static void r700ColorMask(GLcontext * ctx, * * \note Mesa already filters redundant calls to this function. */ -static void r700DepthFunc(GLcontext * ctx, GLenum func) //-------------------- +static void r700DepthFunc(struct gl_context * ctx, GLenum func) //-------------------- { r700SetDepthState(ctx); } @@ -825,7 +825,7 @@ static void r700DepthFunc(GLcontext * ctx, GLenum func) //-------------------- * * \note Mesa already filters redundant calls to this function. */ -static void r700DepthMask(GLcontext * ctx, GLboolean mask) //------------------ +static void r700DepthMask(struct gl_context * ctx, GLboolean mask) //------------------ { r700SetDepthState(ctx); } @@ -835,7 +835,7 @@ static void r700DepthMask(GLcontext * ctx, GLboolean mask) //------------------ * * \note Mesa already filters redundant calls to this function. */ -static void r700CullFace(GLcontext * ctx, GLenum mode) //----------------- +static void r700CullFace(struct gl_context * ctx, GLenum mode) //----------------- { r700UpdateCulling(ctx); } @@ -843,7 +843,7 @@ static void r700CullFace(GLcontext * ctx, GLenum mode) //----------------- /* ============================================================= * Fog */ -static void r700Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param) //-------------- +static void r700Fogfv(struct gl_context * ctx, GLenum pname, const GLfloat * param) //-------------- { } @@ -852,13 +852,13 @@ static void r700Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param) //-- * * \note Mesa already filters redundant calls to this function. */ -static void r700FrontFace(GLcontext * ctx, GLenum mode) //------------------ +static void r700FrontFace(struct gl_context * ctx, GLenum mode) //------------------ { r700UpdateCulling(ctx); r700UpdatePolygonMode(ctx); } -static void r700ShadeModel(GLcontext * ctx, GLenum mode) //-------------------- +static void r700ShadeModel(struct gl_context * ctx, GLenum mode) //-------------------- { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -881,7 +881,7 @@ static void r700ShadeModel(GLcontext * ctx, GLenum mode) //-------------------- /* ============================================================= * Point state */ -static void r700PointSize(GLcontext * ctx, GLfloat size) +static void r700PointSize(struct gl_context * ctx, GLfloat size) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -903,7 +903,7 @@ static void r700PointSize(GLcontext * ctx, GLfloat size) } -static void r700PointParameter(GLcontext * ctx, GLenum pname, const GLfloat * param) //--------------- +static void r700PointParameter(struct gl_context * ctx, GLenum pname, const GLfloat * param) //--------------- { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -980,7 +980,7 @@ static int translate_stencil_op(int op) return 0; } -static void r700SetStencilState(GLcontext * ctx, GLboolean state) +static void r700SetStencilState(struct gl_context * ctx, GLboolean state) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1002,7 +1002,7 @@ static void r700SetStencilState(GLcontext * ctx, GLboolean state) } } -static void r700StencilFuncSeparate(GLcontext * ctx, GLenum face, +static void r700StencilFuncSeparate(struct gl_context * ctx, GLenum face, GLenum func, GLint ref, GLuint mask) //--------------------- { context_t *context = R700_CONTEXT(ctx); @@ -1032,7 +1032,7 @@ static void r700StencilFuncSeparate(GLcontext * ctx, GLenum face, } -static void r700StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask) //-------------- +static void r700StencilMaskSeparate(struct gl_context * ctx, GLenum face, GLuint mask) //-------------- { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1050,7 +1050,7 @@ static void r700StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask) / } -static void r700StencilOpSeparate(GLcontext * ctx, GLenum face, +static void r700StencilOpSeparate(struct gl_context * ctx, GLenum face, GLenum fail, GLenum zfail, GLenum zpass) //-------------------- { context_t *context = R700_CONTEXT(ctx); @@ -1074,7 +1074,7 @@ static void r700StencilOpSeparate(GLcontext * ctx, GLenum face, STENCILZPASS_BF_shift, STENCILZPASS_BF_mask); } -static void r700UpdateWindow(GLcontext * ctx, int id) //-------------------- +static void r700UpdateWindow(struct gl_context * ctx, int id) //-------------------- { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1131,7 +1131,7 @@ static void r700UpdateWindow(GLcontext * ctx, int id) //-------------------- } -static void r700Viewport(GLcontext * ctx, +static void r700Viewport(struct gl_context * ctx, GLint x, GLint y, GLsizei width, @@ -1142,12 +1142,12 @@ static void r700Viewport(GLcontext * ctx, radeon_viewport(ctx, x, y, width, height); } -static void r700DepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) //------------- +static void r700DepthRange(struct gl_context * ctx, GLclampd nearval, GLclampd farval) //------------- { r700UpdateWindow(ctx, 0); } -static void r700LineWidth(GLcontext * ctx, GLfloat widthf) //--------------- +static void r700LineWidth(struct gl_context * ctx, GLfloat widthf) //--------------- { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1161,7 +1161,7 @@ static void r700LineWidth(GLcontext * ctx, GLfloat widthf) //--------------- PA_SU_LINE_CNTL__WIDTH_shift, PA_SU_LINE_CNTL__WIDTH_mask); } -static void r700LineStipple(GLcontext *ctx, GLint factor, GLushort pattern) +static void r700LineStipple(struct gl_context *ctx, GLint factor, GLushort pattern) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1173,7 +1173,7 @@ static void r700LineStipple(GLcontext *ctx, GLint factor, GLushort pattern) SETfield(r700->PA_SC_LINE_STIPPLE.u32All, 1, AUTO_RESET_CNTL_shift, AUTO_RESET_CNTL_mask); } -static void r700SetPolygonOffsetState(GLcontext * ctx, GLboolean state) +static void r700SetPolygonOffsetState(struct gl_context * ctx, GLboolean state) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1191,7 +1191,7 @@ static void r700SetPolygonOffsetState(GLcontext * ctx, GLboolean state) } } -static void r700PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) //-------------- +static void r700PolygonOffset(struct gl_context * ctx, GLfloat factor, GLfloat units) //-------------- { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1221,7 +1221,7 @@ static void r700PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) // r700->PA_SU_POLY_OFFSET_BACK_OFFSET.f32All = constant; } -static void r700UpdatePolygonMode(GLcontext * ctx) +static void r700UpdatePolygonMode(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1276,7 +1276,7 @@ static void r700UpdatePolygonMode(GLcontext * ctx) } } -static void r700PolygonMode(GLcontext * ctx, GLenum face, GLenum mode) //------------------ +static void r700PolygonMode(struct gl_context * ctx, GLenum face, GLenum mode) //------------------ { (void)face; (void)mode; @@ -1284,11 +1284,11 @@ static void r700PolygonMode(GLcontext * ctx, GLenum face, GLenum mode) //------- r700UpdatePolygonMode(ctx); } -static void r700RenderMode(GLcontext * ctx, GLenum mode) //--------------------- +static void r700RenderMode(struct gl_context * ctx, GLenum mode) //--------------------- { } -static void r700ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq ) +static void r700ClipPlane( struct gl_context *ctx, GLenum plane, const GLfloat *eq ) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1306,7 +1306,7 @@ static void r700ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq ) r700->ucp[p].PA_CL_UCP_0_W.u32All = ip[3]; } -static void r700SetClipPlaneState(GLcontext * ctx, GLenum cap, GLboolean state) +static void r700SetClipPlaneState(struct gl_context * ctx, GLenum cap, GLboolean state) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1428,7 +1428,7 @@ void r700SetScissor(context_t *context) //--------------- r700->viewport[id].enabled = GL_TRUE; } -static void r700InitSQConfig(GLcontext * ctx) +static void r700InitSQConfig(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1635,7 +1635,7 @@ static void r700InitSQConfig(GLcontext * ctx) * Assumes that the command buffer and state atoms have been * initialized already. */ -void r700InitState(GLcontext * ctx) //------------------- +void r700InitState(struct gl_context * ctx) //------------------- { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); diff --git a/src/mesa/drivers/dri/r600/r700_state.h b/src/mesa/drivers/dri/r600/r700_state.h index 56885e0b15..2d51198c8a 100644 --- a/src/mesa/drivers/dri/r600/r700_state.h +++ b/src/mesa/drivers/dri/r600/r700_state.h @@ -33,13 +33,13 @@ #include "r700_chip.h" -extern void r700UpdateStateParameters(GLcontext * ctx, GLuint new_state); -extern void r700UpdateShaders (GLcontext * ctx); -extern void r700UpdateShaderStates(GLcontext * ctx); +extern void r700UpdateStateParameters(struct gl_context * ctx, GLuint new_state); +extern void r700UpdateShaders (struct gl_context * ctx); +extern void r700UpdateShaderStates(struct gl_context * ctx); -extern void r700UpdateViewportOffset(GLcontext * ctx); +extern void r700UpdateViewportOffset(struct gl_context * ctx); -extern void r700InitState (GLcontext * ctx); +extern void r700InitState (struct gl_context * ctx); extern void r700InitStateFuncs (radeonContextPtr radeon, struct dd_function_table *functions); extern void r700SetScissor(context_t *context); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 2fee5b4433..7ba49d8f98 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -170,7 +170,7 @@ GLboolean Process_Vertex_Program_Vfetch_Instructions( } GLboolean Process_Vertex_Program_Vfetch_Instructions2( - GLcontext *ctx, + struct gl_context *ctx, struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp) { @@ -197,7 +197,7 @@ GLboolean Process_Vertex_Program_Vfetch_Instructions2( return GL_TRUE; } -void Map_Vertex_Program(GLcontext *ctx, +void Map_Vertex_Program(struct gl_context *ctx, struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp) { @@ -293,7 +293,7 @@ GLboolean Find_Instruction_Dependencies_vp(struct r700_vertex_program *vp, return GL_TRUE; } -struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, +struct r700_vertex_program* r700TranslateVertexShader(struct gl_context *ctx, struct gl_vertex_program *mesa_vp) { context_t *context = R700_CONTEXT(ctx); @@ -385,7 +385,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, return vp; } -void r700SelectVertexShader(GLcontext *ctx) +void r700SelectVertexShader(struct gl_context *ctx) { context_t *context = R700_CONTEXT(ctx); struct r700_vertex_program_cont *vpc; @@ -459,7 +459,7 @@ int getTypeSize(GLenum type) } } -static void r700TranslateAttrib(GLcontext *ctx, GLuint unLoc, int count, const struct gl_client_array *input) +static void r700TranslateAttrib(struct gl_context *ctx, GLuint unLoc, int count, const struct gl_client_array *input) { context_t *context = R700_CONTEXT(ctx); @@ -545,7 +545,7 @@ static void r700TranslateAttrib(GLcontext *ctx, GLuint unLoc, int count, const s context->nNumActiveAos++; } -void r700SetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], int count) +void r700SetVertexFormat(struct gl_context *ctx, const struct gl_client_array *arrays[], int count) { context_t *context = R700_CONTEXT(ctx); struct r700_vertex_program *vpc @@ -574,7 +574,7 @@ void r700SetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], context->radeon.tcl.aos_count = context->nNumActiveAos; } -void * r700GetActiveVpShaderBo(GLcontext * ctx) +void * r700GetActiveVpShaderBo(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); struct r700_vertex_program *vp = context->selected_vp;; @@ -585,7 +585,7 @@ void * r700GetActiveVpShaderBo(GLcontext * ctx) return NULL; } -void * r700GetActiveVpShaderConstBo(GLcontext * ctx) +void * r700GetActiveVpShaderConstBo(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); struct r700_vertex_program *vp = context->selected_vp;; @@ -596,7 +596,7 @@ void * r700GetActiveVpShaderConstBo(GLcontext * ctx) return NULL; } -GLboolean r700SetupVertexProgram(GLcontext * ctx) +GLboolean r700SetupVertexProgram(struct gl_context * ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.h b/src/mesa/drivers/dri/r600/r700_vertprog.h index 9acdc8e350..859afb6e97 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.h +++ b/src/mesa/drivers/dri/r600/r700_vertprog.h @@ -80,27 +80,27 @@ GLboolean Process_Vertex_Program_Vfetch_Instructions( struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); GLboolean Process_Vertex_Program_Vfetch_Instructions2( - GLcontext *ctx, + struct gl_context *ctx, struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); -void Map_Vertex_Program(GLcontext *ctx, +void Map_Vertex_Program(struct gl_context *ctx, struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); GLboolean Find_Instruction_Dependencies_vp(struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); -struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, +struct r700_vertex_program* r700TranslateVertexShader(struct gl_context *ctx, struct gl_vertex_program *mesa_vp); /* Interface */ -extern void r700SelectVertexShader(GLcontext *ctx); -extern void r700SetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], int count); +extern void r700SelectVertexShader(struct gl_context *ctx); +extern void r700SetVertexFormat(struct gl_context *ctx, const struct gl_client_array *arrays[], int count); -extern GLboolean r700SetupVertexProgram(GLcontext * ctx); +extern GLboolean r700SetupVertexProgram(struct gl_context * ctx); -extern void * r700GetActiveVpShaderBo(GLcontext * ctx); +extern void * r700GetActiveVpShaderBo(struct gl_context * ctx); -extern void * r700GetActiveVpShaderConstBo(GLcontext * ctx); +extern void * r700GetActiveVpShaderConstBo(struct gl_context * ctx); extern int getTypeSize(GLenum type); |