mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix unsupported sampler filter used for voxel GI
(cherry picked from commit 09aa1bbdb3)
This commit is contained in:
parent
a5779ff281
commit
908325c29e
7 changed files with 34 additions and 1 deletions
|
|
@ -4306,6 +4306,18 @@ RID RenderingDeviceVulkan::sampler_create(const SamplerState &p_state) {
|
|||
return id;
|
||||
}
|
||||
|
||||
bool RenderingDeviceVulkan::sampler_is_format_supported_for_filter(DataFormat p_format, SamplerFilter p_sampler_filter) const {
|
||||
ERR_FAIL_INDEX_V(p_format, DATA_FORMAT_MAX, false);
|
||||
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
// Validate that this image is supported for the intended filtering.
|
||||
VkFormatProperties properties;
|
||||
vkGetPhysicalDeviceFormatProperties(context->get_physical_device(), vulkan_formats[p_format], &properties);
|
||||
|
||||
return p_sampler_filter == RD::SAMPLER_FILTER_NEAREST || (p_sampler_filter == RD::SAMPLER_FILTER_LINEAR && (properties.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT));
|
||||
}
|
||||
|
||||
/**********************/
|
||||
/**** VERTEX ARRAY ****/
|
||||
/**********************/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue