From 064ae479a770bf434958d673baf6f7530f642697 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 23 Feb 2007 13:40:13 -0700 Subject: Update DRI drivers for new glsl compiler. Mostly: - update #includes - update STATE_* token code --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 2 +- src/mesa/drivers/dri/nouveau/nouveau_shader.c | 5 +++-- src/mesa/drivers/dri/nouveau/nouveau_shader_0.c | 16 ++++++++++------ src/mesa/drivers/dri/nouveau/nouveau_shader_2.c | 3 ++- 4 files changed, 16 insertions(+), 10 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index f811dc1b72e..6f1b57d74ed 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -195,7 +195,7 @@ GLboolean nouveauCreateContext( const __GLcontextModes *glVisual, nouveauShaderInitFuncs(ctx); /* Install Mesa's fixed-function texenv shader support */ if (nmesa->screen->card->type >= NV_40) - ctx->_MaintainTexEnvProgram = GL_TRUE; + ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; /* Initialize the swrast */ _swrast_CreateContext( ctx ); diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader.c b/src/mesa/drivers/dri/nouveau/nouveau_shader.c index ba471325aaa..bee8d5a9354 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_shader.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_shader.c @@ -35,9 +35,10 @@ #include "enums.h" #include "extensions.h" -#include "program.h" +#include "shader/program.h" +#include "shader/prog_instruction.h" +/*#include "shader/arbprogparse.h"*/ #include "tnl/tnl.h" -#include "shader/arbprogparse.h" #include "nouveau_context.h" #include "nouveau_shader.h" diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader_0.c b/src/mesa/drivers/dri/nouveau/nouveau_shader_0.c index 73c1f7c2a53..abba59dc0c2 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_shader_0.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_shader_0.c @@ -34,9 +34,10 @@ #include "macros.h" #include "enums.h" -#include "program.h" -#include "programopt.h" -#include "program_instruction.h" +#include "shader/prog_instruction.h" +#include "shader/prog_parameter.h" +#include "shader/prog_statevars.h" +#include "shader/programopt.h" #include "nouveau_context.h" #include "nouveau_shader.h" @@ -411,8 +412,10 @@ pass0_fixup_swizzle(nvsPtr nvs, nvsFragmentHeader *parent, int fpos, if (!rec->swzconst_done) { struct gl_program *prog = &nvs->mesa.vp.Base; + GLuint swizzle; rec->swzconst_id = _mesa_add_unnamed_constant(prog->Parameters, - sc, 4); + sc, 4, &swizzle); + /* XXX what about swizzle? */ rec->swzconst_done = 1; COPY_4V(nvs->params[rec->swzconst_id].val, sc); } @@ -818,7 +821,8 @@ pass0_vp_insert_ff_clip_planes(GLcontext *ctx, nouveauShader *nvs) nvsInstruction *nvsinst; GLuint fpos = 0; nvsRegister opos, epos, eqn, mv[4]; - GLint tokens[6] = { STATE_MATRIX, STATE_MODELVIEW, 0, 0, 0, 0 }; + gl_state_index tokens[STATE_LENGTH] + = { STATE_MODELVIEW_MATRIX, 0, 0, 0, 0 }; GLint id; int i; @@ -826,7 +830,7 @@ pass0_vp_insert_ff_clip_planes(GLcontext *ctx, nouveauShader *nvs) pass0_make_reg(nvs, &opos, NVS_FILE_ATTRIB, NVS_FR_POSITION); pass0_make_reg(nvs, &epos, NVS_FILE_TEMP , -1); for (i=0; i<4; i++) { - tokens[3] = tokens[4] = i; + tokens[2] = tokens[3] = i; id = _mesa_add_state_reference(prog->Parameters, tokens); pass0_make_reg(nvs, &mv[i], NVS_FILE_CONST, id); } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c b/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c index b043f877e42..6eb9de47769 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c @@ -34,7 +34,8 @@ #include "macros.h" #include "enums.h" -#include "program.h" +#include "shader/prog_parameter.h" +#include "shader/prog_print.h" #include "nouveau_context.h" #include "nouveau_shader.h" -- cgit v1.2.3