Fix get_data layer argument when texture is TEXTURE_TYPE_2D_ARRAY
This commit is contained in:
parent
f71a794359
commit
d5cb280313
1 changed files with 6 additions and 2 deletions
|
@ -1144,8 +1144,12 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer)
|
||||||
shaders.copy.set_conditional(CopyShaderGLES3::USE_TEXTURE2DARRAY, texture->type == VS::TEXTURE_TYPE_2D_ARRAY);
|
shaders.copy.set_conditional(CopyShaderGLES3::USE_TEXTURE2DARRAY, texture->type == VS::TEXTURE_TYPE_2D_ARRAY);
|
||||||
shaders.copy.bind();
|
shaders.copy.bind();
|
||||||
|
|
||||||
|
float layer;
|
||||||
|
if (texture->type == VS::TEXTURE_TYPE_2D_ARRAY)
|
||||||
|
layer = (float)p_layer;
|
||||||
|
else
|
||||||
// calculate the normalized z coordinate for the layer
|
// calculate the normalized z coordinate for the layer
|
||||||
float layer = (float)p_layer / (float)texture->alloc_depth;
|
layer = (float)p_layer / (float)texture->alloc_depth;
|
||||||
|
|
||||||
shaders.copy.set_uniform(CopyShaderGLES3::LAYER, layer);
|
shaders.copy.set_uniform(CopyShaderGLES3::LAYER, layer);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue