Skip to content

Commit

Permalink
Merge pull request godotengine#98767 from jadeharley2/master
Browse files Browse the repository at this point in the history
Fix inability to set TextureLayeredRD as `TEXTURE_TYPE_CUBE` or `TEXTURE_TYPE_CUBE_ARRAY`
  • Loading branch information
Repiteo committed Nov 11, 2024
2 parents c8ff788 + a4d1d36 commit 7464510
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scene/resources/texture_rd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void TextureLayeredRD::_set_texture_rd_rid(RID p_texture_rd_rid) {

RS::TextureLayeredType rs_layer_type;
RD::TextureFormat tf = RD::get_singleton()->texture_get_format(p_texture_rd_rid);
ERR_FAIL_COND(tf.texture_type != RD::TEXTURE_TYPE_2D_ARRAY);
ERR_FAIL_COND(tf.texture_type != RD::TEXTURE_TYPE_2D_ARRAY && tf.texture_type != RD::TEXTURE_TYPE_CUBE && tf.texture_type != RD::TEXTURE_TYPE_CUBE_ARRAY);
ERR_FAIL_COND(tf.depth > 1);
switch (layer_type) {
case LAYERED_TYPE_2D_ARRAY: {
Expand Down
4 changes: 3 additions & 1 deletion servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,9 @@ void TextureStorage::texture_rd_initialize(RID p_texture, const RID &p_rd_textur
ERR_FAIL_COND(tf.array_layers != 1);
texture.type = TextureStorage::TYPE_2D;
} break;
case RD::TEXTURE_TYPE_2D_ARRAY: {
case RD::TEXTURE_TYPE_2D_ARRAY:
case RD::TEXTURE_TYPE_CUBE:
case RD::TEXTURE_TYPE_CUBE_ARRAY: {
// RenderingDevice doesn't distinguish between Array textures and Cube textures
// this condition covers TextureArrays, TextureCube, and TextureCubeArray.
ERR_FAIL_COND(tf.array_layers == 1);
Expand Down

0 comments on commit 7464510

Please sign in to comment.