1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
[require]
GL >= 1.3
ARB_vertex_program
ARB_fragment_program
[vertex program]
!!ARBvp1.0
OPTION ARB_position_invariant;
END
[fragment program]
!!ARBfp1.0
#This test is for instructions that read from more components than the
#presubtract operation writes. For example:
#ADD Temp[0].x Temp[1].x, Temp[2].x
#MUL Temp[4]x. Temp[0].x, Temp[5].x
#DP3 Temp[6].x Temp[0].xyz, Temp[0].xyz
#The ADD instruction can be converted to a presubtract operation and be
#used by the MUL instruction, but it cannot be used by the DP3 instruction
#since that instruction reads from more than just the x component of Temp[0].
#Therefore the ADD instruction should not be removed.
TEMP color;
MOV color, {0.1, 0.4, 0.8, 1.0};
SUB color.x, color.x, color.x;
ADD color.y, color.x, color.y;
SUB color.z, color.x, color.x;
DP3 color.w, color, color;
MOV result.color, color;
END
[test]
ortho 0 1 0 1
clear color 1.0 1.0 1.0 1.0
clear
draw rect 0 0 1 1
probe all rgba 0.0 0.4 0.0 0.16
|