From: Kenneth Graunke Date: Wed, 3 Jul 2013 01:05:48 +0000 (-0700) Subject: i965: Move ctx->Const setup from intelInitContext to the new helper. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=99ebf9d07a23b8c920912dc8289d97e17c753ee2;p=mesa.git i965: Move ctx->Const setup from intelInitContext to the new helper. This also requires moving _mesa_init_point() to after the ctx->Const initialization. Signed-off-by: Kenneth Graunke Acked-by: Chris Forbes Acked-by: Paul Berry Acked-by: Anuj Phogat --- diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 143463c3023..4507c54a7e5 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -33,6 +33,7 @@ #include "main/api_exec.h" #include "main/imports.h" #include "main/macros.h" +#include "main/points.h" #include "main/simple_list.h" #include "main/version.h" #include "main/vtxfmt.h" @@ -115,6 +116,8 @@ brw_initialize_context_constants(struct brw_context *brw) ctx->Const.QueryCounterBits.Timestamp = 36; + ctx->Const.StripTextureBorder = true; + ctx->Const.MaxDualSourceDrawBuffers = 1; ctx->Const.MaxDrawBuffers = BRW_MAX_DRAW_BUFFERS; ctx->Const.FragmentProgram.MaxTextureImageUnits = BRW_MAX_TEX_UNIT; @@ -142,6 +145,8 @@ brw_initialize_context_constants(struct brw_context *brw) ctx->Const.MaxTextureMaxAnisotropy = 16.0; + ctx->Const.MaxRenderbufferSize = 8192; + /* Hardware only supports a limited number of transform feedback buffers. * So we need to override the Mesa default (which is based only on software * limits). @@ -174,7 +179,20 @@ brw_initialize_context_constants(struct brw_context *brw) ctx->Const.MaxIntegerSamples = 8; } + ctx->Const.MinLineWidth = 1.0; + ctx->Const.MinLineWidthAA = 1.0; + ctx->Const.MaxLineWidth = 5.0; + ctx->Const.MaxLineWidthAA = 5.0; + ctx->Const.LineWidthGranularity = 0.5; + + ctx->Const.MinPointSize = 1.0; + ctx->Const.MinPointSizeAA = 1.0; + ctx->Const.MaxPointSize = 255.0; ctx->Const.MaxPointSizeAA = 255.0; + ctx->Const.PointSizeGranularity = 1.0; + + if (intel->gen >= 6) + ctx->Const.MaxClipPlanes = 8; ctx->Const.VertexProgram.MaxNativeInstructions = 16 * 1024; ctx->Const.VertexProgram.MaxAluInstructions = 0; @@ -292,6 +310,9 @@ brwCreateContext(int api, brw_initialize_context_constants(brw); + /* Reinitialize the context point state. It depends on ctx->Const values. */ + _mesa_init_point(ctx); + if (intel->gen >= 6) { /* Create a new hardware context. Using a hardware context means that * our GPU state will be saved/restored on context switch, allowing us diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c index ea7ea1424c6..358fa07e9f4 100644 --- a/src/mesa/drivers/dri/i965/intel_context.c +++ b/src/mesa/drivers/dri/i965/intel_context.c @@ -32,7 +32,6 @@ #include "main/fbobject.h" #include "main/framebuffer.h" #include "main/imports.h" -#include "main/points.h" #include "main/renderbuffer.h" #include "swrast/swrast.h" @@ -532,30 +531,6 @@ intelInitContext(struct intel_context *intel, break; } - ctx->Const.MinLineWidth = 1.0; - ctx->Const.MinLineWidthAA = 1.0; - ctx->Const.MaxLineWidth = 5.0; - ctx->Const.MaxLineWidthAA = 5.0; - ctx->Const.LineWidthGranularity = 0.5; - - ctx->Const.MinPointSize = 1.0; - ctx->Const.MinPointSizeAA = 1.0; - ctx->Const.MaxPointSize = 255.0; - ctx->Const.MaxPointSizeAA = 3.0; - ctx->Const.PointSizeGranularity = 1.0; - - if (intel->gen >= 6) - ctx->Const.MaxClipPlanes = 8; - - ctx->Const.StripTextureBorder = GL_TRUE; - - /* reinitialize the context point state. - * It depend on constants in __struct gl_contextRec::Const - */ - _mesa_init_point(ctx); - - ctx->Const.MaxRenderbufferSize = 8192; - /* Initialize the software rasterizer and helper modules. * * As of GL 3.1 core, the gen4+ driver doesn't need the swrast context for