mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 11:30:21 +01:00
radv/meta: move initializing emulated astc to radv_device_init_meta()
For consistency with emulated etc2. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32809>
This commit is contained in:
parent
422d64d7ee
commit
853c99260b
3 changed files with 11 additions and 30 deletions
|
|
@ -445,7 +445,6 @@ radv_device_init_meta(struct radv_device *device)
|
|||
};
|
||||
|
||||
bool loaded_cache = radv_load_meta_pipeline(device);
|
||||
bool on_demand = !loaded_cache;
|
||||
|
||||
result = vk_meta_device_init(&device->vk, &device->meta_state.device);
|
||||
if (result != VK_SUCCESS)
|
||||
|
|
@ -463,9 +462,12 @@ radv_device_init_meta(struct radv_device *device)
|
|||
vk_texcompress_etc2_init(&device->vk, &device->meta_state.etc_decode);
|
||||
}
|
||||
|
||||
result = radv_device_init_meta_astc_decode_state(device, on_demand);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
if (pdev->emulate_astc) {
|
||||
result = vk_texcompress_astc_init(&device->vk, &device->meta_state.alloc, device->meta_state.cache,
|
||||
&device->meta_state.astc_decode);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
}
|
||||
|
||||
if (device->vk.enabled_extensions.KHR_acceleration_structure) {
|
||||
if (device->vk.enabled_features.nullDescriptor) {
|
||||
|
|
@ -492,7 +494,11 @@ radv_device_finish_meta(struct radv_device *device)
|
|||
if (pdev->emulate_etc2)
|
||||
vk_texcompress_etc2_finish(&device->vk, &device->meta_state.etc_decode);
|
||||
|
||||
radv_device_finish_meta_astc_decode_state(device);
|
||||
if (pdev->emulate_astc) {
|
||||
if (device->meta_state.astc_decode)
|
||||
vk_texcompress_astc_finish(&device->vk, &device->meta_state.alloc, device->meta_state.astc_decode);
|
||||
}
|
||||
|
||||
radv_device_finish_accel_struct_build_state(device);
|
||||
|
||||
radv_store_meta_pipeline(device);
|
||||
|
|
|
|||
|
|
@ -109,9 +109,6 @@ VkResult radv_device_init_null_accel_struct(struct radv_device *device);
|
|||
VkResult radv_device_init_accel_struct_build_state(struct radv_device *device);
|
||||
void radv_device_finish_accel_struct_build_state(struct radv_device *device);
|
||||
|
||||
VkResult radv_device_init_meta_astc_decode_state(struct radv_device *device, bool on_demand);
|
||||
void radv_device_finish_meta_astc_decode_state(struct radv_device *device);
|
||||
|
||||
void radv_meta_save(struct radv_meta_saved_state *saved_state, struct radv_cmd_buffer *cmd_buffer, uint32_t flags);
|
||||
|
||||
void radv_meta_restore(const struct radv_meta_saved_state *state, struct radv_cmd_buffer *cmd_buffer);
|
||||
|
|
|
|||
|
|
@ -11,28 +11,6 @@
|
|||
#include "vk_common_entrypoints.h"
|
||||
#include "vk_format.h"
|
||||
|
||||
VkResult
|
||||
radv_device_init_meta_astc_decode_state(struct radv_device *device, bool on_demand)
|
||||
{
|
||||
const struct radv_physical_device *pdev = radv_device_physical(device);
|
||||
struct radv_meta_state *state = &device->meta_state;
|
||||
|
||||
if (!pdev->emulate_astc)
|
||||
return VK_SUCCESS;
|
||||
|
||||
return vk_texcompress_astc_init(&device->vk, &state->alloc, state->cache, &state->astc_decode);
|
||||
}
|
||||
|
||||
void
|
||||
radv_device_finish_meta_astc_decode_state(struct radv_device *device)
|
||||
{
|
||||
struct radv_meta_state *state = &device->meta_state;
|
||||
struct vk_texcompress_astc_state *astc = state->astc_decode;
|
||||
|
||||
if (astc)
|
||||
vk_texcompress_astc_finish(&device->vk, &state->alloc, astc);
|
||||
}
|
||||
|
||||
static void
|
||||
decode_astc(struct radv_cmd_buffer *cmd_buffer, struct radv_image_view *src_iview, struct radv_image_view *dst_iview,
|
||||
VkImageLayout layout, const VkOffset3D *offset, const VkExtent3D *extent)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue