You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Add VK_EXT_astc_decode_mode support
The work was performed by collaboration of TheForge and Google. I am merely splitting it up into smaller PRs and cleaning it up.
This commit is contained in:
@@ -497,6 +497,7 @@ Error RenderingDeviceDriverVulkan::_initialize_device_extensions() {
|
|||||||
_register_requested_device_extension(VK_KHR_MAINTENANCE_2_EXTENSION_NAME, false);
|
_register_requested_device_extension(VK_KHR_MAINTENANCE_2_EXTENSION_NAME, false);
|
||||||
_register_requested_device_extension(VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME, false);
|
_register_requested_device_extension(VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME, false);
|
||||||
_register_requested_device_extension(VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, false);
|
_register_requested_device_extension(VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, false);
|
||||||
|
_register_requested_device_extension(VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME, false);
|
||||||
|
|
||||||
if (Engine::get_singleton()->is_generate_spirv_debug_info_enabled()) {
|
if (Engine::get_singleton()->is_generate_spirv_debug_info_enabled()) {
|
||||||
_register_requested_device_extension(VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME, true);
|
_register_requested_device_extension(VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME, true);
|
||||||
@@ -1703,6 +1704,16 @@ RDD::TextureID RenderingDeviceDriverVulkan::texture_create(const TextureFormat &
|
|||||||
image_view_create_info.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
image_view_create_info.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VkImageViewASTCDecodeModeEXT decode_mode;
|
||||||
|
if (enabled_device_extension_names.has(VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME)) {
|
||||||
|
if (image_view_create_info.format >= VK_FORMAT_ASTC_4x4_UNORM_BLOCK && image_view_create_info.format <= VK_FORMAT_ASTC_12x12_SRGB_BLOCK) {
|
||||||
|
decode_mode.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT;
|
||||||
|
decode_mode.pNext = nullptr;
|
||||||
|
decode_mode.decodeMode = VK_FORMAT_R8G8B8A8_UNORM;
|
||||||
|
image_view_create_info.pNext = &decode_mode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VkImageView vk_image_view = VK_NULL_HANDLE;
|
VkImageView vk_image_view = VK_NULL_HANDLE;
|
||||||
err = vkCreateImageView(vk_device, &image_view_create_info, VKC::get_allocation_callbacks(VK_OBJECT_TYPE_IMAGE_VIEW), &vk_image_view);
|
err = vkCreateImageView(vk_device, &image_view_create_info, VKC::get_allocation_callbacks(VK_OBJECT_TYPE_IMAGE_VIEW), &vk_image_view);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user