They're now totally independent of the actual shaders.
Also, implemented in terms of pipe_buffer_handles/objects.
void draw_set_mapped_vertex_buffer(struct draw_context *draw,
unsigned attr, const void *buffer);
+void draw_set_mapped_constant_buffer(struct draw_context *draw,
+ const void *buffer);
void
draw_set_vertex_buffer(struct draw_context *draw,
NULL /*samplers*/ );
/* Consts does not require 16 byte alignment. */
- machine.Consts = draw->vertex_shader.constants->constant;
+ machine.Consts = (float (*)[4]) draw->mapped_constants;
machine.Inputs = ALIGN16_ASSIGN(inputs);
machine.Outputs = ALIGN16_ASSIGN(outputs);
}
+void draw_set_mapped_constant_buffer(struct draw_context *draw,
+ const void *buffer)
+{
+ draw->mapped_constants = buffer;
+}
+
+
unsigned
draw_prim_info(unsigned prim, unsigned *first, unsigned *incr)
{
unsigned eltSize; /**< bytes per index (0, 1, 2 or 4) */
/** The mapped vertex arrays */
const void *mapped_vbuffer[PIPE_ATTRIB_MAX];
+ /** The mapped constant buffers (for vertex shader) */
+ const void *mapped_constants;
/* Clip derived state:
*/
draw_set_mapped_element_buffer(draw, 0, NULL);
}
+ draw_set_mapped_constant_buffer(draw,
+ i915->current.constants[PIPE_SHADER_VERTEX]);
+
/* draw! */
draw_arrays(i915->draw, prim, start, count);
#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
#include "pipe/p_state.h"
-
#define I915_TEX_UNITS 8
#define I915_DYNAMIC_MODES4 0
#define I915_CACHE_CONSTANTS 5
#define I915_MAX_CACHE 6
+#define I915_MAX_CONSTANT 32
struct i915_cache_context;
unsigned immediate[I915_MAX_IMMEDIATE];
unsigned dynamic[I915_MAX_DYNAMIC];
+ float constants[PIPE_SHADER_TYPES][I915_MAX_CONSTANT][4];
+ /** number of constants passed in through a constant buffer */
+ uint num_user_constants[PIPE_SHADER_TYPES];
+ /** user constants, plus extra constants from shader translation */
+ uint num_constants[PIPE_SHADER_TYPES];
+
uint *program;
uint program_len;
- uint *constants;
- uint num_constants;
unsigned sampler[I915_TEX_UNITS][3];
unsigned sampler_enable_flags;
struct pipe_blend_color blend_color;
struct pipe_clear_color_state clear_color;
struct pipe_clip_state clip;
+ struct pipe_constant_buffer constants[PIPE_SHADER_TYPES];
struct pipe_depth_state depth_test;
struct pipe_framebuffer_state framebuffer;
struct pipe_shader_state fs;
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
- struct pipe_constant_buffer temp_constants; /*XXX temporary*/
-
unsigned dirty;
unsigned *batch_start;
#define I915_NEW_SAMPLER 0x400
#define I915_NEW_TEXTURE 0x800
#define I915_NEW_STENCIL 0x1000
+#define I915_NEW_CONSTANTS 0x2000
+
/* Driver's internally generated state flags:
*/
#define I915_PROGRAM_SIZE 192
-#define I915_MAX_CONSTANT 32
#define MAX_VARYING 8
uint declarations[I915_PROGRAM_SIZE];
uint program[I915_PROGRAM_SIZE];
- uint constant_flags[I915_MAX_CONSTANT];
-
- struct pipe_constant_buffer *constants;
+ /** points into the i915->current.constants array: */
+ float (*constants)[4];
+ uint num_constants;
+ uint constant_flags[I915_MAX_CONSTANT]; /**< status of each constant */
uint *csr; /* Cursor, points into program.
*/
if (p->constant_flags[reg] == I915_CONSTFLAG_PARAM)
continue;
for (idx = 0; idx < 4; idx++) {
-#if 0
- if (!(p->constant_flags[reg] & (1 << idx)) ||
- p->fp->constant[reg][idx] == c0) {
- p->fp->constant[reg][idx] = c0;
- p->constant_flags[reg] |= 1 << idx;
- if (reg + 1 > p->fp->nr_constants)
- p->fp->nr_constants = reg + 1;
- return swizzle(UREG(REG_TYPE_CONST, reg), idx, ZERO, ZERO, ONE);
- }
-#else
if (!(p->constant_flags[reg] & (1 << idx)) ||
- p->constants->constant[reg][idx] == c0) {
- p->constants->constant[reg][idx] = c0;
+ p->constants[reg][idx] == c0) {
+ p->constants[reg][idx] = c0;
p->constant_flags[reg] |= 1 << idx;
- if (reg + 1 > p->constants->nr_constants)
- p->constants->nr_constants = reg + 1;
+ if (reg + 1 > p->num_constants)
+ p->num_constants = reg + 1;
return swizzle(UREG(REG_TYPE_CONST, reg), idx, ZERO, ZERO, ONE);
}
-#endif
}
}
continue;
for (idx = 0; idx < 3; idx++) {
if (!(p->constant_flags[reg] & (3 << idx))) {
-#if 0
- p->fp->constant[reg][idx] = c0;
- p->fp->constant[reg][idx + 1] = c1;
+ p->constants[reg][idx + 0] = c0;
+ p->constants[reg][idx + 1] = c1;
p->constant_flags[reg] |= 3 << idx;
- if (reg + 1 > p->fp->nr_constants)
- p->fp->nr_constants = reg + 1;
- return swizzle(UREG(REG_TYPE_CONST, reg), idx, idx + 1, ZERO,
- ONE);
-#else
- p->constants->constant[reg][idx + 0] = c0;
- p->constants->constant[reg][idx + 1] = c1;
- p->constant_flags[reg] |= 3 << idx;
- if (reg + 1 > p->constants->nr_constants)
- p->constants->nr_constants = reg + 1;
- return swizzle(UREG(REG_TYPE_CONST, reg), idx, idx + 1, ZERO,
- ONE);
-#endif
+ if (reg + 1 > p->num_constants)
+ p->num_constants = reg + 1;
+ return swizzle(UREG(REG_TYPE_CONST, reg), idx, idx + 1, ZERO, ONE);
}
}
}
for (reg = 0; reg < I915_MAX_CONSTANT; reg++) {
if (p->constant_flags[reg] == 0xf &&
-#if 0
- p->fp->constant[reg][0] == c0 &&
- p->fp->constant[reg][1] == c1 &&
- p->fp->constant[reg][2] == c2 &&
- p->fp->constant[reg][3] == c3
-#else
- p->constants->constant[reg][0] == c0 &&
- p->constants->constant[reg][1] == c1 &&
- p->constants->constant[reg][2] == c2 &&
- p->constants->constant[reg][3] == c3
-#endif
- ) {
+ p->constants[reg][0] == c0 &&
+ p->constants[reg][1] == c1 &&
+ p->constants[reg][2] == c2 &&
+ p->constants[reg][3] == c3) {
return UREG(REG_TYPE_CONST, reg);
}
else if (p->constant_flags[reg] == 0) {
-#if 0
- p->fp->constant[reg][0] = c0;
- p->fp->constant[reg][1] = c1;
- p->fp->constant[reg][2] = c2;
- p->fp->constant[reg][3] = c3;
-#else
- p->constants->constant[reg][0] = c0;
- p->constants->constant[reg][1] = c1;
- p->constants->constant[reg][2] = c2;
- p->constants->constant[reg][3] = c3;
-#endif
+
+ p->constants[reg][0] = c0;
+ p->constants[reg][1] = c1;
+ p->constants[reg][2] = c2;
+ p->constants[reg][3] = c3;
p->constant_flags[reg] = 0xf;
-#if 0
- if (reg + 1 > p->fp->nr_constants)
- p->fp->nr_constants = reg + 1;
-#else
- if (reg + 1 > p->constants->nr_constants)
- p->constants->nr_constants = reg + 1;
-#endif
+ if (reg + 1 > p->num_constants)
+ p->num_constants = reg + 1;
return UREG(REG_TYPE_CONST, reg);
}
}
i915->current.program_len = Elements(passthrough);
}
- i915->current.constants = NULL;
- i915->current.num_constants = 0;
+ i915->current.num_constants[PIPE_SHADER_FRAGMENT] = 0;
+ i915->current.num_user_constants[PIPE_SHADER_FRAGMENT] = 0;
}
p->shader = &i915->fs;
- /* a bit of a hack, need to improve constant buffer infrastructure */
- if (i915->fs.constants)
- p->constants = i915->fs.constants;
- else
- p->constants = &i915->temp_constants;
+ /* new constants found during translation get appended after the
+ * user-provided constants.
+ */
+ p->constants = i915->current.constants[PIPE_SHADER_FRAGMENT];
+ p->num_constants = i915->current.num_user_constants[PIPE_SHADER_FRAGMENT];
p->nr_tex_indirect = 1; /* correct? */
p->nr_tex_insn = 0;
program_size * sizeof(uint));
}
- i915->current.constants = (uint *) p->constants->constant;
- i915->current.num_constants = p->constants->nr_constants;
+ /* update number of constants */
+ i915->current.num_constants[PIPE_SHADER_FRAGMENT] = p->num_constants;
+ assert(i915->current.num_constants[PIPE_SHADER_FRAGMENT]
+ >= i915->current.num_user_constants[PIPE_SHADER_FRAGMENT]);
}
/* Release the compilation struct:
#include "pipe/draw/draw_context.h"
+#include "pipe/p_winsys.h"
#include "i915_context.h"
#include "i915_state.h"
}
+static void i915_set_constant_buffer(struct pipe_context *pipe,
+ uint shader, uint index,
+ const struct pipe_constant_buffer *buf)
+{
+ struct i915_context *i915 = i915_context(pipe);
+ struct pipe_winsys *ws = pipe->winsys;
+
+ assert(shader < PIPE_SHADER_TYPES);
+ assert(index == 0);
+
+ /* Make a copy of shader constants.
+ * During fragment program translation we may add additional
+ * constants to the array.
+ *
+ * We want to consider the situation where some user constants
+ * (ex: a material color) may change frequently but the shader program
+ * stays the same. In that case we should only be updating the first
+ * N constants, leaving any extras from shader translation alone.
+ */
+ {
+ void *mapped;
+ if (buf->size &&
+ (mapped = ws->buffer_map(ws, buf->buffer, PIPE_BUFFER_FLAG_READ))) {
+ memcpy(i915->current.constants[shader], mapped, buf->size);
+ fprintf(stderr, "i915 problem: map of constant buffer failed\n");
+ ws->buffer_unmap(ws, buf->buffer);
+ i915->current.num_user_constants[shader]
+ = buf->size / (4 * sizeof(float));
+ }
+ else {
+ i915->current.num_user_constants[shader] = 0;
+ }
+ }
+
+ i915->dirty |= I915_NEW_CONSTANTS;
+}
+
+
static void i915_set_sampler_state(struct pipe_context *pipe,
unsigned unit,
const struct pipe_sampler_state *sampler)
i915->pipe.set_blend_state = i915_set_blend_state;
i915->pipe.set_clip_state = i915_set_clip_state;
i915->pipe.set_clear_color_state = i915_set_clear_color_state;
+ i915->pipe.set_constant_buffer = i915_set_constant_buffer;
i915->pipe.set_depth_state = i915_set_depth_test_state;
i915->pipe.set_framebuffer_state = i915_set_framebuffer_state;
i915->pipe.set_fs_state = i915_set_fs_state;
/* constants */
if (i915->hardware_dirty & I915_HW_PROGRAM)
{
- const uint nr = i915->current.num_constants;
+ const uint nr = i915->current.num_constants[PIPE_SHADER_FRAGMENT];
+ assert(nr <= I915_MAX_CONSTANT);
if (nr > 0) {
- const uint *c = (const uint *) i915->current.constants;
+ const uint *c
+ = (const uint *) i915->current.constants[PIPE_SHADER_FRAGMENT];
uint i;
OUT_BATCH( _3DSTATE_PIXEL_SHADER_CONSTANTS | (nr * 4) );
OUT_BATCH( (1 << (nr - 1)) | ((1 << (nr - 1)) - 1) );
void (*set_clear_color_state)( struct pipe_context *,
const struct pipe_clear_color_state * );
+ void (*set_constant_buffer)( struct pipe_context *,
+ uint shader, uint index,
+ const struct pipe_constant_buffer *buf );
+
void (*set_depth_state)( struct pipe_context *,
- const struct pipe_depth_state * );
+ const struct pipe_depth_state * );
void (*set_framebuffer_state)( struct pipe_context *,
const struct pipe_framebuffer_state * );
#define PIPE_FLUSH_TEXTURE_CACHE 0x2
+/**
+ * Shaders
+ */
+#define PIPE_SHADER_VERTEX 0
+#define PIPE_SHADER_FRAGMENT 1
+#define PIPE_SHADER_TYPES 2
+
+
/**
* Primitive types:
*/
};
+/**
+ * Constants for vertex/fragment shaders
+ */
struct pipe_constant_buffer {
- float constant[PIPE_MAX_CONSTANT][4];
- unsigned nr_constants;
+ struct pipe_buffer_handle *buffer;
+ unsigned size; /** in bytes */
};
unsigned inputs_read; /**< FRAG/VERT_ATTRIB_x */
unsigned outputs_written; /**< FRAG/VERT_RESULT_x */
const struct tgsi_token *tokens;
- struct pipe_constant_buffer *constants; /* XXX temporary? */
};
struct pipe_depth_state
softpipe->pipe.set_blend_state = softpipe_set_blend_state;
softpipe->pipe.set_clip_state = softpipe_set_clip_state;
softpipe->pipe.set_clear_color_state = softpipe_set_clear_color_state;
+ softpipe->pipe.set_constant_buffer = softpipe_set_constant_buffer;
softpipe->pipe.set_depth_state = softpipe_set_depth_test_state;
softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state;
softpipe->pipe.set_fs_state = softpipe_set_fs_state;
#include "pipe/p_state.h"
#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
#include "sp_quad.h"
#define SP_NEW_STENCIL 0x1000
#define SP_NEW_VERTEX 0x2000
#define SP_NEW_VS 0x4000
+#define SP_NEW_CONSTANTS 0x8000
struct softpipe_context {
struct pipe_blend_color blend_color;
struct pipe_clear_color_state clear_color;
struct pipe_clip_state clip;
+ struct pipe_constant_buffer constants[2];
struct pipe_depth_state depth_test;
struct pipe_framebuffer_state framebuffer;
struct pipe_shader_state fs;
* Mapped vertex buffers
*/
ubyte *mapped_vbuffer[PIPE_ATTRIB_MAX];
-
+
+ /** Mapped constant buffers */
+ void *mapped_constants[PIPE_SHADER_TYPES];
/* FS + setup derived state:
*/
+static void
+softpipe_map_constant_buffers(struct softpipe_context *sp)
+{
+ struct pipe_winsys *ws = sp->pipe.winsys;
+ uint i;
+ for (i = 0; i < 2; i++) {
+ if (sp->constants[i].size)
+ sp->mapped_constants[i] = ws->buffer_map(ws, sp->constants[i].buffer,
+ PIPE_BUFFER_FLAG_READ);
+ }
+
+ draw_set_mapped_constant_buffer(sp->draw,
+ sp->mapped_constants[PIPE_SHADER_VERTEX]);
+}
+
+static void
+softpipe_unmap_constant_buffers(struct softpipe_context *sp)
+{
+ struct pipe_winsys *ws = sp->pipe.winsys;
+ uint i;
+ for (i = 0; i < 2; i++) {
+ if (sp->constants[i].size)
+ ws->buffer_unmap(ws, sp->constants[i].buffer);
+ sp->mapped_constants[i] = NULL;
+ }
+}
+
+
boolean
softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
unsigned start, unsigned count)
softpipe_map_surfaces(sp);
+ softpipe_map_constant_buffers(sp);
+
/*
* Map vertex buffers
*/
}
softpipe_unmap_surfaces(sp);
+ softpipe_unmap_constant_buffers(sp);
return TRUE;
}
*/
#include "pipe/p_util.h"
+#include "pipe/p_defines.h"
#include "sp_context.h"
#include "sp_headers.h"
qss->samplers );
/* Consts does not require 16 byte alignment. */
- machine.Consts = softpipe->fs.constants->constant;
+ machine.Consts = softpipe->mapped_constants[PIPE_SHADER_FRAGMENT];
machine.Inputs = ALIGN16_ASSIGN(inputs);
machine.Outputs = ALIGN16_ASSIGN(outputs);
void softpipe_set_clip_state( struct pipe_context *,
const struct pipe_clip_state * );
+void softpipe_set_constant_buffer(struct pipe_context *,
+ uint shader, uint index,
+ const struct pipe_constant_buffer *buf);
+
void softpipe_set_depth_test_state( struct pipe_context *,
const struct pipe_depth_state * );
/**************************************************************************
*
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
#include "sp_context.h"
#include "sp_state.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_winsys.h"
#include "pipe/draw/draw_context.h"
draw_set_vertex_shader(softpipe->draw, vs);
}
+
+
+void softpipe_set_constant_buffer(struct pipe_context *pipe,
+ uint shader, uint index,
+ const struct pipe_constant_buffer *buf)
+{
+ struct softpipe_context *softpipe = softpipe_context(pipe);
+ struct pipe_winsys *ws = pipe->winsys;
+
+ assert(shader < PIPE_SHADER_TYPES);
+ assert(index == 0);
+
+ /* note: reference counting */
+ ws->buffer_unreference(ws, &softpipe->constants[shader].buffer);
+ softpipe->constants[shader].buffer = ws->buffer_reference(ws, buf->buffer);
+ softpipe->constants[shader].size = buf->size;
+
+ softpipe->dirty |= SP_NEW_CONSTANTS;
+}
+
+
#include "shader/prog_parameter.h"
#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_winsys.h"
#include "pipe/tgsi/mesa/mesa_to_tgsi.h"
#include "pipe/tgsi/core/tgsi_dump.h"
}
+static void
+update_fs_constants(struct st_context *st,
+ struct gl_program_parameter_list *params)
+
+{
+ const uint paramBytes = params->NumParameters * sizeof(GLfloat) * 4;
+ struct pipe_winsys *ws = st->pipe->winsys;
+ struct pipe_constant_buffer *cbuf
+ = &st->state.constants[PIPE_SHADER_FRAGMENT];
+
+ if (!cbuf->buffer)
+ cbuf->buffer = ws->buffer_create(ws, 1);
+
+ /* load Mesa constants into the constant buffer */
+ if (paramBytes)
+ ws->buffer_data(ws, cbuf->buffer, paramBytes, params->ParameterValues);
+
+ cbuf->size = paramBytes;
+
+ st->pipe->set_constant_buffer(st->pipe, PIPE_SHADER_FRAGMENT, 0, cbuf);
+}
+
+
static void update_fs( struct st_context *st )
{
struct pipe_shader_state fs;
struct st_fragment_program *fp = NULL;
struct gl_program_parameter_list *params = NULL;
+ /* find active shader and params */
if (st->ctx->Shader.CurrentProgram &&
st->ctx->Shader.CurrentProgram->LinkStatus &&
st->ctx->Shader.CurrentProgram->FragmentProgram) {
params = st->ctx->FragmentProgram._Current->Base.Parameters;
}
+ /* update constants */
if (fp && params) {
- /* load program's constants array */
-
_mesa_load_state_parameters(st->ctx, params);
-
- fp->constants.nr_constants = params->NumParameters;
- memcpy(fp->constants.constant,
- params->ParameterValues,
- params->NumParameters * sizeof(GLfloat) * 4);
+ update_fs_constants(st, params);
}
+ /* translate shader to TGSI format */
if (fp->dirty)
compile_fs( st, fp );
+ /* update pipe state */
memset( &fs, 0, sizeof(fs) );
fs.inputs_read = fp->Base.Base.InputsRead;
fs.outputs_written = fp->Base.Base.OutputsWritten;
fs.tokens = &fp->tokens[0];
- fs.constants = &fp->constants;
if (memcmp(&fs, &st->state.fs, sizeof(fs)) != 0 ||
fp->dirty)
#include "tnl/t_vp_build.h"
#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "pipe/p_winsys.h"
#include "pipe/tgsi/mesa/mesa_to_tgsi.h"
#include "pipe/tgsi/core/tgsi_dump.h"
}
+static void
+update_vs_constants(struct st_context *st,
+ struct gl_program_parameter_list *params)
+
+{
+ const uint paramBytes = params->NumParameters * sizeof(GLfloat) * 4;
+ struct pipe_winsys *ws = st->pipe->winsys;
+ struct pipe_constant_buffer *cbuf
+ = &st->state.constants[PIPE_SHADER_VERTEX];
+
+ if (!cbuf->buffer)
+ cbuf->buffer = ws->buffer_create(ws, 1);
+
+ /* load Mesa constants into the constant buffer */
+ if (paramBytes)
+ ws->buffer_data(ws, cbuf->buffer, paramBytes, params->ParameterValues);
+
+ cbuf->size = paramBytes;
+
+ st->pipe->set_constant_buffer(st->pipe, PIPE_SHADER_VERTEX, 0, cbuf);
+}
+
+
static void update_vs( struct st_context *st )
{
struct pipe_shader_state vs;
struct st_vertex_program *vp = NULL;
struct gl_program_parameter_list *params = NULL;
-#if 0
- if (st->ctx->VertexProgram._MaintainTnlProgram)
- _tnl_UpdateFixedFunctionProgram( st->ctx );
-#endif
-
+ /* find active shader and params */
if (st->ctx->Shader.CurrentProgram &&
st->ctx->Shader.CurrentProgram->LinkStatus &&
st->ctx->Shader.CurrentProgram->VertexProgram) {
params = st->ctx->VertexProgram._Current->Base.Parameters;
}
- /* XXXX temp */
-#if 1
- if (!vp)
- return;
-#endif
+ /* update constants */
if (vp && params) {
- /* load program's constants array */
-
- /* XXX this should probably be done elsewhere/separately */
_mesa_load_state_parameters(st->ctx, params);
-
- vp->constants.nr_constants = params->NumParameters;
- memcpy(vp->constants.constant,
- params->ParameterValues,
- params->NumParameters * sizeof(GLfloat) * 4);
+ update_vs_constants(st, params);
}
+ /* translate shader to TGSI format */
if (vp->dirty)
compile_vs( st, vp );
+ /* update pipe state */
memset( &vs, 0, sizeof(vs) );
vs.outputs_written = vp->Base.Base.OutputsWritten;
vs.inputs_read = vp->Base.Base.InputsRead;
vs.tokens = &vp->tokens[0];
- vs.constants = &vp->constants;
if (memcmp(&vs, &st->state.vs, sizeof(vs)) != 0 ||
vp->dirty)
memset(&fs, 0, sizeof(fs));
fs.inputs_read = stfp->Base.Base.InputsRead;
fs.tokens = &stfp->tokens[0];
- fs.constants = NULL;
pipe->set_fs_state(pipe, &fs);
}
vs.inputs_read = stvp->Base.Base.InputsRead;
vs.outputs_written = stvp->Base.Base.OutputsWritten;
vs.tokens = &stvp->tokens[0];
- vs.constants = NULL;
pipe->set_vs_state(pipe, &vs);
}
memset(&fs, 0, sizeof(fs));
fs.inputs_read = stfp->Base.Base.InputsRead;
fs.tokens = &stfp->tokens[0];
- fs.constants = NULL;
pipe->set_fs_state(pipe, &fs);
}
vs.inputs_read = stvp->Base.Base.InputsRead;
vs.outputs_written = stvp->Base.Base.OutputsWritten;
vs.tokens = &stvp->tokens[0];
- vs.constants = NULL;
pipe->set_vs_state(pipe, &vs);
}
struct pipe_blend_color blend_color;
struct pipe_clear_color_state clear_color;
struct pipe_clip_state clip;
+ struct pipe_constant_buffer constants[2];
struct pipe_depth_state depth;
struct pipe_framebuffer_state framebuffer;
- struct pipe_shader_state fs;
- struct pipe_shader_state vs;
+ struct pipe_mipmap_tree *texture[PIPE_MAX_SAMPLERS];
struct pipe_poly_stipple poly_stipple;
struct pipe_sampler_state sampler[PIPE_MAX_SAMPLERS];
struct pipe_scissor_state scissor;
struct pipe_setup_state setup;
+ struct pipe_shader_state fs;
+ struct pipe_shader_state vs;
struct pipe_stencil_state stencil;
- struct pipe_mipmap_tree *texture[PIPE_MAX_SAMPLERS];
struct pipe_viewport_state viewport;
} state;
struct tgsi_token tokens[ST_FP_MAX_TOKENS];
GLboolean dirty;
- struct pipe_constant_buffer constants;
-
#if 0
GLfloat (*cbuffer)[4];
GLuint nr_constants;
struct tgsi_token tokens[ST_FP_MAX_TOKENS];
GLboolean dirty;
+#if 0
struct pipe_constant_buffer constants;
+#endif
GLuint param_state;
};