From 817c4242b625fd19c7abf7c8d1b347482d411254 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sat, 25 Sep 2010 22:02:10 -0700 Subject: fdo30337{a,b}: New tests for radeon presubtract. --- tests/shaders/generic/fdo30337a.vpfp | 17 +++++++++++++++++ tests/shaders/generic/fdo30337b.vpfp | 25 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 tests/shaders/generic/fdo30337a.vpfp create mode 100644 tests/shaders/generic/fdo30337b.vpfp (limited to 'tests/shaders/generic') diff --git a/tests/shaders/generic/fdo30337a.vpfp b/tests/shaders/generic/fdo30337a.vpfp new file mode 100644 index 00000000..48b97d73 --- /dev/null +++ b/tests/shaders/generic/fdo30337a.vpfp @@ -0,0 +1,17 @@ +!!ARBvp1.0 +OPTION ARB_position_invariant; +END + +!!ARBfp1.0 +#This tests instructions like: ADD Temp[0], Temp[0], Temp[1] where one of +#the source registers is the same as the destination register. These +#should not be replaced with presubtract operations. +TEMP color; +MOV color, {0.1, 0.4, 0.8, 1.0}; +ADD color.x, color.x, color.x; +ADD color.y, color.x, color.y; +MOV result.color, color; +END + +!!test +expected 0.2 0.6 0.8 1.0 diff --git a/tests/shaders/generic/fdo30337b.vpfp b/tests/shaders/generic/fdo30337b.vpfp new file mode 100644 index 00000000..e6809fc2 --- /dev/null +++ b/tests/shaders/generic/fdo30337b.vpfp @@ -0,0 +1,25 @@ +!!ARBvp1.0 +OPTION ARB_position_invariant; +END + +!!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 +expected 0.0 0.4 0.0 0.16 -- cgit v1.2.3