diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-05 18:33:56 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-05 18:49:14 +0300 |
commit | ab95cdaba970a30127d804bd1e66ad25ab021ec1 (patch) | |
tree | d0da883e11f81253cb7b3e5a75288ca69598e437 /source/blender/gpu/intern/gpu_framebuffer.cc | |
parent | bac4606937514405641659d91a30bf3e6832cdf7 (diff) |
GPUTexture: Change texture creation API
This is to modernize the API:
- Add meaningful name to all textures (except DRW textures).
- Remove unused err_out argument: only used for offscreen python.
- Add mipmap count to creation functions for future changes.
- Clarify the data usage in creation functions.
This is a cleanup commit, there is no functional change.
# Conflicts:
# source/blender/gpu/GPU_texture.h
Diffstat (limited to 'source/blender/gpu/intern/gpu_framebuffer.cc')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index 7fb9d787125..a74f48d15ce 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -577,13 +577,14 @@ GPUOffScreen *GPU_offscreen_create( width = max_ii(1, width); ofs->color = GPU_texture_create_2d( - width, height, (high_bitdepth) ? GPU_RGBA16F : GPU_RGBA8, NULL, err_out); + "ofs_color", width, height, 1, (high_bitdepth) ? GPU_RGBA16F : GPU_RGBA8, NULL); if (depth) { - ofs->depth = GPU_texture_create_2d(width, height, GPU_DEPTH24_STENCIL8, NULL, err_out); + ofs->depth = GPU_texture_create_2d("ofs_depth", width, height, 1, GPU_DEPTH24_STENCIL8, NULL); } if ((depth && !ofs->depth) || !ofs->color) { + BLI_snprintf(err_out, 256, "GPUTexture: Texture allocation failed."); GPU_offscreen_free(ofs); return NULL; } |