Skip to content

Commit

Permalink
Make RID_Owner<Texture> threadsafe in TextureStorage for gles3
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0ACB committed Feb 11, 2024
1 parent 4e990cd commit 09d2c09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/gles3/storage/texture_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ class TextureStorage : public RendererTextureStorage {
RID_Owner<CanvasTexture, true> canvas_texture_owner;

/* Texture API */

mutable RID_Owner<Texture> texture_owner;
// Textures can be created from threads, so this RID_Owner is thread safe.
mutable RID_Owner<Texture, true> texture_owner;

Ref<Image> _get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool p_force_decompress) const;

Expand Down
2 changes: 1 addition & 1 deletion servers/rendering/renderer_rd/storage_rd/texture_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class TextureStorage : public RendererTextureStorage {
void cleanup();
};

//textures can be created from threads, so this RID_Owner is thread safe
// Textures can be created from threads, so this RID_Owner is thread safe.
mutable RID_Owner<Texture, true> texture_owner;
Texture *get_texture(RID p_rid) { return texture_owner.get_or_null(p_rid); };

Expand Down

0 comments on commit 09d2c09

Please sign in to comment.