1
0
mirror of https://github.com/RPCS3/ps3autotests.git synced 2024-11-08 11:52:58 +01:00

Tests updated: rsx_fp_static 2 and 4 (fmod issue)

These scripts were wrongly translated since mod (GLSL) != fmod (CG).
This is now fixed and the .cg/.elf/.expected files have been updated.
Thanks @nohbdy for spotting this.
This commit is contained in:
Alexandro Sánchez Bach 2014-04-25 00:28:12 +02:00
parent e67aaa10b2
commit 48b3c59971
7 changed files with 34 additions and 5 deletions

1
tests/cpu/spu_generic/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build.script

View File

@ -12,6 +12,20 @@ struct f2fConnector
float4 COL0 : COLOR0;
};
// GLSL mod
float mod(float x, float y)
{
return x - y * floor(x/y);
}
float2 mod(float2 x, float y)
{
return x - y * floor(x/y);
}
float3 mod(float3 x, float y)
{
return x - y * floor(x/y);
}
// Defines
#define PI 3.14159265359
@ -46,7 +60,7 @@ f2fConnector main
r *= 1.0 + 0.05*sin(r.x*5.) + 0.05*sin(r.y*3.);
r *= 1.0 + 0.2*length(r);
float side = 0.5;
float2 r2 = fmod(r, side);
float2 r2 = mod(r, side);
float2 r3 = r2-side/2.;
float i = floor(r.x/side)+2.;
float j = floor(r.y/side)+4.;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 263 KiB

View File

@ -12,6 +12,20 @@ struct f2fConnector
float4 COL0 : COLOR0;
};
// GLSL mod
float mod(float x, float y)
{
return x - y * floor(x/y);
}
float2 mod(float2 x, float y)
{
return x - y * floor(x/y);
}
float3 mod(float3 x, float y)
{
return x - y * floor(x/y);
}
// Defines
#define occlusion_enabled
#define occlusion_pass1_quality 40
@ -67,7 +81,7 @@ float hashlerp(float3 p0, float3 p1, float3 interp)
float noise2(float3 p) // 3D noise2
{
float3 pm = fmod(p,1.0);
float3 pm = mod(p,1.0);
float3 pd = p-pm;
return hashlerp(pd,(pd+float3(1.0,1.0,1.0)), pm);
}
@ -109,7 +123,7 @@ float3 rotate_x(float3 v, float angle)
float spheres(float3 p)
{
p.xz += float2(2.0);
p.xz = fmod(p.xz,float2(4.0));
p.xz = mod(p.xz,float2(4.0));
p.xz -= float2(2.0);
float d = length(p)-1.0;
return d;
@ -257,14 +271,14 @@ float3 background(float3 p,float3 d) // Render background
float noise2(float p)
{
float pm = fmod(p,1.0);
float pm = mod(p,1.0);
float pd = p-pm;
return hashlerp(pd,pd+1.0,pm);
}
float noise2(float2 p)
{
float2 pm = fmod(p,1.0);
float2 pm = mod(p,1.0);
float2 pd = p-pm;
return hashlerp(pd,(pd+float2(1.0,1.0)), pm);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 149 KiB