/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
return (GLfloat) _mesa_pow(x, y);
}
-static GLfloat rough_approx_log2_0_1(GLfloat x)
-{
- return LOG2(x);
-}
-
/**
* Perform a reduced swizzle:
{
GLfloat *result = m->File[0][op.rsw.dst];
const GLfloat *arg0 = m->File[op.rsw.file0][op.rsw.idx0];
- GLuint swz = op.rsw.swz;
- GLuint neg = op.rsw.neg;
+ const GLuint swz = op.rsw.swz;
+ const GLuint neg = op.rsw.neg;
GLfloat tmp[4];
/* Need a temporary to be correct in the case where result == arg0.
{
GLfloat *result = m->File[0][op.rsw.dst];
const GLfloat *arg0 = m->File[op.rsw.file0][op.rsw.idx0];
- GLuint swz = op.rsw.swz;
- GLuint neg = op.rsw.neg;
+ const GLuint swz = op.rsw.swz;
+ const GLuint neg = op.rsw.neg;
GLfloat tmp[6];
tmp[4] = 0.0;
tmp[5] = 1.0;
{
GLfloat *result = m->File[0][op.alu.dst];
const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0];
- GLfloat tmp = arg0[0];
- GLfloat flr_tmp = FLOORF(tmp);
- GLfloat frac_tmp = tmp - flr_tmp;
+ const GLfloat tmp = arg0[0];
+ const GLfloat flr_tmp = FLOORF(tmp);
+ const GLfloat frac_tmp = tmp - flr_tmp;
result[0] = LDEXPF(1.0, (int)flr_tmp);
result[1] = frac_tmp;
- result[2] = LDEXPF(rough_approx_log2_0_1(frac_tmp), (int)flr_tmp);
+ result[2] = RoughApproxExp2(tmp);
result[3] = 1.0F;
}
{
GLfloat *result = m->File[0][op.alu.dst];
const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0];
- GLfloat tmp[4];
+ GLfloat tmp[4]; /* use temp in case arg0 == result register */
tmp[0] = 1.0;
tmp[1] = arg0[0];
}
tmp[3] = 1.0;
-
COPY_4V(result, tmp);
}
{
GLfloat *result = m->File[0][op.alu.dst];
const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0];
- GLfloat tmp = FABSF(arg0[0]);
+ const GLfloat tmp = FABSF(arg0[0]);
int exponent;
- GLfloat mantissa = FREXPF(tmp, &exponent);
+ const GLfloat mantissa = FREXPF(tmp, &exponent);
result[0] = (GLfloat) (exponent - 1);
result[1] = 2.0 * mantissa; /* map [.5, 1) -> [1, 2) */
static void do_REL( struct arb_vp_machine *m, union instruction op )
{
GLfloat *result = m->File[0][op.alu.dst];
- GLuint idx = (op.alu.idx0 + (GLint)m->File[0][REG_ADDR][0]) & (MAX_NV_VERTEX_PROGRAM_PARAMS-1);
+ const GLuint idx = (op.alu.idx0 + (GLint)m->File[0][REG_ADDR][0]) & (MAX_NV_VERTEX_PROGRAM_PARAMS-1);
const GLfloat *arg0 = m->File[op.alu.file0][idx];
result[0] = arg0[0];
{
struct compilation cp;
struct tnl_compiled_program *p = CALLOC_STRUCT(tnl_compiled_program);
- GLuint i;
+ GLint i;
if (program->TnlData)
free_tnl_data( program );
/* Test userclip planes. This contributes to VB->ClipMask.
*/
- if (ctx->Transform.ClipPlanesEnabled && !ctx->VertexProgram._Enabled) {
+ if (ctx->Transform.ClipPlanesEnabled && (!ctx->VertexProgram._Enabled ||
+ ctx->VertexProgram.Current->IsPositionInvariant)) {
userclip( ctx,
VB->ClipPtr,
m->clipmask,
m->nr_inputs = m->nr_outputs = 0;
- for (i = 0; i < _TNL_ATTRIB_MAX; i++) {
+ for (i = 0; i < VERT_ATTRIB_MAX; i++) {
if (program->Base.InputsRead & (1<<i) ||
(i == VERT_ATTRIB_POS && program->IsPositionInvariant)) {
GLuint j = m->nr_inputs++;
call_func( p, m );
}
else {
+ GLint j;
for (j = 0; j < p->nr_instructions; j++) {
union instruction inst = p->instructions[j];
opcode_func[inst.alu.opcode]( m, inst );
void
_tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program)
{
- if (program->Target == GL_VERTEX_PROGRAM_ARB) {
+ if (target == GL_VERTEX_PROGRAM_ARB) {
/* free any existing tnl data hanging off the program */
struct gl_vertex_program *vprog = (struct gl_vertex_program *) program;
if (vprog->TnlData) {