Merge pull request #94656 from BlueCube3310/cubemap-layers-retrieve-fix

RenderingDevice: Fix getting cubemap layer data
This commit is contained in:
Rémi Verschelde 2024-07-23 15:55:53 +02:00
commit e4f7b69470
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 0 additions and 3 deletions

View File

@ -1585,9 +1585,6 @@ Vector<uint8_t> RenderingDevice::texture_get_data(RID p_texture, uint32_t p_laye
"Texture requires the `RenderingDevice.TEXTURE_USAGE_CAN_COPY_FROM_BIT` to be set to be retrieved.");
uint32_t layer_count = tex->layers;
if (tex->type == TEXTURE_TYPE_CUBE || tex->type == TEXTURE_TYPE_CUBE_ARRAY) {
layer_count *= 6;
}
ERR_FAIL_COND_V(p_layer >= layer_count, Vector<uint8_t>());
if ((tex->usage_flags & TEXTURE_USAGE_CPU_READ_BIT)) {