diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-10-02 16:18:35 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-10-02 16:18:42 +0300 |
commit | 5a982b0695e831c963456fe922ff950d03ecf03b (patch) | |
tree | e179aaaca7efe058b9ef9cd2505e0c2f45f45768 /source/blender/gpu/GPU_texture.h | |
parent | 208b3a0472b3fb0b90132f740d8966ac386fd847 (diff) |
GPUTexture: Add GPU_texture_create_single_layer_view
This allows the creation of texture arrays from 1D/2D/Cube texture.
This is useful when the shader expect a texture array but the original
texture isn't.
Diffstat (limited to 'source/blender/gpu/GPU_texture.h')
-rw-r--r-- | source/blender/gpu/GPU_texture.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index 8b54f4c9822..79e5926a9df 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -257,6 +257,13 @@ GPUTexture *GPU_texture_create_view(const char *name, int layer_len, bool cube_as_array); +/** + * Create an alias of the source texture as a texture array with only one layer. + * Works for 1D, 2D and cube-map source texture. + * If \a src is freed, the texture view will continue to be valid. + */ +GPUTexture *GPU_texture_create_single_layer_array_view(const char *name, const GPUTexture *src); + void GPU_texture_update_mipmap(GPUTexture *tex, int miplvl, eGPUDataFormat gpu_data_format, |