X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fprogram%2Fprog_execute.c;h=956b84a20d6496c7c9ebe61f592ff27c0b0fc9c6;hb=ed3f1e04c7d2b5c17885919db5fde310d4bdf822;hp=2c77538c2af8a7b43b569b5f5b4e0019b9c2d023;hpb=81d8a0f4a44f8465e674b880fb8a4fb65320e8cb;p=mesa.git diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c index 2c77538c2af..956b84a20d6 100644 --- a/src/mesa/program/prog_execute.c +++ b/src/mesa/program/prog_execute.c @@ -36,8 +36,10 @@ #include "c99_math.h" +#include "main/errors.h" #include "main/glheader.h" #include "main/macros.h" +#include "main/mtypes.h" #include "prog_execute.h" #include "prog_instruction.h" #include "prog_parameter.h" @@ -117,11 +119,13 @@ get_src_register_pointer(const struct prog_src_register *source, /* Fallthrough */ case PROGRAM_CONSTANT: /* Fallthrough */ - case PROGRAM_UNIFORM: + case PROGRAM_UNIFORM: { if (reg >= (GLint) prog->Parameters->NumParameters) return ZeroVec; - return (GLfloat *) prog->Parameters->ParameterValues[reg]; + unsigned pvo = prog->Parameters->ParameterValueOffset[reg]; + return (GLfloat *) prog->Parameters->ParameterValues + pvo; + } case PROGRAM_SYSTEM_VALUE: assert(reg < (GLint) ARRAY_SIZE(machine->SystemValues)); return machine->SystemValues[reg]; @@ -209,10 +213,10 @@ fetch_vector4(const struct prog_src_register *source, } #ifdef NAN_CHECK - assert(!IS_INF_OR_NAN(result[0])); - assert(!IS_INF_OR_NAN(result[0])); - assert(!IS_INF_OR_NAN(result[0])); - assert(!IS_INF_OR_NAN(result[0])); + assert(!util_is_inf_or_nan(result[0])); + assert(!util_is_inf_or_nan(result[0])); + assert(!util_is_inf_or_nan(result[0])); + assert(!util_is_inf_or_nan(result[0])); #endif } @@ -328,9 +332,9 @@ store_vector4(const struct prog_instruction *inst, #if 0 if (value[0] > 1.0e10 || - IS_INF_OR_NAN(value[0]) || - IS_INF_OR_NAN(value[1]) || - IS_INF_OR_NAN(value[2]) || IS_INF_OR_NAN(value[3])) + util_is_inf_or_nan(value[0]) || + util_is_inf_or_nan(value[1]) || + util_is_inf_or_nan(value[2]) || util_is_inf_or_nan(value[3])) printf("store %g %g %g %g\n", value[0], value[1], value[2], value[3]); #endif @@ -343,10 +347,10 @@ store_vector4(const struct prog_instruction *inst, } #ifdef NAN_CHECK - assert(!IS_INF_OR_NAN(value[0])); - assert(!IS_INF_OR_NAN(value[0])); - assert(!IS_INF_OR_NAN(value[0])); - assert(!IS_INF_OR_NAN(value[0])); + assert(!util_is_inf_or_nan(value[0])); + assert(!util_is_inf_or_nan(value[0])); + assert(!util_is_inf_or_nan(value[0])); + assert(!util_is_inf_or_nan(value[0])); #endif if (writeMask & WRITEMASK_X) @@ -430,7 +434,7 @@ _mesa_execute_program(struct gl_context * ctx, { GLfloat t[4]; fetch_vector4(&inst->SrcReg[0], machine, t); - machine->AddressReg[0][0] = IFLOOR(t[0]); + machine->AddressReg[0][0] = util_ifloor(t[0]); if (DEBUG_PROG) { printf("ARL %d\n", machine->AddressReg[0][0]); } @@ -610,7 +614,7 @@ _mesa_execute_program(struct gl_context * ctx, fetch_vector1(&inst->SrcReg[0], machine, a); val = exp2f(a[0]); /* - if (IS_INF_OR_NAN(val)) + if (util_is_inf_or_nan(val)) val = 1.0e10; */ result[0] = result[1] = result[2] = result[3] = val; @@ -740,7 +744,7 @@ _mesa_execute_program(struct gl_context * ctx, fetch_vector1(&inst->SrcReg[0], machine, t); abs_t0 = fabsf(t[0]); if (abs_t0 != 0.0F) { - if (IS_INF_OR_NAN(abs_t0)) + if (util_is_inf_or_nan(abs_t0)) { SET_POS_INFINITY(q[0]); q[1] = 1.0F; @@ -927,7 +931,7 @@ _mesa_execute_program(struct gl_context * ctx, if (DEBUG_PROG) { if (a[0] == 0) printf("RCP(0)\n"); - else if (IS_INF_OR_NAN(a[0])) + else if (util_is_inf_or_nan(a[0])) printf("RCP(inf)\n"); } result[0] = result[1] = result[2] = result[3] = 1.0F / a[0];