Skip to content

Commit

Permalink
Fix the uniform set creation of multimesh with a invalidated buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
n0tank3sh committed May 5, 2022
1 parent c114823 commit 10209e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions servers/rendering/renderer_rd/storage_rd/mesh_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,9 @@ class MeshStorage : public RendererMeshStorage {
_FORCE_INLINE_ RID multimesh_get_3d_uniform_set(RID p_multimesh, RID p_shader, uint32_t p_set) const {
MultiMesh *multimesh = multimesh_owner.get_or_null(p_multimesh);
if (!multimesh->uniform_set_3d.is_valid()) {
if (!multimesh->buffer.is_valid()) {
return RID();
}
Vector<RD::Uniform> uniforms;
RD::Uniform u;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
Expand All @@ -630,6 +633,9 @@ class MeshStorage : public RendererMeshStorage {
_FORCE_INLINE_ RID multimesh_get_2d_uniform_set(RID p_multimesh, RID p_shader, uint32_t p_set) const {
MultiMesh *multimesh = multimesh_owner.get_or_null(p_multimesh);
if (!multimesh->uniform_set_2d.is_valid()) {
if (!multimesh->buffer.is_valid()) {
return RID();
}
Vector<RD::Uniform> uniforms;
RD::Uniform u;
u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER;
Expand Down

0 comments on commit 10209e3

Please sign in to comment.