X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fradeon%2Fradeon_context.c;h=7dd9109cca785e44242d8348a159291f64b809f1;hb=5e78433eec94fcaa87bdcb2526ec0910a69ed347;hp=f151747abcd4c466596be4f9d882b13cb1ebf79f;hpb=2b7a972e3f36bfcdc6fbe2b59d7ffdcde49c9405;p=mesa.git diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index f151747abcd..7dd9109cca7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -37,12 +37,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include "main/glheader.h" #include "main/api_arrayelt.h" +#include "main/api_exec.h" #include "main/context.h" #include "main/simple_list.h" #include "main/imports.h" #include "main/extensions.h" -#include "main/mfeatures.h" #include "main/version.h" +#include "main/vtxfmt.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -179,7 +180,7 @@ r100CreateContext( gl_api api, int tcl_mode, fthrottle_mode; switch (api) { - case API_OPENGL: + case API_OPENGL_COMPAT: if (major_version > 1 || minor_version > 3) { *error = __DRI_CTX_ERROR_BAD_VERSION; return GL_FALSE; @@ -251,16 +252,24 @@ r100CreateContext( gl_api api, rmesa->radeon.swtcl.RenderIndex = ~0; rmesa->radeon.hw.all_dirty = GL_TRUE; + ctx = &rmesa->radeon.glCtx; + /* Initialize the software rasterizer and helper modules. + */ + _swrast_CreateContext( ctx ); + _vbo_CreateContext( ctx ); + _tnl_CreateContext( ctx ); + _swsetup_CreateContext( ctx ); + _ae_create_context( ctx ); + /* Set the maximum texture size small enough that we can guarentee that * all texture units can bind a maximal texture and have all of them in * texturable memory at once. Depending on the allow_large_textures driconf * setting allow larger textures. */ - ctx = rmesa->radeon.glCtx; ctx->Const.MaxTextureUnits = driQueryOptioni (&rmesa->radeon.optionCache, "texture_units"); - ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits; + ctx->Const.FragmentProgram.MaxTextureImageUnits = ctx->Const.MaxTextureUnits; ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits; ctx->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxTextureUnits; @@ -307,14 +316,6 @@ r100CreateContext( gl_api api, _mesa_set_mvp_with_dp4( ctx, GL_TRUE ); - /* Initialize the software rasterizer and helper modules. - */ - _swrast_CreateContext( ctx ); - _vbo_CreateContext( ctx ); - _tnl_CreateContext( ctx ); - _swsetup_CreateContext( ctx ); - _ae_create_context( ctx ); - /* Install the customized pipeline: */ _tnl_destroy_pipeline( ctx ); @@ -353,20 +354,17 @@ r100CreateContext( gl_api api, ctx->Extensions.ATI_texture_mirror_once = true; ctx->Extensions.MESA_ycbcr_texture = true; ctx->Extensions.NV_blend_square = true; -#if FEATURE_OES_EGL_image ctx->Extensions.OES_EGL_image = true; -#endif - ctx->Extensions.EXT_framebuffer_object = true; - ctx->Extensions.ARB_texture_cube_map = true; - if (rmesa->radeon.glCtx->Mesa_DXTn) { + if (rmesa->radeon.glCtx.Mesa_DXTn) { ctx->Extensions.EXT_texture_compression_s3tc = true; - ctx->Extensions.S3_s3tc = true; + ctx->Extensions.ANGLE_texture_compression_dxt = true; } else if (driQueryOptionb (&rmesa->radeon.optionCache, "force_s3tc_enable")) { ctx->Extensions.EXT_texture_compression_s3tc = true; + ctx->Extensions.ANGLE_texture_compression_dxt = true; } ctx->Extensions.NV_texture_rectangle = true; @@ -407,7 +405,7 @@ r100CreateContext( gl_api api, rmesa->radeon.radeonScreen->chip_flags &= ~RADEON_CHIPSET_TCL; fprintf(stderr, "Disabling HW TCL support\n"); } - TCL_FALLBACK(rmesa->radeon.glCtx, RADEON_TCL_FALLBACK_TCL_DISABLE, 1); + TCL_FALLBACK(&rmesa->radeon.glCtx, RADEON_TCL_FALLBACK_TCL_DISABLE, 1); } if (rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL) { @@ -416,6 +414,10 @@ r100CreateContext( gl_api api, _mesa_compute_version(ctx); + /* Exec table initialization requires the version to be computed */ + _mesa_initialize_dispatch_tables(ctx); + _mesa_initialize_vbo_vtxfmt(ctx); + *error = __DRI_CTX_ERROR_SUCCESS; return GL_TRUE; }