result[3] = src[GET_SWZ(source->Swizzle, 3)];
}
- if (source->Abs) {
- result[0] = fabsf(result[0]);
- result[1] = fabsf(result[1]);
- result[2] = fabsf(result[2]);
- result[3] = fabsf(result[3]);
- }
if (source->Negate) {
assert(source->Negate == NEGATE_XYZW);
result[0] = -result[0];
result[2] = deriv[GET_SWZ(source->Swizzle, 2)];
result[3] = deriv[GET_SWZ(source->Swizzle, 3)];
- if (source->Abs) {
- result[0] = fabsf(result[0]);
- result[1] = fabsf(result[1]);
- result[2] = fabsf(result[2]);
- result[3] = fabsf(result[3]);
- }
if (source->Negate) {
assert(source->Negate == NEGATE_XYZW);
result[0] = -result[0];
result[0] = src[GET_SWZ(source->Swizzle, 0)];
- if (source->Abs) {
- result[0] = fabsf(result[0]);
- }
if (source->Negate) {
result[0] = -result[0];
}
store_vector4(inst, machine, color);
}
break;
- case OPCODE_TXD: /* GL_NV_fragment_program only */
+ case OPCODE_TXD:
/* Texture lookup w/ partial derivatives for LOD */
{
GLfloat texcoord[4], dtdx[4], dtdy[4], color[4];
store_vector4(inst, machine, color);
}
break;
- case OPCODE_TXP_NV: /* GL_NV_fragment_program only */
- /* Texture lookup w/ projective divide, as above, but do not
- * do the divide by w if sampling from a cube map.
- */
- {
- GLfloat texcoord[4], color[4];
-
- fetch_vector4(&inst->SrcReg[0], machine, texcoord);
- if (inst->TexSrcTarget != TEXTURE_CUBE_INDEX &&
- texcoord[3] != 0.0F) {
- texcoord[0] /= texcoord[3];
- texcoord[1] /= texcoord[3];
- texcoord[2] /= texcoord[3];
- }
-
- fetch_texel(ctx, machine, inst, texcoord, 0.0, color);
-
- store_vector4(inst, machine, color);
- }
- break;
case OPCODE_TRUNC: /* truncate toward zero */
{
GLfloat a[4], result[4];