Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-04-30 17:02:24 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-04-30 17:39:26 +0300
commiteb7188802daf5909351d8a3c01b68303b655c1bc (patch)
tree137c2c43be509c07efa96ba49c63b5632974cceb /source/blender/gpu/intern/gpu_viewport.c
parent41431eacfa1afc66533f5d27cc21dfa58024e26c (diff)
DRW: Remove DRWTextureFormat in favor or GPUTextureFormat.
Because: - Less redundancy. - Better suffixes. Also a few modification to GPU_texture_create_* to simplify the API: - make the format explicit to the texture creation process. - remove the component count as it's specified in the GPUTextureFormat.
Diffstat (limited to 'source/blender/gpu/intern/gpu_viewport.c')
-rw-r--r--source/blender/gpu/intern/gpu_viewport.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c
index dc898c85773..0bf215f31a8 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -291,7 +291,7 @@ double *GPU_viewport_cache_time_get(GPUViewport *viewport)
* Try to find a texture coresponding to params into the texture pool.
* If no texture was found, create one and add it to the pool.
*/
-GPUTexture *GPU_viewport_texture_pool_query(GPUViewport *viewport, void *engine, int width, int height, int channels, int format)
+GPUTexture *GPU_viewport_texture_pool_query(GPUViewport *viewport, void *engine, int width, int height, int format)
{
GPUTexture *tex;
@@ -314,7 +314,7 @@ GPUTexture *GPU_viewport_texture_pool_query(GPUViewport *viewport, void *engine,
}
}
- tex = GPU_texture_create_2D_custom(width, height, channels, format, NULL, NULL);
+ tex = GPU_texture_create_2D(width, height, format, NULL, NULL);
GPU_texture_bind(tex, 0);
/* Doing filtering for depth does not make sense when not doing shadow mapping,
* and enabling texture filtering on integer texture make them unreadable. */
@@ -391,8 +391,8 @@ static void gpu_viewport_default_fb_create(GPUViewport *viewport)
int *size = viewport->size;
bool ok = true;
- dtxl->color = GPU_texture_create_2D(size[0], size[1], NULL, NULL);
- dtxl->depth = GPU_texture_create_depth_with_stencil(size[0], size[1], NULL);
+ dtxl->color = GPU_texture_create_2D(size[0], size[1], GPU_RGBA8, NULL, NULL);
+ dtxl->depth = GPU_texture_create_2D(size[0], size[1], GPU_DEPTH24_STENCIL8, NULL, NULL);
if (!(dtxl->depth && dtxl->color)) {
ok = false;
@@ -436,8 +436,8 @@ static void gpu_viewport_default_multisample_fb_create(GPUViewport *viewport)
int samples = viewport->samples;
bool ok = true;
- dtxl->multisample_color = GPU_texture_create_2D_multisample(size[0], size[1], NULL, samples, NULL);
- dtxl->multisample_depth = GPU_texture_create_depth_with_stencil_multisample(size[0], size[1], samples, NULL);
+ dtxl->multisample_color = GPU_texture_create_2D_multisample(size[0], size[1], GPU_RGBA8, NULL, samples, NULL);
+ dtxl->multisample_depth = GPU_texture_create_2D_multisample(size[0], size[1], GPU_DEPTH24_STENCIL8, NULL, samples, NULL);
if (!(dtxl->multisample_depth && dtxl->multisample_color)) {
ok = false;