summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_context.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c52
1 files changed, 20 insertions, 32 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 397a9bd3f5..b4e2619929 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -31,7 +31,6 @@
#include "brw_context.h"
-#include "brw_aub.h"
#include "brw_defines.h"
#include "brw_draw.h"
#include "brw_vs.h"
@@ -39,33 +38,35 @@
#include "intel_tex.h"
#include "intel_blit.h"
#include "intel_batchbuffer.h"
+#include "intel_pixel.h"
+#include "intel_span.h"
+#include "tnl/t_pipeline.h"
#include "utils.h"
#include "api_noop.h"
#include "vtxfmt.h"
+#include "shader/shader_api.h"
+
/***************************************
* Mesa's Driver Functions
***************************************/
-static const struct dri_extension brw_extensions[] =
+static void brwUseProgram(GLcontext *ctx, GLuint program)
{
- { "GL_ARB_depth_texture", NULL },
- { "GL_ARB_fragment_program", NULL },
- { "GL_ARB_shadow", NULL },
- { "GL_EXT_shadow_funcs", NULL },
- /* ARB extn won't work if not enabled */
- { "GL_SGIX_depth_texture", NULL },
- { "GL_ARB_texture_env_crossbar", NULL },
- { NULL, NULL }
-};
-
+ _mesa_use_program(ctx, program);
+}
+static void brwInitProgFuncs( struct dd_function_table *functions )
+{
+ functions->UseProgram = brwUseProgram;
+}
static void brwInitDriverFunctions( struct dd_function_table *functions )
{
intelInitDriverFunctions( functions );
- brwInitTextureFuncs( functions );
+
brwInitFragProgFuncs( functions );
+ brwInitProgFuncs( functions );
}
@@ -116,10 +117,15 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
return GL_FALSE;
}
+ /* Initialize swrast, tnl driver tables: */
+ intelInitSpanFuncs(ctx);
+
+ TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline;
+
ctx->Const.MaxTextureUnits = BRW_MAX_TEX_UNIT;
ctx->Const.MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
ctx->Const.MaxTextureCoordUnits = BRW_MAX_TEX_UNIT;
-
+ ctx->Const.MaxVertexTextureImageUnits = 0; /* no vertex shader textures */
/* Advertise the full hardware capabilities. The new memory
* manager should cope much better with overload situations:
@@ -128,15 +134,9 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
ctx->Const.Max3DTextureLevels = 9;
ctx->Const.MaxCubeTextureLevels = 12;
ctx->Const.MaxTextureRectSize = (1<<11);
- ctx->Const.MaxTextureUnits = BRW_MAX_TEX_UNIT;
/* ctx->Const.MaxNativeVertexProgramTemps = 32; */
-
- driInitExtensions( ctx, brw_extensions, GL_FALSE );
-
- brw_aub_init( brw );
-
brw_init_attribs( brw );
brw_init_metaops( brw );
brw_init_state( brw );
@@ -144,8 +144,6 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
brw->state.dirty.mesa = ~0;
brw->state.dirty.brw = ~0;
- memset(&brw->wm.bind, ~0, sizeof(brw->wm.bind));
-
brw->emit_state_always = 0;
ctx->FragmentProgram._MaintainTexEnvProgram = 1;
@@ -154,16 +152,6 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
brw_ProgramCacheInit( ctx );
- brw_FrameBufferTexInit( brw );
-
- {
- const char *filename = getenv("INTEL_REPLAY");
- if (filename) {
- brw_playback_aubfile(brw, filename);
- exit(0);
- }
- }
-
return GL_TRUE;
}