From 53c29dbbea25928bebe5ac01fc5792b6f4ad1413 Mon Sep 17 00:00:00 2001 From: qiaojbao Date: Fri, 26 Jan 2024 13:55:59 +0800 Subject: [PATCH] Update xgl from commit cd97d348 Update Khronos Vulkan Headers to 1.3.273 Update PAL Version in XGL 844 Update params in hard-coded barriers Add missing initializer of library summaries Add new flag deprecateWave64WaveIntrinsics Add null fragment for graphics pipeline library fast link Add option PipelineLinkOptimizationMode and refine option PipelineFastCompileMode Add RGD info for Dispatch/Draw/Barrier Add support for D24_UNORM_S8_UINT and X8_D24_UNORM_PACK32 Add support for LLPC's library summaries Check the pipeline create info before creating a null fragment shader library for graphics pipeline library fast link Cleanup linked libs Correct barrier for timestamp initialization Correct graphics pipeline library cache usage Enable graphics pipeline library fast link by default Expose 3D linear image support after fixes Fill null fragment shader for VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER VK_KHR_calibrated_timestamps implementation VK_KHR_vertex_attribute_divisor implementation Wavesize clamping implementation Implement VK_EXT_image_compression_control Improve the RayTracing pipeline compile time Limit memory size for pipeline binary cache Link libstdc++ statically Optimize color export hash Optimize internal buffer implementation Pass option emitRaytracingShaderDataToken to compiler Prevent CreateClearSubresRanges creates unsupported ranges Refine Pipeline dump Remove all shader for color export shader Remove ShaderCache Remove the unnecessary check for the shader module Remove the workaround of disabling new PAL metadata for Detroit Removed over unnecessary settings Reuse released items in m_shaderModuleHandleMap Set disablePerCompFetch for LLPC Support Pixel Shader and Export Shader compilation for Vulkan graphics pipeline library fast link Support RGP with graphics pipeline library fastlink enabled Fix dEQP-VK.pipeline.fast_linked_library.image.suballocation.sampling_type.*.view_*.format.* test failures Fix flags used in pipeline creation Fix RGP crash when graphics pipeline library fast link enabled Fix Saints Row crash when changing settings Fix the corruption observed in DXVK MetalGearSolid V Fix the corruption on ELEX2 rocks Fix the line corruption observed in TheEvilWithin2 Fix the push_constant issue when the size is v2int8 Fix vkQueueSubmit/vkQueueSubmit2 returns VK_TIMEOUT when non-primary GPU is asked to wait on non-signaled timeline semaphore Fixed memory leak in gpu_decode_layer --- CMakeLists.txt | 2 +- cmake/Modules/AmdCmakeHelper.cmake | 2 +- cmake/Modules/FindAMDBoost.cmake | 2 +- cmake/Modules/FindAMDNinja.cmake | 2 +- cmake/Modules/FindDRM.cmake | 2 +- cmake/Modules/FindKernelHeaders.cmake | 2 +- cmake/Modules/FindXCB.cmake | 2 +- cmake/Modules/XglSetupAmdGlobalRoots.cmake | 2 +- cmake/XglCompileDefinitions.cmake | 2 +- cmake/XglCompilerOptions.cmake | 2 +- cmake/XglHelper.cmake | 2 +- cmake/XglOptions.cmake | 2 +- cmake/XglOverrides.cmake | 2 +- cmake/XglPackaging.cmake | 2 +- cmake/XglVersions.cmake | 4 +- icd/CMakeLists.txt | 26 +- icd/Loader/LunarG/Lnx/amd-icd.json | 4 +- icd/api/app_profile.cpp | 59 +- icd/api/app_resource_optimizer.cpp | 2 +- icd/api/app_shader_optimizer.cpp | 11 +- icd/api/appopt/barrier_filter_layer.cpp | 2 +- icd/api/appopt/barrier_filter_layer.h | 2 +- icd/api/appopt/gpu_decode_layer.cpp | 3 +- icd/api/appopt/gpu_decode_layer.h | 2 +- icd/api/appopt/opt_layer.h | 2 +- icd/api/appopt/strange_brigade_layer.cpp | 2 +- icd/api/appopt/strange_brigade_layer.h | 2 +- icd/api/barrier_policy.cpp | 2 +- icd/api/binary_cache_serialization.cpp | 2 +- icd/api/cache_adapter.cpp | 2 +- icd/api/cmd_buffer_ring.cpp | 2 +- icd/api/color_space_helper.cpp | 2 +- icd/api/compiler_solution.cpp | 2 +- icd/api/compiler_solution_llpc.cpp | 207 ++---- icd/api/debug_printf.cpp | 2 +- icd/api/devmode/devmode_mgr.cpp | 61 +- icd/api/devmode/devmode_mgr.h | 2 +- icd/api/entry.cpp | 2 +- icd/api/gpumemory_event_handler.cpp | 2 +- icd/api/graphics_pipeline_common.cpp | 35 +- icd/api/icd_main.cpp | 2 +- icd/api/include/app_profile.h | 5 +- icd/api/include/app_resource_optimizer.h | 2 +- icd/api/include/app_shader_optimizer.h | 2 +- icd/api/include/barrier_policy.h | 2 +- icd/api/include/binary_cache_serialization.h | 2 +- icd/api/include/cache_adapter.h | 2 +- icd/api/include/cmd_buffer_ring.h | 2 +- icd/api/include/color_space_helper.h | 2 +- icd/api/include/compiler_solution.h | 13 +- icd/api/include/compiler_solution_llpc.h | 3 +- icd/api/include/debug_printf.h | 2 +- icd/api/include/defer_compile_thread.h | 2 +- icd/api/include/gpumemory_event_handler.h | 2 +- icd/api/include/graphics_pipeline_common.h | 3 +- icd/api/include/internal_layer_hooks.h | 2 +- icd/api/include/internal_mem_mgr.h | 2 +- .../khronos/devext/vk_amd_gpa_interface.h | 2 +- .../khronos/devext/vk_internal_ext_helper.h | 2 +- .../khronos/sdk-1.3/vulkan/vulkan_core.h | 224 ++++-- icd/api/include/khronos/vk_icd.h | 2 +- icd/api/include/khronos/vk_layer.h | 2 +- icd/api/include/khronos/vk_platform.h | 2 +- .../vk_video/vulkan_video_codec_h264std.h | 2 +- .../vulkan_video_codec_h264std_decode.h | 2 +- .../vulkan_video_codec_h264std_encode.h | 2 +- .../vk_video/vulkan_video_codec_h265std.h | 2 +- .../vulkan_video_codec_h265std_decode.h | 2 +- .../vulkan_video_codec_h265std_encode.h | 2 +- .../vk_video/vulkan_video_codecs_common.h | 2 +- icd/api/include/khronos/vulkan.h | 2 +- icd/api/include/log.h | 2 +- icd/api/include/pipeline_binary_cache.h | 2 +- icd/api/include/pipeline_compiler.h | 28 +- icd/api/include/render_state_cache.h | 2 +- icd/api/include/virtual_stack_mgr.h | 2 +- icd/api/include/vk_alloccb.h | 2 +- icd/api/include/vk_buffer.h | 2 +- icd/api/include/vk_buffer_view.h | 2 +- icd/api/include/vk_cmd_pool.h | 2 +- icd/api/include/vk_cmdbuffer.h | 4 +- icd/api/include/vk_compute_pipeline.h | 2 +- icd/api/include/vk_conv.h | 16 +- icd/api/include/vk_debug_report.h | 2 +- icd/api/include/vk_debug_utils.h | 2 +- icd/api/include/vk_deferred_operation.h | 2 +- icd/api/include/vk_defines.h | 2 +- icd/api/include/vk_descriptor_buffer.h | 2 +- icd/api/include/vk_descriptor_pool.h | 2 +- icd/api/include/vk_descriptor_set.h | 2 +- icd/api/include/vk_descriptor_set_layout.h | 2 +- .../include/vk_descriptor_update_template.h | 2 +- icd/api/include/vk_device.h | 9 +- icd/api/include/vk_dispatch.h | 2 +- icd/api/include/vk_event.h | 2 +- icd/api/include/vk_extensions.h | 5 +- icd/api/include/vk_fence.h | 2 +- icd/api/include/vk_formats.h | 8 +- icd/api/include/vk_framebuffer.h | 2 +- icd/api/include/vk_gpa_session.h | 2 +- icd/api/include/vk_graphics_pipeline.h | 12 +- .../include/vk_graphics_pipeline_library.h | 3 +- icd/api/include/vk_image.h | 3 +- icd/api/include/vk_image_view.h | 2 +- icd/api/include/vk_instance.h | 9 +- icd/api/include/vk_memory.h | 2 +- icd/api/include/vk_physical_device.h | 27 +- icd/api/include/vk_physical_device_manager.h | 2 +- icd/api/include/vk_pipeline.h | 2 +- icd/api/include/vk_pipeline_cache.h | 2 +- icd/api/include/vk_pipeline_layout.h | 4 +- icd/api/include/vk_private_data_slot.h | 2 +- icd/api/include/vk_query.h | 2 +- icd/api/include/vk_queue.h | 2 +- icd/api/include/vk_render_pass.h | 2 +- icd/api/include/vk_sampler.h | 2 +- icd/api/include/vk_sampler_ycbcr_conversion.h | 2 +- icd/api/include/vk_semaphore.h | 9 +- icd/api/include/vk_shader.h | 4 +- icd/api/include/vk_shader_code.h | 2 +- icd/api/include/vk_surface.h | 2 +- icd/api/include/vk_swapchain.h | 2 +- icd/api/include/vk_utils.h | 2 +- icd/api/internal_mem_mgr.cpp | 2 +- icd/api/pipeline_binary_cache.cpp | 13 +- icd/api/pipeline_compiler.cpp | 665 +++++++++++++++--- icd/api/raytrace/ray_tracing_device.cpp | 2 +- icd/api/raytrace/ray_tracing_device.h | 2 +- icd/api/raytrace/ray_tracing_util.h | 2 +- .../raytrace/vk_acceleration_structure.cpp | 2 +- icd/api/raytrace/vk_acceleration_structure.h | 2 +- icd/api/raytrace/vk_ray_tracing_pipeline.cpp | 59 +- icd/api/raytrace/vk_ray_tracing_pipeline.h | 7 +- icd/api/render_state_cache.cpp | 2 +- icd/api/renderpass/renderpass_builder.cpp | 2 +- icd/api/renderpass/renderpass_builder.h | 2 +- icd/api/renderpass/renderpass_types.h | 2 +- icd/api/shader_cache.cpp | 85 --- icd/api/shaders/auto_stereo.comp | 2 +- icd/api/shaders/auto_stereo_spv.h | 2 +- ...py_acceleration_structure_query_pool_spv.h | 2 +- icd/api/shaders/copy_query_pool.comp | 2 +- .../shaders/copy_timestamp_query_pool_spv.h | 2 +- .../copy_timestamp_query_pool_strided_spv.h | 2 +- icd/api/shaders/generate_shader_util.py | 2 +- icd/api/shaders/make_auto_stereo_shaders.py | 2 +- icd/api/shaders/make_llpc_shaders.py | 3 +- icd/api/shaders/null_fragment.frag | 4 + .../null_fragment_spv.h} | 63 +- icd/api/sqtt/sqtt_layer.cpp | 136 +++- icd/api/sqtt/sqtt_layer.h | 9 +- icd/api/sqtt/sqtt_mgr.cpp | 2 +- icd/api/sqtt/sqtt_mgr.h | 2 +- icd/api/sqtt/sqtt_object_mgr.cpp | 2 +- icd/api/sqtt/sqtt_object_mgr.h | 2 +- icd/api/sqtt/sqtt_rgp_annotations.h | 2 +- icd/api/strings/entry_points.txt | 3 + icd/api/strings/extensions.txt | 3 + icd/api/strings/func_table_template.py | 2 +- icd/api/strings/generate_strings.py | 2 +- icd/api/strings/strings.cpp | 2 +- icd/api/strings/strings.h | 2 +- icd/api/utils/json_reader.cpp | 2 +- icd/api/utils/json_reader.h | 2 +- icd/api/utils/json_writer.cpp | 2 +- icd/api/utils/json_writer.h | 2 +- icd/api/utils/temp_mem_arena.cpp | 2 +- icd/api/utils/temp_mem_arena.h | 2 +- icd/api/virtual_stack_mgr.cpp | 2 +- icd/api/vk_alloccb.cpp | 2 +- icd/api/vk_buffer.cpp | 2 +- icd/api/vk_buffer_view.cpp | 2 +- icd/api/vk_cmd_pool.cpp | 2 +- icd/api/vk_cmdbuffer.cpp | 152 ++-- icd/api/vk_cmdbuffer_transfer.cpp | 2 +- icd/api/vk_compute_pipeline.cpp | 2 +- icd/api/vk_conv.cpp | 2 +- icd/api/vk_debug_report.cpp | 2 +- icd/api/vk_debug_utils.cpp | 2 +- icd/api/vk_deferred_operation.cpp | 2 +- icd/api/vk_descriptor_buffer.cpp | 2 +- icd/api/vk_descriptor_pool.cpp | 2 +- icd/api/vk_descriptor_set.cpp | 2 +- icd/api/vk_descriptor_set_layout.cpp | 2 +- icd/api/vk_descriptor_update_template.cpp | 2 +- icd/api/vk_device.cpp | 72 +- icd/api/vk_dispatch.cpp | 7 +- icd/api/vk_event.cpp | 2 +- icd/api/vk_fence.cpp | 2 +- icd/api/vk_formats.cpp | 2 +- icd/api/vk_framebuffer.cpp | 2 +- icd/api/vk_gpa_session.cpp | 2 +- icd/api/vk_graphics_pipeline.cpp | 171 +++-- icd/api/vk_graphics_pipeline_library.cpp | 58 +- icd/api/vk_image.cpp | 26 +- icd/api/vk_image_view.cpp | 2 +- icd/api/vk_instance.cpp | 24 +- icd/api/vk_memory.cpp | 2 +- icd/api/vk_physical_device.cpp | 48 +- icd/api/vk_physical_device_manager.cpp | 2 +- icd/api/vk_pipeline.cpp | 8 +- icd/api/vk_pipeline_cache.cpp | 2 +- icd/api/vk_pipeline_layout.cpp | 26 +- icd/api/vk_private_data_slot.cpp | 2 +- icd/api/vk_query.cpp | 2 +- icd/api/vk_queue.cpp | 4 +- icd/api/vk_render_pass.cpp | 2 +- icd/api/vk_sampler.cpp | 2 +- icd/api/vk_sampler_ycbcr_conversion.cpp | 2 +- icd/api/vk_semaphore.cpp | 14 +- icd/api/vk_shader.cpp | 4 +- icd/api/vk_surface.cpp | 2 +- icd/api/vk_swapchain.cpp | 4 +- icd/api/vk_utils.cpp | 2 +- icd/imported/gputexdecoder/CMakeLists.txt | 2 +- icd/imported/gputexdecoder/gpuTexDecoder.cpp | 2 +- icd/imported/gputexdecoder/gpuTexDecoder.h | 2 +- icd/imported/gputexdecoder/shaders.h | 2 +- .../gputexdecoder/shaders/AstcDecode.comp | 2 +- .../gputexdecoder/shaders/AstcDecode.h | 2 +- .../gputexdecoder/shaders/Bc3Encoder.h | 2 +- .../gputexdecoder/shaders/Etc2Decode.h | 2 +- .../gputexdecoder/shaders/Etc2ToBc3.h | 2 +- icd/layers/include/query_dlist.h | 2 +- .../include/vk_layer_switchable_graphics.h | 2 +- icd/layers/query_dlist.cpp | 2 +- icd/layers/vk_layer_all_null_devices.cpp | 2 +- icd/layers/vk_layer_switchable_graphics.cpp | 2 +- icd/make/amdicd.so.def | 2 +- icd/res/ver.h | 10 +- icd/settings/settings.cpp | 32 +- icd/settings/settings.h | 2 +- icd/settings/settings_xgl.json | 194 ++++- icd/tools/generate/genSettingsCode.py | 2 +- icd/tools/generate/genShaderProfile.py | 2 +- icd/tools/generate/shaderProfileTemplate.py | 2 +- .../generate/vulkanSettingsCodeTemplates.py | 2 +- icd/tools/xgl-copyright-template.txt | 2 +- 238 files changed, 2177 insertions(+), 888 deletions(-) delete mode 100644 icd/api/shader_cache.cpp create mode 100644 icd/api/shaders/null_fragment.frag rename icd/api/{include/shader_cache.h => shaders/null_fragment_spv.h} (51%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43739b50..9c4841b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/AmdCmakeHelper.cmake b/cmake/Modules/AmdCmakeHelper.cmake index 00e53e6d..0c597e4a 100644 --- a/cmake/Modules/AmdCmakeHelper.cmake +++ b/cmake/Modules/AmdCmakeHelper.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/FindAMDBoost.cmake b/cmake/Modules/FindAMDBoost.cmake index 39822749..0099c468 100644 --- a/cmake/Modules/FindAMDBoost.cmake +++ b/cmake/Modules/FindAMDBoost.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/FindAMDNinja.cmake b/cmake/Modules/FindAMDNinja.cmake index 51a52203..a7a736dd 100644 --- a/cmake/Modules/FindAMDNinja.cmake +++ b/cmake/Modules/FindAMDNinja.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/FindDRM.cmake b/cmake/Modules/FindDRM.cmake index 21dee4ab..332820f9 100644 --- a/cmake/Modules/FindDRM.cmake +++ b/cmake/Modules/FindDRM.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/FindKernelHeaders.cmake b/cmake/Modules/FindKernelHeaders.cmake index ed68f345..1eb806e7 100644 --- a/cmake/Modules/FindKernelHeaders.cmake +++ b/cmake/Modules/FindKernelHeaders.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/FindXCB.cmake b/cmake/Modules/FindXCB.cmake index c53ce12c..91705290 100644 --- a/cmake/Modules/FindXCB.cmake +++ b/cmake/Modules/FindXCB.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/XglSetupAmdGlobalRoots.cmake b/cmake/Modules/XglSetupAmdGlobalRoots.cmake index 75adc264..fa7d9ab6 100644 --- a/cmake/Modules/XglSetupAmdGlobalRoots.cmake +++ b/cmake/Modules/XglSetupAmdGlobalRoots.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglCompileDefinitions.cmake b/cmake/XglCompileDefinitions.cmake index 9575478a..f015f753 100644 --- a/cmake/XglCompileDefinitions.cmake +++ b/cmake/XglCompileDefinitions.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglCompilerOptions.cmake b/cmake/XglCompilerOptions.cmake index c7132b8b..293d5c0e 100644 --- a/cmake/XglCompilerOptions.cmake +++ b/cmake/XglCompilerOptions.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglHelper.cmake b/cmake/XglHelper.cmake index 180853a1..aaba5869 100644 --- a/cmake/XglHelper.cmake +++ b/cmake/XglHelper.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglOptions.cmake b/cmake/XglOptions.cmake index a788820f..f89534a1 100644 --- a/cmake/XglOptions.cmake +++ b/cmake/XglOptions.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglOverrides.cmake b/cmake/XglOverrides.cmake index 5bbefe76..1c5afdbc 100644 --- a/cmake/XglOverrides.cmake +++ b/cmake/XglOverrides.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglPackaging.cmake b/cmake/XglPackaging.cmake index c52a05b5..12bcaf02 100644 --- a/cmake/XglPackaging.cmake +++ b/cmake/XglPackaging.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglVersions.cmake b/cmake/XglVersions.cmake index 65022cf9..d7a93d9e 100644 --- a/cmake/XglVersions.cmake +++ b/cmake/XglVersions.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -28,7 +28,7 @@ include_guard() # This will become the value of PAL_CLIENT_INTERFACE_MAJOR_VERSION. It describes the version of the PAL interface # that the ICD supports. PAL uses this value to enable backwards-compatibility for older interface versions. # It must be updated on each PAL promotion after handling all of the interface changes described in palLib.h. -set(ICD_PAL_CLIENT_MAJOR_VERSION "841") +set(ICD_PAL_CLIENT_MAJOR_VERSION "844") # This will become the value of GPUOPEN_CLIENT_INTERFACE_MAJOR_VERSION if ICD_GPUOPEN_DEVMODE_BUILD=1. # It describes the interface version of the gpuopen shared module (part of PAL) that the ICD supports. diff --git a/icd/CMakeLists.txt b/icd/CMakeLists.txt index d23cf120..ebe60fb8 100644 --- a/icd/CMakeLists.txt +++ b/icd/CMakeLists.txt @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -101,7 +101,6 @@ target_sources(xgl PRIVATE api/pipeline_binary_cache.cpp api/graphics_pipeline_common.cpp api/cache_adapter.cpp - api/shader_cache.cpp api/virtual_stack_mgr.cpp api/vk_alloccb.cpp api/vk_buffer.cpp @@ -296,6 +295,7 @@ add_dependencies(xgl RunVKSettingsGenerator) target_sources(xgl PRIVATE settings/g_settings.cpp settings/settings.cpp + settings/settings_xgl.json ) ### ICD api/sqtt ############################################################## @@ -319,7 +319,11 @@ endif() ### Link Libraries ##################################################################################################### if (UNIX) - target_link_libraries(xgl PRIVATE dl c stdc++ ${CMAKE_DL_LIBS} pthread) + target_link_libraries(xgl PRIVATE ${CMAKE_DL_LIBS}) + # Link pthread + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) + target_link_libraries(xgl PRIVATE Threads::Threads) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") message(WARNING "Intel ICC untested in CMake.") @@ -348,6 +352,11 @@ if (UNIX) -Wl,-soname=${ICD_TARGET}.so.1 ) + if(NOT BUILD_SHARED_LIBS) + # Link libstdc++ statically, so that symbols from libstdc++ do not cause conflicts + target_link_options(xgl PRIVATE -static-libgcc -static-libstdc++) + endif() + if(NOT XGL_USE_SANITIZER) # -Wl,--no-undefined is incompatible with asan target_link_libraries(xgl PRIVATE @@ -391,11 +400,16 @@ target_link_libraries(xgl PRIVATE xgl_cache_support) # Strip the symbols for release build, generate debug file if(UNIX) if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") + if (DEFINED TOOLCHAIN_TARGET) + set(TOOLCHAIN_TARGET_PREFIX "${TOOLCHAIN_TARGET}-") + else() + set(TOOLCHAIN_TARGET_PREFIX "") + endif() add_custom_command( TARGET xgl POST_BUILD - COMMAND objcopy --only-keep-debug ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so.debug - COMMAND strip ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so - COMMAND objcopy --add-gnu-debuglink=${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so.debug ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so + COMMAND ${TOOLCHAIN_TARGET_PREFIX}objcopy --only-keep-debug ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so.debug + COMMAND ${TOOLCHAIN_TARGET_PREFIX}strip ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so + COMMAND ${TOOLCHAIN_TARGET_PREFIX}objcopy --add-gnu-debuglink=${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so.debug ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so ) endif() endif() diff --git a/icd/Loader/LunarG/Lnx/amd-icd.json b/icd/Loader/LunarG/Lnx/amd-icd.json index 39860a5a..0f7876f9 100644 --- a/icd/Loader/LunarG/Lnx/amd-icd.json +++ b/icd/Loader/LunarG/Lnx/amd-icd.json @@ -2,13 +2,13 @@ "file_format_version": "1.0.0", "ICD": { "library_path": "@AMDVLK_INSTALL_PATH@/amdvlk@ISABITS@.so", - "api_version": "1.3.271" + "api_version": "1.3.273" }, "layer": { "name": "VK_LAYER_AMD_switchable_graphics_@ISABITS@", "type": "GLOBAL", "library_path": "@AMDVLK_INSTALL_PATH@/amdvlk@ISABITS@.so", - "api_version": "1.3.271", + "api_version": "1.3.273", "implementation_version": "1", "description": "AMD switchable graphics layer", "functions": { diff --git a/icd/api/app_profile.cpp b/icd/api/app_profile.cpp index c55643ee..536f7b98 100644 --- a/icd/api/app_profile.cpp +++ b/icd/api/app_profile.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -569,6 +569,12 @@ constexpr AppProfilePatternEntry AppNameCSGO = "csgo" }; +constexpr AppProfilePatternEntry AppNameELEX2 = +{ + PatternAppNameLower, + "elex2.exe" +}; + constexpr AppProfilePatternEntry AppNameCSGOLinux32Bit = { PatternAppNameLower, @@ -617,6 +623,12 @@ constexpr AppProfilePatternEntry AppNameMetalGearSolid5 = "mgsvtpp.exe" }; +constexpr AppProfilePatternEntry AppNameMetalGearSolid5Online = +{ + PatternAppNameLower, + "mgsvmgo.exe" +}; + constexpr AppProfilePatternEntry AppEngineIdTech2 = { PatternEngineNameLower, @@ -707,6 +719,18 @@ constexpr AppProfilePatternEntry AppEngineDivinity = "the divinity engine" }; +constexpr AppProfilePatternEntry AppNameDetroit = +{ + PatternAppNameLower, + "detroitbecomehuman" +}; + +constexpr AppProfilePatternEntry AppEngineQuanticDream = +{ + PatternEngineNameLower, + "quantic dream engine" +}; + constexpr AppProfilePatternEntry PatternEnd = {}; // This is a table of patterns. The first matching pattern in this table will be returned. @@ -1239,6 +1263,15 @@ AppProfilePattern AppPatternTable[] = } }, + { + AppProfile::DetroitBecomeHuman, + { + AppNameDetroit, + AppEngineQuanticDream, + PatternEnd + } + }, + { AppProfile::SOTTR, { @@ -1349,6 +1382,14 @@ AppProfilePattern AppPatternTable[] = } }, + { + AppProfile::MetalGearSolid5Online, + { + AppNameMetalGearSolid5Online, + PatternEnd + } + }, + { AppProfile::YamagiQuakeII, { @@ -1383,6 +1424,14 @@ AppProfilePattern AppPatternTable[] = } }, + { + AppProfile::ELEX2, + { + AppNameELEX2, + PatternEnd + } + }, + { AppProfile::Satisfactory, { @@ -1438,6 +1487,14 @@ AppProfilePattern AppPatternTable[] = AppEngineVKD3D, PatternEnd } + }, + + { + AppProfile::DXVK, + { + AppEngineDXVK, + PatternEnd + } } }; diff --git a/icd/api/app_resource_optimizer.cpp b/icd/api/app_resource_optimizer.cpp index 0e3d9f0e..5118967b 100644 --- a/icd/api/app_resource_optimizer.cpp +++ b/icd/api/app_resource_optimizer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/app_shader_optimizer.cpp b/icd/api/app_shader_optimizer.cpp index 7fe347ce..6988ec7e 100644 --- a/icd/api/app_shader_optimizer.cpp +++ b/icd/api/app_shader_optimizer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -1200,6 +1200,15 @@ void ShaderOptimizer::BuildAppProfileLlpc() pEntry->action.shaders[ShaderStage::ShaderStageCompute].shaderCreate.apply.workaroundStorageImageFormats = true; } + if (appProfile == AppProfile::ELEX2) + { + i = m_appProfile.entryCount++; + PipelineProfileEntry *pEntry = &m_appProfile.pEntries[i]; + pEntry->pattern.match.always = true; + pEntry->action.shaders[ShaderStage::ShaderStageCompute].shaderCreate.apply.disableFastMathFlags = true; + pEntry->action.shaders[ShaderStage::ShaderStageCompute].shaderCreate.tuningOptions.disableFastMathFlags = 32u; + } + } #if PAL_ENABLE_PRINTS_ASSERTS diff --git a/icd/api/appopt/barrier_filter_layer.cpp b/icd/api/appopt/barrier_filter_layer.cpp index 33a5d0d2..e19dbaa6 100644 --- a/icd/api/appopt/barrier_filter_layer.cpp +++ b/icd/api/appopt/barrier_filter_layer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/appopt/barrier_filter_layer.h b/icd/api/appopt/barrier_filter_layer.h index cc750385..b16637ad 100644 --- a/icd/api/appopt/barrier_filter_layer.h +++ b/icd/api/appopt/barrier_filter_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/appopt/gpu_decode_layer.cpp b/icd/api/appopt/gpu_decode_layer.cpp index a8d695ae..afb6cedc 100755 --- a/icd/api/appopt/gpu_decode_layer.cpp +++ b/icd/api/appopt/gpu_decode_layer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -172,6 +172,7 @@ GpuDecoderLayer::~GpuDecoderLayer() if (m_pGpuTexDecoder != nullptr) { Util::Destructor(m_pGpuTexDecoder); + m_pDevice->VkInstance()->FreeMem(m_pGpuTexDecoder); m_pGpuTexDecoder = nullptr; m_cachedStagingRes.Reset(); m_decodedImages.Reset(); diff --git a/icd/api/appopt/gpu_decode_layer.h b/icd/api/appopt/gpu_decode_layer.h index c7dc6f03..2523277b 100755 --- a/icd/api/appopt/gpu_decode_layer.h +++ b/icd/api/appopt/gpu_decode_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/appopt/opt_layer.h b/icd/api/appopt/opt_layer.h index 216ff3f8..b2b2b68b 100644 --- a/icd/api/appopt/opt_layer.h +++ b/icd/api/appopt/opt_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/appopt/strange_brigade_layer.cpp b/icd/api/appopt/strange_brigade_layer.cpp index 0dcf0bf2..5296dc5d 100644 --- a/icd/api/appopt/strange_brigade_layer.cpp +++ b/icd/api/appopt/strange_brigade_layer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/appopt/strange_brigade_layer.h b/icd/api/appopt/strange_brigade_layer.h index cd0ff27c..a795a7e3 100644 --- a/icd/api/appopt/strange_brigade_layer.h +++ b/icd/api/appopt/strange_brigade_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/barrier_policy.cpp b/icd/api/barrier_policy.cpp index 3fc945b4..552d3608 100644 --- a/icd/api/barrier_policy.cpp +++ b/icd/api/barrier_policy.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/binary_cache_serialization.cpp b/icd/api/binary_cache_serialization.cpp index 506ae0a7..3849da15 100644 --- a/icd/api/binary_cache_serialization.cpp +++ b/icd/api/binary_cache_serialization.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/cache_adapter.cpp b/icd/api/cache_adapter.cpp index 02f05b0f..59f1d718 100644 --- a/icd/api/cache_adapter.cpp +++ b/icd/api/cache_adapter.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/cmd_buffer_ring.cpp b/icd/api/cmd_buffer_ring.cpp index a0b3e216..3fb55384 100644 --- a/icd/api/cmd_buffer_ring.cpp +++ b/icd/api/cmd_buffer_ring.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/color_space_helper.cpp b/icd/api/color_space_helper.cpp index 93a36a44..abb15d5b 100644 --- a/icd/api/color_space_helper.cpp +++ b/icd/api/color_space_helper.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/compiler_solution.cpp b/icd/api/compiler_solution.cpp index 8ee0c31a..611f1997 100644 --- a/icd/api/compiler_solution.cpp +++ b/icd/api/compiler_solution.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/compiler_solution_llpc.cpp b/icd/api/compiler_solution_llpc.cpp index 11909c0a..b26c9a9b 100644 --- a/icd/api/compiler_solution_llpc.cpp +++ b/icd/api/compiler_solution_llpc.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -225,21 +225,6 @@ VkResult CompilerSolutionLlpc::CreateGraphicsPipelineBinary( pPipelineBuildInfo->pfnOutputAlloc = AllocateShaderOutput; pPipelineBuildInfo->iaState.deviceIndex = deviceIdx; - // By default the client hash provided to PAL is more accurate than the one used by pipeline - // profiles. - // - // Optionally (based on panel setting), these can be set to temporarily match by devs. This - // can be useful when other tools (such as PAL's profiling layer) are used to measure shaders - // while building a pipeline profile which uses the profile hash. - if (settings.pipelineUseProfileHashAsClientHash) - { - for (uint32_t stage = 0; stage < ShaderStage::ShaderStageGfxCount; ++stage) - { - ppShadersInfo[stage]->options.clientHash.lower = pipelineProfileKey.pShaders[stage].codeHash.lower; - ppShadersInfo[stage]->options.clientHash.upper = pipelineProfileKey.pShaders[stage].codeHash.upper; - } - } - for (uint32_t stage = 0; stage < ShaderStage::ShaderStageGfxCount; ++stage) { if (ppShadersInfo[stage]->pModuleData != nullptr) @@ -505,6 +490,7 @@ VkResult CompilerSolutionLlpc::CreateGraphicsShaderBinary( } } + ShaderLibraryBlobHeader blobHeader = {}; if ((hitCache == false) || elfReplace) { // Build the LLPC pipeline @@ -533,18 +519,8 @@ VkResult CompilerSolutionLlpc::CreateGraphicsShaderBinary( if (llpcResult == Vkgc::Result::Success) { - ShaderLibraryBlobHeader blobHeader = {}; blobHeader.binaryLength = finalBinary.codeSize; blobHeader.fragMetaLength = pipelineOut.fsOutputMetaDataSize; - StoreShaderBinaryToCache( - pPipelineCache, - &cacheId, - &blobHeader, - finalBinary.pCode, - pipelineOut.fsOutputMetaData, - hitCache, - hitAppCache, - &shaderLibraryBinary); } else if (llpcResult != Vkgc::Result::RequireFullPipeline) { @@ -552,15 +528,26 @@ VkResult CompilerSolutionLlpc::CreateGraphicsShaderBinary( VK_ERROR_INITIALIZATION_FAILED; } - // PipelineBin has been translated to blob start with ShaderLibraryBlobHeader in StoreShaderBinaryToCache - if (pipelineOut.pipelineBin.pCode != nullptr) - { - FreeGraphicsPipelineBinary(pipelineOut.pipelineBin); - } } if (result == VK_SUCCESS) { + // Always call StoreShaderBinaryToCache to sync data between app cache and binary cache except + // RequireFullPipeline. When cache is hit, blobHeader is zero, StoreShaderBinaryToCache will ignore + // finalBinary, and reuse shaderLibraryBinary. + if ((finalBinary.pCode != nullptr) || (shaderLibraryBinary.pCode != nullptr)) + { + StoreShaderBinaryToCache( + pPipelineCache, + &cacheId, + &blobHeader, + finalBinary.pCode, + pipelineOut.fsOutputMetaData, + hitCache, + hitAppCache, + &shaderLibraryBinary); + } + pShaderModule->elfPackage = shaderLibraryBinary; pCreateInfo->earlyElfPackage[gplType] = pShaderModule->elfPackage; pCreateInfo->earlyElfPackageHash[gplType] = cacheId; @@ -620,6 +607,13 @@ VkResult CompilerSolutionLlpc::CreateGraphicsShaderBinary( } } } + + // PipelineBin has been translated to blob start with ShaderLibraryBlobHeader in StoreShaderBinaryToCache + if (pipelineOut.pipelineBin.pCode != nullptr) + { + FreeGraphicsPipelineBinary(pipelineOut.pipelineBin); + } + m_gplCacheMatrix.totalBinaries++; m_gplCacheMatrix.totalTimeSpent += (Util::GetPerfCpuTime() - startTime); @@ -646,7 +640,6 @@ VkResult CompilerSolutionLlpc::CreateComputePipelineBinary( { const RuntimeSettings& settings = m_pPhysicalDevice->GetRuntimeSettings(); auto pInstance = m_pPhysicalDevice->Manager()->VkInstance(); - AppProfile appProfile = m_pPhysicalDevice->GetAppProfile(); Vkgc::ComputePipelineBuildInfo* pPipelineBuildInfo = &pCreateInfo->pipelineInfo; @@ -663,82 +656,6 @@ VkResult CompilerSolutionLlpc::CreateComputePipelineBinary( pPipelineBuildInfo->pInstance = pInstance; pPipelineBuildInfo->pfnOutputAlloc = AllocateShaderOutput; - // Force enable automatic workgroup reconfigure. - if (appProfile == AppProfile::DawnOfWarIII) - { - pPipelineBuildInfo->options.reconfigWorkgroupLayout = true; - } - - const auto threadGroupSwizzleMode = - pDevice->GetShaderOptimizer()->OverrideThreadGroupSwizzleMode( - ShaderStageCompute, - pipelineProfileKey); - - const bool threadIdSwizzleMode = - pDevice->GetShaderOptimizer()->OverrideThreadIdSwizzleMode( - ShaderStageCompute, - pipelineProfileKey); - - uint32_t overrideShaderThreadGroupSizeX = 0; - uint32_t overrideShaderThreadGroupSizeY = 0; - uint32_t overrideShaderThreadGroupSizeZ = 0; - - pDevice->GetShaderOptimizer()->OverrideShaderThreadGroupSize( - ShaderStageCompute, - pipelineProfileKey, - &overrideShaderThreadGroupSizeX, - &overrideShaderThreadGroupSizeY, - &overrideShaderThreadGroupSizeZ); - - if (threadGroupSwizzleMode != Vkgc::ThreadGroupSwizzleMode::Default) - { - pPipelineBuildInfo->options.threadGroupSwizzleMode = threadGroupSwizzleMode; - } - - if ((overrideShaderThreadGroupSizeX == NotOverrideThreadGroupSizeX) && - (overrideShaderThreadGroupSizeY == NotOverrideThreadGroupSizeX) && - (overrideShaderThreadGroupSizeZ == NotOverrideShaderThreadGroupSizeZ) && - (settings.overrideThreadGroupSizeX == NotOverrideThreadGroupSizeX) && - (settings.overrideThreadGroupSizeY == NotOverrideThreadGroupSizeY) && - (settings.overrideThreadGroupSizeZ == NotOverrideThreadGroupSizeZ)) - { - if (threadIdSwizzleMode) - { - pPipelineBuildInfo->options.forceCsThreadIdSwizzling = threadIdSwizzleMode; - } - } - else - { - pPipelineBuildInfo->options.forceCsThreadIdSwizzling = settings.forceCsThreadIdSwizzling; - } - - if(overrideShaderThreadGroupSizeX != NotOverrideThreadGroupSizeX) - { - pPipelineBuildInfo->options.overrideThreadGroupSizeX = overrideShaderThreadGroupSizeX; - } - else - { - pPipelineBuildInfo->options.overrideThreadGroupSizeX = settings.overrideThreadGroupSizeX; - } - - if(overrideShaderThreadGroupSizeY != NotOverrideThreadGroupSizeY) - { - pPipelineBuildInfo->options.overrideThreadGroupSizeY = overrideShaderThreadGroupSizeY; - } - else - { - pPipelineBuildInfo->options.overrideThreadGroupSizeY = settings.overrideThreadGroupSizeY; - } - - if(overrideShaderThreadGroupSizeZ != NotOverrideThreadGroupSizeZ) - { - pPipelineBuildInfo->options.overrideThreadGroupSizeZ = overrideShaderThreadGroupSizeZ; - } - else - { - pPipelineBuildInfo->options.overrideThreadGroupSizeZ = settings.overrideThreadGroupSizeZ; - } - #if VKI_RAY_TRACING const auto* pModuleData = reinterpret_cast(pPipelineBuildInfo->cs.pModuleData); if (pModuleData != nullptr) @@ -749,21 +666,6 @@ VkResult CompilerSolutionLlpc::CreateComputePipelineBinary( } #endif - // By default the client hash provided to PAL is more accurate than the one used by pipeline - // profiles. - // - // Optionally (based on panel setting), these can be set to temporarily match by devs. This - // can be useful when other tools (such as PAL's profiling layer) are used to measure shaders - // while building a pipeline profile which uses the profile hash. - if (settings.pipelineUseProfileHashAsClientHash) - { - VK_ASSERT(pipelineProfileKey.shaderCount == 1); - VK_ASSERT(pipelineProfileKey.pShaders[0].stage == ShaderStage::ShaderStageCompute); - - pPipelineBuildInfo->cs.options.clientHash.lower = pipelineProfileKey.pShaders[0].codeHash.lower; - pPipelineBuildInfo->cs.options.clientHash.upper = pipelineProfileKey.pShaders[0].codeHash.upper; - } - // Build pipline binary auto llpcResult = m_pLlpc->BuildComputePipeline(pPipelineBuildInfo, &pipelineOut, pPipelineDumpHandle); pCreateInfo->pipelineFeedback = {}; @@ -950,6 +852,8 @@ VkResult CompilerSolutionLlpc::CreateRayTracingPipelineBinary( memcpy(pPipelineBinary->shaderGroupHandle.shaderHandles, pipelineOut.shaderGroupHandle.shaderHandles, shaderGroupHandleSize); pPipelineBinary->shaderGroupHandle.shaderHandleCount = pipelineOut.shaderGroupHandle.shaderHandleCount; void* pOutShaderGroup = static_cast(pipelineOut.shaderGroupHandle.shaderHandles); + + pPipelineBinary->librarySummary = pipelineOut.librarySummary; } *pCompileTime = Util::GetPerfCpuTime() - startTime; @@ -1174,55 +1078,70 @@ void CompilerSolutionLlpc::BuildPipelineInternalBufferData( const uint32_t uberFetchConstBufRegBase, const uint32_t specConstBufVertexRegBase, const uint32_t specConstBufFragmentRegBase, + bool needCache, GraphicsPipelineBinaryCreateInfo* pCreateInfo) { - auto pInstance = m_pPhysicalDevice->VkInstance(); - uint32_t internalBufferSize = 0; + auto pInstance = m_pPhysicalDevice->VkInstance(); + auto pInternalBufferInfo = &(pCreateInfo->pBinaryMetadata->internalBufferInfo); + pInternalBufferInfo->dataSize = 0; // NOTE: Using instance divisor may get an incorrect result, disabled it on LLPC. const RuntimeSettings& settings = m_pPhysicalDevice->GetRuntimeSettings(); VK_ASSERT(settings.disableInstanceDivisorOpt); const VkPipelineVertexInputStateCreateInfo* pVertexInput = nullptr; + bool needUberFetchShaderBuffer = false; + if (pCreateInfo->pipelineInfo.enableUberFetchShader || pCreateInfo->pipelineInfo.enableEarlyCompile) { pVertexInput = pCreateInfo->pipelineInfo.pVertexInput; - internalBufferSize += pCompiler->GetUberFetchShaderInternalDataSize(pVertexInput); + // For monolithic pipeline (needCache = true), we need save internal buffer data to cache, so we always need + // build full internal buffer. But in GPL fast link mode or vertex input library, we needn't add it to cache, + // so if we have copied uber-fetch shader buffer from input library.i.e internalBufferCount is not zero, we + // needn't build internal buffer for uber-fetch shader again. + if (needCache || (pInternalBufferInfo->internalBufferCount == 0)) + { + uint32_t uberFetchShaderInternalDataSize = pCompiler->GetUberFetchShaderInternalDataSize(pVertexInput); + if (uberFetchShaderInternalDataSize > 0) + { + needUberFetchShaderBuffer = true; + pInternalBufferInfo->dataSize += uberFetchShaderInternalDataSize; + } + } } - auto pInternalBufferInfo = &(pCreateInfo->pBinaryMetadata->internalBufferInfo); - pInternalBufferInfo->dataSize = internalBufferSize; - if (internalBufferSize > 0) + if (pInternalBufferInfo->dataSize > 0) { - pInternalBufferInfo->pData = pInstance->AllocMem(internalBufferSize, + pInternalBufferInfo->pData = pInstance->AllocMem(pInternalBufferInfo->dataSize, VK_DEFAULT_MEM_ALIGN, VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); if (pInternalBufferInfo->pData == nullptr) { pCreateInfo->pipelineInfo.enableEarlyCompile = false; pCreateInfo->pipelineInfo.enableUberFetchShader = false; + pInternalBufferInfo->dataSize = 0; + needUberFetchShaderBuffer = false; } } uint32_t internalBufferOffset = 0; - if ((pInternalBufferInfo->pData) && - (pVertexInput != nullptr) && - (pVertexInput->vertexAttributeDescriptionCount > 0)) + if (needUberFetchShaderBuffer) { uint32_t uberFetchShaderInternalDataSize = pCompiler->BuildUberFetchShaderInternalData( pVertexInput, pCreateInfo->pipelineInfo.dynamicVertexStride, pInternalBufferInfo->pData); - if (uberFetchShaderInternalDataSize == 0) - { - pCreateInfo->pipelineInfo.enableUberFetchShader = false; - } - else - { - auto pBufferEntry = &pInternalBufferInfo->internalBufferEntries[pInternalBufferInfo->internalBufferCount++]; - pBufferEntry->userDataOffset = uberFetchConstBufRegBase; - pBufferEntry->bufferOffset = internalBufferOffset; - internalBufferOffset += uberFetchShaderInternalDataSize; - } + auto pBufferEntry = &pInternalBufferInfo->internalBufferEntries[0]; + pBufferEntry->userDataOffset = uberFetchConstBufRegBase; + pBufferEntry->bufferOffset = internalBufferOffset; + internalBufferOffset += uberFetchShaderInternalDataSize; + pInternalBufferInfo->internalBufferCount = 1; + + } + else if (pInternalBufferInfo->internalBufferCount > 0) + { + auto pBufferEntry = &pInternalBufferInfo->internalBufferEntries[0]; + VK_ASSERT(pBufferEntry->bufferAddress[DefaultDeviceIndex] != 0); + pBufferEntry->userDataOffset = uberFetchConstBufRegBase; } } diff --git a/icd/api/debug_printf.cpp b/icd/api/debug_printf.cpp index fd7df8c6..1517112a 100644 --- a/icd/api/debug_printf.cpp +++ b/icd/api/debug_printf.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/devmode/devmode_mgr.cpp b/icd/api/devmode/devmode_mgr.cpp index ca3937dc..924a2832 100644 --- a/icd/api/devmode/devmode_mgr.cpp +++ b/icd/api/devmode/devmode_mgr.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2016-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2016-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,6 +35,8 @@ #include "include/vk_cmdbuffer.h" #include "include/vk_instance.h" #include "include/vk_pipeline.h" +#include "include/vk_graphics_pipeline.h" +#include "include/vk_graphics_pipeline_library.h" #include "include/vk_physical_device.h" #include "include/vk_utils.h" #include "include/vk_conv.h" @@ -2471,7 +2473,31 @@ void DevModeMgr::PipelineCreated( pipelineInfo.apiPsoHash = pPipeline->GetApiHash(); if (pPipeline->PalPipeline(DefaultDeviceIndex) != nullptr) { - m_trace.pGpaSession->RegisterPipeline(pPipeline->PalPipeline(DefaultDeviceIndex), pipelineInfo); + bool isGplPipeline = false; + GraphicsPipeline* pGraphicsPipeline = nullptr; + if (pPipeline->GetType() == VK_PIPELINE_BIND_POINT_GRAPHICS) + { + pGraphicsPipeline = reinterpret_cast(pPipeline); + isGplPipeline = pGraphicsPipeline->GetPalShaderLibrary(GraphicsLibraryPreRaster) != nullptr; + } + + if (isGplPipeline) + { + GpuUtil::RegisterLibraryInfo libInfo = { pipelineInfo.apiPsoHash }; + for (uint32_t i = 0; i < GraphicsLibraryCount; i++) + { + const Pal::IShaderLibrary* pLib = + pGraphicsPipeline->GetPalShaderLibrary(static_cast(i)); + if (pLib != nullptr) + { + m_trace.pGpaSession->RegisterLibrary(pLib, libInfo); + } + } + } + else + { + m_trace.pGpaSession->RegisterPipeline(pPipeline->PalPipeline(DefaultDeviceIndex), pipelineInfo); + } } } } @@ -2486,7 +2512,36 @@ void DevModeMgr::PipelineDestroyed( m_trace.pDevice->GetRuntimeSettings().devModeShaderIsaDbEnable && (m_trace.pGpaSession != nullptr)) { - m_trace.pGpaSession->UnregisterPipeline(pPipeline->PalPipeline(DefaultDeviceIndex)); + if (pPipeline->PalPipeline(DefaultDeviceIndex) != nullptr) + { + bool isGplPipeline = false; + if (pPipeline->GetType() == VK_PIPELINE_BIND_POINT_GRAPHICS) + { + GraphicsPipeline* pGraphicsPipeline = reinterpret_cast(pPipeline); + isGplPipeline = pGraphicsPipeline->GetPalShaderLibrary(GraphicsLibraryPreRaster) != nullptr; + } + + if (isGplPipeline == false) + { + m_trace.pGpaSession->UnregisterPipeline(pPipeline->PalPipeline(DefaultDeviceIndex)); + } + } + else + { + if (pPipeline->GetType() == VK_PIPELINE_BIND_POINT_GRAPHICS) + { + GraphicsPipelineLibrary* pGraphicsLibrary = reinterpret_cast(pPipeline); + const Pal::IShaderLibrary* pPalLibraries[GraphicsLibraryCount] = {}; + pGraphicsLibrary->GetOwnedPalShaderLibraries(pPalLibraries); + for (uint32_t i = 0; i < GraphicsLibraryCount; i++) + { + if (pPalLibraries[i] != nullptr) + { + m_trace.pGpaSession->UnregisterLibrary(pPalLibraries[i]); + } + } + } + } } } diff --git a/icd/api/devmode/devmode_mgr.h b/icd/api/devmode/devmode_mgr.h index 34a60280..0a99d53e 100644 --- a/icd/api/devmode/devmode_mgr.h +++ b/icd/api/devmode/devmode_mgr.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2016-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2016-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/entry.cpp b/icd/api/entry.cpp index 0a731e7a..5cb2566d 100644 --- a/icd/api/entry.cpp +++ b/icd/api/entry.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/gpumemory_event_handler.cpp b/icd/api/gpumemory_event_handler.cpp index 8b920ba4..cae37e7b 100644 --- a/icd/api/gpumemory_event_handler.cpp +++ b/icd/api/gpumemory_event_handler.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/graphics_pipeline_common.cpp b/icd/api/graphics_pipeline_common.cpp index 61626720..c9dbb7f6 100644 --- a/icd/api/graphics_pipeline_common.cpp +++ b/icd/api/graphics_pipeline_common.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -701,7 +701,7 @@ void GraphicsPipelineCommon::ExtractLibraryInfo( pLibInfo->flags.isLibrary = (flags & VK_PIPELINE_CREATE_LIBRARY_BIT_KHR) ? 1 : 0; - pLibInfo->flags.optimize = (flags & VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT) ? 1 : 0; + pLibInfo->flags.optimize = (flags & VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT) ? 1 : 0; pLibInfo->libFlags = (pLibInfo->flags.isLibrary == false) ? GraphicsPipelineLibraryAll : @@ -806,6 +806,15 @@ VkResult GraphicsPipelineCommon::Create( const bool isLibrary = Util::TestAnyFlagSet(flags, VK_PIPELINE_CREATE_LIBRARY_BIT_KHR); + if (pDevice->GetRuntimeSettings().pipelineLinkOptimizationMode == PipelineLinkOptimizationNeverOptimized) + { + flags &= ~VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT; + } + else if (pDevice->GetRuntimeSettings().pipelineLinkOptimizationMode == PipelineLinkOptimizationAlwaysOptimized) + { + flags |= ~VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT; + } + if (isLibrary) { result = GraphicsPipelineLibrary::Create( @@ -863,7 +872,7 @@ static void CopyPreRasterizationShaderState( pInfo->immedInfo.graphicsShaderInfos.gs = libInfo.immedInfo.graphicsShaderInfos.gs; pInfo->immedInfo.graphicsShaderInfos.ts = libInfo.immedInfo.graphicsShaderInfos.ts; pInfo->immedInfo.graphicsShaderInfos.ms = libInfo.immedInfo.graphicsShaderInfos.ms; - pInfo->immedInfo.graphicsShaderInfos.flags = libInfo.immedInfo.graphicsShaderInfos.flags; + pInfo->immedInfo.dynamicGraphicsState = libInfo.immedInfo.dynamicGraphicsState; pInfo->immedInfo.viewportParams = libInfo.immedInfo.viewportParams; pInfo->immedInfo.scissorRectParams = libInfo.immedInfo.scissorRectParams; pInfo->immedInfo.rasterizerDiscardEnable = libInfo.immedInfo.rasterizerDiscardEnable; @@ -2141,8 +2150,6 @@ void GraphicsPipelineCommon::BuildPipelineObjectCreateInfo( bool hasRayTracing = pBinMeta->rayQueryUsed; #endif - uint32_t libFlags = libInfo.libFlags; - pInfo->activeStages = GetActiveShaderStages(pIn, &libInfo); VkShaderStageFlagBits preRasterStages = {}; @@ -2156,15 +2163,12 @@ void GraphicsPipelineCommon::BuildPipelineObjectCreateInfo( hasMesh = true; } - uint64_t dynamicStateFlags = GetDynamicStateFlags(pIn->pDynamicState, &libInfo); - - libInfo.libFlags = libFlags; - pInfo->dynamicStates = dynamicStateFlags; + pInfo->dynamicStates = GetDynamicStateFlags(pIn->pDynamicState, &libInfo);; if (libInfo.libFlags & VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT) { BuildVertexInputInterfaceState( - pDevice, pIn, &pBinMeta->vbInfo, dynamicStateFlags, libInfo.flags.isLibrary, hasMesh, pInfo); + pDevice, pIn, &pBinMeta->vbInfo, pInfo->dynamicStates, libInfo.flags.isLibrary, hasMesh, pInfo); } else if (libInfo.pVertexInputInterfaceLib != nullptr) { @@ -2175,7 +2179,7 @@ void GraphicsPipelineCommon::BuildPipelineObjectCreateInfo( { BuildPreRasterizationShaderState(pDevice, pIn, - dynamicStateFlags, + pInfo->dynamicStates, #if VKI_RAY_TRACING hasRayTracing, #endif @@ -2189,7 +2193,7 @@ void GraphicsPipelineCommon::BuildPipelineObjectCreateInfo( const bool enableRasterization = (~libInfo.libFlags & VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT) || (pInfo->immedInfo.rasterizerDiscardEnable == false) || - IsDynamicStateEnabled(dynamicStateFlags, DynamicStatesInternal::RasterizerDiscardEnable); + IsDynamicStateEnabled(pInfo->dynamicStates, DynamicStatesInternal::RasterizerDiscardEnable); if (enableRasterization) { @@ -2197,7 +2201,7 @@ void GraphicsPipelineCommon::BuildPipelineObjectCreateInfo( { BuildFragmentShaderState(pDevice, pIn, - dynamicStateFlags, + pInfo->dynamicStates, #if VKI_RAY_TRACING hasRayTracing, #endif @@ -2206,12 +2210,11 @@ void GraphicsPipelineCommon::BuildPipelineObjectCreateInfo( else if (libInfo.pFragmentShaderLib != nullptr) { CopyFragmentShaderState(libInfo.pFragmentShaderLib, pInfo); - } if (libInfo.libFlags & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT) { - BuildFragmentOutputInterfaceState(pDevice, pIn, dynamicStateFlags, pInfo); + BuildFragmentOutputInterfaceState(pDevice, pIn, pInfo->dynamicStates, pInfo); } else if (libInfo.pFragmentOutputInterfaceLib != nullptr) { @@ -2221,7 +2224,7 @@ void GraphicsPipelineCommon::BuildPipelineObjectCreateInfo( if (libInfo.flags.isLibrary == false) { - BuildExecutablePipelineState(hasMesh, dynamicStateFlags, pBinMeta, pInfo); + BuildExecutablePipelineState(hasMesh, pInfo->dynamicStates, pBinMeta, pInfo); if (pOptimizerKey != nullptr) { diff --git a/icd/api/icd_main.cpp b/icd/api/icd_main.cpp index 639ba9fa..5f42745a 100644 --- a/icd/api/icd_main.cpp +++ b/icd/api/icd_main.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/app_profile.h b/icd/api/include/app_profile.h index dd47f6af..0c2f8811 100644 --- a/icd/api/include/app_profile.h +++ b/icd/api/include/app_profile.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -120,8 +120,10 @@ enum class AppProfile : uint32_t AngleEngine, // Angle Engine CSGO, // Counter-Strike: Global Offensive DxvkGodOfWar, // DXVK God of War + ELEX2, // ELEX II X4Foundations, // X4: Foundations by Egosoft MetalGearSolid5, // Metal Gear Solid5 : The Phantom Pain + MetalGearSolid5Online, // Metal Gear Solid5 : The Phantom Pain Online YamagiQuakeII, // Yamagi Quake II Battlefield1, // Battlefield 1 GpuCapsViewer32Bit, // GPU Caps Viewer demos by GeeXLab @@ -139,6 +141,7 @@ enum class AppProfile : uint32_t AsyncPostProcessLVr, // AsyncPostProcessing sample app for AMD Liquid VR SDK Enscape, // Enscape by Chaos Vkd3dEngine, // vkd3d-proton for steam games + DXVK, // DXVK }; struct ProfileSettings diff --git a/icd/api/include/app_resource_optimizer.h b/icd/api/include/app_resource_optimizer.h index e1c7f8d9..c98fa0aa 100644 --- a/icd/api/include/app_resource_optimizer.h +++ b/icd/api/include/app_resource_optimizer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/app_shader_optimizer.h b/icd/api/include/app_shader_optimizer.h index 59189213..f2b848ca 100644 --- a/icd/api/include/app_shader_optimizer.h +++ b/icd/api/include/app_shader_optimizer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/barrier_policy.h b/icd/api/include/barrier_policy.h index ebb25b7b..7316e418 100644 --- a/icd/api/include/barrier_policy.h +++ b/icd/api/include/barrier_policy.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/binary_cache_serialization.h b/icd/api/include/binary_cache_serialization.h index 46892612..1dd0181a 100644 --- a/icd/api/include/binary_cache_serialization.h +++ b/icd/api/include/binary_cache_serialization.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/cache_adapter.h b/icd/api/include/cache_adapter.h index 273b77f5..ad595828 100644 --- a/icd/api/include/cache_adapter.h +++ b/icd/api/include/cache_adapter.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/cmd_buffer_ring.h b/icd/api/include/cmd_buffer_ring.h index c155ffc8..8465cd00 100644 --- a/icd/api/include/cmd_buffer_ring.h +++ b/icd/api/include/cmd_buffer_ring.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/color_space_helper.h b/icd/api/include/color_space_helper.h index 8215433d..ddb8b193 100644 --- a/icd/api/include/color_space_helper.h +++ b/icd/api/include/color_space_helper.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/compiler_solution.h b/icd/api/include/compiler_solution.h index de177a4b..a149190b 100644 --- a/icd/api/include/compiler_solution.h +++ b/icd/api/include/compiler_solution.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -50,6 +50,7 @@ class PipelineBinaryCache; class ShaderCache; class DeferredHostOperation; class PipelineCompiler; +class InternalMemory; #if VKI_RAY_TRACING struct DeferredWorkload; @@ -108,11 +109,13 @@ struct VbBindingInfo } bindings[Pal::MaxVertexBuffers]; }; -constexpr uint32_t MaxPipelineInternalBufferCount = 4; +constexpr uint32_t MaxPipelineInternalBufferCount = 3; + struct InternalBufferEntry { uint32_t userDataOffset; uint32_t bufferOffset; + Pal::gpusize bufferAddress[MaxPalDevices]; }; struct PipelineInternalBufferInfo @@ -170,13 +173,15 @@ struct GraphicsPipelineBinaryCreateInfo size_t mappingBufferSize; VkPipelineCreateFlags2KHR flags; VkFormat dbFormat; - PipelineOptimizerKey* pPipelineProfileKey; + const PipelineOptimizerKey* pPipelineProfileKey; PipelineCompilerType compilerType; bool linkTimeOptimization; Vkgc::BinaryData earlyElfPackage[GraphicsLibraryCount]; Util::MetroHash::Hash earlyElfPackageHash[GraphicsLibraryCount]; Pal::IShaderLibrary* pShaderLibraries[GraphicsLibraryCount]; + InternalMemory* pInternalMem; uint64_t apiPsoHash; + uint64_t cbStateHash; uint64_t libraryHash[GraphicsLibraryCount]; FreeCompilerBinary freeCompilerBinary; PipelineCreationFeedback pipelineFeedback; @@ -233,6 +238,7 @@ struct RayTracingPipelineBinary Vkgc::BinaryData* pPipelineBins; Vkgc::RayTracingShaderGroupHandle shaderGroupHandle; Vkgc::RayTracingShaderPropertySet shaderPropSet; + Vkgc::BinaryData librarySummary; void* pElfCache; }; #endif @@ -322,6 +328,7 @@ class CompilerSolution const uint32_t uberFetchConstBufRegBase, const uint32_t specConstBufVertexRegBase, const uint32_t specConstBufFragmentRegBase, + bool needCache, GraphicsPipelineBinaryCreateInfo* pCreateInfo) = 0; virtual VkResult CreateColorExportBinary( diff --git a/icd/api/include/compiler_solution_llpc.h b/icd/api/include/compiler_solution_llpc.h index 4d111aaa..0ec243b2 100644 --- a/icd/api/include/compiler_solution_llpc.h +++ b/icd/api/include/compiler_solution_llpc.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -163,6 +163,7 @@ class CompilerSolutionLlpc final : public CompilerSolution const uint32_t uberFetchConstBufRegBase, const uint32_t specConstBufVertexRegBase, const uint32_t specConstBufFragmentRegBase, + bool needCache, GraphicsPipelineBinaryCreateInfo* pCreateInfo) override; virtual bool IsGplFastLinkCompatible( diff --git a/icd/api/include/debug_printf.h b/icd/api/include/debug_printf.h index 8b537d51..d9f1d918 100644 --- a/icd/api/include/debug_printf.h +++ b/icd/api/include/debug_printf.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/defer_compile_thread.h b/icd/api/include/defer_compile_thread.h index 222c1dd8..6c53624b 100644 --- a/icd/api/include/defer_compile_thread.h +++ b/icd/api/include/defer_compile_thread.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/gpumemory_event_handler.h b/icd/api/include/gpumemory_event_handler.h index 2093a757..7db3cd91 100644 --- a/icd/api/include/gpumemory_event_handler.h +++ b/icd/api/include/gpumemory_event_handler.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/graphics_pipeline_common.h b/icd/api/include/graphics_pipeline_common.h index 61b489c0..b33bff8c 100644 --- a/icd/api/include/graphics_pipeline_common.h +++ b/icd/api/include/graphics_pipeline_common.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -70,6 +70,7 @@ struct GraphicsPipelineObjectImmedInfo Pal::StencilRefMaskParams stencilRefMasks; SamplePattern samplePattern; Pal::DynamicGraphicsShaderInfos graphicsShaderInfos; + Pal::DynamicGraphicsState dynamicGraphicsState; Pal::VrsRateParams vrsRateParams; Pal::DepthStencilStateCreateInfo depthStencilCreateInfo; Pal::MsaaStateCreateInfo msaaCreateInfo; diff --git a/icd/api/include/internal_layer_hooks.h b/icd/api/include/internal_layer_hooks.h index 097f98e6..b3d3bcde 100644 --- a/icd/api/include/internal_layer_hooks.h +++ b/icd/api/include/internal_layer_hooks.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/internal_mem_mgr.h b/icd/api/include/internal_mem_mgr.h index 21e86ce5..fdd70b0d 100644 --- a/icd/api/include/internal_mem_mgr.h +++ b/icd/api/include/internal_mem_mgr.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/devext/vk_amd_gpa_interface.h b/icd/api/include/khronos/devext/vk_amd_gpa_interface.h index 396e172c..636a74fa 100644 --- a/icd/api/include/khronos/devext/vk_amd_gpa_interface.h +++ b/icd/api/include/khronos/devext/vk_amd_gpa_interface.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/devext/vk_internal_ext_helper.h b/icd/api/include/khronos/devext/vk_internal_ext_helper.h index b8820f0f..499a2216 100644 --- a/icd/api/include/khronos/devext/vk_internal_ext_helper.h +++ b/icd/api/include/khronos/devext/vk_internal_ext_helper.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/sdk-1.3/vulkan/vulkan_core.h b/icd/api/include/khronos/sdk-1.3/vulkan/vulkan_core.h index bc0949c8..51408d77 100644 --- a/icd/api/include/khronos/sdk-1.3/vulkan/vulkan_core.h +++ b/icd/api/include/khronos/sdk-1.3/vulkan/vulkan_core.h @@ -69,7 +69,7 @@ extern "C" { #define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 271 +#define VK_HEADER_VERSION 273 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) @@ -733,7 +733,6 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR = 1000181000, VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD = 1000183000, - VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = 1000184000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000, VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR = 1000187000, VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000187001, @@ -746,8 +745,6 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR = 1000388001, VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD = 1000189000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = 1000190002, VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP = 1000191000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV = 1000201000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV = 1000202000, @@ -1037,6 +1034,7 @@ typedef enum VkStructureType { #endif VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI = 1000404000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI = 1000404001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_VRS_FEATURES_HUAWEI = 1000404002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT = 1000411000, VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT = 1000411001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT = 1000412000, @@ -1051,6 +1049,11 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE = 1000420002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT = 1000421000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT = 1000422000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM = 1000424000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_PROPERTIES_ARM = 1000424001, + VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM = 1000424002, + VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_INFO_ARM = 1000424003, + VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_SUBMIT_INFO_ARM = 1000424004, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM = 1000425000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM = 1000425001, VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM = 1000425002, @@ -1117,6 +1120,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV = 1000492001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT = 1000351000, VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT = 1000351002, + VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT = 1000496000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM = 1000497000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM = 1000497001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT = 1000498000, @@ -1145,12 +1149,16 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM = 1000520001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM = 1000521000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT = 1000524000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR = 1000525000, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR = 1000190001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR = 1000190002, VK_STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX = 1000529000, VK_STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX = 1000529001, VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX = 1000529002, VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX = 1000529003, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX = 1000529004, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT = 1000530000, + VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR = 1000184000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV = 1000546000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, @@ -1252,6 +1260,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES, + VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES, @@ -10734,6 +10745,78 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR #endif +// VK_KHR_vertex_attribute_divisor is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_vertex_attribute_divisor 1 +#define VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 1 +#define VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_KHR_vertex_attribute_divisor" +typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t maxVertexAttribDivisor; + VkBool32 supportsNonZeroFirstInstance; +} VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR; + +typedef struct VkVertexInputBindingDivisorDescriptionKHR { + uint32_t binding; + uint32_t divisor; +} VkVertexInputBindingDivisorDescriptionKHR; + +typedef struct VkPipelineVertexInputDivisorStateCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t vertexBindingDivisorCount; + const VkVertexInputBindingDivisorDescriptionKHR* pVertexBindingDivisors; +} VkPipelineVertexInputDivisorStateCreateInfoKHR; + +typedef struct VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 vertexAttributeInstanceRateDivisor; + VkBool32 vertexAttributeInstanceRateZeroDivisor; +} VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR; + + + +// VK_KHR_calibrated_timestamps is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_calibrated_timestamps 1 +#define VK_KHR_CALIBRATED_TIMESTAMPS_SPEC_VERSION 1 +#define VK_KHR_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_KHR_calibrated_timestamps" + +typedef enum VkTimeDomainKHR { + VK_TIME_DOMAIN_DEVICE_KHR = 0, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR = 1, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR = 2, + VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR = 3, + VK_TIME_DOMAIN_DEVICE_EXT = VK_TIME_DOMAIN_DEVICE_KHR, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR, + VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR, + VK_TIME_DOMAIN_MAX_ENUM_KHR = 0x7FFFFFFF +} VkTimeDomainKHR; +typedef struct VkCalibratedTimestampInfoKHR { + VkStructureType sType; + const void* pNext; + VkTimeDomainKHR timeDomain; +} VkCalibratedTimestampInfoKHR; + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainKHR* pTimeDomains); +typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsKHR)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsKHR( + VkPhysicalDevice physicalDevice, + uint32_t* pTimeDomainCount, + VkTimeDomainKHR* pTimeDomains); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetCalibratedTimestampsKHR( + VkDevice device, + uint32_t timestampCount, + const VkCalibratedTimestampInfoKHR* pTimestampInfos, + uint64_t* pTimestamps, + uint64_t* pMaxDeviation); +#endif + + // VK_EXT_debug_report is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_debug_report 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) @@ -11361,7 +11444,7 @@ typedef struct VkExportMemoryAllocateInfoNV { // VK_EXT_validation_flags is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_validation_flags 1 -#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 2 +#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 3 #define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" typedef enum VkValidationCheckEXT { @@ -13072,33 +13155,23 @@ typedef struct VkPipelineCompilerControlCreateInfoAMD { #define VK_EXT_calibrated_timestamps 1 #define VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION 2 #define VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_EXT_calibrated_timestamps" +typedef VkTimeDomainKHR VkTimeDomainEXT; -typedef enum VkTimeDomainEXT { - VK_TIME_DOMAIN_DEVICE_EXT = 0, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = 1, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = 2, - VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = 3, - VK_TIME_DOMAIN_MAX_ENUM_EXT = 0x7FFFFFFF -} VkTimeDomainEXT; -typedef struct VkCalibratedTimestampInfoEXT { - VkStructureType sType; - const void* pNext; - VkTimeDomainEXT timeDomain; -} VkCalibratedTimestampInfoEXT; +typedef VkCalibratedTimestampInfoKHR VkCalibratedTimestampInfoEXT; -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains); -typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsEXT)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainKHR* pTimeDomains); +typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsEXT)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, - VkTimeDomainEXT* pTimeDomains); + VkTimeDomainKHR* pTimeDomains); VKAPI_ATTR VkResult VKAPI_CALL vkGetCalibratedTimestampsEXT( VkDevice device, uint32_t timestampCount, - const VkCalibratedTimestampInfoEXT* pTimestampInfos, + const VkCalibratedTimestampInfoKHR* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); #endif @@ -13158,24 +13231,11 @@ typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT { uint32_t maxVertexAttribDivisor; } VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT; -typedef struct VkVertexInputBindingDivisorDescriptionEXT { - uint32_t binding; - uint32_t divisor; -} VkVertexInputBindingDivisorDescriptionEXT; +typedef VkVertexInputBindingDivisorDescriptionKHR VkVertexInputBindingDivisorDescriptionEXT; -typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t vertexBindingDivisorCount; - const VkVertexInputBindingDivisorDescriptionEXT* pVertexBindingDivisors; -} VkPipelineVertexInputDivisorStateCreateInfoEXT; +typedef VkPipelineVertexInputDivisorStateCreateInfoKHR VkPipelineVertexInputDivisorStateCreateInfoEXT; -typedef struct VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT { - VkStructureType sType; - void* pNext; - VkBool32 vertexAttributeInstanceRateDivisor; - VkBool32 vertexAttributeInstanceRateZeroDivisor; -} VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT; +typedef VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT; @@ -13762,7 +13822,7 @@ typedef VkImageStencilUsageCreateInfo VkImageStencilUsageCreateInfoEXT; // VK_EXT_validation_features is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_validation_features 1 -#define VK_EXT_VALIDATION_FEATURES_SPEC_VERSION 5 +#define VK_EXT_VALIDATION_FEATURES_SPEC_VERSION 6 #define VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME "VK_EXT_validation_features" typedef enum VkValidationFeatureEnableEXT { @@ -16503,7 +16563,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetMicromapBuildSizesEXT( // VK_HUAWEI_cluster_culling_shader is a preprocessor guard. Do not pass it to API calls. #define VK_HUAWEI_cluster_culling_shader 1 -#define VK_HUAWEI_CLUSTER_CULLING_SHADER_SPEC_VERSION 2 +#define VK_HUAWEI_CLUSTER_CULLING_SHADER_SPEC_VERSION 3 #define VK_HUAWEI_CLUSTER_CULLING_SHADER_EXTENSION_NAME "VK_HUAWEI_cluster_culling_shader" typedef struct VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI { VkStructureType sType; @@ -16521,6 +16581,12 @@ typedef struct VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI { VkDeviceSize indirectBufferOffsetAlignment; } VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI; +typedef struct VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI { + VkStructureType sType; + void* pNext; + VkBool32 clusterShadingRate; +} VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI; + typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterHUAWEI)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterIndirectHUAWEI)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); @@ -16598,10 +16664,10 @@ typedef struct VkPhysicalDeviceShaderCorePropertiesARM { #define VK_ARM_SCHEDULING_CONTROLS_EXTENSION_NAME "VK_ARM_scheduling_controls" typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagsARM; -typedef enum VkPhysicalDeviceSchedulingControlsFlagBitsARM { - VK_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_SHADER_CORE_COUNT_ARM = 0x00000001, - VK_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FLAG_BITS_MAX_ENUM_ARM = 0x7FFFFFFF -} VkPhysicalDeviceSchedulingControlsFlagBitsARM; +// Flag bits for VkPhysicalDeviceSchedulingControlsFlagBitsARM +typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagBitsARM; +static const VkPhysicalDeviceSchedulingControlsFlagBitsARM VK_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_SHADER_CORE_COUNT_ARM = 0x00000001ULL; + typedef struct VkDeviceQueueShaderCoreControlCreateInfoARM { VkStructureType sType; void* pNext; @@ -16706,6 +16772,45 @@ typedef struct VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT { +// VK_ARM_render_pass_striped is a preprocessor guard. Do not pass it to API calls. +#define VK_ARM_render_pass_striped 1 +#define VK_ARM_RENDER_PASS_STRIPED_SPEC_VERSION 1 +#define VK_ARM_RENDER_PASS_STRIPED_EXTENSION_NAME "VK_ARM_render_pass_striped" +typedef struct VkPhysicalDeviceRenderPassStripedFeaturesARM { + VkStructureType sType; + void* pNext; + VkBool32 renderPassStriped; +} VkPhysicalDeviceRenderPassStripedFeaturesARM; + +typedef struct VkPhysicalDeviceRenderPassStripedPropertiesARM { + VkStructureType sType; + void* pNext; + VkExtent2D renderPassStripeGranularity; + uint32_t maxRenderPassStripes; +} VkPhysicalDeviceRenderPassStripedPropertiesARM; + +typedef struct VkRenderPassStripeInfoARM { + VkStructureType sType; + const void* pNext; + VkRect2D stripeArea; +} VkRenderPassStripeInfoARM; + +typedef struct VkRenderPassStripeBeginInfoARM { + VkStructureType sType; + const void* pNext; + uint32_t stripeInfoCount; + VkRenderPassStripeInfoARM* pStripeInfos; +} VkRenderPassStripeBeginInfoARM; + +typedef struct VkRenderPassStripeSubmitInfoARM { + VkStructureType sType; + const void* pNext; + uint32_t stripeSemaphoreInfoCount; + const VkSemaphoreSubmitInfo* pStripeSemaphoreInfos; +} VkRenderPassStripeSubmitInfoARM; + + + // VK_QCOM_fragment_density_map_offset is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_fragment_density_map_offset 1 #define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION 1 @@ -17744,6 +17849,39 @@ typedef struct VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV { #define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME "VK_EXT_mutable_descriptor_type" +// VK_EXT_layer_settings is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_layer_settings 1 +#define VK_EXT_LAYER_SETTINGS_SPEC_VERSION 2 +#define VK_EXT_LAYER_SETTINGS_EXTENSION_NAME "VK_EXT_layer_settings" + +typedef enum VkLayerSettingTypeEXT { + VK_LAYER_SETTING_TYPE_BOOL32_EXT = 0, + VK_LAYER_SETTING_TYPE_INT32_EXT = 1, + VK_LAYER_SETTING_TYPE_INT64_EXT = 2, + VK_LAYER_SETTING_TYPE_UINT32_EXT = 3, + VK_LAYER_SETTING_TYPE_UINT64_EXT = 4, + VK_LAYER_SETTING_TYPE_FLOAT32_EXT = 5, + VK_LAYER_SETTING_TYPE_FLOAT64_EXT = 6, + VK_LAYER_SETTING_TYPE_STRING_EXT = 7, + VK_LAYER_SETTING_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkLayerSettingTypeEXT; +typedef struct VkLayerSettingEXT { + const char* pLayerName; + const char* pSettingName; + VkLayerSettingTypeEXT type; + uint32_t valueCount; + const void* pValues; +} VkLayerSettingEXT; + +typedef struct VkLayerSettingsCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t settingCount; + const VkLayerSettingEXT* pSettings; +} VkLayerSettingsCreateInfoEXT; + + + // VK_ARM_shader_core_builtins is a preprocessor guard. Do not pass it to API calls. #define VK_ARM_shader_core_builtins 1 #define VK_ARM_SHADER_CORE_BUILTINS_SPEC_VERSION 2 diff --git a/icd/api/include/khronos/vk_icd.h b/icd/api/include/khronos/vk_icd.h index cefddf94..43679cda 100644 --- a/icd/api/include/khronos/vk_icd.h +++ b/icd/api/include/khronos/vk_icd.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2016-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2016-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_layer.h b/icd/api/include/khronos/vk_layer.h index 05fb1339..fdbd4554 100644 --- a/icd/api/include/khronos/vk_layer.h +++ b/icd/api/include/khronos/vk_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_platform.h b/icd/api/include/khronos/vk_platform.h index 6b698c88..1e6a4b1d 100644 --- a/icd/api/include/khronos/vk_platform.h +++ b/icd/api/include/khronos/vk_platform.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std.h index 947c7e7a..435abcf4 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_decode.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_decode.h index d835f321..458f8483 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_decode.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_decode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_encode.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_encode.h index 6f4079ae..958b4c90 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_encode.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_encode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std.h index ee6a7408..0adffa20 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_decode.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_decode.h index 2d720e0d..c6e55ca9 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_decode.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_decode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_encode.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_encode.h index ac97aba6..2acbcce1 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_encode.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_encode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codecs_common.h b/icd/api/include/khronos/vk_video/vulkan_video_codecs_common.h index b2d04f59..ce14fe97 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codecs_common.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codecs_common.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vulkan.h b/icd/api/include/khronos/vulkan.h index 016a3e14..030be791 100644 --- a/icd/api/include/khronos/vulkan.h +++ b/icd/api/include/khronos/vulkan.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/log.h b/icd/api/include/log.h index 9610cdef..2b98d821 100644 --- a/icd/api/include/log.h +++ b/icd/api/include/log.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/pipeline_binary_cache.h b/icd/api/include/pipeline_binary_cache.h index 70467a2a..4e18cdd8 100644 --- a/icd/api/include/pipeline_binary_cache.h +++ b/icd/api/include/pipeline_binary_cache.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/pipeline_compiler.h b/icd/api/include/pipeline_compiler.h index 1df8f41c..a4f042f5 100644 --- a/icd/api/include/pipeline_compiler.h +++ b/icd/api/include/pipeline_compiler.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -33,7 +33,6 @@ #include "include/khronos/vulkan.h" #include "include/compiler_solution.h" -#include "include/shader_cache.h" #if VKI_RAY_TRACING #include "gpurt/gpurt.h" @@ -146,8 +145,6 @@ class PipelineCompiler const Vkgc::BinaryData& shaderBinary, const bool adaptForFastLink, bool isInternal, - PipelineBinaryCache* pBinaryCache, - PipelineCreationFeedback* pFeedback, ShaderModuleHandle* pShaderModule); void TryEarlyCompileShaderModule( @@ -215,17 +212,17 @@ class PipelineCompiler const PipelineCreationFeedback* pStageFeedback); VkResult ConvertGraphicsPipelineInfo( - const Device* pDevice, + Device* pDevice, const VkGraphicsPipelineCreateInfo* pIn, VkPipelineCreateFlags2KHR flags, const GraphicsPipelineShaderStageInfo* pShaderInfo, const PipelineLayout* pPipelineLayout, - PipelineOptimizerKey* pPipelineProfileKey, + const PipelineOptimizerKey* pPipelineProfileKey, PipelineMetadata* pBinaryMetadata, GraphicsPipelineBinaryCreateInfo* pCreateInfo); VkResult BuildGplFastLinkCreateInfo( - const Device* pDevice, + Device* pDevice, const VkGraphicsPipelineCreateInfo* pIn, VkPipelineCreateFlags2KHR flags, const GraphicsPipelineLibraryInfo& libInfo, @@ -253,7 +250,11 @@ class PipelineCompiler void FreeComputePipelineCreateInfo(ComputePipelineBinaryCreateInfo* pCreateInfo); - void FreeGraphicsPipelineCreateInfo(GraphicsPipelineBinaryCreateInfo* pCreateInfo, bool keepConvertTempMem); + void FreeGraphicsPipelineCreateInfo( + Device* pDevice, + GraphicsPipelineBinaryCreateInfo* pCreateInfo, + bool keepConvertTempMem, + bool keepInternalMem); #if VKI_RAY_TRACING @@ -326,6 +327,7 @@ class PipelineCompiler void BuildPipelineInternalBufferData( const PipelineLayout* pPipelineLayout, + bool needCache, GraphicsPipelineBinaryCreateInfo* pCreateInfo); void GetComputePipelineCacheId( @@ -442,6 +444,13 @@ class PipelineCompiler { GetElfCacheMetricString(&m_pipelineCacheMatrix, "", pOutStr, outStrSize); } + static VkResult UploadInternalBufferData( + Device* pDevice, + GraphicsPipelineBinaryCreateInfo* pCreateInfo); + + static void DumpPipelineMetadata( + void* pPipelineDumpHandle, + const PipelineMetadata* pBinaryMetadata); private: PAL_DISALLOW_COPY_AND_ASSIGN(PipelineCompiler); @@ -483,8 +492,6 @@ class PipelineCompiler const VkShaderModuleCreateFlags internalShaderFlags, const uint32_t compilerMask, const Util::MetroHash::Hash& uniqueHash, - PipelineBinaryCache* pBinaryCache, - PipelineCreationFeedback* pFeedback, ShaderModuleHandle* pShaderModule); void StoreShaderModuleToCache( @@ -492,7 +499,6 @@ class PipelineCompiler const VkShaderModuleCreateFlags internalShaderFlags, const uint32_t compilerMask, const Util::MetroHash::Hash& uniqueHash, - PipelineBinaryCache* pBinaryCache, ShaderModuleHandle* pShaderModule); Util::MetroHash::Hash GetShaderModuleCacheHash( diff --git a/icd/api/include/render_state_cache.h b/icd/api/include/render_state_cache.h index 83c5c478..a0f8d185 100644 --- a/icd/api/include/render_state_cache.h +++ b/icd/api/include/render_state_cache.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/virtual_stack_mgr.h b/icd/api/include/virtual_stack_mgr.h index 7771b260..4d8627df 100644 --- a/icd/api/include/virtual_stack_mgr.h +++ b/icd/api/include/virtual_stack_mgr.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_alloccb.h b/icd/api/include/vk_alloccb.h index ce396d0f..05584969 100644 --- a/icd/api/include/vk_alloccb.h +++ b/icd/api/include/vk_alloccb.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_buffer.h b/icd/api/include/vk_buffer.h index d3556893..3e0e4efd 100644 --- a/icd/api/include/vk_buffer.h +++ b/icd/api/include/vk_buffer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_buffer_view.h b/icd/api/include/vk_buffer_view.h index 999dc070..7375e7ec 100644 --- a/icd/api/include/vk_buffer_view.h +++ b/icd/api/include/vk_buffer_view.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_cmd_pool.h b/icd/api/include/vk_cmd_pool.h index a2b13d8e..c5312651 100644 --- a/icd/api/include/vk_cmd_pool.h +++ b/icd/api/include/vk_cmd_pool.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_cmdbuffer.h b/icd/api/include/vk_cmdbuffer.h index a8e1676b..a37f0d5e 100644 --- a/icd/api/include/vk_cmdbuffer.h +++ b/icd/api/include/vk_cmdbuffer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -119,7 +119,7 @@ enum PipelineBindPoint union PipelineDynamicBindInfo { Pal::DynamicComputeShaderInfo cs; - Pal::DynamicGraphicsShaderInfos gfx; + Pal::DynamicGraphicsState gfxDynState; }; // Internal buffer for dynamic vertex input diff --git a/icd/api/include/vk_compute_pipeline.h b/icd/api/include/vk_compute_pipeline.h index 16f18100..96970432 100644 --- a/icd/api/include/vk_compute_pipeline.h +++ b/icd/api/include/vk_compute_pipeline.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_conv.h b/icd/api/include/vk_conv.h index df1d2537..c1be0982 100755 --- a/icd/api/include/vk_conv.h +++ b/icd/api/include/vk_conv.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -1811,6 +1811,20 @@ namespace convert // Converts Vulkan format to PAL equivalent. inline Pal::SwizzledFormat VkToPalFormat(VkFormat format, const RuntimeSettings& settings) { + if (settings.enableD24S8) + { + if (format == VK_FORMAT_D24_UNORM_S8_UINT) + { + return PalFmt(Pal::ChNumFormat::D32_Float_S8_Uint, + Pal::ChannelSwizzle::X, Pal::ChannelSwizzle::Zero, Pal::ChannelSwizzle::Zero, Pal::ChannelSwizzle::One); + } + if (format == VK_FORMAT_X8_D24_UNORM_PACK32) + { + return PalFmt(Pal::ChNumFormat::X32_Float, + Pal::ChannelSwizzle::X, Pal::ChannelSwizzle::Zero, Pal::ChannelSwizzle::Zero, Pal::ChannelSwizzle::One); + } + } + if (VK_ENUM_IN_RANGE(format, VK_FORMAT)) { diff --git a/icd/api/include/vk_debug_report.h b/icd/api/include/vk_debug_report.h index 341cf74c..852f7bc0 100644 --- a/icd/api/include/vk_debug_report.h +++ b/icd/api/include/vk_debug_report.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_debug_utils.h b/icd/api/include/vk_debug_utils.h index 41a7ab78..42dc0fd2 100644 --- a/icd/api/include/vk_debug_utils.h +++ b/icd/api/include/vk_debug_utils.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_deferred_operation.h b/icd/api/include/vk_deferred_operation.h index e4d37dee..bb05ec50 100644 --- a/icd/api/include/vk_deferred_operation.h +++ b/icd/api/include/vk_deferred_operation.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_defines.h b/icd/api/include/vk_defines.h index 110131ec..33977836 100644 --- a/icd/api/include/vk_defines.h +++ b/icd/api/include/vk_defines.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_descriptor_buffer.h b/icd/api/include/vk_descriptor_buffer.h index 9c39507f..ca6da5ec 100644 --- a/icd/api/include/vk_descriptor_buffer.h +++ b/icd/api/include/vk_descriptor_buffer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_descriptor_pool.h b/icd/api/include/vk_descriptor_pool.h index 7f8fd918..fe9cd17e 100644 --- a/icd/api/include/vk_descriptor_pool.h +++ b/icd/api/include/vk_descriptor_pool.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_descriptor_set.h b/icd/api/include/vk_descriptor_set.h index 832eff23..a51cccba 100644 --- a/icd/api/include/vk_descriptor_set.h +++ b/icd/api/include/vk_descriptor_set.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_descriptor_set_layout.h b/icd/api/include/vk_descriptor_set_layout.h index d967d6af..845f21c0 100644 --- a/icd/api/include/vk_descriptor_set_layout.h +++ b/icd/api/include/vk_descriptor_set_layout.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_descriptor_update_template.h b/icd/api/include/vk_descriptor_update_template.h index db87d1a5..b23c2a88 100644 --- a/icd/api/include/vk_descriptor_update_template.h +++ b/icd/api/include/vk_descriptor_update_template.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_device.h b/icd/api/include/vk_device.h index 8e6d2924..439bc54b 100644 --- a/icd/api/include/vk_device.h +++ b/icd/api/include/vk_device.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -101,6 +101,7 @@ class SqttMgr; class SwapChain; class ChillMgr; class AsyncLayer; +class GraphicsPipelineLibrary; #if VKI_GPU_DECOMPRESS class GpuDecoderLayer; #endif @@ -813,6 +814,8 @@ class Device const PipelineLayout* GetNullPipelineLayout() const { return m_pNullPipelineLayout; } + const GraphicsPipelineLibrary* GetNullFragmentLib() const { return m_pNullFragmentLib; } + template static VkPipelineCreateFlags2KHR GetPipelineCreateFlags( const CreateInfo* pCreateInfo); @@ -963,6 +966,10 @@ class Device // a pipeline layout specified. PipelineLayout* m_pNullPipelineLayout; + // Null fragment library + GraphicsPipelineLibrary* m_pNullFragmentLib; + VkShaderModule m_nullFragmentModule; + // This goes last. The memory for the rest of the array is calculated dynamically based on the number of GPUs in // use. PerGpuInfo m_perGpu[1]; diff --git a/icd/api/include/vk_dispatch.h b/icd/api/include/vk_dispatch.h index 5c2e55d8..a6ee7655 100644 --- a/icd/api/include/vk_dispatch.h +++ b/icd/api/include/vk_dispatch.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_event.h b/icd/api/include/vk_event.h index bb80a14f..d3badd00 100644 --- a/icd/api/include/vk_event.h +++ b/icd/api/include/vk_event.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_extensions.h b/icd/api/include/vk_extensions.h index 2f8f91ae..8e74da71 100644 --- a/icd/api/include/vk_extensions.h +++ b/icd/api/include/vk_extensions.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -273,6 +273,7 @@ class DeviceExtensions final : public Extensions #endif KHR_BIND_MEMORY2, KHR_BUFFER_DEVICE_ADDRESS, + KHR_CALIBRATED_TIMESTAMPS, KHR_COOPERATIVE_MATRIX, KHR_COPY_COMMANDS2, KHR_CREATE_RENDERPASS2, @@ -341,6 +342,7 @@ class DeviceExtensions final : public Extensions KHR_TIMELINE_SEMAPHORE, KHR_UNIFORM_BUFFER_STANDARD_LAYOUT, KHR_VARIABLE_POINTERS, + KHR_VERTEX_ATTRIBUTE_DIVISOR, KHR_VULKAN_MEMORY_MODEL, KHR_WIN32_KEYED_MUTEX, KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT, @@ -379,6 +381,7 @@ class DeviceExtensions final : public Extensions EXT_HDR_METADATA, EXT_HOST_QUERY_RESET, EXT_IMAGE_2D_VIEW_OF_3D, + EXT_IMAGE_COMPRESSION_CONTROL, EXT_IMAGE_DRM_FORMAT_MODIFIER, EXT_IMAGE_ROBUSTNESS, EXT_IMAGE_SLICED_VIEW_OF_3D, diff --git a/icd/api/include/vk_fence.h b/icd/api/include/vk_fence.h index ebe683b4..e4b9fb62 100644 --- a/icd/api/include/vk_fence.h +++ b/icd/api/include/vk_fence.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_formats.h b/icd/api/include/vk_formats.h index 5fa675b9..f4b76ca6 100755 --- a/icd/api/include/vk_formats.h +++ b/icd/api/include/vk_formats.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -178,6 +178,8 @@ bool Formats::HasDepth(VkFormat format) case VK_FORMAT_D16_UNORM: case VK_FORMAT_D32_SFLOAT: case VK_FORMAT_D16_UNORM_S8_UINT: + case VK_FORMAT_D24_UNORM_S8_UINT: + case VK_FORMAT_X8_D24_UNORM_PACK32: case VK_FORMAT_D32_SFLOAT_S8_UINT: hasDepth = true; break; @@ -201,6 +203,7 @@ bool Formats::HasStencil(VkFormat format) { case VK_FORMAT_S8_UINT: case VK_FORMAT_D16_UNORM_S8_UINT: + case VK_FORMAT_D24_UNORM_S8_UINT: case VK_FORMAT_D32_SFLOAT_S8_UINT: hasStencil = true; break; @@ -449,6 +452,8 @@ VkFormat Formats::GetAspectFormat(VkFormat format, VkImageAspectFlags aspectMask subFormat = VK_FORMAT_D16_UNORM; break; case VK_FORMAT_D32_SFLOAT: + case VK_FORMAT_D24_UNORM_S8_UINT: + case VK_FORMAT_X8_D24_UNORM_PACK32: case VK_FORMAT_D32_SFLOAT_S8_UINT: subFormat = VK_FORMAT_D32_SFLOAT; break; @@ -464,6 +469,7 @@ VkFormat Formats::GetAspectFormat(VkFormat format, VkImageAspectFlags aspectMask { case VK_FORMAT_S8_UINT: case VK_FORMAT_D16_UNORM_S8_UINT: + case VK_FORMAT_D24_UNORM_S8_UINT: case VK_FORMAT_D32_SFLOAT_S8_UINT: subFormat = VK_FORMAT_S8_UINT; break; diff --git a/icd/api/include/vk_framebuffer.h b/icd/api/include/vk_framebuffer.h index 4959e899..393b8a7f 100644 --- a/icd/api/include/vk_framebuffer.h +++ b/icd/api/include/vk_framebuffer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_gpa_session.h b/icd/api/include/vk_gpa_session.h index 26dd5ba7..4eeea73e 100644 --- a/icd/api/include/vk_gpa_session.h +++ b/icd/api/include/vk_gpa_session.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_graphics_pipeline.h b/icd/api/include/vk_graphics_pipeline.h index 1a98dd76..2b45e318 100644 --- a/icd/api/include/vk_graphics_pipeline.h +++ b/icd/api/include/vk_graphics_pipeline.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -169,6 +169,9 @@ class GraphicsPipeline final : public GraphicsPipelineCommon, public NonDispatch const Pal::IPipeline* GetPalPipeline(uint32_t deviceIdx) const { return UseOptimizedPipeline() ? m_pOptimizedPipeline[deviceIdx] : m_pPalPipeline[deviceIdx]; } + const Pal::IShaderLibrary* GetPalShaderLibrary(GraphicsLibraryType type) const + { return m_pPalShaderLibrary[type]; } + const Pal::DynamicGraphicsShaderInfos& GetBindInfo() const { return m_info.graphicsShaderInfos; } const Pal::IMsaaState* const* GetMsaaStates() const { return m_pPalMsaa; } @@ -210,6 +213,8 @@ class GraphicsPipeline final : public GraphicsPipelineCommon, public NonDispatch Pal::IMsaaState** pPalMsaa, Pal::IColorBlendState** pPalColorBlend, Pal::IDepthStencilState** pPalDepthStencil, + const Pal::IShaderLibrary** pPalShaderLibrary, + const InternalMemory* pInternalMem, uint32_t coverageSamples, const Util::MetroHash::Hash& cacheHash, uint64_t apiHash, @@ -225,7 +230,7 @@ class GraphicsPipeline final : public GraphicsPipelineCommon, public NonDispatch const GraphicsPipelineShaderStageInfo* pShaderInfo, const PipelineLayout* pPipelineLayout, const Util::MetroHash::Hash* pElfHash, - PipelineOptimizerKey* pPipelineOptimizerKey, + const PipelineOptimizerKey* pPipelineOptimizerKey, GraphicsPipelineBinaryCreateInfo* pBinaryCreateInfo, PipelineCache* pPipelineCache, const VkPipelineCreationFeedbackCreateInfoEXT* pCreationFeedbackInfo, @@ -241,6 +246,7 @@ class GraphicsPipeline final : public GraphicsPipelineCommon, public NonDispatch const PipelineLayout* pPipelineLayout, const VbBindingInfo* pVbInfo, const PipelineInternalBufferInfo* pInternalBuffer, + const InternalMemory* pInternalMem, const Vkgc::BinaryData* pPipelineBinaries, PipelineCache* pPipelineCache, const Util::MetroHash::Hash* pCacheIds, @@ -294,6 +300,8 @@ class GraphicsPipeline final : public GraphicsPipelineCommon, public NonDispatch Pal::IMsaaState* m_pPalMsaa[MaxPalDevices]; // PAL MSAA state object Pal::IColorBlendState* m_pPalColorBlend[MaxPalDevices]; // PAL color blend state object Pal::IDepthStencilState* m_pPalDepthStencil[MaxPalDevices]; // PAL depth stencil state object + const Pal::IShaderLibrary* m_pPalShaderLibrary[GraphicsLibraryCount]; // Pal shader library object + const InternalMemory* m_pInternalMem; // Memory object of internal buffer VbBindingInfo m_vbInfo; // Information about vertex buffer bindings PipelineInternalBufferInfo m_internalBufferInfo; // Information about internal buffer Pal::IPipeline* m_pOptimizedPipeline[MaxPalDevices]; // Optimized PAL pipelines diff --git a/icd/api/include/vk_graphics_pipeline_library.h b/icd/api/include/vk_graphics_pipeline_library.h index 2c1340e3..e7019287 100644 --- a/icd/api/include/vk_graphics_pipeline_library.h +++ b/icd/api/include/vk_graphics_pipeline_library.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -66,6 +66,7 @@ class GraphicsPipelineLibrary final : public GraphicsPipelineCommon, public NonD const Util::MetroHash::Hash* GetElfHash() const { return &m_elfHash; } + void GetOwnedPalShaderLibraries(const Pal::IShaderLibrary* pLibraries[GraphicsLibraryCount]) const; private: PAL_DISALLOW_COPY_AND_ASSIGN(GraphicsPipelineLibrary); diff --git a/icd/api/include/vk_image.h b/icd/api/include/vk_image.h index c14d08bf..1b6534c1 100644 --- a/icd/api/include/vk_image.h +++ b/icd/api/include/vk_image.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -323,6 +323,7 @@ class Image final : public NonDispatchable const VkImageDrmFormatModifierListCreateInfoEXT* pModifierListCreateInfo; const VkImageDrmFormatModifierExplicitCreateInfoEXT* pModifierExplicitCreateInfo; #endif + const VkImageCompressionControlEXT* pImageCompressionControl; }; union ExternalMemoryFlags diff --git a/icd/api/include/vk_image_view.h b/icd/api/include/vk_image_view.h index 85ff0f35..6c79fef2 100644 --- a/icd/api/include/vk_image_view.h +++ b/icd/api/include/vk_image_view.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_instance.h b/icd/api/include/vk_instance.h index 018e7ed7..ce615435 100644 --- a/icd/api/include/vk_instance.h +++ b/icd/api/include/vk_instance.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -217,10 +217,14 @@ class Instance { return m_dispatchTable; } void EnableTracingSupport(); + void EnableCrashAnalysisSupport(); bool IsTracingSupportEnabled() const { return m_flags.sqttSupport; } + bool IsCrashAnalysisSupportEnabled() const + { return m_flags.rgdSupport; } + bool IsNullGpuModeEnabled() const { return m_flags.nullGpuMode; } @@ -328,9 +332,10 @@ class Instance struct { uint32_t sqttSupport : 1; // True if SQTT thread trace annotation markers are enabled + uint32_t rgdSupport : 1; // True if RGD execution marker annotation are enabled uint32_t nullGpuMode : 1; // True if the instance is running in null gpu mode (fake gpus for // shader compilation - uint32_t reserved : 30; + uint32_t reserved : 29; }; uint32_t u32All; } m_flags; diff --git a/icd/api/include/vk_memory.h b/icd/api/include/vk_memory.h index 213f200d..8d1837c1 100644 --- a/icd/api/include/vk_memory.h +++ b/icd/api/include/vk_memory.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_physical_device.h b/icd/api/include/vk_physical_device.h index f4e53789..26fbcc9b 100644 --- a/icd/api/include/vk_physical_device.h +++ b/icd/api/include/vk_physical_device.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -680,13 +680,36 @@ template return m_tunnelPriorities; } + uint32_t GetDeviceSupportedSubgroupSize() const + { + uint32_t supportedWavefrontSize = m_properties.gfxipProperties.shaderCore.maxWavefrontSize; + uint32_t allowedWavefrontSize = GetRuntimeSettings().deprecateWave64; + + if (supportedWavefrontSize > 32) + { + if ((allowedWavefrontSize & DeprecateWave64::DeprecateWave64Reporting) || + (allowedWavefrontSize & DeprecateWave64::DeprecateWave64All)) + { + supportedWavefrontSize = 32; + } + } + + return supportedWavefrontSize; + } + uint32_t GetSubgroupSize() const { - uint32_t subgroupSize = m_properties.gfxipProperties.shaderCore.maxWavefrontSize; + uint32_t subgroupSize = GetDeviceSupportedSubgroupSize(); + // Even if subgroupSize > 32 is forced via settings, we want to honor it const RuntimeSettings& settings = GetRuntimeSettings(); if (settings.subgroupSize != 0) { + if (settings.subgroupSize > subgroupSize) + { + VK_ALERT_ALWAYS_MSG("Forced subgroupSize is greater than device supported or allowed subgroupSize"); + } + subgroupSize = settings.subgroupSize; } return subgroupSize; diff --git a/icd/api/include/vk_physical_device_manager.h b/icd/api/include/vk_physical_device_manager.h index e422f093..f92229fe 100644 --- a/icd/api/include/vk_physical_device_manager.h +++ b/icd/api/include/vk_physical_device_manager.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_pipeline.h b/icd/api/include/vk_pipeline.h index 316e4922..69ddb246 100644 --- a/icd/api/include/vk_pipeline.h +++ b/icd/api/include/vk_pipeline.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_pipeline_cache.h b/icd/api/include/vk_pipeline_cache.h index 2791dbd5..43152297 100644 --- a/icd/api/include/vk_pipeline_cache.h +++ b/icd/api/include/vk_pipeline_cache.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_pipeline_layout.h b/icd/api/include/vk_pipeline_layout.h index 95d206cc..4663e71e 100644 --- a/icd/api/include/vk_pipeline_layout.h +++ b/icd/api/include/vk_pipeline_layout.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -197,6 +197,8 @@ class PipelineLayout final : public NonDispatchable VkSemaphore* pSemaphore); static VkResult PopulateInDeviceGroup( - Device* pDevice, - Pal::IQueueSemaphore* pPalSemaphores[MaxPalDevices], - uint32_t* pSemaphoreCount); + Device* pDevice, + const Pal::QueueSemaphoreCreateInfo& palCreateInfo, + Pal::IQueueSemaphore* pPalSemaphores[MaxPalDevices], + uint32_t* pSemaphoreCount); VkResult ImportSemaphore( Device* pDevice, diff --git a/icd/api/include/vk_shader.h b/icd/api/include/vk_shader.h index 720ffa54..384a3cde 100644 --- a/icd/api/include/vk_shader.h +++ b/icd/api/include/vk_shader.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,6 +38,8 @@ namespace Pal { enum class ResourceMappingNodeType : Pal::uint32; } #define VK_INTERNAL_SHADER_FLAGS_RAY_TRACING_INTERNAL_SHADER_BIT 0x80000000u #endif +#define VK_INTERNAL_SHADER_FLAGS_FORCE_UNCACHED_BIT 0x20000000u + namespace vk { diff --git a/icd/api/include/vk_shader_code.h b/icd/api/include/vk_shader_code.h index a0c05a52..bc3e8df1 100644 --- a/icd/api/include/vk_shader_code.h +++ b/icd/api/include/vk_shader_code.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_surface.h b/icd/api/include/vk_surface.h index b210c67a..2e2c199b 100644 --- a/icd/api/include/vk_surface.h +++ b/icd/api/include/vk_surface.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_swapchain.h b/icd/api/include/vk_swapchain.h index 78cbf4af..f845f7dd 100644 --- a/icd/api/include/vk_swapchain.h +++ b/icd/api/include/vk_swapchain.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_utils.h b/icd/api/include/vk_utils.h index d6cf42d9..5ed6b4e1 100644 --- a/icd/api/include/vk_utils.h +++ b/icd/api/include/vk_utils.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/internal_mem_mgr.cpp b/icd/api/internal_mem_mgr.cpp index 3ec24a5e..651402f9 100644 --- a/icd/api/internal_mem_mgr.cpp +++ b/icd/api/internal_mem_mgr.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/pipeline_binary_cache.cpp b/icd/api/pipeline_binary_cache.cpp index 966d7836..8803ae9c 100644 --- a/icd/api/pipeline_binary_cache.cpp +++ b/icd/api/pipeline_binary_cache.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,6 +38,7 @@ #include "palVectorImpl.h" #include "palHashMapImpl.h" #include "palFile.h" +#include "palLiterals.h" #if ICD_GPUOPEN_DEVMODE_BUILD #include "palPipelineAbiReader.h" @@ -45,6 +46,8 @@ #endif #include +using namespace Util::Literals; + namespace vk { constexpr char PipelineBinaryCache::EnvVarPath[]; @@ -825,9 +828,9 @@ VkResult PipelineBinaryCache::InitMemoryCacheLayer( // Reason: CTS generates a large number of cache applications and cause insufficient memory in 32-bit system. // Purpose: To limit the maximun value of MemorySize in 32-bit system. #ifdef ICD_X86_BUILD - createInfo.maxMemorySize = 192 * 1024 * 1024; + createInfo.maxMemorySize = 192_MiB; #else - createInfo.maxMemorySize = SIZE_MAX; + createInfo.maxMemorySize = 4_GiB; #endif createInfo.expectedEntries = m_expectedEntries; @@ -1097,8 +1100,8 @@ VkResult PipelineBinaryCache::InitArchiveLayers( if (result == VK_SUCCESS) { // Assume that the first layer we open should be the "primary" source and optimize its memory access - constexpr size_t PrimaryLayerBufferSize = 64 * 1024 * 1024; - constexpr size_t SecondaryLayerBufferSize = 8 * 1024 * 1024; + constexpr size_t PrimaryLayerBufferSize = 64_MiB; + constexpr size_t SecondaryLayerBufferSize = 8_MiB; // Open the optional read only cache file. This may fail gracefully const char* const pThirdPartyFileName = getenv(EnvVarReadOnlyFileName); diff --git a/icd/api/pipeline_compiler.cpp b/icd/api/pipeline_compiler.cpp index 08a60367..8cbab378 100644 --- a/icd/api/pipeline_compiler.cpp +++ b/icd/api/pipeline_compiler.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -70,6 +70,37 @@ static bool IsDynamicStateEnabled(const uint64_t dynamicStateFlags, const Dynami return dynamicStateFlags & (1ULL << static_cast(internalState)); } +// ===================================================================================================================== +// Check if Wave64 support is force disabled for any shader types via settings +static bool ShouldForceWave32( + ShaderStage stage, + uint32_t deprecateWave64Mask) +{ + bool shouldForceWave32 = false; + + if (deprecateWave64Mask & DeprecateWave64::DeprecateWave64All) + { + shouldForceWave32 = true; + } + else if (stage == ShaderStage::ShaderStageCompute) + { + if (deprecateWave64Mask & DeprecateWave64::DeprecateWave64Cs) + { + shouldForceWave32 = true; + } + } + else if (((1 << stage) & ShaderStageAllGraphicsBit) != 0) + { + if (deprecateWave64Mask & DeprecateWave64::DeprecateWave64NonCs) + { + shouldForceWave32 = true; + } + } + // For RT stages we don't do anything + + return shouldForceWave32; +} + #if VKI_RAY_TRACING // ===================================================================================================================== // Populates shaderLibrary input flags according to settings @@ -123,16 +154,43 @@ static void ApplyProfileOptions( const auto* pShaderOptimizer = pDevice->GetShaderOptimizer(); pShaderOptimizer->OverrideShaderCreateInfo(*pProfileKey, shaderIndex, options); + // By default the client hash provided to PAL is more accurate than the one used by pipeline profiles. + // + // Optionally (based on panel setting), these can be set to temporarily match by devs. This can be useful + // when other tools (such as PAL's profiling layer) are used to measure shaders while building a pipeline + // profile which uses the profile hash. + // It is only valid for graphics and compute pipeline. + if (settings.pipelineUseProfileHashAsClientHash) + { + if ((pProfileKey->shaderCount == 1) && + (pProfileKey->pShaders[0].stage == ShaderStage::ShaderStageCompute) && + (shaderIndex == 0)) + { + pShaderInfo->options.clientHash.lower = pProfileKey->pShaders[0].codeHash.lower; + pShaderInfo->options.clientHash.upper = pProfileKey->pShaders[0].codeHash.upper; + } + else if (pProfileKey->pShaders[shaderIndex].stage < ShaderStageGfxCount) + { + pShaderInfo->options.clientHash.lower = pProfileKey->pShaders[shaderIndex].codeHash.lower; + pShaderInfo->options.clientHash.upper = pProfileKey->pShaders[shaderIndex].codeHash.upper; + } + } } } // ===================================================================================================================== static bool SupportInternalModuleCache( - const PhysicalDevice* pDevice, - const uint32_t compilerMask) + const PhysicalDevice* pDevice, + const uint32_t compilerMask, + const VkShaderModuleCreateFlags internalShaderFlags) { bool supportInternalModuleCache = pDevice->GetRuntimeSettings().enableEarlyCompile; + if (Util::TestAnyFlagSet(internalShaderFlags, VK_INTERNAL_SHADER_FLAGS_FORCE_UNCACHED_BIT)) + { + supportInternalModuleCache = false; + } + #if ICD_X86_BUILD supportInternalModuleCache = false; #endif @@ -347,7 +405,7 @@ void PipelineCompiler::Destroy() auto pInstance = m_pPhysicalDevice->Manager()->VkInstance(); Util::MutexAuto mutexLock(&m_cacheLock); - if (SupportInternalModuleCache(m_pPhysicalDevice, GetCompilerCollectionMask())) + if (SupportInternalModuleCache(m_pPhysicalDevice, GetCompilerCollectionMask(), 0)) { for (auto it = m_shaderModuleHandleMap.Begin(); it.Get() != nullptr; it.Next()) { @@ -431,50 +489,42 @@ VkResult PipelineCompiler::LoadShaderModuleFromCache( const VkShaderModuleCreateFlags internalShaderFlags, const uint32_t compilerMask, const Util::MetroHash::Hash& uniqueHash, - PipelineBinaryCache* pBinaryCache, - PipelineCreationFeedback* pFeedback, ShaderModuleHandle* pShaderModule) { VkResult result = VK_ERROR_INITIALIZATION_FAILED; - const bool supportInternalModuleCache = SupportInternalModuleCache(m_pPhysicalDevice, compilerMask); + const bool supportInternalModuleCache = + SupportInternalModuleCache(m_pPhysicalDevice, compilerMask, internalShaderFlags); const bool delayConversion = false; VK_ASSERT(pShaderModule->pRefCount == nullptr); - if ((pBinaryCache != nullptr) || supportInternalModuleCache) + if (supportInternalModuleCache) { const Util::MetroHash::Hash shaderModuleCacheHash = GetShaderModuleCacheHash(flags, compilerMask, uniqueHash); + ShaderModuleHandle* pHandleInShaderModuleHandleMap = nullptr; const void* pShaderModuleBinary = nullptr; size_t shaderModuleSize = 0; Util::Result cacheResult = Util::Result::NotFound; - bool hitApplicationCache = false; // 1. Look up in internal cache m_shaderModuleHandleMap. if (supportInternalModuleCache) { Util::MutexAuto mutexLock(&m_cacheLock); - ShaderModuleHandle* pHandle = m_shaderModuleHandleMap.FindKey(shaderModuleCacheHash); - if (pHandle != nullptr) + pHandleInShaderModuleHandleMap = m_shaderModuleHandleMap.FindKey(shaderModuleCacheHash); + if ((pHandleInShaderModuleHandleMap != nullptr) && IsValidShaderModule(pHandleInShaderModuleHandleMap)) { - VK_ASSERT(pHandle->pRefCount != nullptr); - (*(pHandle->pRefCount))++; - *pShaderModule = *pHandle; + VK_ASSERT(pHandleInShaderModuleHandleMap->pRefCount != nullptr); + (*(pHandleInShaderModuleHandleMap->pRefCount))++; + *pShaderModule = *pHandleInShaderModuleHandleMap; result = VK_SUCCESS; cacheResult = Util::Result::Success; } } - // 2. Look up in application cache pBinaryCache. Only query availability when hits in m_shaderModuleHandleMap. - if (pBinaryCache != nullptr) - { - - cacheResult = hitApplicationCache ? Util::Result::Success : cacheResult; - } - // 3. Look up in internal cache m_pBinaryCache if ((cacheResult != Util::Result::Success) && (m_pBinaryCache != nullptr) && supportInternalModuleCache) { @@ -495,7 +545,14 @@ VkResult PipelineCompiler::LoadShaderModuleFromCache( // Initialize the reference count to two: one for the runtime cache and one for this shader module. *pShaderModule->pRefCount = 2; - result = PalToVkResult(m_shaderModuleHandleMap.Insert(shaderModuleCacheHash, *pShaderModule)); + if (pHandleInShaderModuleHandleMap == nullptr) + { + result = PalToVkResult(m_shaderModuleHandleMap.Insert(shaderModuleCacheHash, *pShaderModule)); + } + else + { + *pHandleInShaderModuleHandleMap = *pShaderModule; + } VK_ASSERT(result == VK_SUCCESS); if (result != VK_SUCCESS) @@ -507,18 +564,6 @@ VkResult PipelineCompiler::LoadShaderModuleFromCache( } } } - - // 5. Set feedback info - if (pFeedback != nullptr) - { - pFeedback->hitApplicationCache = hitApplicationCache; - } - - // 6. Store binary in application cache if cache hits but not hits in application cache here. This is because - // PipelineCompiler::StoreShaderModuleToCache() would not be called if cache hits. - if ((cacheResult == Util::Result::Success) && (hitApplicationCache == false) && (pBinaryCache != nullptr)) - { - } } return result; @@ -531,24 +576,19 @@ void PipelineCompiler::StoreShaderModuleToCache( const VkShaderModuleCreateFlags internalShaderFlags, const uint32_t compilerMask, const Util::MetroHash::Hash& uniqueHash, - PipelineBinaryCache* pBinaryCache, ShaderModuleHandle* pShaderModule) { VK_ASSERT(pShaderModule->pRefCount == nullptr); - const bool supportInternalModuleCache = SupportInternalModuleCache(m_pPhysicalDevice, compilerMask); + const bool supportInternalModuleCache = + SupportInternalModuleCache(m_pPhysicalDevice, compilerMask, internalShaderFlags); - if ((pBinaryCache != nullptr) || supportInternalModuleCache) + if (supportInternalModuleCache) { const Util::MetroHash::Hash shaderModuleCacheHash = GetShaderModuleCacheHash(flags, compilerMask, uniqueHash); - // 1. Store in application cache pBinaryCache. - if (pBinaryCache != nullptr) - { - } - // 2. Store in internal cache m_shaderModuleHandleMap and m_pBinaryCache if (supportInternalModuleCache) { @@ -585,8 +625,6 @@ VkResult PipelineCompiler::BuildShaderModule( const Vkgc::BinaryData& shaderBinary, const bool adaptForFastLink, bool isInternal, - PipelineBinaryCache* pBinaryCache, - PipelineCreationFeedback* pFeedback, ShaderModuleHandle* pShaderModule) { const RuntimeSettings* pSettings = &m_pPhysicalDevice->GetRuntimeSettings(); @@ -621,7 +659,7 @@ VkResult PipelineCompiler::BuildShaderModule( } result = LoadShaderModuleFromCache( - flags, internalShaderFlags, compilerMask, uniqueHash, pBinaryCache, pFeedback, pShaderModule); + flags, internalShaderFlags, compilerMask, uniqueHash, pShaderModule); if (result != VK_SUCCESS) { @@ -639,7 +677,7 @@ VkResult PipelineCompiler::BuildShaderModule( } - StoreShaderModuleToCache(flags, internalShaderFlags, compilerMask, uniqueHash, pBinaryCache, pShaderModule); + StoreShaderModuleToCache(flags, internalShaderFlags, compilerMask, uniqueHash, pShaderModule); } else if ((pSettings->enablePipelineDump) ) @@ -778,7 +816,7 @@ bool PipelineCompiler::ReplacePipelineShaderModule( if (LoadReplaceShaderBinary(hash64, &shaderBinary)) { VkResult result = - BuildShaderModule(pDevice, 0, 0, shaderBinary, false, false, nullptr, nullptr, pShaderModule); + BuildShaderModule(pDevice, 0, 0, shaderBinary, false, false, pShaderModule); if (result == VK_SUCCESS) { @@ -1154,7 +1192,9 @@ VkResult PipelineCompiler::CreateGraphicsPipelineBinary( if (result == VK_SUCCESS) { Vkgc::IPipelineDumper::DumpPipelineBinary(pPipelineDumpHandle, m_gfxIp, pPipelineBinary); + DumpPipelineMetadata(pPipelineDumpHandle, pCreateInfo->pBinaryMetadata); } + Vkgc::IPipelineDumper::EndPipelineDump(pPipelineDumpHandle); } @@ -1269,7 +1309,16 @@ VkResult PipelineCompiler::CreateColorExportShaderLibrary( dumpOptions.dumpDuplicatePipelines = settings.dumpDuplicatePipelines; Vkgc::PipelineBuildInfo pipelineInfo = {}; - pipelineInfo.pGraphicsInfo = &pCreateInfo->pipelineInfo; + GraphicsPipelineBuildInfo graphicsInfo = pCreateInfo->pipelineInfo; + graphicsInfo.task.pModuleData = nullptr; + graphicsInfo.vs.pModuleData = nullptr; + graphicsInfo.tcs.pModuleData = nullptr; + graphicsInfo.tes.pModuleData = nullptr; + graphicsInfo.gs.pModuleData = nullptr; + graphicsInfo.mesh.pModuleData = nullptr; + graphicsInfo.fs.pModuleData = nullptr; + pipelineInfo.pGraphicsInfo = &graphicsInfo; + pPipelineDumpHandle = Vkgc::IPipelineDumper::BeginPipelineDump(&dumpOptions, pipelineInfo, dumpHash); @@ -1762,11 +1811,21 @@ static void CopyVertexInputInterfaceState( pCreateInfo->pipelineInfo.iaState.topology = libInfo.pipelineInfo.iaState.topology; pCreateInfo->pipelineInfo.iaState.disableVertexReuse = libInfo.pipelineInfo.iaState.disableVertexReuse; pCreateInfo->pipelineInfo.dynamicVertexStride = libInfo.pipelineInfo.dynamicVertexStride; + if (pCreateInfo->pipelineInfo.pVertexInput != nullptr) { BuildLlpcVertexInputDescriptors( pDevice, pCreateInfo->pipelineInfo.pVertexInput, &pCreateInfo->pBinaryMetadata->vbInfo); } + + if (libInfo.pBinaryMetadata->internalBufferInfo.internalBufferCount > 0) + { + VK_ASSERT(libInfo.pBinaryMetadata->internalBufferInfo.internalBufferCount == 1); + VK_ASSERT(pCreateInfo->pBinaryMetadata->internalBufferInfo.internalBufferCount == 0); + pCreateInfo->pBinaryMetadata->internalBufferInfo.internalBufferCount = 1; + pCreateInfo->pBinaryMetadata->internalBufferInfo.internalBufferEntries[0] = + libInfo.pBinaryMetadata->internalBufferInfo.internalBufferEntries[0]; + } } // ===================================================================================================================== @@ -1878,6 +1937,7 @@ static void CopyFragmentOutputInterfaceState( pCreateInfo->pipelineInfo.cbState.dualSourceBlendEnable = libInfo.pipelineInfo.cbState.dualSourceBlendEnable; pCreateInfo->pipelineInfo.cbState.dualSourceBlendDynamic = libInfo.pipelineInfo.cbState.dualSourceBlendDynamic; pCreateInfo->pipelineInfo.iaState.enableMultiView = libInfo.pipelineInfo.iaState.enableMultiView; + pCreateInfo->cbStateHash = libInfo.cbStateHash; } // ===================================================================================================================== @@ -2187,6 +2247,15 @@ void PipelineCompiler::BuildPipelineShaderInfo( pShaderInfoOut, pOptimizerKey, pNggState); + + // If DeprecateWave64Cs or DeprecateWave64NonCs is set, driver might not report wave32-only support, + // but we want to force wavesize to wave32 internally depending on settings and shader stage. + // We override any wavesize forced via shader opts also here. + // NOTE: If the app uses subgroup size then wavesize forced here might get overriden later based on + // subgroupsize. To avoid this beahvior, DeprecateWave64Reporting must be set as well in settings. + pShaderInfoOut->options.waveSize = + ShouldForceWave32(static_cast(stage), pDevice->GetRuntimeSettings().deprecateWave64) ? + 32 : pShaderInfoOut->options.waveSize; } } @@ -2646,11 +2715,29 @@ static void BuildFragmentOutputInterfaceState( (pRenderPass != nullptr) ? pRenderPass->IsMultiviewEnabled() : ((pPipelineRenderingCreateInfoKHR != nullptr) && (Util::CountSetBits(pPipelineRenderingCreateInfoKHR->viewMask) != 0)); + + // Build color export shader partial hash + Util::MetroHash64 hasher = {}; + Util::MetroHash::Hash cbStateHash = {}; + const auto& cbState = pCreateInfo->pipelineInfo.cbState; + hasher.Update(pCreateInfo->pipelineInfo.iaState.enableMultiView); + hasher.Update(cbState.alphaToCoverageEnable); + hasher.Update(cbState.dualSourceBlendEnable); + hasher.Update(cbState.dualSourceBlendDynamic); + for (uint32_t i = 0; i < MaxColorTargets; ++i) + { + hasher.Update(cbState.target[i].channelWriteMask); + hasher.Update(cbState.target[i].blendEnable); + hasher.Update(cbState.target[i].blendSrcAlphaToColor); + hasher.Update(cbState.target[i].format); + } + hasher.Finalize(cbStateHash.bytes); + pCreateInfo->cbStateHash = cbStateHash.qwords[0]; } // ===================================================================================================================== static void BuildExecutablePipelineState( - const Device* pDevice, + Device* pDevice, const VkGraphicsPipelineCreateInfo* pIn, VkPipelineCreateFlags2KHR flags, const GraphicsPipelineShaderStageInfo* pShaderInfo, @@ -2701,7 +2788,8 @@ static void BuildExecutablePipelineState( if (pCreateInfo->pipelineInfo.enableUberFetchShader) { - pDefaultCompiler->BuildPipelineInternalBufferData(pPipelineLayout, pCreateInfo); + pDefaultCompiler->BuildPipelineInternalBufferData(pPipelineLayout, true, pCreateInfo); + pDefaultCompiler->UploadInternalBufferData(pDevice, pCreateInfo); pCreateInfo->pBinaryMetadata->enableUberFetchShader = pCreateInfo->pipelineInfo.enableUberFetchShader; } @@ -2738,18 +2826,94 @@ static void BuildExecutablePipelineState( } #endif - pCreateInfo->linkTimeOptimization = (flags & VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT); + pCreateInfo->linkTimeOptimization = (flags & VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT); +} + +// ===================================================================================================================== +VkResult PipelineCompiler::UploadInternalBufferData( + Device* pDevice, + GraphicsPipelineBinaryCreateInfo* pCreateInfo) +{ + VkResult result = VK_SUCCESS; + PipelineInternalBufferInfo* pInternalBufferInfo = &pCreateInfo->pBinaryMetadata->internalBufferInfo; + if (pInternalBufferInfo->dataSize > 0) + { + InternalMemory* pInternalMem = nullptr; + void* pMem = pDevice->VkInstance()->AllocMem(sizeof(InternalMemory), + VK_DEFAULT_MEM_ALIGN, + VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + if (pMem != nullptr) + { + pInternalMem = VK_PLACEMENT_NEW(pMem) InternalMemory; + + InternalMemCreateInfo allocInfo = {}; + allocInfo.pal.size = pInternalBufferInfo->dataSize; + allocInfo.pal.alignment = VK_DEFAULT_MEM_ALIGN; + allocInfo.pal.priority = Pal::GpuMemPriority::Normal; + + pDevice->MemMgr()->GetCommonPool(InternalPoolDescriptorTable, &allocInfo); + + result = pDevice->MemMgr()->AllocGpuMem( + allocInfo, + pInternalMem, + pDevice->GetPalDeviceMask(), + VK_OBJECT_TYPE_PIPELINE, + 0); + } + else + { + result = VK_ERROR_OUT_OF_HOST_MEMORY; + } + + if (result != VK_SUCCESS) + { + VK_NEVER_CALLED(); + pCreateInfo->pipelineInfo.enableEarlyCompile = false; + pCreateInfo->pipelineInfo.enableUberFetchShader = false; + if (pMem != nullptr) + { + pDevice->VkInstance()->FreeMem(pMem); + } + } + else + { + pCreateInfo->pInternalMem = pInternalMem; + } + } + + if (pCreateInfo->pInternalMem != nullptr) + { + utils::IterateMask deviceGroup(pDevice->GetPalDeviceMask()); + do + { + const uint32_t deviceIdx = deviceGroup.Index(); + void* pBufferCpuAddr = pCreateInfo->pInternalMem->CpuAddr(deviceIdx); + Pal::gpusize bufferGpuAddr = pCreateInfo->pInternalMem->GpuVirtAddr(deviceIdx); + memcpy(pBufferCpuAddr, pInternalBufferInfo->pData, pInternalBufferInfo->dataSize); + + for (uint32_t i = 0; i < pInternalBufferInfo->internalBufferCount; i++) + { + auto pEntry = &pInternalBufferInfo->internalBufferEntries[i]; + if (pEntry->bufferAddress[deviceIdx] == 0) + { + pEntry->bufferAddress[deviceIdx] = bufferGpuAddr + pEntry->bufferOffset; + } + } + } while (deviceGroup.IterateNext()); + } + + return result; } // ===================================================================================================================== // Converts Vulkan graphics pipeline parameters to an internal structure VkResult PipelineCompiler::ConvertGraphicsPipelineInfo( - const Device* pDevice, + Device* pDevice, const VkGraphicsPipelineCreateInfo* pIn, VkPipelineCreateFlags2KHR flags, const GraphicsPipelineShaderStageInfo* pShaderInfo, const PipelineLayout* pPipelineLayout, - PipelineOptimizerKey* pPipelineProfileKey, + const PipelineOptimizerKey* pPipelineProfileKey, PipelineMetadata* pBinaryMetadata, GraphicsPipelineBinaryCreateInfo* pCreateInfo) { @@ -2777,12 +2941,9 @@ VkResult PipelineCompiler::ConvertGraphicsPipelineInfo( pCreateInfo->libFlags |= (libInfo.pFragmentOutputInterfaceLib == nullptr) ? 0 : VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT; - uint32_t libFlags = libInfo.libFlags; - - libInfo.libFlags = libFlags; - pCreateInfo->flags = pIn->flags; + pCreateInfo->flags = flags; pDevice->GetCompiler(DefaultDeviceIndex)->ApplyPipelineOptions(pDevice, - pIn->flags, + flags, &pCreateInfo->pipelineInfo.options ); @@ -2898,10 +3059,22 @@ VkResult PipelineCompiler::ConvertGraphicsPipelineInfo( } } - if ((result == VK_SUCCESS) && (libInfo.flags.isLibrary == false)) + if (result == VK_SUCCESS) { - BuildExecutablePipelineState( - pDevice, pIn, flags, pShaderInfo, &libInfo, pPipelineLayout, dynamicStateFlags, pCreateInfo); + if (libInfo.flags.isLibrary == false) + { + BuildExecutablePipelineState( + pDevice, pIn, flags, pShaderInfo, &libInfo, pPipelineLayout, dynamicStateFlags, pCreateInfo); + } + else if ((libInfo.libFlags & VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT) != 0) + { + bool enableUberFetchShader = pCreateInfo->pipelineInfo.enableUberFetchShader; + pCreateInfo->pipelineInfo.enableUberFetchShader = true; + pDevice->GetCompiler(DefaultDeviceIndex)->BuildPipelineInternalBufferData( + pDevice->GetNullPipelineLayout(), false, pCreateInfo); + pDevice->GetCompiler(DefaultDeviceIndex)->UploadInternalBufferData(pDevice, pCreateInfo); + pCreateInfo->pipelineInfo.enableUberFetchShader = enableUberFetchShader; + } } return result; @@ -2910,7 +3083,7 @@ VkResult PipelineCompiler::ConvertGraphicsPipelineInfo( // ===================================================================================================================== // Converts Vulkan graphics pipeline parameters to an internal structure for graphics library fast link VkResult PipelineCompiler::BuildGplFastLinkCreateInfo( - const Device* pDevice, + Device* pDevice, const VkGraphicsPipelineCreateInfo* pIn, VkPipelineCreateFlags2KHR flags, const GraphicsPipelineLibraryInfo& libInfo, @@ -2944,10 +3117,9 @@ VkResult PipelineCompiler::BuildGplFastLinkCreateInfo( // Copy parameters if (result == VK_SUCCESS) { - // We needn't copy the state of pre-raster and fragment, they have been included in graphics shader libraries. - CopyPipelineShadersInfo(libInfo.pPreRasterizationShaderLib, pCreateInfo); - CopyPipelineShadersInfo(libInfo.pFragmentShaderLib, pCreateInfo); - pCreateInfo->pipelineInfo.enableUberFetchShader = pCreateInfo->pBinaryMetadata->enableUberFetchShader; + // Copy the state of pre-raster and fragment. + CopyPreRasterizationShaderState(libInfo.pPreRasterizationShaderLib, pCreateInfo); + CopyFragmentShaderState(libInfo.pFragmentShaderLib, pCreateInfo); if (libInfo.libFlags & VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT) { @@ -3001,7 +3173,10 @@ VkResult PipelineCompiler::BuildGplFastLinkCreateInfo( { if (pCreateInfo->pipelineInfo.enableUberFetchShader) { - BuildPipelineInternalBufferData(pPipelineLayout, pCreateInfo); + // Always build internal buffer data if pipeline dump is enabled. + const bool enableCache = pDevice->GetRuntimeSettings().enablePipelineDump; + BuildPipelineInternalBufferData(pPipelineLayout, enableCache, pCreateInfo); + UploadInternalBufferData(pDevice, pCreateInfo); } } @@ -3052,6 +3227,10 @@ void PipelineCompiler::ApplyPipelineOptions( Vkgc::PipelineOptions* pOptions ) { + // Provide necessary runtime settings and PAL device properties + const auto& settings = m_pPhysicalDevice->GetRuntimeSettings(); + const auto& info = m_pPhysicalDevice->PalProperties(); + if (pDevice->IsExtensionEnabled(DeviceExtensions::AMD_SHADER_INFO) || (pDevice->IsExtensionEnabled(DeviceExtensions::KHR_PIPELINE_EXECUTABLE_PROPERTIES) && ((flags & VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR) != 0))) @@ -3060,7 +3239,25 @@ void PipelineCompiler::ApplyPipelineOptions( pOptions->includeIr = true; } - pOptions->optimizationLevel = ((flags & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) != 0 ? 0 : 2); + switch (settings.pipelineFastCompileMode) + { + case PipelineFastCompileApiControlled: + pOptions->optimizationLevel = ((flags & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) != 0 ? 0 : 2); + break; + case PipelineFastCompileNeverOptimized: + pOptions->optimizationLevel = 0; + break; + case PipelineFastCompileFastOptimized: + pOptions->optimizationLevel = 1; + break; + case PipelineFastCompileFullOptimized: + pOptions->optimizationLevel = 2; + break; + default: + VK_NEVER_CALLED(); + pOptions->optimizationLevel = 2; + break; + } if (pDevice->IsExtensionEnabled(DeviceExtensions::EXT_SCALAR_BLOCK_LAYOUT) || pDevice->GetEnabledFeatures().scalarBlockLayout @@ -3074,10 +3271,6 @@ void PipelineCompiler::ApplyPipelineOptions( pOptions->robustBufferAccess = true; } - // Provide necessary runtime settings and PAL device properties - const auto& settings = m_pPhysicalDevice->GetRuntimeSettings(); - const auto& info = m_pPhysicalDevice->PalProperties(); - pOptions->shadowDescriptorTableUsage = settings.enableFmaskBasedMsaaRead ? Vkgc::ShadowDescriptorTableUsage::Enable : Vkgc::ShadowDescriptorTableUsage::Disable; @@ -3089,7 +3282,7 @@ void PipelineCompiler::ApplyPipelineOptions( pOptions->enableRelocatableShaderElf = settings.enableRelocatableShaders; pOptions->disableImageResourceCheck = settings.disableImageResourceTypeCheck; #if VKI_BUILD_GFX11 - pOptions->optimizeTessFactor = settings.optimizeTessFactor; + pOptions->optimizeTessFactor = settings.optimizeTessFactor != OptimizeTessFactorDisable; #endif pOptions->forceCsThreadIdSwizzling = settings.forceCsThreadIdSwizzling; pOptions->overrideThreadGroupSizeX = settings.overrideThreadGroupSizeX; @@ -3105,6 +3298,8 @@ void PipelineCompiler::ApplyPipelineOptions( pOptions->disableTruncCoordForGather = settings.disableTruncCoordForGather; + pOptions->disablePerCompFetch = settings.disablePerCompFetch; + if (pDevice->GetEnabledFeatures().robustBufferAccessExtended) { pOptions->extendedRobustness.robustBufferAccess = true; @@ -3136,6 +3331,9 @@ VkResult PipelineCompiler::ConvertComputePipelineInfo( { VkResult result = VK_SUCCESS; auto pInstance = m_pPhysicalDevice->Manager()->VkInstance(); + auto& settings = m_pPhysicalDevice->GetRuntimeSettings(); + + AppProfile appProfile = m_pPhysicalDevice->GetAppProfile(); if (result == VK_SUCCESS) { @@ -3211,7 +3409,7 @@ VkResult PipelineCompiler::ConvertComputePipelineInfo( if (result == VK_SUCCESS) { - pCreateInfo->compilerType = CheckCompilerType(&pCreateInfo->pipelineInfo); + pCreateInfo->compilerType = CheckCompilerType(&pCreateInfo->pipelineInfo); if (pShaderInfo->stage.pModuleHandle != nullptr) { @@ -3219,9 +3417,6 @@ VkResult PipelineCompiler::ConvertComputePipelineInfo( ShaderModule::GetShaderData(pCreateInfo->compilerType, pShaderInfo->stage.pModuleHandle); } -#if VKI_RAY_TRACING - auto& settings = m_pPhysicalDevice->GetRuntimeSettings(); -#endif #if VKI_RAY_TRACING const auto* pModuleData = reinterpret_cast (pCreateInfo->pipelineInfo.cs.pModuleData); @@ -3247,8 +3442,92 @@ VkResult PipelineCompiler::ConvertComputePipelineInfo( &pCreateInfo->pipelineInfo.cs, pCreateInfo->pPipelineProfileKey, nullptr); + + // If DeprecateWave64Cs is set, driver might not report wave32-only support, but we want to force wavesize + // to wave32 internally depending on settings. + // We override any wavesize forced via shader opts also here. + // NOTE: If the app uses subgroup size then wavesize forced here might get overriden later based on + // subgroupsize. To avoid this beahvior, DeprecateWave64Reporting must also be set in the bitmask. + pCreateInfo->pipelineInfo.cs.options.waveSize = + ShouldForceWave32(ShaderStage::ShaderStageCompute, settings.deprecateWave64) ? + 32 : pCreateInfo->pipelineInfo.cs.options.waveSize; } + // Force enable automatic workgroup reconfigure. + if (appProfile == AppProfile::DawnOfWarIII) + { + pCreateInfo->pipelineInfo.options.reconfigWorkgroupLayout = true; + } + + const auto threadGroupSwizzleMode = + pDevice->GetShaderOptimizer()->OverrideThreadGroupSwizzleMode( + ShaderStageCompute, + *pCreateInfo->pPipelineProfileKey); + + const bool threadIdSwizzleMode = + pDevice->GetShaderOptimizer()->OverrideThreadIdSwizzleMode( + ShaderStageCompute, + *pCreateInfo->pPipelineProfileKey); + + uint32_t overrideShaderThreadGroupSizeX = 0; + uint32_t overrideShaderThreadGroupSizeY = 0; + uint32_t overrideShaderThreadGroupSizeZ = 0; + + pDevice->GetShaderOptimizer()->OverrideShaderThreadGroupSize( + ShaderStageCompute, + *pCreateInfo->pPipelineProfileKey, + &overrideShaderThreadGroupSizeX, + &overrideShaderThreadGroupSizeY, + &overrideShaderThreadGroupSizeZ); + + if (threadGroupSwizzleMode != Vkgc::ThreadGroupSwizzleMode::Default) + { + pCreateInfo->pipelineInfo.options.threadGroupSwizzleMode = threadGroupSwizzleMode; + } + + if ((overrideShaderThreadGroupSizeX == NotOverrideThreadGroupSizeX) && + (overrideShaderThreadGroupSizeY == NotOverrideThreadGroupSizeX) && + (overrideShaderThreadGroupSizeZ == NotOverrideShaderThreadGroupSizeZ) && + (settings.overrideThreadGroupSizeX == NotOverrideThreadGroupSizeX) && + (settings.overrideThreadGroupSizeY == NotOverrideThreadGroupSizeY) && + (settings.overrideThreadGroupSizeZ == NotOverrideThreadGroupSizeZ)) + { + if (threadIdSwizzleMode) + { + pCreateInfo->pipelineInfo.options.forceCsThreadIdSwizzling = threadIdSwizzleMode; + } + } + else + { + pCreateInfo->pipelineInfo.options.forceCsThreadIdSwizzling = settings.forceCsThreadIdSwizzling; + } + + if (overrideShaderThreadGroupSizeX != NotOverrideThreadGroupSizeX) + { + pCreateInfo->pipelineInfo.options.overrideThreadGroupSizeX = overrideShaderThreadGroupSizeX; + } + else + { + pCreateInfo->pipelineInfo.options.overrideThreadGroupSizeX = settings.overrideThreadGroupSizeX; + } + + if (overrideShaderThreadGroupSizeY != NotOverrideThreadGroupSizeY) + { + pCreateInfo->pipelineInfo.options.overrideThreadGroupSizeY = overrideShaderThreadGroupSizeY; + } + else + { + pCreateInfo->pipelineInfo.options.overrideThreadGroupSizeY = settings.overrideThreadGroupSizeY; + } + + if (overrideShaderThreadGroupSizeZ != NotOverrideThreadGroupSizeZ) + { + pCreateInfo->pipelineInfo.options.overrideThreadGroupSizeZ = overrideShaderThreadGroupSizeZ; + } + else + { + pCreateInfo->pipelineInfo.options.overrideThreadGroupSizeZ = settings.overrideThreadGroupSizeZ; + } return result; } @@ -3309,9 +3588,11 @@ void PipelineCompiler::ApplyDefaultShaderOptions( pShaderOptions->waveBreakSize = static_cast(settings.waveBreakSize); pShaderOptions->disableLoopUnroll = settings.disableLoopUnrolls; - if (((flags & VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT) != 0) && - (((flags & VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT) != 0) || - (m_pPhysicalDevice->GetEnabledAPIVersion() >= VK_MAKE_API_VERSION( 0, 1, 3, 0)))) + if ((((settings.deprecateWave64 & DeprecateWave64Reporting) != 0) && + ((settings.deprecateWave64 & DeprecateWave64WaveIntrinsics) == 0)) || + (((flags & VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT) != 0) && + (((flags & VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT) != 0) || + (m_pPhysicalDevice->GetEnabledAPIVersion() >= VK_MAKE_API_VERSION( 0, 1, 3, 0))))) { pShaderOptions->allowVaryWaveSize = true; } @@ -3369,16 +3650,33 @@ void PipelineCompiler::FreeComputePipelineCreateInfo( // ===================================================================================================================== // Free the temp memories in graphics pipeline create info void PipelineCompiler::FreeGraphicsPipelineCreateInfo( + Device* pDevice, GraphicsPipelineBinaryCreateInfo* pCreateInfo, - bool keepConvertTempMemory) + bool keepConvertTempMemory, + bool keepInternalMem) { - auto pInstance = m_pPhysicalDevice->Manager()->VkInstance(); + auto pInstance = pDevice->VkInstance(); if ((pCreateInfo->pTempBuffer != nullptr) && (keepConvertTempMemory == false)) { pInstance->FreeMem(pCreateInfo->pTempBuffer); pCreateInfo->pTempBuffer = nullptr; } + + if (pCreateInfo->pBinaryMetadata->internalBufferInfo.pData != nullptr) + { + pInstance->FreeMem(pCreateInfo->pBinaryMetadata->internalBufferInfo.pData); + pCreateInfo->pBinaryMetadata->internalBufferInfo.pData = nullptr; + pCreateInfo->pBinaryMetadata->internalBufferInfo.dataSize = 0; + } + + if ((pCreateInfo->pInternalMem != nullptr) && (keepInternalMem == false)) + { + pDevice->MemMgr()->FreeGpuMem(pCreateInfo->pInternalMem); + Util::Destructor(pCreateInfo->pInternalMem); + pInstance->FreeMem(pCreateInfo->pInternalMem); + pCreateInfo->pInternalMem = nullptr; + } } #if VKI_RAY_TRACING @@ -3416,6 +3714,8 @@ VkResult PipelineCompiler::ConvertRayTracingPipelineInfo( bool isReplay = ((pIn->groupCount > 0) && (pIn->pGroups[0].pShaderGroupCaptureReplayHandle != nullptr)); + pCreateInfo->pipelineInfo.libraryMode = isLibrary ? LibraryMode::Library : LibraryMode::Pipeline; + if (hasLibraries) { VkShaderStageFlags libraryStageMask = 0; @@ -3523,6 +3823,11 @@ VkResult PipelineCompiler::ConvertRayTracingPipelineInfo( tempBufferSize += genericMappingBufferSize + pCreateInfo->mappingBufferSize; } + if (hasLibraries) + { + tempBufferSize += sizeof(BinaryData) * pIn->pLibraryInfo->libraryCount; + } + // We can't have a pipeline with 0 shader stages VK_ASSERT(tempBufferSize > 0); @@ -3585,6 +3890,7 @@ VkResult PipelineCompiler::ConvertRayTracingPipelineInfo( uint32_t nonRayGenCount = 0; bool shaderCanInline = (settings.rtCompileMode != RtCompileMode::RtCompileModeIndirect); + size_t shaderTotalSize = 0; for (uint32_t i = 0; i < pShaderInfo->stageCount; ++i) { @@ -3594,6 +3900,7 @@ VkResult PipelineCompiler::ConvertRayTracingPipelineInfo( pShaderInfo->pStages[i].pSpecializationInfo; pCreateInfo->pipelineInfo.pShaders[i].pEntryTarget = pShaderInfo->pStages[i].pEntryPoint; pCreateInfo->pipelineInfo.pShaders[i].entryStage = pShaderInfo->pStages[i].stage; + shaderTotalSize += pShaderInfo->pStages[i].codeSize; if (pShaderInfo->pStages[i].stage != ShaderStage::ShaderStageRayTracingRayGen) { @@ -3638,7 +3945,8 @@ VkResult PipelineCompiler::ConvertRayTracingPipelineInfo( pCreateInfo->allowShaderInlining = (shaderCanInline && (nonRayGenCount <= settings.maxUnifiedNonRayGenShaders) && - (raygenCount <= settings.maxUnifiedRayGenShaders)); + (raygenCount <= settings.maxUnifiedRayGenShaders) && + (shaderTotalSize <= settings.maxTotalSizeOfUnifiedShaders)); // if it is a pipeline library, or a main pipeline which would link to a library, // force indirect path by set pCreateInfo->allowShaderInlining = false if (isLibrary || hasLibraries) @@ -3653,8 +3961,8 @@ VkResult PipelineCompiler::ConvertRayTracingPipelineInfo( for (uint32_t i = 0; i < pShaderInfo->stageCount; ++i) { ApplyDefaultShaderOptions(pShaderInfo->pStages[i].stage, - pShaderInfo->pStages[i].flags, - &pCreateInfo->pipelineInfo.pShaders[i].options); + pShaderInfo->pStages[i].flags, + &pCreateInfo->pipelineInfo.pShaders[i].options); } if (pCreateInfo->compilerType == PipelineCompilerTypeLlpc) @@ -3684,11 +3992,34 @@ VkResult PipelineCompiler::ConvertRayTracingPipelineInfo( &pCreateInfo->pipelineInfo.pShaders[i], pPipelineProfileKey, nullptr); + + // Don't check for DeprecateWave64 here because currently we don't do anything for RT shaders } } SetRayTracingState(pDevice, &pCreateInfo->pipelineInfo.rtState, pCreateInfo->flags); + + if (hasLibraries) + { + uint32_t libraryCount = pIn->pLibraryInfo->libraryCount; + BinaryData* pSummaries = reinterpret_cast( + VoidPtrInc(pCreateInfo->pTempBuffer, tempBufferOffset)); + tempBufferOffset += sizeof(BinaryData) * libraryCount; + + pCreateInfo->pipelineInfo.libraryCount = libraryCount; + pCreateInfo->pipelineInfo.pLibrarySummaries = pSummaries; + + for (uint32_t i = 0; i != libraryCount; ++i) + { + VkPipeline libraryHandle = pIn->pLibraryInfo->pLibraries[i]; + RayTracingPipeline* pLibrary = RayTracingPipeline::ObjectFromHandle(libraryHandle); + + const BinaryData& summary = pLibrary->GetLibrarySummary(pCreateInfo->pipelineInfo.deviceIndex); + + pSummaries[i] = summary; + } + } } } @@ -3876,6 +4207,8 @@ VkResult PipelineCompiler::CreateRayTracingPipelineBinary( Vkgc::IPipelineDumper::DumpRayTracingPipelineMetadata(pPipelineDumpHandle, &pipelineMeta); + Vkgc::IPipelineDumper::DumpRayTracingLibrarySummary(pPipelineDumpHandle, &pPipelineBinary->librarySummary); + if (pPipelineBinary->pElfCache == nullptr) { pInstance->FreeMem(const_cast(pipelineMeta.pCode)); @@ -3998,6 +4331,9 @@ void PipelineCompiler::SetRayTracingState( pRtState->exportConfig.indirectCalleeSavedRegs.callable = settings.indirectCalleeCallable; pRtState->exportConfig.enableUniformNoReturn = settings.enableUniformNoReturn; + pRtState->exportConfig.emitRaytracingShaderDataToken = settings.rtEmitRayTracingShaderDataToken || + m_pPhysicalDevice->Manager()->VkInstance()->PalPlatform()->IsRaytracingShaderDataTokenRequested(); + // Set ray query swizzle pRtState->rayQueryCsSwizzle = settings.rayQueryCsSwizzle; @@ -4252,6 +4588,8 @@ void PipelineCompiler::ExtractRayTracingPipelineBinary( VoidPtrInc(pBase, reinterpret_cast(pPipelineBinary->shaderPropSet.shaderProps))); pPipelineBinary->pPipelineBins = reinterpret_cast( VoidPtrInc(pBase, reinterpret_cast(pPipelineBinary->pPipelineBins))); + pPipelineBinary->librarySummary.pCode = + VoidPtrInc(pBase, reinterpret_cast(pPipelineBinary->librarySummary.pCode)); for (uint32_t i = 0; i < pPipelineBinary->pipelineBinCount; ++i) { @@ -4274,7 +4612,8 @@ size_t PipelineCompiler::GetRayTracingPipelineMetaSize( return sizeof(RayTracingPipelineBinary) + sizeof(Vkgc::RayTracingShaderIdentifier) * pPipelineBinary->shaderGroupHandle.shaderHandleCount + sizeof(Vkgc::RayTracingShaderProperty) * pPipelineBinary->shaderPropSet.shaderCount + - sizeof(Vkgc::BinaryData) * pPipelineBinary->pipelineBinCount; + sizeof(Vkgc::BinaryData) * pPipelineBinary->pipelineBinCount + + Pow2Align(pPipelineBinary->librarySummary.codeSize, 8); } // ===================================================================================================================== @@ -4320,7 +4659,16 @@ bool PipelineCompiler::BuildRayTracingPipelineBinary( pHeader->shaderPropSet.shaderProps = reinterpret_cast(VoidPtrDiff(pProperty, pAllocBuf)); - Vkgc::BinaryData* pBinary = reinterpret_cast(pProperty + pPipelineBinary->shaderPropSet.shaderCount); + void *pLibrarySummary = pProperty + pPipelineBinary->shaderPropSet.shaderCount; + size_t librarySummaryAlignedSize = Pow2Align(pPipelineBinary->librarySummary.codeSize, 8); + memcpy(pLibrarySummary, pPipelineBinary->librarySummary.pCode, pPipelineBinary->librarySummary.codeSize); + memset(VoidPtrInc(pLibrarySummary, pPipelineBinary->librarySummary.codeSize), + 0, + librarySummaryAlignedSize - pPipelineBinary->librarySummary.codeSize); + pHeader->librarySummary.pCode = reinterpret_cast(VoidPtrDiff(pLibrarySummary, pAllocBuf)); + + Vkgc::BinaryData* pBinary = + reinterpret_cast(VoidPtrInc(pLibrarySummary, librarySummaryAlignedSize)); memcpy(pBinary, pPipelineBinary->pPipelineBins, sizeof(Vkgc::BinaryData) * pPipelineBinary->pipelineBinCount); pHeader->pPipelineBins = reinterpret_cast(VoidPtrDiff(pBinary, pAllocBuf)); @@ -4505,20 +4853,9 @@ void PipelineCompiler::GetColorExportShaderCacheId( Util::MetroHash64 hash = {}; // Update hash based on fragment output state - hash.Update(pCreateInfo->pipelineInfo.iaState.enableMultiView); - hash.Update(pCreateInfo->pBinaryMetadata->dualSrcBlendingUsed); - const auto& cbState = pCreateInfo->pipelineInfo.cbState; - hash.Update(cbState.alphaToCoverageEnable); - hash.Update(cbState.dualSourceBlendEnable); - hash.Update(cbState.dualSourceBlendDynamic); - for (uint32_t i = 0; i < MaxColorTargets; ++i) - { - hash.Update(cbState.target[i].channelWriteMask); - hash.Update(cbState.target[i].blendEnable); - hash.Update(cbState.target[i].blendSrcAlphaToColor); - hash.Update(cbState.target[i].format); - } + hash.Update(pCreateInfo->pBinaryMetadata->dualSrcBlendingUsed); + hash.Update(pCreateInfo->cbStateHash); // Update hash based on fragment shader output metadata hash.Update(static_cast(pCreateInfo->pBinaryMetadata->pFsOutputMetaData), @@ -4557,6 +4894,7 @@ void PipelineCompiler::GetRayTracingPipelineCacheId( // ===================================================================================================================== void PipelineCompiler::BuildPipelineInternalBufferData( const PipelineLayout* pPipelineLayout, + bool needCache, GraphicsPipelineBinaryCreateInfo* pCreateInfo) { uint32_t fetchShaderConstBufRegBase = PipelineLayout::InvalidReg; @@ -4585,6 +4923,7 @@ void PipelineCompiler::BuildPipelineInternalBufferData( fetchShaderConstBufRegBase, specConstBufVertexRegBase, specConstBufFragmentRegBase, + needCache, pCreateInfo); } @@ -4715,6 +5054,15 @@ VkResult PipelineCompiler::WriteBinaryMetadata( if (pSection != nullptr) { memcpy(pSection, pMetadata, sizeof(PipelineMetadata)); + PipelineMetadata* pDstMeta = static_cast(pSection); + pDstMeta->internalBufferInfo.pData = nullptr; + for (uint32_t i = 0; i < pDstMeta->internalBufferInfo.internalBufferCount; i++) + { + for (uint32_t j = 0; j < MaxPalDevices; j++) + { + pDstMeta->internalBufferInfo.internalBufferEntries[i].bufferAddress[j] = 0; + } + } memcpy( Util::VoidPtrInc(pSection, sizeof(PipelineMetadata)), pMetadata->internalBufferInfo.pData, @@ -5090,6 +5438,123 @@ uint32_t PipelineCompiler::BuildUberFetchShaderInternalData( pUberFetchShaderInternalData); } +// ===================================================================================================================== +void PipelineCompiler::DumpPipelineMetadata( + void* pPipelineDumpHandle, + const PipelineMetadata* pBinaryMetadata) +{ + char metaString[512]; + + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, "\n;[PipelineMetadata]\n"); + +#if VKI_RAY_TRACING + Util::Snprintf(metaString, + sizeof(metaString), + ";rayQueryUsed = %u\n", + pBinaryMetadata->rayQueryUsed); + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, metaString); +#endif + + Util::Snprintf(metaString, + sizeof(metaString), + ";pointSizeUsed = %u\n" + ";dualSrcBlendingUsed = %u\n" + ";shadingRateUsedInShader = %u\n" + ";enableEarlyCompile = %u\n" + ";enableUberFetchShader = %u\n" + ";postDepthCoverageEnable = %u\n" + ";psOnlyPointCoordEnable = %u\n", + pBinaryMetadata->pointSizeUsed, + pBinaryMetadata->dualSrcBlendingUsed, + pBinaryMetadata->shadingRateUsedInShader, + pBinaryMetadata->enableEarlyCompile, + pBinaryMetadata->enableUberFetchShader, + pBinaryMetadata->postDepthCoverageEnable, + pBinaryMetadata->psOnlyPointCoordEnable); + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, metaString); + + Util::Snprintf(metaString, + sizeof(metaString), + ";vbInfo.bindingTableSize = %u\n" + ";vbInfo.bindingCount = %u\n" + ";vbInfo.bindings: {", + pBinaryMetadata->vbInfo.bindingTableSize, + pBinaryMetadata->vbInfo.bindingCount); + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, metaString); + for (uint32_t i = 0; i < pBinaryMetadata->vbInfo.bindingCount; i++) + { + Util::Snprintf(metaString, + sizeof(metaString), + "{%u, %u},", + pBinaryMetadata->vbInfo.bindings[i].slot, + pBinaryMetadata->vbInfo.bindings[i].byteStride); + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, metaString); + } + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, "}\n"); + + Util::Snprintf(metaString, + sizeof(metaString), + ";internalBuffer (count = %u, dataSize = %u) \n", + pBinaryMetadata->internalBufferInfo.internalBufferCount, + pBinaryMetadata->internalBufferInfo.dataSize); + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, metaString); + + for (uint32_t i = 0; i < pBinaryMetadata->internalBufferInfo.internalBufferCount; i++) + { + Util::Snprintf(metaString, + sizeof(metaString), + ";internalBufferEntries[%u] = {.userDataOffset = %u, .bufferOffset = %u, .bufferAddress = %llx} \n", + i, + pBinaryMetadata->internalBufferInfo.internalBufferEntries[i].userDataOffset, + pBinaryMetadata->internalBufferInfo.internalBufferEntries[i].bufferOffset, + pBinaryMetadata->internalBufferInfo.internalBufferEntries[i].bufferAddress[0]); + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, metaString); + } + + if (pBinaryMetadata->internalBufferInfo.pData != nullptr) + { + const uint32_t* pData = static_cast(pBinaryMetadata->internalBufferInfo.pData); + for (uint32_t i = 0; i < pBinaryMetadata->internalBufferInfo.dataSize / sizeof(uint32_t); i++) + { + if ((i % 8) == 0) + { + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, ";"); + } + Util::Snprintf(metaString, sizeof(metaString), "0x%08X ", pData[i]); + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, metaString); + if((i % 8) == 7) + { + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, "\n"); + } + } + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, "\n"); + } + + if (pBinaryMetadata->pFsOutputMetaData != nullptr) + { + Util::Snprintf(metaString, + sizeof(metaString), + ";fsOutputMetaData (dataSize = %u) \n", + pBinaryMetadata->fsOutputMetaDataSize); + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, metaString); + const uint32_t* pData = static_cast(pBinaryMetadata->pFsOutputMetaData); + for (uint32_t i = 0; i < pBinaryMetadata->fsOutputMetaDataSize / sizeof(uint32_t); i++) + { + if ((i % 8) == 0) + { + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, ";"); + } + Util::Snprintf(metaString, sizeof(metaString), "0x%08X ", pData[i]); + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, metaString); + if ((i % 8) == 7) + { + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, "\n"); + } + } + Vkgc::IPipelineDumper::DumpPipelineExtraInfo(pPipelineDumpHandle, "\n"); + } +} + // ===================================================================================================================== // Template instantiation needed for references in other files. Linux complains if we don't do this. diff --git a/icd/api/raytrace/ray_tracing_device.cpp b/icd/api/raytrace/ray_tracing_device.cpp index f951bc99..b5c189ca 100644 --- a/icd/api/raytrace/ray_tracing_device.cpp +++ b/icd/api/raytrace/ray_tracing_device.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/raytrace/ray_tracing_device.h b/icd/api/raytrace/ray_tracing_device.h index 16a4ecc5..3c158ca7 100644 --- a/icd/api/raytrace/ray_tracing_device.h +++ b/icd/api/raytrace/ray_tracing_device.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/raytrace/ray_tracing_util.h b/icd/api/raytrace/ray_tracing_util.h index e73e58fe..4fd11dd7 100644 --- a/icd/api/raytrace/ray_tracing_util.h +++ b/icd/api/raytrace/ray_tracing_util.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/raytrace/vk_acceleration_structure.cpp b/icd/api/raytrace/vk_acceleration_structure.cpp index a805b7fa..d85e8281 100644 --- a/icd/api/raytrace/vk_acceleration_structure.cpp +++ b/icd/api/raytrace/vk_acceleration_structure.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/raytrace/vk_acceleration_structure.h b/icd/api/raytrace/vk_acceleration_structure.h index e1c5f13e..93702db0 100644 --- a/icd/api/raytrace/vk_acceleration_structure.h +++ b/icd/api/raytrace/vk_acceleration_structure.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/raytrace/vk_ray_tracing_pipeline.cpp b/icd/api/raytrace/vk_ray_tracing_pipeline.cpp index 39256984..86528fd8 100644 --- a/icd/api/raytrace/vk_ray_tracing_pipeline.cpp +++ b/icd/api/raytrace/vk_ray_tracing_pipeline.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -320,6 +320,7 @@ RayTracingPipeline::RayTracingPipeline( memset(m_pShaderGroupStackSizes, 0, sizeof(ShaderGroupStackSizes*) * MaxPalDevices); memset(m_traceRayGpuVas, 0, sizeof(gpusize) * MaxPalDevices); memset(m_defaultPipelineStackSizes, 0, sizeof(Pal::CompilerStackSizes) * MaxPalDevices); + memset(m_librarySummary, 0, sizeof(BinaryData) * MaxPalDevices); } // ===================================================================================================================== @@ -337,6 +338,7 @@ void RayTracingPipeline::Init( Vkgc::RayTracingShaderIdentifier* pShaderGroupHandles[MaxPalDevices], ShaderGroupStackSizes* pShaderGroupStackSizes[MaxPalDevices], ShaderGroupInfo* pShaderGroupInfos, + const BinaryData* pLibrarySummary, uint32_t attributeSize, gpusize traceRayGpuVas[MaxPalDevices], uint32_t dispatchRaysUserDataOffset, @@ -366,6 +368,7 @@ void RayTracingPipeline::Init( memcpy(m_pShaderGroupHandles, pShaderGroupHandles, sizeof(Vkgc::RayTracingShaderIdentifier*) * MaxPalDevices); memcpy(m_pShaderGroupStackSizes, pShaderGroupStackSizes, sizeof(ShaderGroupStackSizes*) * MaxPalDevices); memcpy(m_traceRayGpuVas, traceRayGpuVas, sizeof(gpusize) * MaxPalDevices); + memcpy(m_librarySummary, pLibrarySummary, sizeof(BinaryData) * MaxPalDevices); } // ===================================================================================================================== @@ -387,6 +390,11 @@ VkResult RayTracingPipeline::Destroy( } } + if (m_librarySummary[0].pCode != nullptr) + { + pAllocator->pfnFree(pAllocator->pUserData, const_cast(m_librarySummary[0].pCode)); + } + if (m_captureReplayVaMappingBufferInfo.pData != nullptr) { pAllocator->pfnFree(pAllocator->pUserData, m_captureReplayVaMappingBufferInfo.pData); @@ -606,6 +614,7 @@ VkResult RayTracingPipeline::CreateImpl( RayTracingPipelineBinary pipelineBinary[MaxPalDevices] = {}; Vkgc::RayTracingShaderIdentifier* pShaderGroups [MaxPalDevices] = {}; + BinaryData librarySummaries[MaxPalDevices] = {}; if (totalGroupCount > 0) { @@ -833,6 +842,43 @@ VkResult RayTracingPipeline::CreateImpl( &localPipelineInfo.immedInfo.computeShaderInfo); } + if (result == VK_SUCCESS) + { + size_t totalLibrarySummariesSize = 0; + + for (uint32_t deviceIdx = 0; deviceIdx != MaxPalDevices; ++deviceIdx) + { + const auto& librarySummary = pipelineBinary[deviceIdx].librarySummary; + totalLibrarySummariesSize += Pow2Align(librarySummary.codeSize, 8); + } + + if (totalLibrarySummariesSize != 0) + { + void* pBuffer = pAllocator->pfnAllocation(pAllocator->pUserData, + totalLibrarySummariesSize, + VK_DEFAULT_MEM_ALIGN, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + + if (pBuffer == nullptr) + { + result = VK_ERROR_OUT_OF_HOST_MEMORY; + } + else + { + size_t offset = 0; + + for (uint32_t deviceIdx = 0; deviceIdx != MaxPalDevices; ++deviceIdx) + { + const auto& librarySummary = pipelineBinary[deviceIdx].librarySummary; + librarySummaries[deviceIdx].pCode = VoidPtrInc(pBuffer, offset); + librarySummaries[deviceIdx].codeSize = librarySummary.codeSize; + memcpy(VoidPtrInc(pBuffer, offset), librarySummary.pCode, librarySummary.codeSize); + offset += Pow2Align(librarySummary.codeSize, 8); + } + } + } + } + size_t pipelineSize = 0; size_t shaderLibrarySize = 0; void* pSystemMem = nullptr; @@ -1391,6 +1437,7 @@ VkResult RayTracingPipeline::CreateImpl( pShaderGroups, pShaderGroupStackSizes, pShaderGroupInfos, + librarySummaries, binaryCreateInfo.maxAttributeSize, traceRayGpuVas, dispatchRaysUserDataOffset, @@ -1420,6 +1467,16 @@ VkResult RayTracingPipeline::CreateImpl( pPalPipeline[deviceIdx]->Destroy(); } } + + if (pShaderGroups[0] != nullptr) + { + pAllocator->pfnFree(pAllocator->pUserData, pShaderGroups[0]); + } + + if (librarySummaries[0].pCode != nullptr) + { + pAllocator->pfnFree(pAllocator->pUserData, const_cast(librarySummaries[0].pCode)); + } } // Free the temporary memory for shader modules diff --git a/icd/api/raytrace/vk_ray_tracing_pipeline.h b/icd/api/raytrace/vk_ray_tracing_pipeline.h index 6d137a42..3a962a7b 100644 --- a/icd/api/raytrace/vk_ray_tracing_pipeline.h +++ b/icd/api/raytrace/vk_ray_tracing_pipeline.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -207,6 +207,9 @@ class RayTracingPipeline final : public Pipeline, public NonDispatchableIsCrashAnalysisEnabled()) + { + Pal::RgdMarkerInfoCmdBufData info = {}; + info.header.infoType = Pal::RgdMarkerInfoTypeCmdBufStart; + info.queue = m_queueFamilyIndex; + info.deviceId = m_deviceId; + info.queueFlags = m_queueFamilyFlags; + + constexpr bool Ignored = true; + GetParent()->PalCmdBuffer(DefaultDeviceIndex)->CmdInsertExecutionMarker( + Ignored, Pal::RgdMarkerSourceCmdBufInfo, reinterpret_cast(&info), sizeof(info)); + } +} + +// ==================================================================================================================== +void SqttCmdBufferState::RgdAnnotateDispatch( + RgpSqttMarkerEventType type, // Type of rgp command marker + uint32 threadX, // Number of thread groups in X dimension + uint32 threadY, // Number of thread groups in Y dimension + uint32 threadZ) // Number of thread groups in Z dimension +{ + // CrashAnalysis already insert marker for all dispatches on PAL side. Here, we just provide additional context for + // the described dispatch. + if (m_pDevModeMgr->IsCrashAnalysisEnabled()) + { + if ((type == RgpSqttMarkerEventType::CmdDispatch) + || (type == RgpSqttMarkerEventType::CmdDispatchIndirect) +#if VKI_RAY_TRACING + || (type == RgpSqttMarkerEventType::CmdTraceRaysKHR) + || (type == RgpSqttMarkerEventType::CmdTraceRaysIndirectKHR) +#endif + ) + { + Pal::RgdMarkerInfoDispatchData info = {}; + info.header.infoType = Pal::RgdMarkerInfoTypeDispatch; + info.type = static_cast(type); + info.threadX = threadX; + info.threadY = threadY; + info.threadZ = threadZ; + + constexpr bool Ignored = true; + GetParent()->PalCmdBuffer(DefaultDeviceIndex)->CmdInsertExecutionMarker( + Ignored, Pal::RgdMarkerSourceOpInfo, reinterpret_cast(&info), sizeof(info)); + } + } +} + +// ==================================================================================================================== +void SqttCmdBufferState::RgdAnnotateDraw( + RgpSqttMarkerEventType type, // Type of rgp command marker + uint32 vertexOffset, // Vertex offset (first vertex) user data register index + uint32 instanceOffset, // Instance offset (start instance) user data register index + uint32 drawId) // Draw ID SPI user data register index +{ + // CrashAnalysis already insert marker for all draws that comes from application on PAL side. Here, we just provide + // additional context for the described draw. + if (m_pDevModeMgr->IsCrashAnalysisEnabled()) + { + if ((type == RgpSqttMarkerEventType::CmdDraw) || (type == RgpSqttMarkerEventType::CmdDrawIndexed)) + { + constexpr bool Ignored = true; + GetParent()->PalCmdBuffer(DefaultDeviceIndex)->CmdInsertExecutionMarker( + Ignored, Pal::RgdMarkerSourceSqttEventInfo, reinterpret_cast(&type), sizeof(type)); + + // Set UserData + Pal::RgdMarkerInfoDrawUserData info = {}; + info.header.infoType = Pal::RgdMarkerInfoTypeDrawUserData; + info.vertexOffset = vertexOffset; + info.instanceOffset = instanceOffset; + info.drawId = drawId; + + GetParent()->PalCmdBuffer(DefaultDeviceIndex)->CmdInsertExecutionMarker( + Ignored, Pal::RgdMarkerSourceOpInfo, reinterpret_cast(&info), sizeof(info)); + } + } +} + +// ==================================================================================================================== +void SqttCmdBufferState::RgdInsertBarrierBeginMarker( + Pal::Developer::BarrierType type, // Barrier type + uint32 reason) // Reason for the barrier +{ + if (m_pDevModeMgr->IsCrashAnalysisEnabled() && + (m_currentEventType == RgpSqttMarkerEventType::CmdPipelineBarrier)) + { + Pal::RgdMarkerInfoBarrierBeginData info = {}; + info.header.infoType = Pal::RgdMarkerInfoTypeBarrierBegin; + info.type = type; + info.reason = reason; + + constexpr bool Ignored = true; + GetParent()->PalCmdBuffer(DefaultDeviceIndex)->CmdInsertExecutionMarker( + Ignored, Pal::RgdMarkerSourceOpInfo, reinterpret_cast(&info), sizeof(info)); + } +} + +// ==================================================================================================================== +void SqttCmdBufferState::RgdInsertBarrierEndMarker( + Pal::Developer::BarrierOperations operations) // What the barrier does +{ + // CrashAnalysisCmdBuffer does not insert marker for Barrier. We insert as MarkerSource::Pal here. + if (m_pDevModeMgr->IsCrashAnalysisEnabled() && + (m_currentEventType == RgpSqttMarkerEventType::CmdPipelineBarrier)) + { + Pal::RgdMarkerInfoBarrierEndData info = {}; + info.header.infoType = Pal::RgdMarkerInfoTypeBarrierEnd; + info.pipelineStalls = operations.pipelineStalls.u16All; + info.layoutTransitions = operations.layoutTransitions.u16All; + info.caches = operations.caches.u16All; + + constexpr bool Ignored = true; + GetParent()->PalCmdBuffer(DefaultDeviceIndex)->CmdInsertExecutionMarker( + Ignored, Pal::RgdMarkerSourceOpInfo, reinterpret_cast(&info), sizeof(info)); + } +} + // ===================================================================================================================== void SqttCmdBufferState::ResetBarrierState() { @@ -575,10 +695,12 @@ void SqttCmdBufferState::PalBarrierCallback( m_currentBarrier.inside = true; WriteBarrierStartMarker(barrier); + RgdInsertBarrierBeginMarker(barrier.type, barrier.reason); break; case Pal::Developer::CallbackType::BarrierEnd: WriteBarrierEndMarker(barrier); + RgdInsertBarrierEndMarker(barrier.operations); ResetBarrierState(); break; @@ -609,6 +731,12 @@ void SqttCmdBufferState::PalDrawDispatchCallback( drawDispatch.draw.userDataRegs.instanceOffset, drawDispatch.draw.userDataRegs.drawIndex, drawDispatch.subQueueFlags); + + RgdAnnotateDraw( + m_currentEventType, + drawDispatch.draw.userDataRegs.firstVertex, + drawDispatch.draw.userDataRegs.instanceOffset, + drawDispatch.draw.userDataRegs.drawIndex); } // Dispatch call else @@ -626,6 +754,12 @@ void SqttCmdBufferState::PalDrawDispatchCallback( drawDispatch.dispatch.groupDims.y, drawDispatch.dispatch.groupDims.z, drawDispatch.subQueueFlags); + + RgdAnnotateDispatch( + m_currentEventType, + drawDispatch.dispatch.groupDims.x, + drawDispatch.dispatch.groupDims.y, + drawDispatch.dispatch.groupDims.z); } else { diff --git a/icd/api/sqtt/sqtt_layer.h b/icd/api/sqtt/sqtt_layer.h index 8881a75c..da9bbdc8 100644 --- a/icd/api/sqtt/sqtt_layer.h +++ b/icd/api/sqtt/sqtt_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -141,6 +141,13 @@ class SqttCmdBufferState void PipelineBound(VkPipelineBindPoint bindPoint, VkPipeline pipeline); + // Functions for handling rgd event annotation. + void RgdAnnotateCmdBuf(); + void RgdAnnotateDispatch(RgpSqttMarkerEventType type, uint32 threadX, uint32 threadY, uint32 threadZ); + void RgdAnnotateDraw(RgpSqttMarkerEventType type, uint32 vertexOffset, uint32 instanceOffset, uint32 drawId); + void RgdInsertBarrierBeginMarker(Pal::Developer::BarrierType type, uint32 reason); + void RgdInsertBarrierEndMarker(Pal::Developer::BarrierOperations operations); + const DispatchTable* GetNextLayer() const { return m_pNextLayer; } diff --git a/icd/api/sqtt/sqtt_mgr.cpp b/icd/api/sqtt/sqtt_mgr.cpp index eefe1678..02005042 100644 --- a/icd/api/sqtt/sqtt_mgr.cpp +++ b/icd/api/sqtt/sqtt_mgr.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/sqtt/sqtt_mgr.h b/icd/api/sqtt/sqtt_mgr.h index cd4b8ba6..17433b34 100644 --- a/icd/api/sqtt/sqtt_mgr.h +++ b/icd/api/sqtt/sqtt_mgr.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/sqtt/sqtt_object_mgr.cpp b/icd/api/sqtt/sqtt_object_mgr.cpp index 3c0564fb..cd53f7dd 100644 --- a/icd/api/sqtt/sqtt_object_mgr.cpp +++ b/icd/api/sqtt/sqtt_object_mgr.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/sqtt/sqtt_object_mgr.h b/icd/api/sqtt/sqtt_object_mgr.h index baa14d61..bcfb2555 100644 --- a/icd/api/sqtt/sqtt_object_mgr.h +++ b/icd/api/sqtt/sqtt_object_mgr.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/sqtt/sqtt_rgp_annotations.h b/icd/api/sqtt/sqtt_rgp_annotations.h index 742705c1..7773b752 100644 --- a/icd/api/sqtt/sqtt_rgp_annotations.h +++ b/icd/api/sqtt/sqtt_rgp_annotations.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/strings/entry_points.txt b/icd/api/strings/entry_points.txt index 3028f215..6f7fbf8b 100644 --- a/icd/api/strings/entry_points.txt +++ b/icd/api/strings/entry_points.txt @@ -406,6 +406,9 @@ vkSetHdrMetadataEXT @device @dext(EXT_hdr_ vkGetPhysicalDeviceCalibrateableTimeDomainsEXT @device @dext(EXT_calibrated_timestamps) vkGetCalibratedTimestampsEXT @device @dext(EXT_calibrated_timestamps) +vkGetPhysicalDeviceCalibrateableTimeDomainsKHR @device @dext(KHR_calibrated_timestamps) +vkGetCalibratedTimestampsKHR @device @dext(KHR_calibrated_timestamps) + vkGetPipelineExecutablePropertiesKHR @device @dext(KHR_pipeline_executable_properties) vkGetPipelineExecutableStatisticsKHR @device @dext(KHR_pipeline_executable_properties) vkGetPipelineExecutableInternalRepresentationsKHR @device @dext(KHR_pipeline_executable_properties) diff --git a/icd/api/strings/extensions.txt b/icd/api/strings/extensions.txt index d30c74d7..dc71915f 100644 --- a/icd/api/strings/extensions.txt +++ b/icd/api/strings/extensions.txt @@ -119,6 +119,7 @@ VK_EXT_shader_demote_to_helper_invocation VK_EXT_subgroup_size_control VK_EXT_calibrated_timestamps VK_EXT_fragment_shader_interlock +VK_KHR_calibrated_timestamps VK_KHR_pipeline_executable_properties VK_EXT_line_rasterization VK_EXT_shader_atomic_float @@ -201,4 +202,6 @@ VK_EXT_physical_device_drm VK_KHR_cooperative_matrix VK_EXT_texture_compression_astc_hdr VK_EXT_image_drm_format_modifier +VK_KHR_vertex_attribute_divisor VK_EXT_frame_boundary +VK_EXT_image_compression_control diff --git a/icd/api/strings/func_table_template.py b/icd/api/strings/func_table_template.py index dae6c57d..3ca9502f 100644 --- a/icd/api/strings/func_table_template.py +++ b/icd/api/strings/func_table_template.py @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/strings/generate_strings.py b/icd/api/strings/generate_strings.py index ab9c9b8a..9fbe54a6 100644 --- a/icd/api/strings/generate_strings.py +++ b/icd/api/strings/generate_strings.py @@ -2,7 +2,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/strings/strings.cpp b/icd/api/strings/strings.cpp index 34a7d825..15573d7f 100644 --- a/icd/api/strings/strings.cpp +++ b/icd/api/strings/strings.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/strings/strings.h b/icd/api/strings/strings.h index bd26a220..230de578 100644 --- a/icd/api/strings/strings.h +++ b/icd/api/strings/strings.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/json_reader.cpp b/icd/api/utils/json_reader.cpp index 1b7978bc..dc78394c 100644 --- a/icd/api/utils/json_reader.cpp +++ b/icd/api/utils/json_reader.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/json_reader.h b/icd/api/utils/json_reader.h index ed80a27b..f9c6009e 100644 --- a/icd/api/utils/json_reader.h +++ b/icd/api/utils/json_reader.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/json_writer.cpp b/icd/api/utils/json_writer.cpp index 5dd5ffec..6effe4f5 100644 --- a/icd/api/utils/json_writer.cpp +++ b/icd/api/utils/json_writer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/json_writer.h b/icd/api/utils/json_writer.h index ecd624e7..26fd26cf 100644 --- a/icd/api/utils/json_writer.h +++ b/icd/api/utils/json_writer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/temp_mem_arena.cpp b/icd/api/utils/temp_mem_arena.cpp index abb8af6c..bf373d95 100644 --- a/icd/api/utils/temp_mem_arena.cpp +++ b/icd/api/utils/temp_mem_arena.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/temp_mem_arena.h b/icd/api/utils/temp_mem_arena.h index 31bf571b..7d22c1de 100644 --- a/icd/api/utils/temp_mem_arena.h +++ b/icd/api/utils/temp_mem_arena.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/virtual_stack_mgr.cpp b/icd/api/virtual_stack_mgr.cpp index fea1a83c..e2faf5c1 100644 --- a/icd/api/virtual_stack_mgr.cpp +++ b/icd/api/virtual_stack_mgr.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_alloccb.cpp b/icd/api/vk_alloccb.cpp index a7db0fec..c652b750 100644 --- a/icd/api/vk_alloccb.cpp +++ b/icd/api/vk_alloccb.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_buffer.cpp b/icd/api/vk_buffer.cpp index 586f2efa..07cf6489 100644 --- a/icd/api/vk_buffer.cpp +++ b/icd/api/vk_buffer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_buffer_view.cpp b/icd/api/vk_buffer_view.cpp index 1748699d..858ae2fc 100644 --- a/icd/api/vk_buffer_view.cpp +++ b/icd/api/vk_buffer_view.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_cmd_pool.cpp b/icd/api/vk_cmd_pool.cpp index 7c2844e3..3accbbb7 100644 --- a/icd/api/vk_cmd_pool.cpp +++ b/icd/api/vk_cmd_pool.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_cmdbuffer.cpp b/icd/api/vk_cmdbuffer.cpp index bdaf4951..d12c7cc3 100644 --- a/icd/api/vk_cmdbuffer.cpp +++ b/icd/api/vk_cmdbuffer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -323,6 +323,7 @@ Pal::Result CreateClearRegions( template Pal::Result CreateClearSubresRanges( const vk::ImageView* pImageView, + const bool is3dImage, const VkClearAttachment& clearInfo, const uint32_t rectCount, const VkClearRect* const pRects, @@ -354,6 +355,10 @@ Pal::Result CreateClearSubresRanges( } } + // For 3D color images, we set up the expected subres range during ImageView::Create() call + // and 3D depth/stencil images are NOT supported. + // PAL expects that for all 3D images arraySlice = 0 and numSlices = 1. + if (viewMask > 0) { const auto layerRanges = RangesOfOnesInBitMask(viewMask); @@ -365,15 +370,18 @@ Pal::Result CreateClearSubresRanges( for (auto layerRangeIt = layerRanges.Begin(); layerRangeIt.IsValid(); layerRangeIt.Next()) { pOutClearSubresRanges->PushBack(subresRange); - pOutClearSubresRanges->Back().startSubres.arraySlice += layerRangeIt.Get().offset; - pOutClearSubresRanges->Back().numSlices = layerRangeIt.Get().extent; - - if (hasPlaneDepthAndStencil) + if (is3dImage == false) { - subresRange.startSubres.plane = 1; - pOutClearSubresRanges->PushBack(subresRange); pOutClearSubresRanges->Back().startSubres.arraySlice += layerRangeIt.Get().offset; pOutClearSubresRanges->Back().numSlices = layerRangeIt.Get().extent; + + if (hasPlaneDepthAndStencil) + { + subresRange.startSubres.plane = 1; + pOutClearSubresRanges->PushBack(subresRange); + pOutClearSubresRanges->Back().startSubres.arraySlice += layerRangeIt.Get().offset; + pOutClearSubresRanges->Back().numSlices = layerRangeIt.Get().extent; + } } } } @@ -387,15 +395,18 @@ Pal::Result CreateClearSubresRanges( for (uint32_t rectIndex = 0; rectIndex < rectCount; ++rectIndex) { pOutClearSubresRanges->PushBack(subresRange); - pOutClearSubresRanges->Back().startSubres.arraySlice += pRects[rectIndex].baseArrayLayer; - pOutClearSubresRanges->Back().numSlices = pRects[rectIndex].layerCount; - - if (hasPlaneDepthAndStencil) + if (is3dImage == false) { - subresRange.startSubres.plane = 1; - pOutClearSubresRanges->PushBack(subresRange); pOutClearSubresRanges->Back().startSubres.arraySlice += pRects[rectIndex].baseArrayLayer; pOutClearSubresRanges->Back().numSlices = pRects[rectIndex].layerCount; + + if (hasPlaneDepthAndStencil) + { + subresRange.startSubres.plane = 1; + pOutClearSubresRanges->PushBack(subresRange); + pOutClearSubresRanges->Back().startSubres.arraySlice += pRects[rectIndex].baseArrayLayer; + pOutClearSubresRanges->Back().numSlices = pRects[rectIndex].layerCount; + } } } } @@ -411,6 +422,7 @@ Pal::Result CreateClearSubresRanges( template Pal::Result CreateClearSubresRanges( const Framebuffer::Attachment& attachment, + const bool is3dImage, const VkClearAttachment& clearInfo, const uint32_t rectCount, const VkClearRect* const pRects, @@ -426,6 +438,10 @@ Pal::Result CreateClearSubresRanges( pOutClearSubresRanges->Clear(); + // For 3D color images, we set up the expected subres range during ImageView::Create() call + // and 3D depth/stencil images are NOT supported. + // PAL expects that for all 3D images arraySlice = 0 and numSlices = 1. + if (renderPass.IsMultiviewEnabled()) { const auto viewMask = renderPass.GetViewMask(subpass); @@ -440,8 +456,11 @@ Pal::Result CreateClearSubresRanges( for (auto layerRangeIt = layerRanges.Begin(); layerRangeIt.IsValid(); layerRangeIt.Next()) { pOutClearSubresRanges->PushBack(attachmentSubresRanges.At(rangeIndex)); - pOutClearSubresRanges->Back().startSubres.arraySlice += layerRangeIt.Get().offset; - pOutClearSubresRanges->Back().numSlices = layerRangeIt.Get().extent; + if (is3dImage == false) + { + pOutClearSubresRanges->Back().startSubres.arraySlice += layerRangeIt.Get().offset; + pOutClearSubresRanges->Back().numSlices = layerRangeIt.Get().extent; + } } } } @@ -457,8 +476,11 @@ Pal::Result CreateClearSubresRanges( for (uint32_t rectIndex = 0; rectIndex < rectCount; ++rectIndex) { pOutClearSubresRanges->PushBack(attachmentSubresRanges.At(rangeIndex)); - pOutClearSubresRanges->Back().startSubres.arraySlice += pRects[rectIndex].baseArrayLayer; - pOutClearSubresRanges->Back().numSlices = pRects[rectIndex].layerCount; + if (is3dImage == false) + { + pOutClearSubresRanges->Back().startSubres.arraySlice += pRects[rectIndex].baseArrayLayer; + pOutClearSubresRanges->Back().numSlices = pRects[rectIndex].layerCount; + } } } } @@ -1693,7 +1715,7 @@ void CmdBuffer::ResetPipelineState() } while (bindIdx < PipelineBindCount); - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; pDynamicState->colorWriteMask = UINT32_MAX; pDynamicState->logicOp = Pal::LogicOp::Copy; @@ -3526,8 +3548,9 @@ void CmdBuffer::ClearDynamicRenderingImages( CreateClearSubresRanges( attachment.pImageView, + pImage->GetImageType() == VK_IMAGE_TYPE_3D, clearInfo, - rectCount, + rectBatch, pRects + rectIdx, m_allGpuState.dynamicRenderingInstance.viewMask, &clearSubresRanges); @@ -3603,8 +3626,9 @@ void CmdBuffer::ClearDynamicRenderingImages( CreateClearSubresRanges( pDepthStencilView, + false, // is3dImage clearInfo, - rectCount, + rectBatch, pRects + rectIdx, m_allGpuState.dynamicRenderingInstance.viewMask, &clearSubresRanges); @@ -4093,8 +4117,10 @@ void CmdBuffer::ClearImageAttachments( &clearBoxes); CreateClearSubresRanges( - attachment, clearInfo, - rectCount, pRects + rectIdx, + attachment, + attachment.pImage->GetImageType() == VK_IMAGE_TYPE_3D, + clearInfo, + rectBatch, pRects + rectIdx, *pRenderPass, subpass, &clearSubresRanges); @@ -4155,8 +4181,10 @@ void CmdBuffer::ClearImageAttachments( &clearRects); CreateClearSubresRanges( - attachment, clearInfo, - rectCount, pRects + rectIdx, + attachment, + false, // is3dImage + clearInfo, + rectBatch, pRects + rectIdx, *pRenderPass, subpass, &clearSubresRanges); @@ -6436,10 +6464,10 @@ void CmdBuffer::ResetAccelerationStructureQueryPool( Pal::CoherShaderRead | // vkCmdCopyQueryPoolResults Pal::CoherCopyDst; // vkCmdResetQueryPool (CmdFillMemory) - static const Pal::HwPipePoint pipePoint = Pal::HwPipeBottom; - // Wait for any accelerationStructure query pool events to complete prior to filling memory { + static const Pal::HwPipePoint pipePoint = Pal::HwPipeBottom; + static const Pal::BarrierTransition Transition = { AccelerationStructureCoher, // srcCacheMask @@ -6481,11 +6509,13 @@ void CmdBuffer::ResetAccelerationStructureQueryPool( // Wait for memory fill to complete { + static const Pal::HwPipePoint pipePoint = Pal::HwPipePostBlt; + static const Pal::BarrierTransition Transition = { - Pal::CoherMemory, // srcCacheMask - AccelerationStructureCoher, // dstCacheMask - { } // imageInfo + Pal::CoherMemory | Pal::CoherCopyDst, // srcCacheMask + AccelerationStructureCoher, // dstCacheMask + { } // imageInfo }; static const Pal::BarrierInfo Barrier = @@ -6523,10 +6553,10 @@ void CmdBuffer::FillTimestampQueryPool( Pal::CoherCopyDst | // vkCmdResetQueryPool (CmdFillMemory) Pal::CoherTimestamp; // vkCmdWriteTimestamp (CmdWriteTimestamp) - static const Pal::HwPipePoint pipePoint = Pal::HwPipeBottom; - // Wait for any timestamp query pool events to complete prior to filling memory { + static const Pal::HwPipePoint pipePoint = Pal::HwPipeBottom; + static const Pal::BarrierTransition Transition = { TimestampCoher, // srcCacheMask @@ -6579,11 +6609,13 @@ void CmdBuffer::FillTimestampQueryPool( // Wait for memory fill to complete { + static const Pal::HwPipePoint pipePoint = Pal::HwPipePostBlt; + static const Pal::BarrierTransition Transition = { - Pal::CoherMemory, // srcCacheMask - TimestampCoher, // dstCacheMask - { } // imageInfo + Pal::CoherMemory | Pal::CoherCopyDst, // srcCacheMask + TimestampCoher, // dstCacheMask + { } // imageInfo }; static const Pal::BarrierInfo Barrier = @@ -8800,7 +8832,8 @@ void CmdBuffer::PushConstants( DbgBarrierPreCmd(DbgBarrierBindSetsPushConstants); uint32_t startInDwords = start / sizeof(uint32_t); - uint32_t lengthInDwords = length / sizeof(uint32_t); + + uint32_t lengthInDwords = PipelineLayout::GetPushConstantSizeInDword(length); const uint32_t* const pInputValues = reinterpret_cast(values); @@ -9695,9 +9728,9 @@ void CmdBuffer::SetVertexInput( &PerGpuState(deviceIdx)->vbBindings[firstChanged]); } - if (vertexBufferCount != pBindState->dynamicBindInfo.gfx.dynamicState.vertexBufferCount) + if (vertexBufferCount != pBindState->dynamicBindInfo.gfxDynState.vertexBufferCount) { - pBindState->dynamicBindInfo.gfx.dynamicState.vertexBufferCount = vertexBufferCount; + pBindState->dynamicBindInfo.gfxDynState.vertexBufferCount = vertexBufferCount; m_allGpuState.dirtyGraphics.pipeline = 1; } @@ -11246,7 +11279,7 @@ void CmdBuffer::ValidateGraphicsStates() m_allGpuState.colorBlendCreateInfo); auto pDynamicState = - &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; if (dualSourceBlendEnable != pDynamicState->dualSourceBlendEnable) { pDynamicState->dualSourceBlendEnable = dualSourceBlendEnable; @@ -11263,18 +11296,17 @@ void CmdBuffer::ValidateGraphicsStates() { Pal::PipelineBindParams params = {}; - params.pipelineBindPoint = Pal::PipelineBindPoint::Graphics; - params.pPipeline = pGraphicsPipeline->GetPalPipeline(deviceIdx); - params.graphics = pGraphicsPipeline->GetBindInfo(); - params.graphics.dynamicState = - m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; - if (params.graphics.dynamicState.enable.depthClampMode && - (params.graphics.dynamicState.enable.depthClipMode == false)) + params.pipelineBindPoint = Pal::PipelineBindPoint::Graphics; + params.pPipeline = pGraphicsPipeline->GetPalPipeline(deviceIdx); + params.gfxDynState = + m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; + if (params.gfxDynState.enable.depthClampMode && + (params.gfxDynState.enable.depthClipMode == false)) { - bool clipEnable = params.graphics.dynamicState.depthClampMode == Pal::DepthClampMode::_None; - params.graphics.dynamicState.enable.depthClipMode = true; - params.graphics.dynamicState.depthClipFarEnable = clipEnable; - params.graphics.dynamicState.depthClipNearEnable = clipEnable; + bool clipEnable = params.gfxDynState.depthClampMode == Pal::DepthClampMode::_None; + params.gfxDynState.enable.depthClipMode = true; + params.gfxDynState.depthClipFarEnable = clipEnable; + params.gfxDynState.depthClipNearEnable = clipEnable; } params.apiPsoHash = pGraphicsPipeline->GetApiHash(); @@ -11717,7 +11749,7 @@ void CmdBuffer::SetColorWriteEnableEXT( if (colorWriteEnable != m_allGpuState.colorWriteEnable) { m_allGpuState.colorWriteEnable = colorWriteEnable; - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; pDynamicState->colorWriteMask = m_allGpuState.colorWriteMask & colorWriteEnable; if (pDynamicState->enable.colorWriteMask) { @@ -11731,7 +11763,7 @@ void CmdBuffer::SetColorWriteEnableEXT( void CmdBuffer::SetRasterizerDiscardEnableEXT( VkBool32 rasterizerDiscardEnable) { - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; if (pDynamicState->rasterizerDiscardEnable != static_cast(rasterizerDiscardEnable)) { pDynamicState->rasterizerDiscardEnable = rasterizerDiscardEnable; @@ -11976,7 +12008,7 @@ void CmdBuffer::SetColorWriteMask( if (colorWriteMask != m_allGpuState.colorWriteMask) { m_allGpuState.colorWriteMask = colorWriteMask; - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; pDynamicState->colorWriteMask = colorWriteMask & m_allGpuState.colorWriteEnable; if (pDynamicState->enable.colorWriteMask) { @@ -11999,7 +12031,7 @@ void CmdBuffer::SetSampleLocationsEnable( void CmdBuffer::SetLineRasterizationMode( VkLineRasterizationModeEXT lineRasterizationMode) { - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; bool perpLineEndCapsEnable = lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT; if (perpLineEndCapsEnable != pDynamicState->perpLineEndCapsEnable) { @@ -12021,7 +12053,7 @@ void CmdBuffer::SetLogicOp( m_allGpuState.logicOp = logicOp; if (m_allGpuState.logicOpEnable) { - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; pDynamicState->logicOp = VkToPalLogicOp(logicOp); if (pDynamicState->enable.logicOp) { @@ -12038,7 +12070,7 @@ void CmdBuffer::SetLogicOpEnable( if (m_allGpuState.logicOpEnable != logicOpEnable) { m_allGpuState.logicOpEnable = logicOpEnable; - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; pDynamicState->logicOp = m_allGpuState.logicOpEnable ? VkToPalLogicOp(m_allGpuState.logicOp) : Pal::LogicOp::Copy; if (pDynamicState->enable.logicOp) @@ -12052,7 +12084,7 @@ void CmdBuffer::SetLogicOpEnable( void CmdBuffer::SetTessellationDomainOrigin( VkTessellationDomainOrigin domainOrigin) { - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; bool switchWinding = domainOrigin == VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT; if (switchWinding != pDynamicState->switchWinding) { @@ -12069,7 +12101,7 @@ void CmdBuffer::SetTessellationDomainOrigin( void CmdBuffer::SetDepthClampEnable( VkBool32 depthClampEnable) { - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; Pal::DepthClampMode clampMode = depthClampEnable ? Pal::DepthClampMode::Viewport : Pal::DepthClampMode::_None; if (clampMode != pDynamicState->depthClampMode) { @@ -12085,7 +12117,7 @@ void CmdBuffer::SetDepthClampEnable( void CmdBuffer::SetAlphaToCoverageEnable( VkBool32 alphaToCoverageEnable) { - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; if (static_cast(alphaToCoverageEnable) != pDynamicState->alphaToCoverageEnable) { @@ -12102,7 +12134,7 @@ void CmdBuffer::SetAlphaToCoverageEnable( void CmdBuffer::SetDepthClipEnable( VkBool32 depthClipEnable) { - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; if (static_cast(depthClipEnable) != pDynamicState->depthClipNearEnable) { pDynamicState->depthClipNearEnable = depthClipEnable; @@ -12119,7 +12151,7 @@ void CmdBuffer::SetDepthClipEnable( void CmdBuffer::SetDepthClipNegativeOneToOne( VkBool32 negativeOneToOne) { - auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx.dynamicState; + auto pDynamicState = &m_allGpuState.pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; Pal::DepthRange depthRange = negativeOneToOne ? Pal::DepthRange::NegativeOneToOne : Pal::DepthRange::ZeroToOne; if (depthRange != pDynamicState->depthRange) { diff --git a/icd/api/vk_cmdbuffer_transfer.cpp b/icd/api/vk_cmdbuffer_transfer.cpp index 9b5b2d60..5536150f 100644 --- a/icd/api/vk_cmdbuffer_transfer.cpp +++ b/icd/api/vk_cmdbuffer_transfer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_compute_pipeline.cpp b/icd/api/vk_compute_pipeline.cpp index 3271d855..64a5e30c 100644 --- a/icd/api/vk_compute_pipeline.cpp +++ b/icd/api/vk_compute_pipeline.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_conv.cpp b/icd/api/vk_conv.cpp index 63a489c3..918d9548 100644 --- a/icd/api/vk_conv.cpp +++ b/icd/api/vk_conv.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_debug_report.cpp b/icd/api/vk_debug_report.cpp index ac78c727..617d590c 100644 --- a/icd/api/vk_debug_report.cpp +++ b/icd/api/vk_debug_report.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_debug_utils.cpp b/icd/api/vk_debug_utils.cpp index bce1b32d..9487719f 100644 --- a/icd/api/vk_debug_utils.cpp +++ b/icd/api/vk_debug_utils.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_deferred_operation.cpp b/icd/api/vk_deferred_operation.cpp index 9b2935d8..b90106cf 100644 --- a/icd/api/vk_deferred_operation.cpp +++ b/icd/api/vk_deferred_operation.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_descriptor_buffer.cpp b/icd/api/vk_descriptor_buffer.cpp index ef783a1f..c44c02ad 100644 --- a/icd/api/vk_descriptor_buffer.cpp +++ b/icd/api/vk_descriptor_buffer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_descriptor_pool.cpp b/icd/api/vk_descriptor_pool.cpp index 03191e35..7fc6172c 100644 --- a/icd/api/vk_descriptor_pool.cpp +++ b/icd/api/vk_descriptor_pool.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_descriptor_set.cpp b/icd/api/vk_descriptor_set.cpp index 4b589b91..e4be7758 100644 --- a/icd/api/vk_descriptor_set.cpp +++ b/icd/api/vk_descriptor_set.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_descriptor_set_layout.cpp b/icd/api/vk_descriptor_set_layout.cpp index 66887eda..234a0b35 100644 --- a/icd/api/vk_descriptor_set_layout.cpp +++ b/icd/api/vk_descriptor_set_layout.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_descriptor_update_template.cpp b/icd/api/vk_descriptor_update_template.cpp index 0d672f2c..cc5e2c69 100644 --- a/icd/api/vk_descriptor_update_template.cpp +++ b/icd/api/vk_descriptor_update_template.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_device.cpp b/icd/api/vk_device.cpp index 89abed31..17fc6b7e 100644 --- a/icd/api/vk_device.cpp +++ b/icd/api/vk_device.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -66,6 +66,7 @@ #include "include/vk_conv.h" #include "include/cmd_buffer_ring.h" #include "include/graphics_pipeline_common.h" +#include "include/vk_graphics_pipeline_library.h" #include "include/internal_layer_hooks.h" #if VKI_RAY_TRACING @@ -288,7 +289,9 @@ Device::Device( #endif m_pBorderColorUsedIndexes(nullptr), m_retrievedFaultData(false), - m_pNullPipelineLayout(nullptr) + m_pNullPipelineLayout(nullptr), + m_pNullFragmentLib(nullptr), + m_nullFragmentModule(VK_NULL_HANDLE) { memset(m_pQueues, 0, sizeof(m_pQueues)); @@ -1201,7 +1204,8 @@ VkResult Device::Initialize( result = PalToVkResult(PalDevice(DefaultDeviceIndex)->SetSamplePatternPalette(palette)); } - if ((result == VK_SUCCESS) && VkInstance()->IsTracingSupportEnabled()) + if ((result == VK_SUCCESS) && + (VkInstance()->IsTracingSupportEnabled() || VkInstance()->IsCrashAnalysisSupportEnabled())) { uint32_t queueFamilyIndex; uint32_t queueIndex; @@ -1856,8 +1860,6 @@ VkResult Device::CreateInternalComputePipeline( spvBin, false, true, - nullptr, - nullptr, &shaderModule); if (result == VK_SUCCESS) @@ -1878,6 +1880,11 @@ VkResult Device::CreateInternalComputePipeline( pCompiler->ApplyDefaultShaderOptions(ShaderStage::ShaderStageCompute, 0, &pShaderInfo->options); + // forceWave64 is currently true for only GpuRT shaders and shouldForceWave32 should not affect GpuRT shaders + bool shouldForceWave32 = (((GetRuntimeSettings().deprecateWave64 & DeprecateWave64::DeprecateWave64Cs) || + (GetRuntimeSettings().deprecateWave64 & DeprecateWave64::DeprecateWave64All)) && + (forceWave64 == false)); + if (forceWave64) { pShaderInfo->options.waveSize = 64; @@ -1907,6 +1914,8 @@ VkResult Device::CreateInternalComputePipeline( 0, options); + options.pOptions->waveSize = (shouldForceWave32) ? 32 : options.pOptions->waveSize; + // PAL Pipeline caching Util::Result cacheResult = Util::Result::NotFound; Util::MetroHash::Hash cacheId = {}; @@ -2126,6 +2135,50 @@ VkResult Device::CreateInternalPipelines() } #endif + if ((result == VK_SUCCESS) && + GetRuntimeSettings().useShaderLibraryForPipelineLibraryFastLink && + GetEnabledFeatures().graphicsPipelineLibrary) + { + static constexpr uint8_t NullFragment[] = + { + #include "shaders/null_fragment_spv.h" + }; + + // ShaderModule + const VkAllocationCallbacks* pAllocator = VkInstance()->GetAllocCallbacks(); + VkShaderModuleCreateInfo shaderModuleInfo = {}; + shaderModuleInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; + shaderModuleInfo.pCode = reinterpret_cast(NullFragment); + shaderModuleInfo.codeSize = sizeof(NullFragment); + CreateShaderModule(&shaderModuleInfo, pAllocator, &m_nullFragmentModule); + + // Graphics pipeline info + VkGraphicsPipelineCreateInfo createInfo = {}; + createInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; + + VkGraphicsPipelineLibraryCreateInfoEXT library = {}; + library.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT; + library.flags = VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT; + createInfo.pNext = &library; + + VkPipelineShaderStageCreateInfo stages = {}; + stages.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; + stages.stage = VK_SHADER_STAGE_FRAGMENT_BIT; + stages.pName = "main"; + stages.module = m_nullFragmentModule; + createInfo.stageCount = 1; + createInfo.pStages = &stages; + createInfo.flags = VK_PIPELINE_CREATE_LIBRARY_BIT_KHR; + + VkPipeline pipeline = VK_NULL_HANDLE; + result = GraphicsPipelineCommon::Create(this, nullptr, &createInfo, VK_PIPELINE_CREATE_LIBRARY_BIT_KHR, + pAllocator, &pipeline); + if (result == VK_SUCCESS) + { + m_pNullFragmentLib = GraphicsPipelineLibrary::ObjectFromHandle(pipeline); + } + } + return result; } @@ -2154,6 +2207,15 @@ void Device::DestroyInternalPipelines() #if VKI_RAY_TRACING DestroyInternalPipeline(&m_accelerationStructureQueryCopyPipeline); #endif + if (m_pNullFragmentLib != nullptr) + { + m_pNullFragmentLib->Destroy(this, VkInstance()->GetAllocCallbacks()); + } + + if (m_nullFragmentModule != VK_NULL_HANDLE) + { + ShaderModule::ObjectFromHandle(m_nullFragmentModule)->Destroy(this, VkInstance()->GetAllocCallbacks()); + } } // ===================================================================================================================== diff --git a/icd/api/vk_dispatch.cpp b/icd/api/vk_dispatch.cpp index cfbe9400..7b3c87ef 100644 --- a/icd/api/vk_dispatch.cpp +++ b/icd/api/vk_dispatch.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -629,6 +629,11 @@ void DispatchTable::Init() INIT_DISPATCH_ENTRY(vkGetPhysicalDeviceCalibrateableTimeDomainsEXT ); INIT_DISPATCH_ENTRY(vkGetCalibratedTimestampsEXT ); + INIT_DISPATCH_ALIAS(vkGetPhysicalDeviceCalibrateableTimeDomainsKHR, + vkGetPhysicalDeviceCalibrateableTimeDomainsEXT ); + INIT_DISPATCH_ALIAS(vkGetCalibratedTimestampsKHR, + vkGetCalibratedTimestampsEXT ); + INIT_DISPATCH_ENTRY(vkCmdBeginConditionalRenderingEXT ); INIT_DISPATCH_ENTRY(vkCmdEndConditionalRenderingEXT ); diff --git a/icd/api/vk_event.cpp b/icd/api/vk_event.cpp index 0d7acf6b..9690bdb9 100644 --- a/icd/api/vk_event.cpp +++ b/icd/api/vk_event.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_fence.cpp b/icd/api/vk_fence.cpp index ce29f567..001dda88 100644 --- a/icd/api/vk_fence.cpp +++ b/icd/api/vk_fence.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_formats.cpp b/icd/api/vk_formats.cpp index 5e1ad9be..d593e09b 100644 --- a/icd/api/vk_formats.cpp +++ b/icd/api/vk_formats.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_framebuffer.cpp b/icd/api/vk_framebuffer.cpp index 1530a2fb..78386234 100644 --- a/icd/api/vk_framebuffer.cpp +++ b/icd/api/vk_framebuffer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_gpa_session.cpp b/icd/api/vk_gpa_session.cpp index 7f927b5c..ea63e919 100644 --- a/icd/api/vk_gpa_session.cpp +++ b/icd/api/vk_gpa_session.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_graphics_pipeline.cpp b/icd/api/vk_graphics_pipeline.cpp index 16ee24c3..39ea3dcb 100644 --- a/icd/api/vk_graphics_pipeline.cpp +++ b/icd/api/vk_graphics_pipeline.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -62,7 +62,7 @@ VkResult GraphicsPipeline::CreatePipelineBinaries( const GraphicsPipelineShaderStageInfo* pShaderInfo, const PipelineLayout* pPipelineLayout, const Util::MetroHash::Hash* pElfHash, - PipelineOptimizerKey* pPipelineOptimizerKey, + const PipelineOptimizerKey* pPipelineOptimizerKey, GraphicsPipelineBinaryCreateInfo* pBinaryCreateInfo, PipelineCache* pPipelineCache, const VkPipelineCreationFeedbackCreateInfoEXT* pCreationFeedbackInfo, @@ -191,13 +191,7 @@ VkResult GraphicsPipeline::CreatePipelineBinaries( binaryCreateInfoMGPU.stageFeedback); } - if (binaryMetadataMGPU.internalBufferInfo.pData != nullptr) - { - pDevice->VkInstance()->FreeMem(binaryMetadataMGPU.internalBufferInfo.pData); - binaryMetadataMGPU.internalBufferInfo.pData = nullptr; - } - - pDefaultCompiler->FreeGraphicsPipelineCreateInfo(&binaryCreateInfoMGPU, false); + pDefaultCompiler->FreeGraphicsPipelineCreateInfo(pDevice, &binaryCreateInfoMGPU, false, false); } } else if (deviceIdx == DefaultDeviceIndex) @@ -206,6 +200,8 @@ VkResult GraphicsPipeline::CreatePipelineBinaries( pDevice, pPipelineBinaries[DefaultDeviceIndex], pBinaryMetadata); + pBinaryCreateInfo->pBinaryMetadata = pBinaryMetadata; + pDevice->GetCompiler(DefaultDeviceIndex)->UploadInternalBufferData(pDevice, pBinaryCreateInfo); } // Add to any cache layer where missing @@ -325,6 +321,7 @@ VkResult GraphicsPipeline::CreatePipelineObjects( const PipelineLayout* pPipelineLayout, const VbBindingInfo* pVbInfo, const PipelineInternalBufferInfo* pInternalBuffer, + const InternalMemory* pInternalMem, const Vkgc::BinaryData* pPipelineBinaries, PipelineCache* pPipelineCache, const Util::MetroHash::Hash* pCacheIds, @@ -355,7 +352,7 @@ VkResult GraphicsPipeline::CreatePipelineObjects( pSystemMem = pDevice->AllocApiObject( pAllocator, - sizeof(GraphicsPipeline) + (palSize * numPalDevices) + pInternalBuffer->dataSize); + sizeof(GraphicsPipeline) + (palSize * numPalDevices)); if (pSystemMem == nullptr) { @@ -463,13 +460,6 @@ VkResult GraphicsPipeline::CreatePipelineObjects( // On success, wrap it up in a Vulkan object. if (result == VK_SUCCESS) { - PipelineInternalBufferInfo internalBuffer = *pInternalBuffer; - if (pInternalBuffer->dataSize > 0) - { - internalBuffer.pData = Util::VoidPtrInc(pSystemMem, sizeof(GraphicsPipeline) + (palSize * numPalDevices)); - memcpy(internalBuffer.pData, pInternalBuffer->pData, pInternalBuffer->dataSize); - } - VK_PLACEMENT_NEW(pSystemMem) GraphicsPipeline( pDevice, pPalPipeline, @@ -481,10 +471,12 @@ VkResult GraphicsPipeline::CreatePipelineObjects( pObjectCreateInfo->dispatchRaysUserDataOffset, #endif *pVbInfo, - &internalBuffer, + pInternalBuffer, pPalMsaa, pPalColorBlend, pPalDepthStencil, + pObjectCreateInfo->pipeline.ppShaderLibraries, + pInternalMem, pObjectCreateInfo->sampleCoverage, pCacheIds[DefaultDeviceIndex], apiPsoHash, @@ -634,6 +626,9 @@ void DumpGplFastLinkInfo( } } } + + PipelineCompiler::DumpPipelineMetadata(pPipelineDumpHandle, pCreateInfo->pBinaryMetadata); + Vkgc::IPipelineDumper::EndPipelineDump(pPipelineDumpHandle); } } @@ -650,6 +645,7 @@ VkResult GraphicsPipeline::Create( { VkResult result = VK_SUCCESS; uint64 startTimeTicks = Util::GetPerfCpuTime(); + uint64_t colorExportDuration = 0; PipelineCompiler* pDefaultCompiler = pDevice->GetCompiler(DefaultDeviceIndex); @@ -677,11 +673,34 @@ VkResult GraphicsPipeline::Create( VK_ASSERT(pCreateInfo->layout != VK_NULL_HANDLE); pPipelineLayout = PipelineLayout::ObjectFromHandle(pCreateInfo->layout); + GraphicsPipelineLibraryInfo libInfo = {}; + GraphicsPipelineCommon::ExtractLibraryInfo(pCreateInfo, flags, &libInfo); + // 1. Check whether GPL fast link is possible if (pDevice->GetRuntimeSettings().useShaderLibraryForPipelineLibraryFastLink) { - GraphicsPipelineLibraryInfo libInfo; - GraphicsPipelineCommon::ExtractLibraryInfo(pCreateInfo, flags, &libInfo); + + // If pipeline only contains PreRasterizationShaderLib and no fragment shader is in the create info, + // we add a null fragement library in order to use fast link. + if ((libInfo.flags.isLibrary == false) && + ((libInfo.pPreRasterizationShaderLib != nullptr) && (libInfo.pFragmentShaderLib == nullptr))) + { + bool hasFragShader = false; + for (uint32_t i = 0; i < pCreateInfo->stageCount; ++i) + { + if (ShaderFlagBitToStage(pCreateInfo->pStages[i].stage) == ShaderStageFragment) + { + hasFragShader = true; + break; + } + } + + if (hasFragShader == false) + { + libInfo.pFragmentShaderLib = pDevice->GetNullFragmentLib(); + } + } + if (IsGplFastLinkPossible(libInfo)) { result = pDevice->GetCompiler(DefaultDeviceIndex)->BuildGplFastLinkCreateInfo( @@ -698,6 +717,7 @@ VkResult GraphicsPipeline::Create( shaderLibraries[numShaderLibraries++] = fragmentCreateInfo.pShaderLibraries[GraphicsLibraryFragment]; if (binaryCreateInfo.pipelineInfo.enableColorExportShader) { + uint64_t colorExportTicks = Util::GetPerfCpuTime(); Pal::IShaderLibrary* pColorExportLib = nullptr; result = pDevice->GetCompiler(DefaultDeviceIndex)->CreateColorExportShaderLibrary(pDevice, &binaryCreateInfo, @@ -708,11 +728,13 @@ VkResult GraphicsPipeline::Create( shaderLibraries[numShaderLibraries++] = pColorExportLib; binaryCreateInfo.pShaderLibraries[GraphicsLibraryColorExport] = pColorExportLib; } + uint64_t durationTicks = Util::GetPerfCpuTime() - colorExportTicks; + colorExportDuration = vk::utils::TicksToNano(durationTicks); } } else if (result == VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT) { - flags |= VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT; + flags |= VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT; } if (result == VK_SUCCESS) @@ -720,7 +742,8 @@ VkResult GraphicsPipeline::Create( objectCreateInfo.pipeline.ppShaderLibraries = shaderLibraries; objectCreateInfo.pipeline.numShaderLibraries = numShaderLibraries; if ((pDevice->VkInstance()->GetDevModeMgr() != nullptr) || - pDevice->GetRuntimeSettings().enablePipelineDump) + pDevice->GetRuntimeSettings().enablePipelineDump || + pDevice->GetRuntimeSettings().logTagIdMask) { BuildApiHash(pCreateInfo, flags, &apiPsoHash, &elfHash); binaryCreateInfo.apiPsoHash = apiPsoHash; @@ -816,6 +839,7 @@ VkResult GraphicsPipeline::Create( pPipelineLayout, &binaryMetadata.vbInfo, &binaryMetadata.internalBufferInfo, + binaryCreateInfo.pInternalMem, pipelineBinaries, pPipelineCache, cacheId, @@ -828,11 +852,6 @@ VkResult GraphicsPipeline::Create( // Free the temporary newly-built shader modules FreeTempModules(pDevice, ShaderStage::ShaderStageGfxCount, tempModules); - if (binaryMetadata.internalBufferInfo.pData != nullptr) - { - pDevice->VkInstance()->FreeMem(binaryMetadata.internalBufferInfo.pData); - binaryMetadata.internalBufferInfo.pData = nullptr; - } // Free the created pipeline binaries now that the PAL Pipelines/PipelineBinaryInfo have read them. for (uint32_t deviceIdx = 0; deviceIdx < pDevice->NumPalDevices(); deviceIdx++) { @@ -845,11 +864,6 @@ VkResult GraphicsPipeline::Create( } } - // Deferred compile will reuse all object generated in PipelineCompiler::ConvertGraphicsPipelineInfo. - // i.e. we need keep temp buffer in binaryCreateInfo - pDefaultCompiler->FreeGraphicsPipelineCreateInfo(&binaryCreateInfo, - objectCreateInfo.immedInfo.checkDeferCompilePipeline); - if (objectCreateInfo.immedInfo.checkDeferCompilePipeline) { GraphicsPipeline* pThis = GraphicsPipeline::ObjectFromHandle(*pPipeline); @@ -904,11 +918,16 @@ VkResult GraphicsPipeline::Create( } } - // The hash is same as pipline dump file name, we can easily analyze further. + // The hash is same as pipeline dump file name, we can easily analyze further. AmdvlkLog(pDevice->GetRuntimeSettings().logTagIdMask, PipelineCompileTime, - "0x%016llX-%llu", - apiPsoHash, duration); + "0x%016llX-IsLib: %u-Opt: %u-LibFlag: %u-Duration: %llu-ColorExportDuration: %llu", + apiPsoHash, + libInfo.flags.isLibrary, + libInfo.flags.optimize, + libInfo.libFlags, + duration, + colorExportDuration); if (enableFastLink && pDevice->GetRuntimeSettings().enablePipelineDump) { @@ -916,6 +935,13 @@ VkResult GraphicsPipeline::Create( } } + // Deferred compile will reuse all object generated in PipelineCompiler::ConvertGraphicsPipelineInfo. + // i.e. we need keep temp buffer in binaryCreateInfo + pDefaultCompiler->FreeGraphicsPipelineCreateInfo(pDevice, + &binaryCreateInfo, + objectCreateInfo.immedInfo.checkDeferCompilePipeline, + true); + return result; } @@ -1230,7 +1256,7 @@ VkResult GraphicsPipeline::DeferCreateOptimizedPipeline( SetOptimizedPipeline(pPalPipeline); } - pDevice->GetCompiler(DefaultDeviceIndex)->FreeGraphicsPipelineCreateInfo(pBinaryCreateInfo, false); + pDevice->GetCompiler(DefaultDeviceIndex)->FreeGraphicsPipelineCreateInfo(pDevice, pBinaryCreateInfo, false, true); for (uint32_t deviceIdx = 0; deviceIdx < pDevice->NumPalDevices(); deviceIdx++) { @@ -1277,6 +1303,8 @@ GraphicsPipeline::GraphicsPipeline( Pal::IMsaaState** pPalMsaa, Pal::IColorBlendState** pPalColorBlend, Pal::IDepthStencilState** pPalDepthStencil, + const Pal::IShaderLibrary** pPalShaderLibrary, + const InternalMemory* pInternalMem, uint32_t coverageSamples, const Util::MetroHash::Hash& cacheHash, uint64_t apiHash, @@ -1288,6 +1316,8 @@ GraphicsPipeline::GraphicsPipeline( #endif pDevice), m_info(immedInfo), + m_pPalShaderLibrary{}, + m_pInternalMem(pInternalMem), m_vbInfo(vbInfo), m_internalBufferInfo(*pInternalBuffer), m_pOptimizedPipeline{}, @@ -1308,64 +1338,68 @@ GraphicsPipeline::GraphicsPipeline( memcpy(m_pPalMsaa, pPalMsaa, sizeof(pPalMsaa[0]) * pDevice->NumPalDevices()); memcpy(m_pPalColorBlend, pPalColorBlend, sizeof(pPalColorBlend[0]) * pDevice->NumPalDevices()); memcpy(m_pPalDepthStencil, pPalDepthStencil, sizeof(pPalDepthStencil[0]) * pDevice->NumPalDevices()); + if (pPalShaderLibrary != nullptr) + { + memcpy(m_pPalShaderLibrary, pPalShaderLibrary, sizeof(m_pPalShaderLibrary)); + } CreateStaticState(); if (ContainsDynamicState(DynamicStatesInternal::RasterizerDiscardEnable)) { - m_info.graphicsShaderInfos.dynamicState.enable.rasterizerDiscardEnable = 1; + m_info.dynamicGraphicsState.enable.rasterizerDiscardEnable = 1; } if (ContainsDynamicState(DynamicStatesInternal::ColorWriteEnable) || ContainsDynamicState(DynamicStatesInternal::ColorWriteMask)) { - m_info.graphicsShaderInfos.dynamicState.enable.colorWriteMask = 1; + m_info.dynamicGraphicsState.enable.colorWriteMask = 1; } if (ContainsDynamicState(DynamicStatesInternal::LogicOp) || ContainsDynamicState(DynamicStatesInternal::LogicOpEnable)) { - m_info.graphicsShaderInfos.dynamicState.enable.logicOp = 1; + m_info.dynamicGraphicsState.enable.logicOp = 1; } if (ContainsDynamicState(DynamicStatesInternal::LineRasterizationMode)) { - m_info.graphicsShaderInfos.dynamicState.enable.perpLineEndCapsEnable = 1; + m_info.dynamicGraphicsState.enable.perpLineEndCapsEnable = 1; } if (ContainsDynamicState(DynamicStatesInternal::TessellationDomainOrigin)) { - m_info.graphicsShaderInfos.dynamicState.enable.switchWinding = 1; + m_info.dynamicGraphicsState.enable.switchWinding = 1; } if (ContainsDynamicState(DynamicStatesInternal::AlphaToCoverageEnable)) { - m_info.graphicsShaderInfos.dynamicState.enable.alphaToCoverageEnable = 1; + m_info.dynamicGraphicsState.enable.alphaToCoverageEnable = 1; } if (ContainsDynamicState(DynamicStatesInternal::DepthClipNegativeOneToOne)) { - m_info.graphicsShaderInfos.dynamicState.enable.depthRange = 1; + m_info.dynamicGraphicsState.enable.depthRange = 1; } if (ContainsDynamicState(DynamicStatesInternal::DepthClipEnable)) { - m_info.graphicsShaderInfos.dynamicState.enable.depthClipMode = 1; + m_info.dynamicGraphicsState.enable.depthClipMode = 1; } if (ContainsDynamicState(DynamicStatesInternal::DepthClampEnable)) { - m_info.graphicsShaderInfos.dynamicState.enable.depthClampMode = 1; + m_info.dynamicGraphicsState.enable.depthClampMode = 1; } if (ContainsDynamicState(DynamicStatesInternal::ColorBlendEquation)) { - m_info.graphicsShaderInfos.dynamicState.enable.dualSourceBlendEnable = 1; + m_info.dynamicGraphicsState.enable.dualSourceBlendEnable = 1; } if (ContainsDynamicState(DynamicStatesInternal::VertexInput)) { - m_info.graphicsShaderInfos.dynamicState.enable.vertexBufferCount = 1; + m_info.dynamicGraphicsState.enable.vertexBufferCount = 1; } pPalPipelineHasher->Update(m_palPipelineHash); @@ -1530,6 +1564,13 @@ VkResult GraphicsPipeline::Destroy( pDevice->VkInstance()->FreeMem(pBaseMem); } + if (m_pInternalMem != nullptr) + { + pDevice->MemMgr()->FreeGpuMem(m_pInternalMem); + Util::Destructor(m_pInternalMem); + pDevice->VkInstance()->FreeMem(const_cast(m_pInternalMem)); + } + return Pipeline::Destroy(pDevice, pAllocator); } @@ -1539,11 +1580,10 @@ void GraphicsPipeline::BindToCmdBuffer( CmdBuffer* pCmdBuffer ) const { - AllGpuRenderState* pRenderState = pCmdBuffer->RenderState(); - - const Pal::DynamicGraphicsShaderInfos& graphicsShaderInfos = m_info.graphicsShaderInfos; - Pal::DynamicGraphicsShaderInfos* pGfxDynamicBindInfo = - &pRenderState->pipelineState[PipelineBindGraphics].dynamicBindInfo.gfx; + AllGpuRenderState* pRenderState = pCmdBuffer->RenderState(); + const Pal::DynamicGraphicsState& dynamicGraphicsState = m_info.dynamicGraphicsState; + Pal::DynamicGraphicsState* pGfxDynamicBindInfo = + &pRenderState->pipelineState[PipelineBindGraphics].dynamicBindInfo.gfxDynState; // Get this pipeline's static tokens const auto& newTokens = m_info.staticTokens; @@ -1602,7 +1642,7 @@ void GraphicsPipeline::BindToCmdBuffer( } while (deviceGroup.IterateNext()); } - Pal::DepthRange depthRange = pGfxDynamicBindInfo->dynamicState.depthRange; + Pal::DepthRange depthRange = pGfxDynamicBindInfo->depthRange; if (ContainsStaticState(DynamicStatesInternal::DepthClipNegativeOneToOne)) { depthRange = m_info.viewportParams.depthRange; @@ -1944,10 +1984,10 @@ void GraphicsPipeline::BindToCmdBuffer( const uint64_t oldHash = pRenderState->boundGraphicsPipelineHash; const uint64_t newHash = useOptimizedPipeline ? m_optimizedPipelineHash : PalPipelineHash(); const bool dynamicStateDirty = - pGfxDynamicBindInfo->dynamicState.enable.u32All != graphicsShaderInfos.dynamicState.enable.u32All; + pGfxDynamicBindInfo->enable.u32All != dynamicGraphicsState.enable.u32All; // Update pipleine dynamic state - pGfxDynamicBindInfo->dynamicState.enable.u32All = graphicsShaderInfos.dynamicState.enable.u32All; + pGfxDynamicBindInfo->enable.u32All = dynamicGraphicsState.enable.u32All; if (ContainsStaticState(DynamicStatesInternal::ColorWriteMask) ^ ContainsStaticState(DynamicStatesInternal::ColorWriteEnable)) @@ -1962,24 +2002,24 @@ void GraphicsPipeline::BindToCmdBuffer( pRenderState->colorWriteEnable = m_info.colorWriteEnable; } - pGfxDynamicBindInfo->dynamicState.colorWriteMask = + pGfxDynamicBindInfo->colorWriteMask = pRenderState->colorWriteMask & pRenderState->colorWriteEnable; } // Overwrite state with dynamic state in current render state - if (graphicsShaderInfos.dynamicState.enable.logicOp) + if (dynamicGraphicsState.enable.logicOp) { if (ContainsStaticState(DynamicStatesInternal::LogicOp)) { pRenderState->logicOp = m_info.logicOp; - pGfxDynamicBindInfo->dynamicState.logicOp = + pGfxDynamicBindInfo->logicOp = pRenderState->logicOpEnable ? VkToPalLogicOp(pRenderState->logicOp) : Pal::LogicOp::Copy; } if (ContainsStaticState(DynamicStatesInternal::LogicOpEnable)) { pRenderState->logicOpEnable = m_info.logicOpEnable; - pGfxDynamicBindInfo->dynamicState.logicOp = + pGfxDynamicBindInfo->logicOp = pRenderState->logicOpEnable ? VkToPalLogicOp(pRenderState->logicOp) : Pal::LogicOp::Copy; } } @@ -2146,20 +2186,15 @@ void GraphicsPipeline::BindToCmdBuffer( } } - if ((useOptimizedPipeline == false) && (m_internalBufferInfo.dataSize > 0)) + if ((useOptimizedPipeline == false) && (m_internalBufferInfo.internalBufferCount > 0)) { - VK_ASSERT(m_internalBufferInfo.internalBufferCount > 0); - Pal::gpusize gpuAddress = {}; - uint32_t* pCpuAddr = pPalCmdBuf->CmdAllocateEmbeddedData(m_internalBufferInfo.dataSize, 1, &gpuAddress); - memcpy(pCpuAddr, m_internalBufferInfo.pData, m_internalBufferInfo.dataSize); for (uint32_t i = 0; i < m_internalBufferInfo.internalBufferCount; i++) { - Pal::gpusize bufferAddress = gpuAddress; - bufferAddress += m_internalBufferInfo.internalBufferEntries[i].bufferOffset; + const InternalBufferEntry& buffEntry = m_internalBufferInfo.internalBufferEntries[i]; pPalCmdBuf->CmdSetUserData(Pal::PipelineBindPoint::Graphics, - m_internalBufferInfo.internalBufferEntries[i].userDataOffset, + buffEntry.userDataOffset, 2, - reinterpret_cast(&bufferAddress)); + reinterpret_cast(&buffEntry.bufferAddress[deviceIdx])); } } } diff --git a/icd/api/vk_graphics_pipeline_library.cpp b/icd/api/vk_graphics_pipeline_library.cpp index b3bef155..9f70f99f 100644 --- a/icd/api/vk_graphics_pipeline_library.cpp +++ b/icd/api/vk_graphics_pipeline_library.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -281,12 +281,13 @@ static GraphicsPipelineBinaryCreateInfo* DumpGraphicsPipelineBinaryCreateInfo( } } - pCreateInfo->pPipelineProfileKey = static_cast(pSystemMem); + PipelineOptimizerKey* pPipelineProfileKey = static_cast(pSystemMem); + pCreateInfo->pPipelineProfileKey = pPipelineProfileKey; pSystemMem = Util::VoidPtrInc(pSystemMem, sizeof(PipelineOptimizerKey)); - pCreateInfo->pPipelineProfileKey->shaderCount = shaderKeyCount; - pCreateInfo->pPipelineProfileKey->pShaders = static_cast(pSystemMem); + pPipelineProfileKey->shaderCount = shaderKeyCount; + pPipelineProfileKey->pShaders = static_cast(pSystemMem); memcpy(pSystemMem, pBinInfo->pPipelineProfileKey->pShaders, shaderKeyBytes); pSystemMem = Util::VoidPtrInc(pSystemMem, shaderKeyBytes); @@ -432,6 +433,18 @@ VkResult GraphicsPipelineLibrary::CreatePartialPipelineBinary( } } + if (pDevice->GetRuntimeSettings().useShaderLibraryForPipelineLibraryFastLink) + { + // If there is no fragment shader when create fragment library, we use a null pal graphics library. + if ((pLibInfo->libFlags & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT) && + (pBinaryCreateInfo->pipelineInfo.fs.pModuleData == nullptr)) + { + const auto& fragmentCreateInfo = pDevice->GetNullFragmentLib()->GetPipelineBinaryCreateInfo(); + pBinaryCreateInfo->pShaderLibraries[GraphicsLibraryFragment] = + fragmentCreateInfo.pShaderLibraries[GraphicsLibraryFragment]; + } + } + return result; } @@ -541,7 +554,7 @@ VkResult GraphicsPipelineLibrary::Create( } // Cleanup temp memory in binaryCreateInfo. - pDevice->GetCompiler(DefaultDeviceIndex)->FreeGraphicsPipelineCreateInfo(&binaryCreateInfo, false); + pDevice->GetCompiler(DefaultDeviceIndex)->FreeGraphicsPipelineCreateInfo(pDevice, &binaryCreateInfo, false, true); if (result == VK_SUCCESS) { @@ -657,6 +670,13 @@ VkResult GraphicsPipelineLibrary::Destroy( } } + if (m_pBinaryCreateInfo->pInternalMem != nullptr) + { + pDevice->MemMgr()->FreeGpuMem(m_pBinaryCreateInfo->pInternalMem); + Util::Destructor(m_pBinaryCreateInfo->pInternalMem); + pDevice->VkInstance()->FreeMem(const_cast(m_pBinaryCreateInfo->pInternalMem)); + } + return Pipeline::Destroy(pDevice, pAllocator); } @@ -754,4 +774,32 @@ const ShaderModuleHandle* GraphicsPipelineLibrary::GetShaderModuleHandle( return pHandle; } +// ===================================================================================================================== +void GraphicsPipelineLibrary::GetOwnedPalShaderLibraries( + const Pal::IShaderLibrary* pLibraries[GraphicsLibraryCount] + ) const +{ + uint32_t libraryMask = 0; + for (uint32_t i = 0; i < ShaderStage::ShaderStageGfxCount; ++i) + { + if (m_tempModuleStates[i].stage != ShaderStage::ShaderStageInvalid) + { + libraryMask |= (1 << GetGraphicsLibraryType(m_tempModuleStates[i].stage)); + } + } + + for (uint32_t i = 0; i < ArrayLen(m_pBinaryCreateInfo->pShaderLibraries); ++i) + { + Pal::IShaderLibrary* pShaderLib = m_pBinaryCreateInfo->pShaderLibraries[i]; + if (Util::TestAnyFlagSet(libraryMask, 1 << i) && (pShaderLib != nullptr)) + { + pLibraries[i] = pShaderLib; + } + else + { + pLibraries[i] = nullptr; + } + } +} + } diff --git a/icd/api/vk_image.cpp b/icd/api/vk_image.cpp index 7179bb65..2994ac89 100644 --- a/icd/api/vk_image.cpp +++ b/icd/api/vk_image.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -484,6 +484,13 @@ void Image::ConvertImageCreateInfo( pPalCreateInfo->metadataMode = Pal::MetadataMode::Disabled; } + if (settings.enableD24S8 && + ((pCreateInfo->format == VK_FORMAT_D24_UNORM_S8_UINT) || + (pCreateInfo->format == VK_FORMAT_X8_D24_UNORM_PACK32))) + { + pPalCreateInfo->usageFlags.depthAsZ24 = 1; + } + // If DCC was disabled above, still attempt to use Fmask. if ((pPalCreateInfo->samples > 1) && pPalCreateInfo->usageFlags.colorTarget && (pPalCreateInfo->metadataMode == Pal::MetadataMode::Disabled)) @@ -525,6 +532,17 @@ void Image::ConvertImageCreateInfo( // Apply per application (or run-time) options pDevice->GetResourceOptimizer()->OverrideImageCreateInfo(resourceKey, pPalCreateInfo); + if (extStructs.pImageCompressionControl != nullptr) + { + // Disable compression when requested by application calling VK_EXT_image_compression_control + if ((extStructs.pImageCompressionControl->sType == VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT) && + (extStructs.pImageCompressionControl->flags == VK_IMAGE_COMPRESSION_DISABLED_EXT)) + { + pPalCreateInfo->metadataMode = Pal::MetadataMode::Disabled; + pPalCreateInfo->metadataTcCompatMode = Pal::MetadataTcCompatMode::Disabled; + } + } + #if defined(__unix__) pPalCreateInfo->modifier = DRM_FORMAT_MOD_INVALID; @@ -782,6 +800,12 @@ void Image::HandleExtensionStructs( break; } #endif + case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT: + { + pExtStructs->pImageCompressionControl = + static_cast(pNext); + break; + } default: // Skip any unknown extension structures break; diff --git a/icd/api/vk_image_view.cpp b/icd/api/vk_image_view.cpp index cbb0bbec..23fc2c76 100644 --- a/icd/api/vk_image_view.cpp +++ b/icd/api/vk_image_view.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_instance.cpp b/icd/api/vk_instance.cpp index 5cd3f0de..cca1b3cc 100644 --- a/icd/api/vk_instance.cpp +++ b/icd/api/vk_instance.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -586,7 +586,7 @@ void Instance::InitDispatchTable() } // Install SQTT marker annotation layer if needed - if (IsTracingSupportEnabled()) + if (IsTracingSupportEnabled() || IsCrashAnalysisSupportEnabled()) { SqttOverrideDispatchTable(&m_dispatchTable, nullptr); } @@ -1029,6 +1029,19 @@ void Instance::EnableTracingSupport() m_flags.sqttSupport = 1; } +// ===================================================================================================================== +// This function notifies the instance that it should return versions of Vulkan entry points that support Execution +// Marker annotations for RGD. +// +// IMPORTANT: This function should only be called by physical devices during Instance initialization when those +// devices are first initialized and they read the PAL settings. +void Instance::EnableCrashAnalysisSupport() +{ + // This function should not be called after the loader/application has queried this ICD's per-instance dispatch + // table. + m_flags.rgdSupport = 1; +} + // ===================================================================================================================== // Early-initializes the GPU Open Developer Mode manager if that mode is enabled. This is called prior to enumerating // PAL devices (before physical device manager is created). @@ -1063,6 +1076,11 @@ void Instance::DevModeLateInitialize() { EnableTracingSupport(); } + + if (m_pDevModeMgr->IsCrashAnalysisEnabled()) + { + EnableCrashAnalysisSupport(); + } #endif } @@ -1142,7 +1160,7 @@ void PAL_STDCALL Instance::PalDeveloperCallback( { Instance* pInstance = static_cast(pPrivateData); - if (pInstance->IsTracingSupportEnabled()) + if (pInstance->IsTracingSupportEnabled() || pInstance->IsCrashAnalysisSupportEnabled()) { // This is required to trap internal barriers and dispatches performed by PAL so that they can be correctly // annotated to RGP. diff --git a/icd/api/vk_memory.cpp b/icd/api/vk_memory.cpp index 562fe7fd..3bed7a4b 100644 --- a/icd/api/vk_memory.cpp +++ b/icd/api/vk_memory.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_physical_device.cpp b/icd/api/vk_physical_device.cpp index 32ff4a20..04ced74f 100644 --- a/icd/api/vk_physical_device.cpp +++ b/icd/api/vk_physical_device.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -2835,12 +2835,8 @@ void PhysicalDevice::PopulateLimits() m_limits.maxPushConstantsSize = MaxPushConstants; // Maximum number of device memory allocations, as created by vkAllocMemory, that can exist simultaneously. -#if defined(__unix__) - // relax the limitation on Linux since there is no real limitation from OS's perspective. m_limits.maxMemoryAllocationCount = UINT_MAX; -#else - m_limits.maxMemoryAllocationCount = 4096; -#endif + if (settings.memoryCustomDeviceAllocationCountLimit > 0) { m_limits.maxMemoryAllocationCount = settings.memoryCustomDeviceAllocationCountLimit; @@ -4509,6 +4505,12 @@ DeviceExtensions::Supported PhysicalDevice::GetAvailableExtensions( availableExtensions.AddExtension(VK_DEVICE_EXTENSION(KHR_SPIRV_1_4)); } + if ((pPhysicalDevice == nullptr) || pPhysicalDevice->GetRuntimeSettings().exportImageCompressionControl) + { + // exporting for vkd3d/ vkd3d-proton + availableExtensions.AddExtension(VK_DEVICE_EXTENSION(EXT_IMAGE_COMPRESSION_CONTROL)); + } + return availableExtensions; } @@ -5010,7 +5012,7 @@ void PhysicalDevice::GetPhysicalDeviceSubgroupSizeControlProperties( ) const { *pMinSubgroupSize = m_properties.gfxipProperties.shaderCore.minWavefrontSize; - *pMaxSubgroupSize = m_properties.gfxipProperties.shaderCore.maxWavefrontSize; + *pMaxSubgroupSize = GetDeviceSupportedSubgroupSize(); // No limits on the maximum number of subgroups allowed within a workgroup. *pMaxComputeWorkgroupSubgroups = UINT32_MAX; @@ -7267,6 +7269,7 @@ VkResult PhysicalDevice::GetImageFormatProperties2( VkStructHeaderNonConst* pHeader2; VkExternalImageFormatProperties* pExternalImageProperties = nullptr; VkTextureLODGatherFormatPropertiesAMD* pTextureLODGatherFormatProperties = nullptr; + VkImageCompressionPropertiesEXT* pImageCompressionProps = nullptr; VkSamplerYcbcrConversionImageFormatProperties* pSamplerYcbcrConversionImageFormatProperties = nullptr; for (pHeader = reinterpret_cast(pImageFormatInfo->pNext); @@ -7326,6 +7329,11 @@ VkResult PhysicalDevice::GetImageFormatProperties2( Formats::GetYuvPlaneCounts(createInfoFormat); break; } + case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: + { + pImageCompressionProps = reinterpret_cast(pHeader2); + break; + } default: break; } @@ -7368,6 +7376,22 @@ VkResult PhysicalDevice::GetImageFormatProperties2( pTextureLODGatherFormatProperties->supportsTextureGatherLODBiasAMD = VK_TRUE; } + if (pImageCompressionProps != nullptr) + { + pImageCompressionProps->imageCompressionFixedRateFlags = VK_IMAGE_COMPRESSION_FIXED_RATE_NONE_EXT; + + if (Formats::IsDepthStencilFormat(createInfoFormat)) + { + pImageCompressionProps->imageCompressionFlags = VK_IMAGE_COMPRESSION_DEFAULT_EXT; + } + else + { + pImageCompressionProps->imageCompressionFlags = (GetRuntimeSettings().forceEnableDcc == ForceDisableDcc) + ? VK_IMAGE_COMPRESSION_DISABLED_EXT + : VK_IMAGE_COMPRESSION_DEFAULT_EXT; + } + } + return result; } @@ -7505,7 +7529,7 @@ void PhysicalDevice::GetDeviceProperties2( pProps->computeUnitsPerShaderArray = palProps.gfxipProperties.shaderCore.numCusPerShaderArray; pProps->simdPerComputeUnit = palProps.gfxipProperties.shaderCore.numSimdsPerCu; pProps->wavefrontsPerSimd = palProps.gfxipProperties.shaderCore.numWavefrontsPerSimd; - pProps->wavefrontSize = palProps.gfxipProperties.shaderCore.maxWavefrontSize; + pProps->wavefrontSize = GetDeviceSupportedSubgroupSize(); // Scalar General Purpose Registers (SGPR) pProps->sgprsPerSimd = palProps.gfxipProperties.shaderCore.sgprsPerSimd; @@ -8175,6 +8199,14 @@ void PhysicalDevice::GetDeviceProperties2( break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR: + { + auto* pProps = static_cast(pNext); + + pProps->maxVertexAttribDivisor = UINT32_MAX; + pProps->supportsNonZeroFirstInstance = VK_TRUE; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT: { auto* pProps = static_cast(pNext); diff --git a/icd/api/vk_physical_device_manager.cpp b/icd/api/vk_physical_device_manager.cpp index f812d401..8e16d303 100644 --- a/icd/api/vk_physical_device_manager.cpp +++ b/icd/api/vk_physical_device_manager.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_pipeline.cpp b/icd/api/vk_pipeline.cpp index 6696ea15..cf35dad4 100644 --- a/icd/api/vk_pipeline.cpp +++ b/icd/api/vk_pipeline.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -345,19 +345,15 @@ VkResult Pipeline::BuildShaderStageInfo( } } - PipelineBinaryCache* pBinaryCache = (pCache == nullptr) ? nullptr : pCache->GetPipelineCache(); - if (shaderBinary.pCode != nullptr) { result = pCompiler->BuildShaderModule( pDevice, flags, - 0, + VK_INTERNAL_SHADER_FLAGS_FORCE_UNCACHED_BIT, shaderBinary, adaptForFastLink, false, - pBinaryCache, - pShaderFeedback, &pTempModules[outIdx]); pShaderStageInfo[outIdx].pModuleHandle = &pTempModules[outIdx]; diff --git a/icd/api/vk_pipeline_cache.cpp b/icd/api/vk_pipeline_cache.cpp index 0f9f38e6..bdc484a2 100644 --- a/icd/api/vk_pipeline_cache.cpp +++ b/icd/api/vk_pipeline_cache.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_pipeline_layout.cpp b/icd/api/vk_pipeline_layout.cpp index 74427f80..191a2cb0 100644 --- a/icd/api/vk_pipeline_layout.cpp +++ b/icd/api/vk_pipeline_layout.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -120,6 +120,24 @@ constexpr size_t PipelineLayout::GetMaxStaticDescValueSize() ; } +// ===================================================================================================================== +// Calculates the pushConstantSize in dwords +uint32_t PipelineLayout::GetPushConstantSizeInDword( + const uint32_t pushConstantsSizeInBytes) +{ + uint32_t lengthInDwords = 0; + if ((pushConstantsSizeInBytes != 0) && (pushConstantsSizeInBytes < sizeof(uint32_t))) + { + // For the data size is less than uint32_t, eg: uint8/uint16 + lengthInDwords = 1; + } + else + { + lengthInDwords = pushConstantsSizeInBytes / sizeof(uint32_t); + } + return lengthInDwords; +} + // ===================================================================================================================== PipelineLayout::PipelineLayout( const Device* pDevice, @@ -306,9 +324,7 @@ VkResult PipelineLayout::BuildCompactSchemeInfo( // Total number of dynamic descriptors across all descriptor sets uint32_t totalDynDescCount = 0; - - const uint32_t pushConstRegCount = pushConstantsSizeInBytes / sizeof(uint32_t); - + uint32_t pushConstRegCount = GetPushConstantSizeInDword(pushConstantsSizeInBytes); uint32_t gfxReservedCount = 0; // Reserve an user-data to store the VA of buffer for transform feedback. if (ReserveXfbNode(pDevice)) @@ -612,7 +628,7 @@ VkResult PipelineLayout::BuildIndirectSchemeInfo( // Allocate user data for push constant buffer pointer pUserDataLayout->pushConstPtrRegBase = pInfo->userDataRegCount; - pUserDataLayout->pushConstSizeInDword = pushConstantsSizeInBytes / sizeof(uint32_t); + pUserDataLayout->pushConstSizeInDword = GetPushConstantSizeInDword(pushConstantsSizeInBytes); pPipelineInfo->numUserDataNodes += 1; pPipelineInfo->numRsrcMapNodes += 1; pInfo->userDataRegCount += 1; diff --git a/icd/api/vk_private_data_slot.cpp b/icd/api/vk_private_data_slot.cpp index a248983b..6579ef63 100644 --- a/icd/api/vk_private_data_slot.cpp +++ b/icd/api/vk_private_data_slot.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_query.cpp b/icd/api/vk_query.cpp index c0ef7b1c..ccd84955 100644 --- a/icd/api/vk_query.cpp +++ b/icd/api/vk_query.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_queue.cpp b/icd/api/vk_queue.cpp index 69ceed44..0b90beab 100644 --- a/icd/api/vk_queue.cpp +++ b/icd/api/vk_queue.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -1949,6 +1949,8 @@ VkResult Queue::Present( pCmdBufState, &hasPostProcessing); + m_pDevice->VkInstance()->PalPlatform()->UpdateFrameTraceController(pPresentQueue); + // Notify gpuopen developer mode that we're about to present (frame-end boundary) #if ICD_GPUOPEN_DEVMODE_BUILD if (m_pDevice->VkInstance()->GetDevModeMgr() != nullptr) diff --git a/icd/api/vk_render_pass.cpp b/icd/api/vk_render_pass.cpp index eb8732f6..23e2944f 100644 --- a/icd/api/vk_render_pass.cpp +++ b/icd/api/vk_render_pass.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_sampler.cpp b/icd/api/vk_sampler.cpp index de496591..6c85c71a 100644 --- a/icd/api/vk_sampler.cpp +++ b/icd/api/vk_sampler.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_sampler_ycbcr_conversion.cpp b/icd/api/vk_sampler_ycbcr_conversion.cpp index 6cd94c4b..912a34fc 100644 --- a/icd/api/vk_sampler_ycbcr_conversion.cpp +++ b/icd/api/vk_sampler_ycbcr_conversion.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_semaphore.cpp b/icd/api/vk_semaphore.cpp index 6729cd30..daae49f5 100644 --- a/icd/api/vk_semaphore.cpp +++ b/icd/api/vk_semaphore.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,9 +35,10 @@ namespace vk // ===================================================================================================================== VkResult Semaphore::PopulateInDeviceGroup( - Device* pDevice, - Pal::IQueueSemaphore* pPalSemaphores[MaxPalDevices], - uint32_t* pSemaphoreCount) + Device* pDevice, + const Pal::QueueSemaphoreCreateInfo& palCreateInfo, + Pal::IQueueSemaphore* pPalSemaphores[MaxPalDevices], + uint32_t* pSemaphoreCount) { Pal::Result palResult = Pal::Result::Success; uint32_t count = 1; @@ -59,6 +60,7 @@ VkResult Semaphore::PopulateInDeviceGroup( palOpenInfo.externalSemaphore = handle; palOpenInfo.flags.crossProcess = false; palOpenInfo.flags.isReference = true; + palOpenInfo.flags.timeline = palCreateInfo.flags.timeline; for (uint32_t deviceIdx = 1; deviceIdx < pDevice->NumPalDevices(); deviceIdx ++) { @@ -205,7 +207,7 @@ VkResult Semaphore::Create( { uint32_t semaphoreCount = 1; - vkResult = PopulateInDeviceGroup(pDevice, pPalSemaphores, &semaphoreCount); + vkResult = PopulateInDeviceGroup(pDevice, palCreateInfo, pPalSemaphores, &semaphoreCount); if (vkResult == VK_SUCCESS) { @@ -334,7 +336,7 @@ VkResult Semaphore::ImportSemaphore( { uint32_t semaphoreCount = 1; - vkResult = PopulateInDeviceGroup(pDevice, pPalSemaphores, &semaphoreCount); + vkResult = PopulateInDeviceGroup(pDevice, m_palCreateInfo, pPalSemaphores, &semaphoreCount); if (vkResult == VK_SUCCESS) { diff --git a/icd/api/vk_shader.cpp b/icd/api/vk_shader.cpp index e32efe15..973915a4 100644 --- a/icd/api/vk_shader.cpp +++ b/icd/api/vk_shader.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -215,8 +215,6 @@ VkResult ShaderModule::Init( shaderBinary, false, false, - nullptr, - nullptr, &m_handle); if (result == VK_SUCCESS) diff --git a/icd/api/vk_surface.cpp b/icd/api/vk_surface.cpp index 8b2d1802..e61a93ee 100644 --- a/icd/api/vk_surface.cpp +++ b/icd/api/vk_surface.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_swapchain.cpp b/icd/api/vk_swapchain.cpp index 51b6189e..50fbae9b 100644 --- a/icd/api/vk_swapchain.cpp +++ b/icd/api/vk_swapchain.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -413,7 +413,7 @@ VkResult SwapChain::Create( offset += palSwapChainSize; - result = PalToVkResult(palResult); + result = (palResult == Pal::Result::AlreadyExists) ? VK_ERROR_NATIVE_WINDOW_IN_USE_KHR : PalToVkResult(palResult); if (result == VK_SUCCESS) { diff --git a/icd/api/vk_utils.cpp b/icd/api/vk_utils.cpp index 32bbe13b..a99dd888 100644 --- a/icd/api/vk_utils.cpp +++ b/icd/api/vk_utils.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/CMakeLists.txt b/icd/imported/gputexdecoder/CMakeLists.txt index 4f698040..af84051c 100644 --- a/icd/imported/gputexdecoder/CMakeLists.txt +++ b/icd/imported/gputexdecoder/CMakeLists.txt @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/gpuTexDecoder.cpp b/icd/imported/gputexdecoder/gpuTexDecoder.cpp index ecaf69d4..8da4cc88 100755 --- a/icd/imported/gputexdecoder/gpuTexDecoder.cpp +++ b/icd/imported/gputexdecoder/gpuTexDecoder.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/gpuTexDecoder.h b/icd/imported/gputexdecoder/gpuTexDecoder.h index 758bf1aa..0fff1c28 100755 --- a/icd/imported/gputexdecoder/gpuTexDecoder.h +++ b/icd/imported/gputexdecoder/gpuTexDecoder.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/shaders.h b/icd/imported/gputexdecoder/shaders.h index ff9a2dac..23d96799 100644 --- a/icd/imported/gputexdecoder/shaders.h +++ b/icd/imported/gputexdecoder/shaders.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/shaders/AstcDecode.comp b/icd/imported/gputexdecoder/shaders/AstcDecode.comp index a82f068e..fdcf9029 100644 --- a/icd/imported/gputexdecoder/shaders/AstcDecode.comp +++ b/icd/imported/gputexdecoder/shaders/AstcDecode.comp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/shaders/AstcDecode.h b/icd/imported/gputexdecoder/shaders/AstcDecode.h index d5ea5796..3d8fbb53 100644 --- a/icd/imported/gputexdecoder/shaders/AstcDecode.h +++ b/icd/imported/gputexdecoder/shaders/AstcDecode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/shaders/Bc3Encoder.h b/icd/imported/gputexdecoder/shaders/Bc3Encoder.h index 8a8278ee..c4db696c 100644 --- a/icd/imported/gputexdecoder/shaders/Bc3Encoder.h +++ b/icd/imported/gputexdecoder/shaders/Bc3Encoder.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/shaders/Etc2Decode.h b/icd/imported/gputexdecoder/shaders/Etc2Decode.h index 94be2939..59a72d15 100644 --- a/icd/imported/gputexdecoder/shaders/Etc2Decode.h +++ b/icd/imported/gputexdecoder/shaders/Etc2Decode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/shaders/Etc2ToBc3.h b/icd/imported/gputexdecoder/shaders/Etc2ToBc3.h index be945c38..c98cffb3 100644 --- a/icd/imported/gputexdecoder/shaders/Etc2ToBc3.h +++ b/icd/imported/gputexdecoder/shaders/Etc2ToBc3.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/layers/include/query_dlist.h b/icd/layers/include/query_dlist.h index 84132953..05e1c246 100644 --- a/icd/layers/include/query_dlist.h +++ b/icd/layers/include/query_dlist.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/layers/include/vk_layer_switchable_graphics.h b/icd/layers/include/vk_layer_switchable_graphics.h index fcd0393e..46e26448 100644 --- a/icd/layers/include/vk_layer_switchable_graphics.h +++ b/icd/layers/include/vk_layer_switchable_graphics.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/layers/query_dlist.cpp b/icd/layers/query_dlist.cpp index c9224c91..7233ae81 100644 --- a/icd/layers/query_dlist.cpp +++ b/icd/layers/query_dlist.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/layers/vk_layer_all_null_devices.cpp b/icd/layers/vk_layer_all_null_devices.cpp index bc7f9596..05ca3e76 100644 --- a/icd/layers/vk_layer_all_null_devices.cpp +++ b/icd/layers/vk_layer_all_null_devices.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/layers/vk_layer_switchable_graphics.cpp b/icd/layers/vk_layer_switchable_graphics.cpp index 6f820744..f60027d1 100644 --- a/icd/layers/vk_layer_switchable_graphics.cpp +++ b/icd/layers/vk_layer_switchable_graphics.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/make/amdicd.so.def b/icd/make/amdicd.so.def index e299fa0b..51d81fdb 100644 --- a/icd/make/amdicd.so.def +++ b/icd/make/amdicd.so.def @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/res/ver.h b/icd/res/ver.h index bb34e42e..af2f5272 100644 --- a/icd/res/ver.h +++ b/icd/res/ver.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ #define VERSION_MAJOR_STR MAKE_VERSION_STRING(VULKAN_ICD_MAJOR_VERSION) "\0" // Bump up after each promotion to mainline -#define VULKAN_ICD_BUILD_VERSION 295 +#define VULKAN_ICD_BUILD_VERSION 297 // String version is needed with leading zeros and extra termination (unicode) #define VERSION_NUMBER_MINOR VULKAN_ICD_BUILD_VERSION @@ -45,11 +45,11 @@ // These values specify the driver ID and driver info string #define VULKAN_DRIVER_ID VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR // "AMDOPEN" #define VULKAN_DRIVER_NAME_STR "AMD open-source driver" -#define VULKAN_DRIVER_INFO_STR "2023.Q4.3" +#define VULKAN_DRIVER_INFO_STR "2024.Q1.1" #define VULKAN_DRIVER_INFO_STR_LLPC "(LLPC)" // These values tell which version of the conformance test the driver is compliant against #define CTS_VERSION_MAJOR 1 #define CTS_VERSION_MINOR 3 -#define CTS_VERSION_SUBMINOR 3 -#define CTS_VERSION_PATCH 1 +#define CTS_VERSION_SUBMINOR 5 +#define CTS_VERSION_PATCH 2 diff --git a/icd/settings/settings.cpp b/icd/settings/settings.cpp index 97b6c296..c7d4d1c3 100644 --- a/icd/settings/settings.cpp +++ b/icd/settings/settings.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -174,6 +174,12 @@ VkResult VulkanSettingsLoader::OverrideProfiledSettings( m_settings.usePalPipelineCaching = (atoi(pPipelineCacheEnvVar) != 0); } + const char* pEnableInternalCacheToDisk = getenv("AMD_VK_ENABLE_INTERNAL_PIPELINECACHING_TO_DISK"); + if (pEnableInternalCacheToDisk != nullptr) + { + m_settings.enableInternalPipelineCachingToDisk = (atoi(pEnableInternalCacheToDisk) != 0); + } + // In general, DCC is very beneficial for color attachments, 2D, 3D shader storage resources that have BPP>=32. // If this is completely offset, maybe by increased shader read latency or partial writes of DCC blocks, it should // be debugged on a case by case basis. @@ -219,10 +225,6 @@ VkResult VulkanSettingsLoader::OverrideProfiledSettings( { m_settings.disableImplicitInvariantExports = false; - -#if VKI_BUILD_GFX11 - m_settings.optimizeTessFactor = true; -#endif } #if VKI_BUILD_GFX11 @@ -494,10 +496,13 @@ VkResult VulkanSettingsLoader::OverrideProfiledSettings( // Disable image type checking on Navi10 to avoid 2% loss. m_settings.disableImageResourceTypeCheck = true; + m_settings.enableGraphicsPipelineLibraries = true; } if (appProfile == AppProfile::CSGO) { + m_settings.enableGraphicsPipelineLibraries = true; + if (pInfo->gfxLevel == Pal::GfxIpLevel::GfxIp10_3) { @@ -861,8 +866,6 @@ VkResult VulkanSettingsLoader::OverrideProfiledSettings( } m_settings.ac01WaNotNeeded = true; - - m_settings.disable3dLinearImageFormatSupport = false; } if (appProfile == AppProfile::GhostReconBreakpoint) @@ -1131,8 +1134,6 @@ VkResult VulkanSettingsLoader::OverrideProfiledSettings( { m_settings.resourceBarrierOptions &= ~ResourceBarrierOptions::AvoidCpuMemoryCoher; } - const char *option = "-use-register-field-format=0"; - Util::Strncpy(&m_settings.llpcOptions[0], option, strlen(option) + 1); } if (appProfile == AppProfile::WarThunder) @@ -1259,6 +1260,11 @@ VkResult VulkanSettingsLoader::OverrideProfiledSettings( m_settings.padVertexBuffers = true; } + if (appProfile == AppProfile::MetalGearSolid5Online) + { + m_settings.padVertexBuffers = true; + } + if (appProfile == AppProfile::YamagiQuakeII) { m_settings.forceImageSharingMode = @@ -1289,6 +1295,7 @@ VkResult VulkanSettingsLoader::OverrideProfiledSettings( if (appProfile == AppProfile::SaintsRowV) { m_settings.barrierFilterOptions = BarrierFilterOptions::FlushOnHostMask; + } if ((appProfile == AppProfile::HalfLifeAlyx) || @@ -1344,6 +1351,13 @@ VkResult VulkanSettingsLoader::OverrideProfiledSettings( if (appProfile == AppProfile::Vkd3dEngine) { m_settings.exportNvComputeShaderDerivatives = true; + m_settings.exportImageCompressionControl = true; + } + + if ((appProfile == AppProfile::DXVK) || + (appProfile == AppProfile::Vkd3dEngine)) + { + m_settings.disableSingleMipAnisoOverride = false; } pAllocCb->pfnFree(pAllocCb->pUserData, pInfo); diff --git a/icd/settings/settings.h b/icd/settings/settings.h index 8c03b514..1a3b74c5 100644 --- a/icd/settings/settings.h +++ b/icd/settings/settings.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/settings/settings_xgl.json b/icd/settings/settings_xgl.json index 8dbd6b95..7a52a64f 100644 --- a/icd/settings/settings_xgl.json +++ b/icd/settings/settings_xgl.json @@ -759,7 +759,7 @@ }, { "Name": "PipelineFastCompileMode", - "Description": "Controls how SC 'fast compile mode' (disable optimizations) is enabled", + "Description": "Controls how pipeline compile 'fast compile mode' (disable optimizations) is enabled", "Tags": [ "Pipeline Options" ], @@ -772,17 +772,22 @@ { "Name": "PipelineFastCompileApiControlled", "Value": 0, - "Description": "'Fast compile' disabled (SC fast optimizations enabled) if VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT is set." + "Description": "Full optimzimization is disabled (optLevel = C1 or C0 dependent on compiler) if VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT is set. and optLevel = C2 if VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT is not set" }, { "Name": "PipelineFastCompileNeverOptimized", "Value": 1, - "Description": "'Fast compile' always enabled (disables SC shader optimization)." + "Description": "Disable all optimizization to enable fast compile. i.e. Force optLevel = C0." }, { - "Name": "PipelineFastCompileAlwaysOptimized", + "Name": "PipelineFastCompileFastOptimized", "Value": 2, - "Description": "'Fast compile' always disabled (SC fast optimizations enabled)." + "Description": "Disable most optimziation to optimize compile. i.e. Force optLevel = C1." + }, + { + "Name": "PipelineFastCompileFullOptimized", + "Value": 3, + "Description": "Force to do full optimziation. i.e. Force optLevel = C2." } ], "Name": "PipelineFastCompileMode" @@ -790,6 +795,39 @@ "Scope": "Driver", "Type": "enum" }, + { + "Name": "PipelineLinkOptimizationMode", + "Description": "Controls link optimization flag in pipeline creatation", + "Tags": [ + "Pipeline Options" + ], + "Defaults": { + "Default": "PipelineLinkOptimizationApiControlled" + }, + "ValidValues": { + "IsEnum": true, + "Values": [ + { + "Name": "PipelineLinkOptimizationApiControlled", + "Value": 0, + "Description": "Use VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT set by API" + }, + { + "Name": "PipelineLinkOptimizationNeverOptimized", + "Value": 1, + "Description": "Force flag VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT = 0" + }, + { + "Name": "PipelineLinkOptimizationAlwaysOptimized", + "Value": 2, + "Description": "Force flag VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT = 1." + } + ], + "Name": "PipelineLinkOptimizationMode" + }, + "Scope": "Driver", + "Type": "enum" + }, { "Name": "PipelineLayoutMode", "Description": "Control the pipeline descriptor layout for early compile", @@ -1054,7 +1092,7 @@ "Pipeline Options" ], "Defaults": { - "Default": false + "Default": true }, "Type": "bool", "Scope": "Driver" @@ -1536,9 +1574,7 @@ "IsDir": true }, "Defaults": { - "Default": "ShaderReplace", - "Windows": "ShaderReplace", - "Linux": "ShaderReplace" + "Default": "ShaderReplace" }, "Scope": "Driver", "Name": "ShaderReplaceDir", @@ -2126,10 +2162,31 @@ "SPIRV Options" ], "Defaults": { - "Default": false + "Default": "OptimizeTessFactorAuto" + }, + "ValidValues": { + "IsEnum": true, + "Values": [ + { + "Name": "OptimizeTessFactorAuto", + "Value": 0, + "Description": "Determine the tessellation fator optimization by compiler." + }, + { + "Name": "OptimizeTessFactorDisable", + "Value": 1, + "Description": "Force disable tessellation factor optimization." + }, + { + "Name": "OptimizeTessFactorEnable", + "Value": 2, + "Description": "Force enable tessellation fator optimziation." + } + ], + "Name": "OptimizeTessFactorMode" }, "Scope": "Driver", - "Type": "bool", + "Type": "enum", "Name": "OptimizeTessFactor" }, { @@ -2288,7 +2345,7 @@ }, { "Name": "EnableInternalPipelineCachingToDisk", - "Description": "Controls whether the pipeline compiler enables Pal's archive-file based caching for internal pipelines. (Default: TRUE) Related environment variables AMD_ARCHIVE_DISK_CACHE_PATH: Path to where archive file is to be stored (optional) AMD_ARCHIVE_APP_PREFIX : Fixed prefix string for generated archive file name (optional)", + "Description": "Controls whether the pipeline compiler enables Pal's archive-file based caching for internal pipelines. This value can be overwritten by environment variable AMD_VK_ENABLE_INTERNAL_PIPELINECACHING_TO_DISK. Related environment variables AMD_ARCHIVE_DISK_CACHE_PATH: Path to where archive file is to be stored (optional) AMD_ARCHIVE_APP_PREFIX : Fixed prefix string for generated archive file name (optional)", "Tags": [ "SPIRV Options" ], @@ -3329,6 +3386,21 @@ "Name": "MaxUnifiedNonRayGenShaders", "Scope": "Driver" }, + { + "Description": "Max total size in bytes of shaders to inline in Unified pipeline before falling back to indirect", + "Tags": [ + "Ray Tracing" + ], + "BuildTypes": [ + "VKI_RAY_TRACING" + ], + "Defaults": { + "Default": 307200 + }, + "Type": "uint32", + "Name": "MaxTotalSizeOfUnifiedShaders", + "Scope": "Driver" + }, { "Description": "Percentage of LDS to use for traversal stack vs. LDS spilling for indirect AnyHit/Intersection shaders, when EnableOptimalLdsStackSizeForIndirect = true and EnableLdsSpilling = true. The LDS stack size calculated is clamped to a power of 2.", "Tags": [ @@ -5032,6 +5104,58 @@ "Name": "RobustBufferAccess", "Scope": "Driver" }, + { + "Description": "Disables wave64 support. Selected waves default to wave32 and wave size tuning is disabled.", + "Tags": [ + "General" + ], + "Defaults": { + "Default": 0 + }, + "Flags": { + "IsHex": true, + "IsBitmask": true + }, + "ValidValues": { + "IsEnum": true, + "Name": "DeprecateWave64", + "Values": [ + { + "Name": "DeprecateWave64Disabled", + "Value": 0, + "Description": "Default case. Wave64 is both reported and enabled." + }, + { + "Name": "DeprecateWave64Cs", + "Value": 1, + "Description": "Wave64 can be reported but wave32 will be forced for compute shaders internally. If app uses subgroup operations then this setting still might not force desired wavesize since subgroupsize will take precedence. To avoid that DeprecateWave64Reporting MUST be set along with this setting." + }, + { + "Name": "DeprecateWave64NonCs", + "Value": 2, + "Description": "Wave64 can be reported but wave32 will be forced for all non-compute shaders. If app uses subgroup operations then this setting still might not force desired wavesize since subgroupsize will take precedence. To avoid that DeprecateWave64Reporting MUST be set along with this setting." + }, + { + "Name": "DeprecateWave64Reporting", + "Value": 4, + "Description": "Only wave32 is reported." + }, + { + "Name": "DeprecateWave64WaveIntrinsics", + "Value": 8, + "Description": "This flag must be set together with DeprecateWave64Reporting. When set, shader specified subgroupSize will be overriden to wave32." + }, + { + "Name": "DeprecateWave64All", + "Value": 4294967295, + "Description": "Wave32 is reported and forced for all shaders." + } + ] + }, + "Type": "uint32", + "Scope": "Driver", + "Name": "DeprecateWave64" + }, { "Description": "Enable Merge Sort for Morton Code sorting - If False, the default Radix Sort is used.", "Tags": [ @@ -6801,6 +6925,18 @@ "Type": "bool", "Scope": "Driver" }, + { + "Name": "EnableD24S8", + "Description": "Enable support for format D24_UNORM_S8_UINT and X8_D24_UNORM_PACK32.", + "Tags": [ + "Optimization" + ], + "Defaults": { + "Default": false + }, + "Type": "bool", + "Scope": "Driver" + }, { "ValidValues": { "IsEnum": true, @@ -7257,9 +7393,7 @@ "IsDir": true }, "Defaults": { - "Default": "PipelineReplace", - "Windows": "PipelineReplace", - "Linux": "PipelineReplace" + "Default": "PipelineReplace" }, "Scope": "Driver", "Name": "DevModeElfReplacementDirectory", @@ -7542,9 +7676,7 @@ "IsFile": true }, "Defaults": { - "Default": "trace.rgp", - "Windows": "trace.rgp", - "Linux": "trace.rgp" + "Default": "trace.rgp" }, "Scope": "Driver", "Name": "DevModeRgpTraceDumpFile", @@ -8611,6 +8743,18 @@ "Type": "bool", "Scope": "Driver" }, + { + "Name": "ExportImageCompressionControl", + "Description": "Export extension VK_EXT_image_compression_control", + "Tags": [ + "General" + ], + "Defaults": { + "Default": false + }, + "Type": "bool", + "Scope": "Driver" + }, { "Description": "[GFX10+ only] MALL RPM Views policy.", "Tags": [ @@ -8659,11 +8803,23 @@ "General" ], "Defaults": { - "Default": true + "Default": false }, "Type": "bool", "Scope": "Driver", "Name": "Disable3dLinearImageFormatSupport" + }, + { + "Description": "Enable Graphics Pipeline Libraries", + "Tags": [ + "Pipeline Options" + ], + "Defaults": { + "Default": false + }, + "Type": "bool", + "Scope": "Driver", + "Name": "EnableGraphicsPipelineLibraries" } ] } \ No newline at end of file diff --git a/icd/tools/generate/genSettingsCode.py b/icd/tools/generate/genSettingsCode.py index d3762e71..117ef3ae 100644 --- a/icd/tools/generate/genSettingsCode.py +++ b/icd/tools/generate/genSettingsCode.py @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2019-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/tools/generate/genShaderProfile.py b/icd/tools/generate/genShaderProfile.py index bb0739d7..8fd8990d 100644 --- a/icd/tools/generate/genShaderProfile.py +++ b/icd/tools/generate/genShaderProfile.py @@ -2,7 +2,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/tools/generate/shaderProfileTemplate.py b/icd/tools/generate/shaderProfileTemplate.py index 4edac01f..9d943f3a 100644 --- a/icd/tools/generate/shaderProfileTemplate.py +++ b/icd/tools/generate/shaderProfileTemplate.py @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/tools/generate/vulkanSettingsCodeTemplates.py b/icd/tools/generate/vulkanSettingsCodeTemplates.py index 6b2a387b..407b8910 100644 --- a/icd/tools/generate/vulkanSettingsCodeTemplates.py +++ b/icd/tools/generate/vulkanSettingsCodeTemplates.py @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2023 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/tools/xgl-copyright-template.txt b/icd/tools/xgl-copyright-template.txt index 467600c3..2954b961 100644 --- a/icd/tools/xgl-copyright-template.txt +++ b/icd/tools/xgl-copyright-template.txt @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal