Remove superfluous locking in RID owners in Vulkan RD

This commit is contained in:
Pedro J. Estébanez 2023-11-30 13:05:29 +01:00
parent 4964d9a083
commit 72bf8dfecf
1 changed files with 13 additions and 13 deletions

View File

@ -159,7 +159,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
RID owner; RID owner;
}; };
RID_Owner<Texture, true> texture_owner; RID_Owner<Texture> texture_owner;
uint32_t texture_upload_region_size_px = 0; uint32_t texture_upload_region_size_px = 0;
Vector<uint8_t> _texture_get_data_from_image(Texture *tex, VkImage p_image, VmaAllocation p_allocation, uint32_t p_layer, bool p_2d = false); Vector<uint8_t> _texture_get_data_from_image(Texture *tex, VkImage p_image, VmaAllocation p_allocation, uint32_t p_layer, bool p_2d = false);
@ -409,7 +409,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
uint32_t view_count; uint32_t view_count;
}; };
RID_Owner<Framebuffer, true> framebuffer_owner; RID_Owner<Framebuffer> framebuffer_owner;
/***********************/ /***********************/
/**** VERTEX BUFFER ****/ /**** VERTEX BUFFER ****/
@ -424,7 +424,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
// This mapping is done here internally, and it's not // This mapping is done here internally, and it's not
// exposed. // exposed.
RID_Owner<Buffer, true> vertex_buffer_owner; RID_Owner<Buffer> vertex_buffer_owner;
struct VertexDescriptionKey { struct VertexDescriptionKey {
Vector<VertexAttribute> vertex_formats; Vector<VertexAttribute> vertex_formats;
@ -506,7 +506,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
Vector<VkDeviceSize> offsets; Vector<VkDeviceSize> offsets;
}; };
RID_Owner<VertexArray, true> vertex_array_owner; RID_Owner<VertexArray> vertex_array_owner;
struct IndexBuffer : public Buffer { struct IndexBuffer : public Buffer {
uint32_t max_index = 0; // Used for validation. uint32_t max_index = 0; // Used for validation.
@ -515,7 +515,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
bool supports_restart_indices = false; bool supports_restart_indices = false;
}; };
RID_Owner<IndexBuffer, true> index_buffer_owner; RID_Owner<IndexBuffer> index_buffer_owner;
struct IndexArray { struct IndexArray {
uint32_t max_index = 0; // Remember the maximum index here too, for validation. uint32_t max_index = 0; // Remember the maximum index here too, for validation.
@ -526,7 +526,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
bool supports_restart_indices = false; bool supports_restart_indices = false;
}; };
RID_Owner<IndexArray, true> index_array_owner; RID_Owner<IndexArray> index_array_owner;
/****************/ /****************/
/**** SHADER ****/ /**** SHADER ****/
@ -649,7 +649,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
String _shader_uniform_debug(RID p_shader, int p_set = -1); String _shader_uniform_debug(RID p_shader, int p_set = -1);
RID_Owner<Shader, true> shader_owner; RID_Owner<Shader> shader_owner;
/******************/ /******************/
/**** UNIFORMS ****/ /**** UNIFORMS ****/
@ -713,8 +713,8 @@ class RenderingDeviceVulkan : public RenderingDevice {
DescriptorPool *_descriptor_pool_allocate(const DescriptorPoolKey &p_key); DescriptorPool *_descriptor_pool_allocate(const DescriptorPoolKey &p_key);
void _descriptor_pool_free(const DescriptorPoolKey &p_key, DescriptorPool *p_pool); void _descriptor_pool_free(const DescriptorPoolKey &p_key, DescriptorPool *p_pool);
RID_Owner<Buffer, true> uniform_buffer_owner; RID_Owner<Buffer> uniform_buffer_owner;
RID_Owner<Buffer, true> storage_buffer_owner; RID_Owner<Buffer> storage_buffer_owner;
// Texture buffer needs a view. // Texture buffer needs a view.
struct TextureBuffer { struct TextureBuffer {
@ -722,7 +722,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
VkBufferView view = VK_NULL_HANDLE; VkBufferView view = VK_NULL_HANDLE;
}; };
RID_Owner<TextureBuffer, true> texture_buffer_owner; RID_Owner<TextureBuffer> texture_buffer_owner;
// This structure contains the descriptor set. They _need_ to be allocated // This structure contains the descriptor set. They _need_ to be allocated
// for a shader (and will be erased when this shader is erased), but should // for a shader (and will be erased when this shader is erased), but should
@ -752,7 +752,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
void *invalidated_callback_userdata = nullptr; void *invalidated_callback_userdata = nullptr;
}; };
RID_Owner<UniformSet, true> uniform_set_owner; RID_Owner<UniformSet> uniform_set_owner;
/*******************/ /*******************/
/**** PIPELINES ****/ /**** PIPELINES ****/
@ -791,7 +791,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
uint32_t push_constant_stages_mask = 0; uint32_t push_constant_stages_mask = 0;
}; };
RID_Owner<RenderPipeline, true> render_pipeline_owner; RID_Owner<RenderPipeline> render_pipeline_owner;
struct PipelineCacheHeader { struct PipelineCacheHeader {
uint32_t magic; uint32_t magic;
@ -830,7 +830,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
uint32_t local_group_size[3] = { 0, 0, 0 }; uint32_t local_group_size[3] = { 0, 0, 0 };
}; };
RID_Owner<ComputePipeline, true> compute_pipeline_owner; RID_Owner<ComputePipeline> compute_pipeline_owner;
/*******************/ /*******************/
/**** DRAW LIST ****/ /**** DRAW LIST ****/