Henri Verbeet pushed to branch master at wine / vkd3d
Commits:
ce4f2728 by Henri Verbeet at 2025-01-16T19:18:08+01:00
vkd3d-shader/msl: Get rid of a stray vkd3d_string_buffer_printf() in the VEC4 UINT immediate constant handling.
Uncovered by the ininf() test in the next commit. This is why we insist
on test coverage; unfortunately this one slipped through in
fd1beedc07becc7e5e49b64273f7bde7f9a8b2a0.
- - - - -
a082daeb by Nikolay Sivov at 2025-01-16T19:25:02+01:00
vkd3d-shader/hlsl: Implement the isinf() intrinsic.
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
- - - - -
7 changed files:
- Makefile.am
- libs/vkd3d-shader/hlsl.c
- libs/vkd3d-shader/hlsl.h
- libs/vkd3d-shader/hlsl.y
- libs/vkd3d-shader/hlsl_codegen.c
- libs/vkd3d-shader/msl.c
- + tests/hlsl/isinf.shader_test
View it on GitLab: https://gitlab.winehq.org/wine/vkd3d/-/compare/cf19b4da49caec1e43156eca04c1…
--
View it on GitLab: https://gitlab.winehq.org/wine/vkd3d/-/compare/cf19b4da49caec1e43156eca04c1…
You're receiving this email because of your account on gitlab.winehq.org.
Henri Verbeet pushed to branch master at wine / vkd3d
Commits:
4f7c1172 by Francisco Casas at 2025-01-16T18:43:12+01:00
tests: Test casting negative floats to int.
Turns out we are not doing this correctly in SM1, because the rounding
should be to the number that is closer to zero and lower_casts_to_int()
doesn't do that.
A vertex shader test is added since in SM1 they must rely on the SLT
operation instead of the CMP operation.
- - - - -
2d91bd92 by Francisco Casas at 2025-01-16T18:46:49+01:00
vkd3d-shader/hlsl: Properly lower casts to int for negative numbers.
While it looks complicated, it is what fxc/d3dcompiler does.
A shader as simple as:
float4 f;
float4 main() : sv_target
{
return (int4)f;
}
results in the following instructions:
ps_2_0
def c1, 0, 1, 0, 0
frc r0, c0
cmp r1, -r0, c1.x, c1.y
add r0, -r0, c0
mov r2, c0
cmp r1, r2, c1.x, r1
add r0, r0, r1
mov oC0, r0
- - - - -
cf19b4da by Francisco Casas at 2025-01-16T18:48:35+01:00
vkd3d-shader/hlsl: Specialize lowering SM1 casts to int for vertex shaders.
Vertex shaders do not have CMP, so we use SLT and MAD.
For example, this vertex shader:
uniform float4 f;
void main(inout float4 pos : position, out float4 t1 : TEXCOORD1)
{
t1 = (int4)f;
}
results in:
vs_2_0
dcl_position v0
slt r0, c0, -c0
frc r1, c0
add r2, -r1, c0
slt r1, -r1, r1
mad oT1, r0, r1, r2
mov oPos, v0
while we have the lower_cmp() pass, each time it is applied many
instructions are generated, so this patch introduces a specialized
version of the cast-to-int lowering for efficiency.
- - - - -
2 changed files:
- libs/vkd3d-shader/hlsl_codegen.c
- tests/hlsl/cast-to-int.shader_test
View it on GitLab: https://gitlab.winehq.org/wine/vkd3d/-/compare/efd7f2e014d9092393da6b91762b…
--
View it on GitLab: https://gitlab.winehq.org/wine/vkd3d/-/compare/efd7f2e014d9092393da6b91762b…
You're receiving this email because of your account on gitlab.winehq.org.