diff --git a/docs/features.txt b/docs/features.txt index b0a59153c0b..c109041482e 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -566,7 +566,7 @@ Khronos extensions that are not part of any Vulkan version: VK_EXT_external_memory_dma_buf DONE (anv, pvr, radv, tu, v3dv, vn) VK_EXT_external_memory_host DONE (anv, lvp, radv) VK_EXT_filter_cubic DONE (tu/a650) - VK_EXT_fragment_shader_interlock DONE (anv/gen9+, vn) + VK_EXT_fragment_shader_interlock DONE (anv/gen9+, radv/gfx9+, vn) VK_EXT_global_priority DONE (anv, radv, tu) VK_EXT_global_priority_query DONE (anv, radv, tu) VK_EXT_graphics_pipeline_library DONE (lvp, radv, tu) diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index 009dffa05b8..cd73147b1a7 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -7,3 +7,4 @@ OpenGL ES 3.0 on Asahi VK_KHR_fragment_shader_barycentric on RADV/GFX10.3+ VK_KHR_ray_tracing_pipeline on RADV/GFX10.3+ VK_EXT_depth_bias_control on RADV +VK_EXT_fragment_shader_interlock on RADV/GFX9+ diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index 4e652c2e93b..c201e9c4565 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -494,6 +494,7 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device .EXT_extended_dynamic_state3 = true, .EXT_external_memory_dma_buf = true, .EXT_external_memory_host = device->rad_info.has_userptr, + .EXT_fragment_shader_interlock = radv_has_pops(device), .EXT_global_priority = true, .EXT_global_priority_query = true, .EXT_graphics_pipeline_library = !device->use_llvm && !(device->instance->debug_flags & RADV_DEBUG_NO_GPL), @@ -594,6 +595,7 @@ radv_physical_device_get_features(const struct radv_physical_device *pdevice, st bool has_perf_query = radv_perf_query_supported(pdevice); bool has_shader_image_float_minmax = pdevice->rad_info.gfx_level != GFX8 && pdevice->rad_info.gfx_level != GFX9 && pdevice->rad_info.gfx_level != GFX11; + bool has_fragment_shader_interlock = radv_has_pops(pdevice); *features = (struct vk_features){ /* Vulkan 1.0 */ @@ -1021,6 +1023,11 @@ radv_physical_device_get_features(const struct radv_physical_device *pdevice, st .leastRepresentableValueForceUnormRepresentation = true, .floatRepresentation = true, .depthBiasExact = true, + + /* VK_EXT_fragment_shader_interlock */ + .fragmentShaderSampleInterlock = has_fragment_shader_interlock, + .fragmentShaderPixelInterlock = has_fragment_shader_interlock, + .fragmentShaderShadingRateInterlock = false, }; } @@ -1607,7 +1614,8 @@ radv_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDev props->fragmentShadingRateWithSampleMask = true; props->fragmentShadingRateWithShaderSampleMask = false; props->fragmentShadingRateWithConservativeRasterization = true; - props->fragmentShadingRateWithFragmentShaderInterlock = false; + props->fragmentShadingRateWithFragmentShaderInterlock = + pdevice->rad_info.gfx_level >= GFX11 && radv_has_pops(pdevice); props->fragmentShadingRateWithCustomSampleLocations = false; props->fragmentShadingRateStrictMultiplyCombiner = true; break; diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 1c0bbc22c1e..3a927dc3d39 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -3581,6 +3581,12 @@ radv_has_shader_buffer_float_minmax(const struct radv_physical_device *pdevice, pdevice->rad_info.gfx_level == GFX10_3 || (pdevice->rad_info.gfx_level == GFX11 && bitsize == 32); } +static inline bool +radv_has_pops(const struct radv_physical_device *pdevice) +{ + return pdevice->rad_info.gfx_level >= GFX9 && !pdevice->use_llvm; +} + /* radv_perfcounter.c */ void radv_perfcounter_emit_shaders(struct radeon_cmdbuf *cs, unsigned shaders); void radv_perfcounter_emit_spm_reset(struct radeon_cmdbuf *cs); diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 0fe496d1fa1..ef6898302f9 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -363,6 +363,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_pipeline_ .device = device, .object = stage->spirv.object, }; + const bool has_fragment_shader_interlock = radv_has_pops(device->physical_device); const struct spirv_to_nir_options spirv_options = { .caps = { @@ -388,6 +389,8 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_pipeline_ .float64_atomic_min_max = true, .fragment_barycentric = true, .fragment_fully_covered = true, + .fragment_shader_pixel_interlock = has_fragment_shader_interlock, + .fragment_shader_sample_interlock = has_fragment_shader_interlock, .geometry_streams = true, .groups = true, .image_atomic_int64 = true,