mesa/src/intel/vulkan
Alyssa Rosenzweig 3ce875a2d0 anv: use D3D-compatible texturing for Proton
Intel & AMD Direct3D drivers modify their rounding behaviour for texturing to
match Direct3D expectations. Such behaviour is not conformant in Vulkan, and
Intel hardware lacks a reasonable way to get NVIDIA's behaviour (which uniquely
works for Vulkan & Direct3D). The second best choice is to use
Direct3D-compatible behaviour for Proton (via driconf) and our current
Vulkan-conformant behaviour everywhere else. Given the APIs diverge and there is
no Vulkan extension to control the behaviour explicitly, driconf'ing on the
engineName is the reasonable solution.

anv already has a anv_force_filter_addr_rounding driconf option to force
Direct3D behaviour for certain Direct3D titles. Here we simply apply it to all
D3D10+ titles, aligning us with the Windows driver.

Note that D3D9 does not have this behaviour. We therefore use standard Vulkan
behaviour for D3D9 to avoid breaking D3D9 titles, even though the engineName is
the same as D3D10+.

This is the same solution radv uses, they call it radv_disable_trunc_coord. We
could unify the driconf entries later.

See https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38098#note_3166306
for a more detailed analysis, as well as the linked references:

   https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27337
   https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25911
   https://github.com/HansKristian-Work/vkd3d-proton/pull/1884

This fixes misrendering in piles of Direct3D games run on anv via Proton,
including Assassin's Creed Valhalla.

Cc: mesa-stable
Closes: #13886
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Co-authored-by: Calder Young <cgiacun@gmail.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
(cherry picked from commit 7a71952762)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38268>
2025-10-30 12:13:52 -07:00
..
bvh vulkan/bvh: Enable glsl extensions in meson 2025-09-16 20:18:01 +00:00
i915 anv: Switch to util/cache_ops.h 2025-10-16 01:19:44 +00:00
layers anv: reuse object string for RMV token 2024-08-05 21:12:59 +00:00
tests intel/tests: Reduce load from anv_tests 2024-09-09 12:54:34 +00:00
xe anv: Switch to util/cache_ops.h 2025-10-16 01:19:44 +00:00
anv_allocator.c anv/allocator: Subtract start_offset in chunk_offset 2025-10-08 17:26:42 +00:00
anv_android.c anv: adopt common GetAndroidHardwareBufferPropertiesANDROID 2025-08-22 23:40:35 +00:00
anv_android.h anv: drop anv_ahb_format_for_vk_format 2025-08-22 23:40:35 +00:00
anv_android_stubs.c anv: drop anv_ahb_format_for_vk_format 2025-08-22 23:40:35 +00:00
anv_api_version.h anv: advertise Vulkan 1.4 2024-12-02 21:56:39 +00:00
anv_astc_emu.c brw: drop indirection on compiler options 2025-09-18 14:14:08 +00:00
anv_batch_chain.c anv: Switch to util/cache_ops.h 2025-10-16 01:19:44 +00:00
anv_blorp.c anv: fix companion usage for emulated image 2025-10-09 21:38:33 +00:00
anv_buffer.c anv: pass down buffer usage for isl_buffer_fill_state 2025-03-26 20:19:07 +00:00
anv_buffer_view.c anv: add support for shaderStorageImageReadWithoutFormat through emulation 2025-06-06 12:28:42 +00:00
anv_cmd_buffer.c anv: fix crash in ESO tests 2025-09-24 00:34:50 +03:00
anv_descriptor_set.c anv: destroy sets when destroying pool 2025-10-24 07:55:02 -07:00
anv_device.c anv: Switch to util/cache_ops.h 2025-10-16 01:19:44 +00:00
anv_embedded_sampler.c anv: extract embedded samplers from pipeline_cache 2025-08-01 11:35:04 +00:00
anv_event.c anv: split events from anv_device.c 2024-07-22 18:46:05 +00:00
anv_formats.c anv: Enable R10X6 & R10X6G10X6 unorm formats 2025-10-09 18:42:13 +00:00
anv_gem.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
anv_gem_stubs.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
anv_genX.h anv: Rename anv_shader_bin to anv_shader_internal 2025-10-08 19:58:30 +00:00
anv_image.c anv: Assert that we only import ahb image with one layer 2025-10-09 18:42:13 +00:00
anv_image_host_copy.c anv: fix image-to-image copies of TileW images 2025-10-16 11:37:38 -07:00
anv_image_view.c vulkan: Drop the driver_internal from vk_image_view_init/create() 2025-09-05 23:34:14 +00:00
anv_instance.c anv: use D3D-compatible texturing for Proton 2025-10-30 12:13:52 -07:00
anv_internal_kernels.c brw: Move into a new src/intel/compiler/brw subdirectory 2025-10-09 07:01:47 +00:00
anv_internal_kernels.h anv: implement Wa_16011107343/22018402687 for generated draws 2024-11-12 22:48:39 +00:00
anv_kmd_backend.c
anv_kmd_backend.h anv: make device initialization more asynchronous 2024-06-13 08:29:25 +00:00
anv_measure.c anv: rework gfx state emission (again) 2025-08-11 11:14:53 +00:00
anv_measure.h
anv_nir.h anv: remove unused gfx/compute pipeline code 2025-09-05 07:46:20 +00:00
anv_nir_apply_pipeline_layout.c brw: Move into a new src/intel/compiler/brw subdirectory 2025-10-09 07:01:47 +00:00
anv_nir_compute_push_layout.c brw: Move into a new src/intel/compiler/brw subdirectory 2025-10-09 07:01:47 +00:00
anv_nir_lower_multiview.c treewide: use nir_def_block 2025-08-01 15:34:24 +00:00
anv_nir_lower_resource_intel.c treewide: use nir_metadata_control_flow 2024-06-17 16:28:14 -04:00
anv_nir_lower_ubo_loads.c brw,anv: Reduce UBO robustness size alignment to 16 bytes 2025-08-21 09:04:55 +00:00
anv_nir_lower_unaligned_dispatch.c brw: Move into a new src/intel/compiler/brw subdirectory 2025-10-09 07:01:47 +00:00
anv_nir_push_descriptor_analysis.c brw: Move into a new src/intel/compiler/brw subdirectory 2025-10-09 07:01:47 +00:00
anv_perf.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
anv_physical_device.c anv: Enable VK_ANDROID_external_format_resolve 2025-10-09 18:42:13 +00:00
anv_pipeline_cache.c brw: Rename brw_shader_reloc to intel_shader_reloc 2025-10-09 07:01:46 +00:00
anv_private.h brw: handle GLSL/GLSL tessellation parameters 2025-10-24 07:54:56 -07:00
anv_queue.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
anv_rmv.c anv: remove unused gfx/compute pipeline code 2025-09-05 07:46:20 +00:00
anv_rmv.h anv: remove unused gfx/compute pipeline code 2025-09-05 07:46:20 +00:00
anv_sampler.c anv: rework embedded sampler hashing 2025-07-07 18:53:53 +00:00
anv_shader.c brw: Move into a new src/intel/compiler/brw subdirectory 2025-10-09 07:01:47 +00:00
anv_shader.h anv: Simply anv_shader_set_relocs() parameters 2025-10-08 19:58:29 +00:00
anv_shader_compile.c anv: Call brw_nir_lower_rt_intrinsics_pre_trace lowering pass 2025-10-27 09:34:33 -07:00
anv_slab_bo.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
anv_slab_bo.h anv: Add the base infrastructure to support memory pool 2025-04-30 12:56:39 +00:00
anv_sparse.c anv: Rework locking for sparse binding with TR-TT 2025-09-15 17:45:15 +00:00
anv_util.c brw: Move into a new src/intel/compiler/brw subdirectory 2025-10-09 07:01:47 +00:00
anv_utrace.c anv: Rename anv_shader_bin to anv_shader_internal 2025-10-08 19:58:30 +00:00
anv_va.c anv: track the first 2MB of unused VA 2025-02-05 09:56:03 +00:00
anv_video.c anv/video: remove support for VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT 2025-10-13 12:06:24 +00:00
anv_wsi.c vulkan/wsi: Take a vk_queue in wsi_common_queue_present() 2025-08-22 23:05:02 +00:00
av1_tables.h anv: add default av1 tables from media-driver 2025-01-10 21:45:04 +00:00
genX_acceleration_structure.c vulkan: Add more detail to encode debug markers 2025-09-10 08:35:50 +00:00
genX_blorp_exec.c anv: rework gfx state emission (again) 2025-08-11 11:14:53 +00:00
genX_cmd_buffer.c anv: Add external format resolve operation using blorp 2025-10-09 18:42:13 +00:00
genX_cmd_compute.c anv: Rename anv_shader_bin to anv_shader_internal 2025-10-08 19:58:30 +00:00
genX_cmd_draw.c anv: fix FS output <-> attachment map building 2025-09-24 21:47:42 +00:00
genX_cmd_draw_generated_flush.h intel: Use _brw suffix for genX headers that rely on brw 2024-02-24 00:24:32 +00:00
genX_cmd_draw_generated_indirect.h anv: Rename anv_shader_bin to anv_shader_internal 2025-10-08 19:58:30 +00:00
genX_cmd_draw_helpers.h anv: store gfx/compute bound shaders on command buffer state 2025-08-01 11:35:08 +00:00
genX_cmd_video.c anv: Fix tiling for AV1 IntraBC surface on Gfx125+ 2025-09-23 07:48:42 +00:00
genX_cmd_video_enc.c anv/video: fix to set slice block size correctly for h265 decoding. 2025-09-26 12:27:59 +00:00
genX_gfx_state.c anv/brw: fix output tcs vertices 2025-10-24 07:55:01 -07:00
genX_gpu_memcpy.c anv: rework gfx state emission (again) 2025-08-11 11:14:53 +00:00
genX_init_state.c anv: store a few default instructions 2025-09-05 07:46:20 +00:00
genX_internal_kernels.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
genX_mi_builder.h anv/genxml: use special genX video pack files 2025-04-01 00:03:56 +03:00
genX_query.c anv: fix query copy with shaders 2025-10-10 21:31:09 +00:00
genX_shader.c brw: handle GLSL/GLSL tessellation parameters 2025-10-24 07:54:56 -07:00
genX_simple_shader.c anv: Rename anv_shader_bin to anv_shader_internal 2025-10-08 19:58:30 +00:00
meson.build vulkan: Compute path to write into JSON manifests once, use it everywhere 2025-09-26 10:47:31 +00:00
vp9_tables.h anv: add default vp9 tables from FFMpeg and intel-vaapi-driver 2025-06-13 04:51:51 +00:00