mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
tests/d3dbc: Add some tests for dp2add instructions.
These are adapted from Wine's dp2add_ps_test() d3d9 test by Jason Green.
This commit is contained in:
Notes:
Henri Verbeet
2025-12-08 17:49:28 +01:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1859
@@ -52,6 +52,7 @@ vkd3d_cross_tests = \
|
||||
tests/hlsl_d3d12
|
||||
|
||||
vkd3d_shader_tests = \
|
||||
tests/d3dbc/dp2add.shader_test \
|
||||
tests/d3dbc/lrp.shader_test \
|
||||
tests/d3dbc/nrm.shader_test \
|
||||
tests/hlsl/abs.shader_test \
|
||||
|
||||
35
tests/d3dbc/dp2add.shader_test
Normal file
35
tests/d3dbc/dp2add.shader_test
Normal file
@@ -0,0 +1,35 @@
|
||||
[require]
|
||||
shader model = 2.0
|
||||
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0200 % ps_2_0
|
||||
05000051 a00f0000 3f000000 3f000000 3f800000 00000000 % def c0, 0.5, 0.5, 1.0, 0.0
|
||||
02000001 800f0000 a0e40000 % mov r0, c0
|
||||
0400005a 80070000 80000000 80000000 80ff0000 % dp2add r0.xyz, r0, r0, r0.w
|
||||
02000001 80080000 a0aa0000 % mov r0.w, c0.z
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (320, 240) f32(.5, .5, .5, 1.0)
|
||||
|
||||
% Test the _sat modifier.
|
||||
%
|
||||
% dp2add: (-0.5 * -0.5) + (-0.5 * -0.5) + 2.0 = 2.5
|
||||
% _sat: -> 1.0
|
||||
% add: (1.0 + -0.5) = 0.5
|
||||
%
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0200 % ps_2_0
|
||||
05000051 a00f0000 bf000000 bf000000 3f800000 40000000 % def c0, -0.5, -0.5, 1.0, 2.0
|
||||
02000001 800f0000 a0e40000 % mov r0, c0
|
||||
0400005a 80170000 80000000 80000000 80ff0000 % dp2add_sat r0.xyz, r0, r0, r0.w
|
||||
03000002 80070000 80e40000 a0000000 % add r0.xyz, r0, c0.x
|
||||
02000001 80080000 a0aa0000 % mov r0.w, c0.z
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (320, 240) f32(.5, .5, .5, 1.0)
|
||||
Reference in New Issue
Block a user