HansKristian-Work / vkd3d-proton

Fork of VKD3D. Development branches for Proton's Direct3D 12 implementation.
GNU Lesser General Public License v2.1
1.82k stars 190 forks source link

tests rely on undefined behavior #1831

Closed KonstantinSeurer closed 8 months ago

KonstantinSeurer commented 8 months ago

Float to integer conversions

The SPIR_V spec states:

Khronos issue #491: For OpConvertFToU and OpConvertFToS, behavior is undefined if Result Type is not wide enough to hold the converted value.

test_shader_instructions expects the conversions to saturate and map NAN to 0. The issue can be reproduced when running on lavapipe.

Texture sampling level selection

The Vulkan spec allows lod=0.5 to be rounded to 1 or 0: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#textures-image-level-selection with 0 being preferred. test_sample_instructions test 23 expects it to be ceiled.

doitsujin commented 8 months ago

As discussed on Discord:

KonstantinSeurer commented 8 months ago

Makes sense. I will se what I can do on the lavapipe side.