From 16dd382f0648b1486a2a9d1c68ef3baa768ba7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Thu, 17 Mar 2022 14:39:03 +0100 Subject: GPUTexture: Add Cube view as 2D array This is useful to read/write to the textures directly using compute shaders and imageLoad/Store. --- source/blender/gpu/GPU_texture.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/gpu/GPU_texture.h') diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index 4dbcd84672c..37edc2abeb2 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -230,6 +230,7 @@ GPUTexture *GPU_texture_create_error(int dimension, bool array); * Create an alias of the source texture data. * If \a src is freed, the texture view will continue to be valid. * If \a mip_start or \a mip_len is bigger than available mips they will be clamped. + * If \a cube_as_array is true, then the texture cube (array) becomes a 2D array texture. * TODO(@fclem): Target conversion is not implemented yet. */ GPUTexture *GPU_texture_create_view(const char *name, @@ -238,7 +239,8 @@ GPUTexture *GPU_texture_create_view(const char *name, int mip_start, int mip_len, int layer_start, - int layer_len); + int layer_len, + bool cube_as_array); void GPU_texture_update_mipmap(GPUTexture *tex, int miplvl, -- cgit v1.2.3