Skip to content

Commit

Permalink
Remove superfluous locking in RID owners in Vulkan RD
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomShaper committed Dec 1, 2023
1 parent 4964d9a commit 72bf8df
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions drivers/vulkan/rendering_device_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
RID owner;
};

RID_Owner<Texture, true> texture_owner;
RID_Owner<Texture> texture_owner;
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);
Expand Down Expand Up @@ -409,7 +409,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
uint32_t view_count;
};

RID_Owner<Framebuffer, true> framebuffer_owner;
RID_Owner<Framebuffer> framebuffer_owner;

/***********************/
/**** VERTEX BUFFER ****/
Expand All @@ -424,7 +424,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
// This mapping is done here internally, and it's not
// exposed.

RID_Owner<Buffer, true> vertex_buffer_owner;
RID_Owner<Buffer> vertex_buffer_owner;

struct VertexDescriptionKey {
Vector<VertexAttribute> vertex_formats;
Expand Down Expand Up @@ -506,7 +506,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
Vector<VkDeviceSize> offsets;
};

RID_Owner<VertexArray, true> vertex_array_owner;
RID_Owner<VertexArray> vertex_array_owner;

struct IndexBuffer : public Buffer {
uint32_t max_index = 0; // Used for validation.
Expand All @@ -515,7 +515,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
bool supports_restart_indices = false;
};

RID_Owner<IndexBuffer, true> index_buffer_owner;
RID_Owner<IndexBuffer> index_buffer_owner;

struct IndexArray {
uint32_t max_index = 0; // Remember the maximum index here too, for validation.
Expand All @@ -526,7 +526,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
bool supports_restart_indices = false;
};

RID_Owner<IndexArray, true> index_array_owner;
RID_Owner<IndexArray> index_array_owner;

/****************/
/**** SHADER ****/
Expand Down Expand Up @@ -649,7 +649,7 @@ class RenderingDeviceVulkan : public RenderingDevice {

String _shader_uniform_debug(RID p_shader, int p_set = -1);

RID_Owner<Shader, true> shader_owner;
RID_Owner<Shader> shader_owner;

/******************/
/**** UNIFORMS ****/
Expand Down Expand Up @@ -713,16 +713,16 @@ class RenderingDeviceVulkan : public RenderingDevice {
DescriptorPool *_descriptor_pool_allocate(const DescriptorPoolKey &p_key);
void _descriptor_pool_free(const DescriptorPoolKey &p_key, DescriptorPool *p_pool);

RID_Owner<Buffer, true> uniform_buffer_owner;
RID_Owner<Buffer, true> storage_buffer_owner;
RID_Owner<Buffer> uniform_buffer_owner;
RID_Owner<Buffer> storage_buffer_owner;

// Texture buffer needs a view.
struct TextureBuffer {
Buffer buffer;
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
// for a shader (and will be erased when this shader is erased), but should
Expand Down Expand Up @@ -752,7 +752,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
void *invalidated_callback_userdata = nullptr;
};

RID_Owner<UniformSet, true> uniform_set_owner;
RID_Owner<UniformSet> uniform_set_owner;

/*******************/
/**** PIPELINES ****/
Expand Down Expand Up @@ -791,7 +791,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
uint32_t push_constant_stages_mask = 0;
};

RID_Owner<RenderPipeline, true> render_pipeline_owner;
RID_Owner<RenderPipeline> render_pipeline_owner;

struct PipelineCacheHeader {
uint32_t magic;
Expand Down Expand Up @@ -830,7 +830,7 @@ class RenderingDeviceVulkan : public RenderingDevice {
uint32_t local_group_size[3] = { 0, 0, 0 };
};

RID_Owner<ComputePipeline, true> compute_pipeline_owner;
RID_Owner<ComputePipeline> compute_pipeline_owner;

/*******************/
/**** DRAW LIST ****/
Expand Down

0 comments on commit 72bf8df

Please sign in to comment.