From eb7188802daf5909351d8a3c01b68303b655c1bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 30 Apr 2018 16:02:24 +0200 Subject: 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. --- source/blender/gpu/intern/gpu_viewport.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/gpu/intern/gpu_viewport.c') 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; -- cgit v1.2.3