diff options
author | Bastiaan Olij <mux213@gmail.com> | 2024-03-26 12:57:26 +1100 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2024-05-03 17:20:30 +1000 |
commit | 9042ddf19f33445abbb69a8330fff7e98fcda2dc (patch) | |
tree | 6e3fc77e57d3b032d525e9d02dd753cc99ac65af /drivers/vulkan | |
parent | 34b5e8f55cb7d09977074b1486bbdf00d5c16a01 (diff) | |
download | redot-engine-9042ddf19f33445abbb69a8330fff7e98fcda2dc.tar.gz |
Improvements to VRS/Foveated rendering
Diffstat (limited to 'drivers/vulkan')
-rw-r--r-- | drivers/vulkan/rendering_device_driver_vulkan.cpp | 8 | ||||
-rw-r--r-- | drivers/vulkan/rendering_device_driver_vulkan.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/vulkan/rendering_device_driver_vulkan.cpp b/drivers/vulkan/rendering_device_driver_vulkan.cpp index 803555cb07..339d0782bf 100644 --- a/drivers/vulkan/rendering_device_driver_vulkan.cpp +++ b/drivers/vulkan/rendering_device_driver_vulkan.cpp @@ -758,11 +758,13 @@ Error RenderingDeviceDriverVulkan::_check_device_capabilities() { vrs_capabilities.min_texel_size.y = vrs_properties.minFragmentShadingRateAttachmentTexelSize.height; vrs_capabilities.max_texel_size.x = vrs_properties.maxFragmentShadingRateAttachmentTexelSize.width; vrs_capabilities.max_texel_size.y = vrs_properties.maxFragmentShadingRateAttachmentTexelSize.height; + vrs_capabilities.max_fragment_size.x = vrs_properties.maxFragmentSize.width; // either 4 or 8 + vrs_capabilities.max_fragment_size.y = vrs_properties.maxFragmentSize.height; // generally the same as width // We'll attempt to default to a texel size of 16x16. vrs_capabilities.texel_size = Vector2i(16, 16).clamp(vrs_capabilities.min_texel_size, vrs_capabilities.max_texel_size); - print_verbose(String(" Attachment fragment shading rate") + String(", min texel size: (") + itos(vrs_capabilities.min_texel_size.x) + String(", ") + itos(vrs_capabilities.min_texel_size.y) + String(")") + String(", max texel size: (") + itos(vrs_capabilities.max_texel_size.x) + String(", ") + itos(vrs_capabilities.max_texel_size.y) + String(")")); + print_verbose(String(" Attachment fragment shading rate") + String(", min texel size: (") + itos(vrs_capabilities.min_texel_size.x) + String(", ") + itos(vrs_capabilities.min_texel_size.y) + String(")") + String(", max texel size: (") + itos(vrs_capabilities.max_texel_size.x) + String(", ") + itos(vrs_capabilities.max_texel_size.y) + String(")") + String(", max fragment size: (") + itos(vrs_capabilities.max_fragment_size.x) + String(", ") + itos(vrs_capabilities.max_fragment_size.y) + String(")")); } } else { @@ -4887,6 +4889,10 @@ uint64_t RenderingDeviceDriverVulkan::limit_get(Limit p_limit) { return vrs_capabilities.texel_size.x; case LIMIT_VRS_TEXEL_HEIGHT: return vrs_capabilities.texel_size.y; + case LIMIT_VRS_MAX_FRAGMENT_WIDTH: + return vrs_capabilities.max_fragment_size.x; + case LIMIT_VRS_MAX_FRAGMENT_HEIGHT: + return vrs_capabilities.max_fragment_size.y; default: ERR_FAIL_V(0); } diff --git a/drivers/vulkan/rendering_device_driver_vulkan.h b/drivers/vulkan/rendering_device_driver_vulkan.h index 70c4cebba5..e70019962a 100644 --- a/drivers/vulkan/rendering_device_driver_vulkan.h +++ b/drivers/vulkan/rendering_device_driver_vulkan.h @@ -87,6 +87,7 @@ class RenderingDeviceDriverVulkan : public RenderingDeviceDriver { Size2i min_texel_size; Size2i max_texel_size; + Size2i max_fragment_size; Size2i texel_size; // The texel size we'll use }; |