From: Mike Blumenkrantz Date: Wed, 17 May 2023 11:47:06 +0000 (-0400) Subject: lavapipe: EXT_memory_budget X-Git-Tag: upstream/23.3.3~8237 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c42056ee126dbf9f06d27f0380f890ec04ea431;p=platform%2Fupstream%2Fmesa.git lavapipe: EXT_memory_budget Reviewed-by: Dave Airlie Part-of: --- diff --git a/docs/features.txt b/docs/features.txt index 483b8f3..a60e406 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -574,7 +574,7 @@ Khronos extensions that are not part of any Vulkan version: VK_EXT_index_type_uint8 DONE (anv, lvp, panvk, radv/gfx8+, v3dv, tu, vn) VK_EXT_line_rasterization DONE (anv, lvp, radv, tu, v3dv, vn) VK_EXT_load_store_op_none DONE (anv, radv, tu, v3dv, vn) - VK_EXT_memory_budget DONE (anv, radv, tu, v3dv, vn) + VK_EXT_memory_budget DONE (anv, lvp, radv, tu, v3dv, vn) VK_EXT_memory_priority DONE (radv) VK_EXT_mesh_shader DONE (anv/gfx12.5+, radv) VK_EXT_multi_draw DONE (anv, lvp, radv, tu, vn) diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index a968307..98b1787 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -166,6 +166,7 @@ static const struct vk_device_extension_table lvp_device_extensions_supported = .EXT_image_robustness = true, .EXT_index_type_uint8 = true, .EXT_inline_uniform_block = true, + .EXT_memory_budget = true, .EXT_multisampled_render_to_single_sampled = true, .EXT_multi_draw = true, .EXT_non_seamless_cube_map = true, @@ -1171,6 +1172,13 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceProperties2( props->shaderBinaryVersion = 1; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: { + VkPhysicalDeviceMemoryBudgetPropertiesEXT *props = (VkPhysicalDeviceMemoryBudgetPropertiesEXT*)ext; + os_get_total_physical_memory(&props->heapBudget[0]); + os_get_available_system_memory(&props->heapUsage[0]); + props->heapUsage[0] = props->heapBudget[0] - props->heapUsage[0]; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: { VkPhysicalDeviceRobustness2PropertiesEXT *props = (VkPhysicalDeviceRobustness2PropertiesEXT *)ext;