Skip to content

Commit

Permalink
RenderingDevice: Reject creation of textures with no usage
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomShaper committed May 31, 2024
1 parent e7dd6f1 commit 3e58656
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions servers/rendering/rendering_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,8 @@ RID RenderingDevice::texture_create(const TextureFormat &p_format, const Texture

ERR_FAIL_INDEX_V(format.samples, TEXTURE_SAMPLES_MAX, RID());

ERR_FAIL_COND_V_MSG(format.usage_bits == 0, RID(), "No usage bits specified (at least one is needed)");

format.height = format.texture_type != TEXTURE_TYPE_1D && format.texture_type != TEXTURE_TYPE_1D_ARRAY ? format.height : 1;
format.depth = format.texture_type == TEXTURE_TYPE_3D ? format.depth : 1;

Expand Down

0 comments on commit 3e58656

Please sign in to comment.