X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fi915%2Fi830_context.c;h=3da0745577627b788d7fbbe901349c2d6bf0ad20;hb=10f214e5b248e5dd5f323c689549cd66d2f6ad22;hp=09b1ec922ffc32d9e78539ea07497907a8c3eeb9;hpb=ee35de2dfb12415416817d417f59e676b34ea81b;p=mesa.git diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c index 09b1ec922ff..3da07455776 100644 --- a/src/mesa/drivers/dri/i915/i830_context.c +++ b/src/mesa/drivers/dri/i915/i830_context.c @@ -27,16 +27,13 @@ #include "i830_context.h" #include "main/imports.h" -#include "texmem.h" -#include "intel_tex.h" #include "tnl/tnl.h" #include "tnl/t_vertex.h" #include "tnl/t_context.h" #include "tnl/t_pipeline.h" -#include "utils.h" #include "intel_span.h" -#include "intel_pixel.h" #include "intel_tris.h" +#include "../glsl/ralloc.h" /*************************************** * Mesa's Driver Functions @@ -47,32 +44,35 @@ i830InitDriverFunctions(struct dd_function_table *functions) { intelInitDriverFunctions(functions); i830InitStateFuncs(functions); - i830InitTextureFuncs(functions); } extern const struct tnl_pipeline_stage *intel_pipeline[]; -GLboolean -i830CreateContext(const __GLcontextModes * mesaVis, - __DRIcontextPrivate * driContextPriv, +bool +i830CreateContext(const struct gl_config * mesaVis, + __DRIcontext * driContextPriv, void *sharedContextPrivate) { struct dd_function_table functions; - struct i830_context *i830 = CALLOC_STRUCT(i830_context); + struct i830_context *i830 = rzalloc(NULL, struct i830_context); struct intel_context *intel = &i830->intel; - GLcontext *ctx = &intel->ctx; + struct gl_context *ctx = &intel->ctx; if (!i830) - return GL_FALSE; + return false; i830InitVtbl(i830); i830InitDriverFunctions(&functions); - if (!intelInitContext(intel, mesaVis, driContextPriv, + if (!intelInitContext(intel, __DRI_API_OPENGL, mesaVis, driContextPriv, sharedContextPrivate, &functions)) { - FREE(i830); - return GL_FALSE; + free(i830); + return false; } + intel_init_texture_formats(ctx); + + _math_matrix_ctr(&intel->ViewportMatrix); + /* Initialize swrast, tnl driver tables: */ intelInitSpanFuncs(ctx); intelInitTriFuncs(ctx); @@ -97,16 +97,19 @@ i830CreateContext(const __GLcontextModes * mesaVis, ctx->Const.MaxTextureRectSize = (1 << 11); ctx->Const.MaxTextureUnits = I830_TEX_UNITS; + ctx->Const.MaxTextureMaxAnisotropy = 2.0; + + ctx->Const.MaxDrawBuffers = 1; + _tnl_init_vertices(ctx, ctx->Const.MaxArrayLockSize + 12, 18 * sizeof(GLfloat)); intel->verts = TNL_CONTEXT(ctx)->clipspace.vertex_buf; i830InitState(i830); - i830InitMetaFuncs(i830); _tnl_allow_vertex_fog(ctx, 1); _tnl_allow_pixel_fog(ctx, 0); - return GL_TRUE; + return true; }