I915_MAX_TEX_INSN);
ctx->Const.FragmentProgram.MaxNativeTexIndirections = I915_MAX_TEX_INDIRECT;
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
- ctx->_MaintainTexEnvProgram = GL_TRUE;
+ ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
driInitExtensions( ctx, i915_extensions, GL_FALSE );
#include "i915_context.h"
#include "i915_program.h"
-#include "program_instruction.h"
+#include "prog_instruction.h"
+#include "prog_parameter.h"
#include "program.h"
#include "programopt.h"
}
-#define FRAG_BIT_TEX(n) (FRAG_BIT_TEX0 << (n))
-
-
static void check_wpos( struct i915_fragment_program *p )
{
GLuint inputs = p->FragProg.Base.InputsRead;
if (p->error) {
p->FragProg.Base.NumNativeInstructions = 0;
- p->FragProg.NumNativeAluInstructions = 0;
- p->FragProg.NumNativeTexInstructions = 0;
- p->FragProg.NumNativeTexIndirections = 0;
+ p->FragProg.Base.NumNativeAluInstructions = 0;
+ p->FragProg.Base.NumNativeTexInstructions = 0;
+ p->FragProg.Base.NumNativeTexIndirections = 0;
}
else {
p->FragProg.Base.NumNativeInstructions = (p->nr_alu_insn +
p->nr_tex_insn +
p->nr_decl_insn);
- p->FragProg.NumNativeAluInstructions = p->nr_alu_insn;
- p->FragProg.NumNativeTexInstructions = p->nr_tex_insn;
- p->FragProg.NumNativeTexIndirections = p->nr_tex_indirect;
+ p->FragProg.Base.NumNativeAluInstructions = p->nr_alu_insn;
+ p->FragProg.Base.NumNativeTexInstructions = p->nr_tex_insn;
+ p->FragProg.Base.NumNativeTexIndirections = p->nr_tex_indirect;
}
p->declarations[0] |= program_size + decl_size - 2;
GLboolean enabled;
GLboolean try_pixel_fog;
- if (ctx->FragmentProgram._Active) {
+ if (ctx->FragmentProgram._Enabled) {
/* Pull in static fog state from program */
mode = ctx->FragmentProgram._Current->FogOption;
if (ctx->FragmentProgram._Current)
i915ValidateFragmentProgram( i915 );
else {
- assert(!ctx->_MaintainTexEnvProgram);
+ assert(!ctx->FragmentProgram._MaintainTexEnvProgram);
i915ValidateTextureProgram( i915 );
}
}
I915_MAX_TEX_INDIRECT;
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */
- ctx->_MaintainTexEnvProgram = 1;
- ctx->_UseTexEnvProgram = 1;
+ ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
+ /*ctx->_UseTexEnvProgram = 1;*/
driInitExtensions(ctx, i915_extensions, GL_FALSE);
#include "i915_context.h"
#include "i915_program.h"
-#include "program_instruction.h"
+#include "prog_instruction.h"
+#include "prog_parameter.h"
#include "program.h"
#include "programopt.h"
}
-#define FRAG_BIT_TEX(n) (FRAG_BIT_TEX0 << (n))
-
-
static void
check_wpos(struct i915_fragment_program *p)
{
if (p->error) {
p->FragProg.Base.NumNativeInstructions = 0;
- p->FragProg.NumNativeAluInstructions = 0;
- p->FragProg.NumNativeTexInstructions = 0;
- p->FragProg.NumNativeTexIndirections = 0;
+ p->FragProg.Base.NumNativeAluInstructions = 0;
+ p->FragProg.Base.NumNativeTexInstructions = 0;
+ p->FragProg.Base.NumNativeTexIndirections = 0;
}
else {
p->FragProg.Base.NumNativeInstructions = (p->nr_alu_insn +
p->nr_tex_insn +
p->nr_decl_insn);
- p->FragProg.NumNativeAluInstructions = p->nr_alu_insn;
- p->FragProg.NumNativeTexInstructions = p->nr_tex_insn;
- p->FragProg.NumNativeTexIndirections = p->nr_tex_indirect;
+ p->FragProg.Base.NumNativeAluInstructions = p->nr_alu_insn;
+ p->FragProg.Base.NumNativeTexInstructions = p->nr_tex_insn;
+ p->FragProg.Base.NumNativeTexIndirections = p->nr_tex_indirect;
}
p->declarations[0] |= program_size + decl_size - 2;
GLboolean enabled;
GLboolean try_pixel_fog;
- if (ctx->FragmentProgram._Active) {
+ if (ctx->FragmentProgram._Enabled) {
/* Pull in static fog state from program */
mode = ctx->FragmentProgram._Current->FogOption;
brw->emit_state_always = 0;
- ctx->_MaintainTexEnvProgram = 1;
+ ctx->FragmentProgram._MaintainTexEnvProgram = 1;
brw_draw_init( brw );
#include "context.h"
#include "macros.h"
#include "enums.h"
-#include "shader/program.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_statevars.h"
#include "intel_batchbuffer.h"
#include "brw_context.h"
#include "brw_defines.h"
#include "brw_structs.h"
#include "brw_defines.h"
-#include "shader/program.h"
+#include "shader/prog_instruction.h"
#define BRW_SWIZZLE4(a,b,c,d) (((a)<<0) | ((b)<<2) | ((c)<<4) | ((d)<<6))
#define BRW_GET_SWZ(swz, idx) (((swz) >> ((idx)*2)) & 0x3)
#include "glheader.h"
#include "context.h"
#include "macros.h"
-#include "enums.h"
-#include "dd.h"
#include "shader/arbprogparse.h"
*/
-#include "brw_util.h"
#include "mtypes.h"
-#include "shader/program.h"
+#include "shader/prog_parameter.h"
+#include "brw_util.h"
#include "brw_defines.h"
GLuint brw_count_bits( GLuint val )
}
-static GLuint brw_parameter_state_flags(const enum state_index state[])
+static GLuint brw_parameter_state_flags(const gl_state_index state[])
{
switch (state[0]) {
case STATE_MATERIAL:
case STATE_POINT_ATTENUATION:
return _NEW_POINT;
- case STATE_MATRIX:
- switch (state[1]) {
- case STATE_MODELVIEW:
- return _NEW_MODELVIEW;
- case STATE_PROJECTION:
- return _NEW_PROJECTION;
- case STATE_MVP:
- return _NEW_MODELVIEW | _NEW_PROJECTION;
- case STATE_TEXTURE:
- return _NEW_TEXTURE_MATRIX;
- case STATE_PROGRAM:
- return _NEW_TRACK_MATRIX;
- default:
- assert(0);
- return 0;
- }
+ case STATE_MODELVIEW_MATRIX:
+ return _NEW_MODELVIEW;
+ case STATE_PROJECTION_MATRIX:
+ return _NEW_PROJECTION;
+ case STATE_MVP_MATRIX:
+ return _NEW_MODELVIEW | _NEW_PROJECTION;
+ case STATE_TEXTURE_MATRIX:
+ return _NEW_TEXTURE_MATRIX;
+ case STATE_PROGRAM_MATRIX:
+ return _NEW_TRACK_MATRIX;
case STATE_DEPTH_RANGE:
return _NEW_VIEWPORT;
#include "brw_vs.h"
#include "brw_util.h"
#include "brw_state.h"
-#include "program.h"
-#include "shader/arbprogparse.h"
+#include "shader/prog_print.h"
*/
-#include "brw_context.h"
-#include "program.h"
-#include "program_instruction.h"
#include "macros.h"
+#include "brw_context.h"
#include "brw_vs.h"
/* Component is active if it may diverge from [0,0,0,1]. Undef values
*/
-#include "brw_context.h"
#include "program.h"
-#include "program_instruction.h"
#include "macros.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
+#include "brw_context.h"
#include "brw_vs.h"
#include "glheader.h"
#include "macros.h"
#include "enums.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
#include "brw_vs.h"
#include "brw_state.h"
-#include "shader/program.h"
-#include "shader/program_instruction.h"
-#include "shader/arbprogparse.h"
struct state_key {
unsigned light_global_enabled:1;
{
GLfloat values[4];
GLint idx;
+ GLuint swizzle;
values[0] = s0;
values[1] = s1;
values[2] = s2;
values[3] = s3;
- idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4 );
+ idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4,
+ &swizzle);
+ /* XXX what about swizzle? */
return make_ureg(PROGRAM_STATE_VAR, idx);
}
return p->identity;
}
-static struct ureg register_param6( struct tnl_program *p,
- GLint s0,
- GLint s1,
- GLint s2,
- GLint s3,
- GLint s4,
- GLint s5)
+static struct ureg register_param5( struct tnl_program *p,
+ GLint s0,
+ GLint s1,
+ GLint s2,
+ GLint s3,
+ GLint s4)
{
- GLint tokens[6];
+ gl_state_index tokens[STATE_LENGTH];
GLint idx;
tokens[0] = s0;
tokens[1] = s1;
tokens[2] = s2;
tokens[3] = s3;
tokens[4] = s4;
- tokens[5] = s5;
idx = _mesa_add_state_reference( p->program->Base.Parameters, tokens );
return make_ureg(PROGRAM_STATE_VAR, idx);
}
-#define register_param1(p,s0) register_param6(p,s0,0,0,0,0,0)
-#define register_param2(p,s0,s1) register_param6(p,s0,s1,0,0,0,0)
-#define register_param3(p,s0,s1,s2) register_param6(p,s0,s1,s2,0,0,0)
-#define register_param4(p,s0,s1,s2,s3) register_param6(p,s0,s1,s2,s3,0,0)
+#define register_param1(p,s0) register_param5(p,s0,0,0,0,0)
+#define register_param2(p,s0,s1) register_param5(p,s0,s1,0,0,0)
+#define register_param3(p,s0,s1,s2) register_param5(p,s0,s1,s2,0,0)
+#define register_param4(p,s0,s1,s2,s3) register_param5(p,s0,s1,s2,s3,0)
-static void register_matrix_param6( struct tnl_program *p,
- GLint s0,
- GLint s1,
- GLint s2,
- GLint s3,
- GLint s4,
- GLint s5,
+static void register_matrix_param5( struct tnl_program *p,
+ GLint s0, /* matrix name */
+ GLint s1, /* texture matrix number */
+ GLint s2, /* first row */
+ GLint s3, /* last row */
+ GLint s4, /* modifier */
struct ureg *matrix )
{
GLint i;
/* This is a bit sad as the support is there to pull the whole
* matrix out in one go:
*/
- for (i = 0; i <= s4 - s3; i++)
- matrix[i] = register_param6( p, s0, s1, s2, i, i, s5 );
+ for (i = 0; i <= s3 - s2; i++)
+ matrix[i] = register_param5( p, s0, s1, i, i, s4 );
}
p->eye_position = reserve_temp(p);
if (PREFER_DP4) {
- register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 3,
- STATE_MATRIX, modelview );
+ register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3,
+ 0, modelview );
emit_matrix_transform_vec4(p, p->eye_position, modelview, pos);
}
else {
- register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 3,
+ register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 3,
STATE_MATRIX_TRANSPOSE, modelview );
emit_transpose_matrix_transform_vec4(p, p->eye_position, modelview, pos);
struct ureg normal = register_input(p, VERT_ATTRIB_NORMAL );
struct ureg mvinv[3];
- register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 2,
+ register_matrix_param5( p, STATE_MODELVIEW_MATRIX, 0, 0, 2,
STATE_MATRIX_INVTRANS, mvinv );
p->eye_normal = reserve_temp(p);
struct ureg mvp[4];
if (PREFER_DP4) {
- register_matrix_param6( p, STATE_MATRIX, STATE_MVP, 0, 0, 3,
- STATE_MATRIX, mvp );
+ register_matrix_param5( p, STATE_MVP_MATRIX, 0, 0, 3,
+ 0, mvp );
emit_matrix_transform_vec4( p, hpos, mvp, pos );
}
else {
- register_matrix_param6( p, STATE_MATRIX, STATE_MVP, 0, 0, 3,
+ register_matrix_param5( p, STATE_MVP_MATRIX, 0, 0, 3,
STATE_MATRIX_TRANSPOSE, mvp );
emit_transpose_matrix_transform_vec4( p, hpos, mvp, pos );
}
*/
VPpli = register_param3(p, STATE_LIGHT, i,
STATE_POSITION_NORMALIZED);
- half = register_param3(p, STATE_LIGHT, i, STATE_HALF);
+ half = register_param3(p, STATE_LIGHT, i, STATE_HALF_VECTOR);
}
else {
struct ureg Ppli = register_param3(p, STATE_LIGHT, i,
out_texgen :
register_input(p, VERT_ATTRIB_TEX0+i));
if (PREFER_DP4) {
- register_matrix_param6( p, STATE_MATRIX, STATE_TEXTURE, i,
- 0, 3, STATE_MATRIX, texmat );
+ register_matrix_param5( p, STATE_TEXTURE_MATRIX, i, 0, 3,
+ 0, texmat );
emit_matrix_transform_vec4( p, out, texmat, in );
}
else {
- register_matrix_param6( p, STATE_MATRIX, STATE_TEXTURE, i,
- 0, 3, STATE_MATRIX_TRANSPOSE, texmat );
+ register_matrix_param5( p, STATE_TEXTURE_MATRIX, i, 0, 3,
+ STATE_MATRIX_TRANSPOSE, texmat );
emit_transpose_matrix_transform_vec4( p, out, texmat, in );
}
}
#include "brw_state.h"
#include "brw_hal.h"
-#include "program.h"
-#include "program_instruction.h"
-#include "arbprogparse.h"
-
GLuint brw_wm_nr_args( GLuint opcode )
{
#include "brw_context.h"
#include "brw_eu.h"
-#include "program_instruction.h"
+#include "prog_instruction.h"
/* A big lookup table is used to figure out which and how many
* additional regs will inserted before the main payload in the WM
#include "brw_context.h"
#include "brw_wm.h"
-#include "program.h"
-#include "shader/arbprogparse.h"
-#include "shader/program_instruction.h"
void brw_wm_print_value( struct brw_wm_compile *c,
*/
-#include "brw_context.h"
-#include "program.h"
-#include "program_instruction.h"
#include "macros.h"
+#include "brw_context.h"
#include "brw_wm.h"
#define SATURATE (1<<5)
#include "brw_wm.h"
#include "brw_util.h"
-#include "shader/program.h"
-#include "shader/program_instruction.h"
-#include "shader/arbprogparse.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
+#include "shader/prog_statevars.h"
+
#define FIRST_INTERNAL_TEMP MAX_NV_FRAGMENT_PROGRAM_TEMPS
* harm and it's not as if the parameter handling isn't a big hack
* anyway.
*/
-static struct prog_src_register search_or_add_param6( struct brw_wm_compile *c,
- GLint s0,
- GLint s1,
- GLint s2,
- GLint s3,
- GLint s4,
- GLint s5)
+static struct prog_src_register search_or_add_param5(struct brw_wm_compile *c,
+ GLint s0,
+ GLint s1,
+ GLint s2,
+ GLint s3,
+ GLint s4)
{
struct gl_program_parameter_list *paramList = c->fp->program.Base.Parameters;
- GLint tokens[6];
+ gl_state_index tokens[STATE_LENGTH];
GLuint idx;
tokens[0] = s0;
tokens[1] = s1;
tokens[2] = s2;
tokens[3] = s3;
tokens[4] = s4;
- tokens[5] = s5;
for (idx = 0; idx < paramList->NumParameters; idx++) {
if (paramList->Parameters[idx].Type == PROGRAM_STATE_VAR &&
struct gl_program_parameter_list *paramList = c->fp->program.Base.Parameters;
GLfloat values[4];
GLuint idx;
+ GLuint swizzle;
values[0] = s0;
values[1] = s1;
return src_reg(PROGRAM_STATE_VAR, idx);
}
- idx = _mesa_add_unnamed_constant( paramList, values, 4 );
-
+ idx = _mesa_add_unnamed_constant( paramList, values, 4, &swizzle );
+ /* XXX what about swizzle? */
return src_reg(PROGRAM_STATE_VAR, idx);
}
if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) {
struct prog_src_register scale =
- search_or_add_param6( c,
+ search_or_add_param5( c,
STATE_INTERNAL,
STATE_TEXRECT_SCALE,
inst->TexSrcUnit,
- 0,0,0 );
+ 0,0 );
tmpcoord = get_temp(c);
struct prog_src_register fog_factor )
{
struct prog_dst_register outcolor = dst_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLR);
- struct prog_src_register fogcolor = search_or_add_param6( c, STATE_FOG_COLOR, 0,0,0,0,0 );
+ struct prog_src_register fogcolor = search_or_add_param5( c, STATE_FOG_COLOR, 0,0,0,0 );
/* color.xyz = LRP fog_factor.xxxx, output_color, fog_color */
#include "brw_context.h"
#include "brw_wm.h"
-#include "program.h"
-#include "arbprogparse.h"
-#include "program_instruction.h"
+#include "shader/prog_parameter.h"
#include "brw_context.h"
#include "brw_wm.h"
-#include "program.h"
-#include "arbprogparse.h"
-#include "program_instruction.h"
static GLuint get_tracked_mask(struct brw_wm_compile *c,
#include "brw_context.h"
#include "brw_wm.h"
-#include "program.h"
-#include "arbprogparse.h"
-#include "program_instruction.h"
+
/* Use these to force spilling so that that functionality can be
* tested with known-good examples rather than having to construct new
{
float rhw = 1.0 / LE32_IN_FLOAT( p + 2 );
- dst->texcoord[1][0] = rhw*LE32_IN_FLOAT( p++ );
- dst->texcoord[1][1] = rhw*LE32_IN_FLOAT( p++ );
+ dst->attrib[FRAG_ATTRIB_TEX1][0] = rhw*LE32_IN_FLOAT( p++ );
+ dst->attrib[FRAG_ATTRIB_TEX1][1] = rhw*LE32_IN_FLOAT( p++ );
}
#else
- dst->texcoord[1][0] = LE32_IN_FLOAT( p++ );
- dst->texcoord[1][1] = LE32_IN_FLOAT( p++ );
+ dst->attrib[FRAG_ATTRIB_TEX1][0] = LE32_IN_FLOAT( p++ );
+ dst->attrib[FRAG_ATTRIB_TEX1][1] = LE32_IN_FLOAT( p++ );
#endif
- dst->texcoord[1][3] = 1.0;
+ dst->attrib[FRAG_ATTRIB_TEX1][3] = 1.0;
p++;
case TEX0_VERTEX_FORMAT:
{
float rhw = 1.0 / LE32_IN_FLOAT( p + 2 );
- dst->texcoord[0][0] = rhw*LE32_IN_FLOAT( p++ );
- dst->texcoord[0][1] = rhw*LE32_IN_FLOAT( p++ );
+ dst->attrib[FRAG_ATTRIB_TEX0][0] = rhw*LE32_IN_FLOAT( p++ );
+ dst->attrib[FRAG_ATTRIB_TEX0][1] = rhw*LE32_IN_FLOAT( p++ );
}
#else
- dst->texcoord[0][0] = LE32_IN_FLOAT( p++ );
- dst->texcoord[0][1] = LE32_IN_FLOAT( p++ );
+ dst->attrib[FRAG_ATTRIB_TEX0][0] = LE32_IN_FLOAT( p++ );
+ dst->attrib[FRAG_ATTRIB_TEX0][1] = LE32_IN_FLOAT( p++ );
#endif
- dst->texcoord[0][3] = 1.0;
+ dst->attrib[FRAG_ATTRIB_TEX0][3] = 1.0;
dst->win[3] = LE32_IN_FLOAT( p++ );
case NOTEX_VERTEX_FORMAT:
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 );
#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"
#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"
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);
}
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;
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);
}
#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"
#include "macros.h"
#include "enums.h"
#include "program.h"
+#include "shader/prog_instruction.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_statevars.h"
+#include "shader/programopt.h"
+#include "tnl/tnl.h"
#include "r200_context.h"
#include "r200_vertprog.h"
#include "r200_ioctl.h"
#include "r200_tcl.h"
-#include "program_instruction.h"
-#include "programopt.h"
-#include "tnl/tnl.h"
#if SWIZZLE_X != VSF_IN_COMPONENT_X || \
SWIZZLE_Y != VSF_IN_COMPONENT_Y || \
base e isn't directly available neither. */
if ((mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) && !vp->fogpidx) {
struct gl_program_parameter_list *paramList;
- GLint tokens[6] = { STATE_FOG_PARAMS, 0, 0, 0, 0, 0 };
+ gl_state_index tokens[STATE_LENGTH] = { STATE_FOG_PARAMS, 0, 0, 0, 0 };
paramList = mesa_vp->Base.Parameters;
vp->fogpidx = _mesa_add_state_reference(paramList, tokens);
}
ctx->Const.FragmentProgram.MaxNativeTexIndirections = PFS_MAX_TEX_INDIRECT;
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* and these are?? */
_tnl_ProgramCacheInit(ctx);
- ctx->_MaintainTexEnvProgram = GL_TRUE;
+ ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
driInitExtensions(ctx, card_extensions, GL_TRUE);
#include "glheader.h"
#include "macros.h"
#include "enums.h"
+#include "shader/prog_instruction.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
-#include "program.h"
-#include "program_instruction.h"
#include "r300_context.h"
#include "r300_fragprog.h"
#include "r300_reg.h"
#include "glheader.h"
#include "macros.h"
#include "enums.h"
+#include "shader/program.h"
+#include "shader/prog_instruction.h"
-#include "program.h"
#include "r300_context.h"
-#include "program_instruction.h"
+
#if 0
/* representation of a register for emit_arith/swizzle */
static void
r300BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
-
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- struct r300_vertex_program_cont *vp=(void *)prog;
-
-
switch(target){
case GL_VERTEX_PROGRAM_ARB:
//rmesa->curr_vp = (struct gl_vertex_program *)vp;
#include "api_arrayelt.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_statevars.h"
#include "vbo/vbo.h"
#include "tnl/tnl.h"
#include "texformat.h"
#endif
}
-static void r300FetchStateParameter(GLcontext *ctx, const enum state_index state[],
- GLfloat *value)
+static void
+r300FetchStateParameter(GLcontext *ctx,
+ const gl_state_index state[STATE_LENGTH],
+ GLfloat *value)
{
r300ContextPtr r300 = R300_CONTEXT(ctx);
#include "macros.h"
#include "enums.h"
#include "program.h"
-#include "nvvertexec.h"
+#include "shader/prog_instruction.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_statevars.h"
+#include "tnl/tnl.h"
#include "r300_context.h"
#include "r300_program.h"
-#include "program_instruction.h"
#if SWIZZLE_X != VSF_IN_COMPONENT_X || \
SWIZZLE_Y != VSF_IN_COMPONENT_Y || \
struct gl_program_parameter_list *paramList;
if (mesa_vp->IsNVProgram) {
- _mesa_init_vp_per_primitive_registers(ctx);
+ _mesa_load_tracked_matrices(ctx);
for (pi=0; pi < MAX_NV_VERTEX_PROGRAM_PARAMS; pi++) {
*dst++=ctx->VertexProgram.Parameters[pi][0];
struct gl_program_parameter_list *paramList;
int i;
- GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX };
+ gl_state_index tokens[STATE_LENGTH] = { STATE_MVP_MATRIX, 0, 0, 0, 0 };
#ifdef PREFER_DP4
tokens[5] = STATE_MATRIX;
GLuint temp_index)
{
- GLint tokens[6] = { STATE_INTERNAL, STATE_R300_WINDOW_DIMENSION, 0, 0, 0, 0 };
+ gl_state_index tokens[STATE_LENGTH]
+ = { STATE_INTERNAL, STATE_R300_WINDOW_DIMENSION, 0, 0, 0 };
struct prog_instruction *vpi;
struct prog_instruction *vpi_insert;
GLuint window_index;
ctx->Texture.Unit[0]._Current->DriverData); \
deltwx = deltwy = wstart = deltdx = deltdy = dstart = 0; \
\
- u0 = (v[idx[0]].texcoord[0][0] \
+ u0 = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] \
* (GLfloat)(t->image[0].image->Width) * 256.0); \
- u1 = (v[idx[1]].texcoord[0][0] \
+ u1 = (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] \
* (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \
- u2 = (v[idx[2]].texcoord[0][0] \
+ u2 = (v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0] \
* (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \
- v0 = (v[idx[0]].texcoord[0][1] \
+ v0 = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] \
* (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \
- v1 = (v[idx[1]].texcoord[0][1] \
+ v1 = (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] \
* (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \
- v2 = (v[idx[2]].texcoord[0][1] \
+ v2 = (v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1] \
* (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \
\
w0 = (v[idx[0]].win[3]); \
GLfloat sxy, suv; \
int lev; \
\
- suv = (v[idx[0]].texcoord[0][0] - \
- v[idx[2]].texcoord[0][0]) * \
- (v[idx[1]].texcoord[0][1] - \
- v[idx[2]].texcoord[0][1]) - \
- (v[idx[1]].texcoord[0][0] - \
- v[idx[2]].texcoord[0][0]) * \
- (v[idx[0]].texcoord[0][1] - \
- v[idx[2]].texcoord[0][2]); \
-\
- sxy = (v[idx[0]].texcoord[0][0] - \
- v[idx[2]].texcoord[0][0]) * \
- (v[idx[1]].texcoord[0][1] - \
- v[idx[2]].texcoord[0][1]) - \
- (v[idx[1]].texcoord[0][0] - \
- v[idx[2]].texcoord[0][0]) * \
- (v[idx[0]].texcoord[0][1] - \
- v[idx[2]].texcoord[0][2]); \
+ suv = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] - \
+ v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \
+ (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] - \
+ v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1]) - \
+ (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] - \
+ v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \
+ (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] - \
+ v[idx[2]].attrib[FRAG_ATTRIB_TEX0][2]); \
+\
+ sxy = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] - \
+ v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \
+ (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] - \
+ v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1]) - \
+ (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] - \
+ v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \
+ (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] - \
+ v[idx[2]].attrib[FRAG_ATTRIB_TEX0][2]); \
\
if (sxy < 0) sxy *= -1.0; \
if (suv < 0) suv *= -1.0; \
dst->color[2] = src->color[0];
dst->color[3] = src->color[3];
- dst->texcoord[0][0] = 1.0 / fxMesa->sScale0 * w * src->tu0;
- dst->texcoord[0][1] = 1.0 / fxMesa->tScale0 * w * src->tv0;
+ dst->attrib[FRAG_ATTRIB_TEX0][0] = 1.0 / fxMesa->sScale0 * w * src->tu0;
+ dst->attrib[FRAG_ATTRIB_TEX0][1] = 1.0 / fxMesa->tScale0 * w * src->tv0;
if (fxMesa->vertexFormat == TDFX_LAYOUT_PROJ1 || fxMesa->vertexFormat == TDFX_LAYOUT_PROJ2) {
- dst->texcoord[0][3] = w * src->tq0;
+ dst->attrib[FRAG_ATTRIB_TEX0][3] = w * src->tq0;
} else {
- dst->texcoord[0][3] = 1.0;
+ dst->attrib[FRAG_ATTRIB_TEX0][3] = 1.0;
}
if (fxMesa->SetupIndex & TDFX_TEX1_BIT) {
- dst->texcoord[1][0] = 1.0 / fxMesa->sScale1 * w * src->tu1;
- dst->texcoord[1][1] = 1.0 / fxMesa->tScale1 * w * src->tv1;
+ dst->attrib[FRAG_ATTRIB_TEX1][0] = 1.0 / fxMesa->sScale1 * w * src->tu1;
+ dst->attrib[FRAG_ATTRIB_TEX1][1] = 1.0 / fxMesa->tScale1 * w * src->tv1;
if (fxMesa->vertexFormat == TDFX_LAYOUT_PROJ2) {
- dst->texcoord[1][3] = w * src->tq1;
+ dst->attrib[FRAG_ATTRIB_TEX1][3] = w * src->tq1;
} else {
- dst->texcoord[1][3] = 1.0;
+ dst->attrib[FRAG_ATTRIB_TEX1][3] = 1.0;
}
}
}
GLuint vertex_format;
GLuint vertex_size;
GLuint vertex_stride_shift;
- char *verts;
+ GLubyte *verts;
GLint tmu_source[2];