mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
tests/d3dbc: Add some tests for nrm instructions.
These are adapted from Wine's test_nrm_instruction() d3d9 test by Paul Gofman.
This commit is contained in:
Notes:
Henri Verbeet
2025-11-27 22:06:01 +01:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1847
142
tests/d3dbc/nrm.shader_test
Normal file
142
tests/d3dbc/nrm.shader_test
Normal file
@@ -0,0 +1,142 @@
|
||||
[require]
|
||||
shader model = 3.0
|
||||
|
||||
[vertex shader d3dbc-hex]
|
||||
fffe0300 % vs_3_0
|
||||
05000051 a00f0000 00000000 3f800000 3e99999a 3f000000 % def c0, 0.0, 1.0, 0.3, 0.5
|
||||
0200001f 80000000 900f0000 % dcl_position v0
|
||||
0200001f 80000000 e00f0000 % dcl_position o0
|
||||
0200001f 80000005 e00f0001 % dcl_texcoord0 o1
|
||||
0200001f 80010005 e00f0002 % dcl_texcoord1 o2
|
||||
0200001f 80020005 e00f0003 % dcl_texcoord2 o3
|
||||
02000001 e00f0000 90e40000 % mov o0, v0
|
||||
02000001 e00f0001 a0450000 % mov o1, c0.yyxy
|
||||
02000001 e00f0002 a0e40000 % mov o2, c0
|
||||
02000024 800f0000 a0e40000 % nrm r0, c0
|
||||
02000001 e00f0003 80e40000 % mov o3, r0
|
||||
0000ffff % end
|
||||
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0300 % ps_3_0
|
||||
0200001f 80000005 90070001 % dcl_texcoord0 v0.xyz
|
||||
02000024 800f0000 90e40001 % nrm r0, v0
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (320, 240) f32(.707106769, .707106769, 0, .707106769)
|
||||
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0300 % ps_3_0
|
||||
0200001f 80000005 90070000 % dcl_texcoord0 v0.xyz
|
||||
02000001 800f0000 a0e40000 % mov r0, c0
|
||||
02000024 80070000 90e40000 % nrm r0.xyz, v0
|
||||
02000001 80040000 80ff0000 % mov r0.z, r0.w
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
uniform 0 float4 .1 .1 .1 .1
|
||||
todo draw quad
|
||||
probe (320, 240) f32(.707106769, .707106769, .1, .1)
|
||||
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0300 % ps_3_0
|
||||
0200001f 80010005 900f0000 % dcl_texcoord1 v0.xyzw
|
||||
02000024 800f0000 90e40000 % nrm r0, v0
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (320, 240) f32(0, .957826257, .287347883, .478913128)
|
||||
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0300 % ps_3_0
|
||||
0200001f 80020005 900f0000 % dcl_texcoord2 v0.xyzw
|
||||
02000001 800f0000 90e40000 % mov r0, v0
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (320, 240) f32(0, .957826257, .287347883, .478913128)
|
||||
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0300 % ps_3_0
|
||||
0200001f 80010005 900f0000 % dcl_texcoord1 v0.xyzw
|
||||
02000001 800f0000 a0e40000 % mov r0, c0
|
||||
02000024 80070000 90e40000 % nrm r0.xyz, v0
|
||||
02000001 80040000 80ff0000 % mov r0.z, r0.w
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (320, 240) f32(0, .957826257, .1, .1)
|
||||
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0300 % ps_3_0
|
||||
0200001f 80010005 900f0000 % dcl_texcoord1 v0.xyzw
|
||||
02000001 800f0000 a0e40000 % mov r0, c0
|
||||
02000024 800f0000 90540000 % nrm r0, v0.xy
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (320, 240) f32(0, .707106769, .707106769, .707106769)
|
||||
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0300 % ps_3_0
|
||||
0200001f 80010005 900f0000 % dcl_texcoord1 v0.xyzw
|
||||
02000001 800f0000 a0e40000 % mov r0, c0
|
||||
02000024 80070000 90fd0000 % nrm r0.xyz, v0.yw
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (320, 240) f32(.816496611, .408248276, .408248276, .1) 1
|
||||
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0300 % ps_3_0
|
||||
0200001f 80010005 90030000 % dcl_texcoord1 v0.xy
|
||||
02000001 800f0000 a0e40000 % mov r0, c0
|
||||
02000024 800f0000 90540000 % nrm r0, v0
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
probe (320, 240) f32(0, .707106769, .707106769, .707106769)
|
||||
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0300 % ps_3_0
|
||||
02000024 800f0000 a0e40000 % nrm r0, c0
|
||||
02000001 80040000 80ff0000 % mov r0.z, r0.w
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
uniform 0 float4 0 0 0 0
|
||||
todo draw quad
|
||||
probe (320, 240) f32(0, 0, 0, 0)
|
||||
uniform 0 float4 2.0 0.0 0.0 0.5
|
||||
todo draw quad
|
||||
probe (320, 240) f32(1.0, 0.0, .25, .25)
|
||||
uniform 0 float4 1.0 1.0 1.0 1.0
|
||||
todo draw quad
|
||||
probe (320, 240) f32(.577350259, .577350259, .577350259, .577350259)
|
||||
|
||||
[pixel shader d3dbc-hex]
|
||||
ffff0300 % ps_3_0
|
||||
02000024 800f0000 a0390000 % nrm r0, c0.yzwx
|
||||
02000001 800f0800 80e40000 % mov oC0, r0
|
||||
0000ffff % end
|
||||
|
||||
[test]
|
||||
uniform 0 float4 1.0 1.0 0.0 2.0
|
||||
todo draw quad
|
||||
probe (320, 240) f32(.447213590, 0, .894427180, .447213590)
|
||||
Reference in New Issue
Block a user