diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-23 06:15:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-23 06:16:03 +0300 |
commit | 2e4f1b592f7d1b63ec012528997fab64f16c0416 (patch) | |
tree | e53da8d758e3f3454afd27064d2382260653e210 /source/blender/draw | |
parent | 14d947dcadea7c9debe6c8a078a571eba6cb828c (diff) |
Cleanup: use eGPU prefix for GPU enum types
Diffstat (limited to 'source/blender/draw')
13 files changed, 33 insertions, 33 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c index 7cb6492a37c..7c66a32f5fa 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c @@ -114,7 +114,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v int buffer_size[2] = {(int)viewport_size[0] / 2, (int)viewport_size[1] / 2}; - GPUTextureFormat down_format = DRW_state_draw_background() ? GPU_R11F_G11F_B10F : GPU_RGBA16F; + eGPUTextureFormat down_format = DRW_state_draw_background() ? GPU_R11F_G11F_B10F : GPU_RGBA16F; effects->dof_down_near = DRW_texture_pool_query_2D(buffer_size[0], buffer_size[1], down_format, &draw_engine_eevee_type); @@ -131,7 +131,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v }); /* Go full 32bits for rendering and reduce the color artifacts. */ - GPUTextureFormat fb_format = DRW_state_is_image_render() ? GPU_RGBA32F : GPU_RGBA16F; + eGPUTextureFormat fb_format = DRW_state_is_image_render() ? GPU_RGBA32F : GPU_RGBA16F; effects->dof_blur = DRW_texture_pool_query_2D(buffer_size[0] * 2, buffer_size[1], fb_format, &draw_engine_eevee_type); diff --git a/source/blender/draw/engines/eevee/eevee_effects.c b/source/blender/draw/engines/eevee/eevee_effects.c index a707961da63..09f88fb3ee8 100644 --- a/source/blender/draw/engines/eevee/eevee_effects.c +++ b/source/blender/draw/engines/eevee/eevee_effects.c @@ -117,7 +117,7 @@ static void eevee_create_shader_downsample(void) } #define SETUP_BUFFER(tex, fb, fb_color) { \ - GPUTextureFormat format = (DRW_state_is_scene_render()) ? GPU_RGBA32F : GPU_RGBA16F; \ + eGPUTextureFormat format = (DRW_state_is_scene_render()) ? GPU_RGBA32F : GPU_RGBA16F; \ DRW_texture_ensure_fullscreen_2D(&tex, format, DRW_TEX_FILTER | DRW_TEX_MIPMAP); \ GPU_framebuffer_ensure_config(&fb, { \ GPU_ATTACHMENT_TEXTURE(dtxl->depth), \ diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index 483220fde9c..7f6f485644c 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -256,7 +256,7 @@ static void eevee_draw_background(void *vedata) DRW_uniformbuffer_update(sldata->common_ubo, &sldata->common_data); GPU_framebuffer_bind(fbl->main_fb); - GPUFrameBufferBits clear_bits = GPU_DEPTH_BIT; + eGPUFrameBufferBits clear_bits = GPU_DEPTH_BIT; clear_bits |= (DRW_state_draw_background()) ? 0 : GPU_COLOR_BIT; clear_bits |= ((stl->effects->enabled_effects & EFFECT_SSS) != 0) ? GPU_STENCIL_BIT : 0; GPU_framebuffer_clear(fbl->main_fb, clear_bits, clear_col, clear_depth, clear_stencil); diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index 008d458bc6a..3199fc430cf 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -330,7 +330,7 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat static float error_col[3] = {1.0f, 0.0f, 1.0f}; struct GPUMaterial *gpumat = EEVEE_material_world_lightprobe_get(scene, wo); - GPUMaterialStatus status = GPU_material_status(gpumat); + eGPUMaterialStatus status = GPU_material_status(gpumat); switch (status) { case GPU_MAT_SUCCESS: diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index 820ead715d9..af3531e9a6c 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -528,7 +528,7 @@ void EEVEE_lights_cache_shcaster_object_add(EEVEE_ViewLayerData *sldata, Object void EEVEE_lights_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) { EEVEE_LampsInfo *linfo = sldata->lamps; - GPUTextureFormat shadow_pool_format = GPU_R32F; + eGPUTextureFormat shadow_pool_format = GPU_R32F; sldata->common_data.la_num_light = linfo->num_light; diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index f0274eafaeb..6786bf7e911 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -1164,14 +1164,14 @@ static void material_opaque( scene, ma, vedata, false, false, use_ssrefract, use_sss, use_translucency, linfo->shadow_method); - GPUMaterialStatus status_mat_surface = GPU_material_status(*gpumat); + eGPUMaterialStatus status_mat_surface = GPU_material_status(*gpumat); /* Alpha CLipped : Discard pixel from depth pass, then * fail the depth test for shading. */ if (ELEM(ma->blend_method, MA_BM_CLIP, MA_BM_HASHED)) { *gpumat_depth = EEVEE_material_mesh_depth_get(scene, ma, (ma->blend_method == MA_BM_HASHED), false); - GPUMaterialStatus status_mat_depth = GPU_material_status(*gpumat_depth); + eGPUMaterialStatus status_mat_depth = GPU_material_status(*gpumat_depth); if (status_mat_depth != GPU_MAT_SUCCESS) { /* Mixing both flags. If depth shader fails, show it to the user by not using * the surface shader. */ diff --git a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c index a3a11285e5e..440321b583e 100644 --- a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c +++ b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c @@ -159,7 +159,7 @@ int EEVEE_screen_raytrace_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) int tracing_res[2] = {(int)viewport_size[0] / divisor, (int)viewport_size[1] / divisor}; int size_fs[2] = {(int)viewport_size[0], (int)viewport_size[1]}; const bool high_qual_input = true; /* TODO dither low quality input */ - const GPUTextureFormat format = (high_qual_input) ? GPU_RGBA16F : GPU_RGBA8; + const eGPUTextureFormat format = (high_qual_input) ? GPU_RGBA16F : GPU_RGBA8; /* MRT for the shading pass in order to output needed data for the SSR pass. */ effects->ssr_specrough_input = DRW_texture_pool_query_2D(size_fs[0], size_fs[1], format, diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 6bb8c4575b8..25cfaf1e3c6 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -111,7 +111,7 @@ static void GPENCIL_create_framebuffers(void *vedata) GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; /* Go full 32bits for rendering */ - GPUTextureFormat fb_format = DRW_state_is_image_render() ? GPU_RGBA32F : GPU_RGBA16F; + eGPUTextureFormat fb_format = DRW_state_is_image_render() ? GPU_RGBA32F : GPU_RGBA16F; if (DRW_state_is_fbo()) { const float *viewport_size = DRW_viewport_size_get(); diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c index ef401c6a1c1..af6b83679ea 100644 --- a/source/blender/draw/engines/workbench/workbench_deferred.c +++ b/source/blender/draw/engines/workbench/workbench_deferred.c @@ -409,9 +409,9 @@ void workbench_deferred_engine_init(WORKBENCH_Data *vedata) { const float *viewport_size = DRW_viewport_size_get(); const int size[2] = {(int)viewport_size[0], (int)viewport_size[1]}; - const GPUTextureFormat nor_tex_format = NORMAL_ENCODING_ENABLED() ? GPU_RG16 : GPU_RGBA32F; - const GPUTextureFormat comp_tex_format = DRW_state_is_image_render() ? GPU_RGBA16F : GPU_R11F_G11F_B10F; - const GPUTextureFormat id_tex_format = OBJECT_ID_PASS_ENABLED(wpd) ? GPU_R32UI : GPU_R8; + const eGPUTextureFormat nor_tex_format = NORMAL_ENCODING_ENABLED() ? GPU_RG16 : GPU_RGBA32F; + const eGPUTextureFormat comp_tex_format = DRW_state_is_image_render() ? GPU_RGBA16F : GPU_R11F_G11F_B10F; + const eGPUTextureFormat id_tex_format = OBJECT_ID_PASS_ENABLED(wpd) ? GPU_R32UI : GPU_R8; e_data.object_id_tx = NULL; e_data.color_buffer_tx = NULL; diff --git a/source/blender/draw/engines/workbench/workbench_effect_taa.c b/source/blender/draw/engines/workbench/workbench_effect_taa.c index db20c963e54..c4421b98d8c 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_taa.c +++ b/source/blender/draw/engines/workbench/workbench_effect_taa.c @@ -174,7 +174,7 @@ DRWPass *workbench_taa_create_pass(WORKBENCH_Data *vedata, GPUTexture **color_bu int previous_jitter_index = effect_info->jitter_index; { - const GPUTextureFormat hist_buffer_format = DRW_state_is_image_render() ? GPU_RGBA16F : GPU_RGBA8; + const eGPUTextureFormat hist_buffer_format = DRW_state_is_image_render() ? GPU_RGBA16F : GPU_RGBA8; DRW_texture_ensure_fullscreen_2D(&txl->history_buffer_tx, hist_buffer_format, 0); DRW_texture_ensure_fullscreen_2D(&txl->depth_buffer_tx, GPU_DEPTH24_STENCIL8, 0); } diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index 72c55657748..4280359976e 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -200,23 +200,23 @@ typedef enum { /* Textures from DRW_texture_pool_query_* have the options * DRW_TEX_FILTER for color float textures, and no options * for depth textures and integer textures. */ -struct GPUTexture *DRW_texture_pool_query_2D(int w, int h, GPUTextureFormat format, DrawEngineType *engine_type); +struct GPUTexture *DRW_texture_pool_query_2D(int w, int h, eGPUTextureFormat format, DrawEngineType *engine_type); struct GPUTexture *DRW_texture_create_1D( - int w, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels); + int w, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels); struct GPUTexture *DRW_texture_create_2D( - int w, int h, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels); + int w, int h, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels); struct GPUTexture *DRW_texture_create_2D_array( - int w, int h, int d, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels); + int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels); struct GPUTexture *DRW_texture_create_3D( - int w, int h, int d, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels); + int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels); struct GPUTexture *DRW_texture_create_cube( - int w, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels); + int w, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels); void DRW_texture_ensure_fullscreen_2D( - struct GPUTexture **tex, GPUTextureFormat format, DRWTextureFlag flags); + struct GPUTexture **tex, eGPUTextureFormat format, DRWTextureFlag flags); void DRW_texture_ensure_2D( - struct GPUTexture **tex, int w, int h, GPUTextureFormat format, DRWTextureFlag flags); + struct GPUTexture **tex, int w, int h, eGPUTextureFormat format, DRWTextureFlag flags); void DRW_texture_generate_mipmaps(struct GPUTexture *tex); void DRW_texture_free(struct GPUTexture *tex); @@ -255,7 +255,7 @@ struct GPUShader *DRW_shader_create_with_lib( const char *vert, const char *geom, const char *frag, const char *lib, const char *defines); struct GPUShader *DRW_shader_create_with_transform_feedback( const char *vert, const char *geom, const char *defines, - const GPUShaderTFBType prim_type, const char **varying_names, const int varying_count); + const eGPUShaderTFBType prim_type, const char **varying_names, const int varying_count); struct GPUShader *DRW_shader_create_2D(const char *frag, const char *defines); struct GPUShader *DRW_shader_create_3D(const char *frag, const char *defines); struct GPUShader *DRW_shader_create_fullscreen(const char *frag, const char *defines); diff --git a/source/blender/draw/intern/draw_manager_shader.c b/source/blender/draw/intern/draw_manager_shader.c index 437e305646c..79717fc58e4 100644 --- a/source/blender/draw/intern/draw_manager_shader.c +++ b/source/blender/draw/intern/draw_manager_shader.c @@ -363,7 +363,7 @@ GPUShader *DRW_shader_create_with_lib( GPUShader *DRW_shader_create_with_transform_feedback( const char *vert, const char *geom, const char *defines, - const GPUShaderTFBType prim_type, const char **varying_names, const int varying_count) + const eGPUShaderTFBType prim_type, const char **varying_names, const int varying_count) { return GPU_shader_create_ex(vert, datatoc_gpu_shader_depth_only_frag_glsl, diff --git a/source/blender/draw/intern/draw_manager_texture.c b/source/blender/draw/intern/draw_manager_texture.c index 6976b65d6d4..9d70a35d1a4 100644 --- a/source/blender/draw/intern/draw_manager_texture.c +++ b/source/blender/draw/intern/draw_manager_texture.c @@ -30,7 +30,7 @@ #ifndef NDEBUG /* Maybe gpu_texture.c is a better place for this. */ -static bool drw_texture_format_supports_framebuffer(GPUTextureFormat format) +static bool drw_texture_format_supports_framebuffer(eGPUTextureFormat format) { /* Some formats do not work with framebuffers. */ switch (format) { @@ -79,7 +79,7 @@ void drw_texture_set_parameters(GPUTexture *tex, DRWTextureFlag flags) GPU_texture_unbind(tex); } -GPUTexture *DRW_texture_create_1D(int w, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels) +GPUTexture *DRW_texture_create_1D(int w, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels) { GPUTexture *tex = GPU_texture_create_1D(w, format, fpixels, NULL); drw_texture_set_parameters(tex, flags); @@ -87,7 +87,7 @@ GPUTexture *DRW_texture_create_1D(int w, GPUTextureFormat format, DRWTextureFlag return tex; } -GPUTexture *DRW_texture_create_2D(int w, int h, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels) +GPUTexture *DRW_texture_create_2D(int w, int h, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels) { GPUTexture *tex = GPU_texture_create_2D(w, h, format, fpixels, NULL); drw_texture_set_parameters(tex, flags); @@ -96,7 +96,7 @@ GPUTexture *DRW_texture_create_2D(int w, int h, GPUTextureFormat format, DRWText } GPUTexture *DRW_texture_create_2D_array( - int w, int h, int d, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels) + int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels) { GPUTexture *tex = GPU_texture_create_2D_array(w, h, d, format, fpixels, NULL); drw_texture_set_parameters(tex, flags); @@ -105,7 +105,7 @@ GPUTexture *DRW_texture_create_2D_array( } GPUTexture *DRW_texture_create_3D( - int w, int h, int d, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels) + int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels) { GPUTexture *tex = GPU_texture_create_3D(w, h, d, format, fpixels, NULL); drw_texture_set_parameters(tex, flags); @@ -113,7 +113,7 @@ GPUTexture *DRW_texture_create_3D( return tex; } -GPUTexture *DRW_texture_create_cube(int w, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels) +GPUTexture *DRW_texture_create_cube(int w, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels) { GPUTexture *tex = GPU_texture_create_cube(w, format, fpixels, NULL); drw_texture_set_parameters(tex, flags); @@ -121,7 +121,7 @@ GPUTexture *DRW_texture_create_cube(int w, GPUTextureFormat format, DRWTextureFl return tex; } -GPUTexture *DRW_texture_pool_query_2D(int w, int h, GPUTextureFormat format, DrawEngineType *engine_type) +GPUTexture *DRW_texture_pool_query_2D(int w, int h, eGPUTextureFormat format, DrawEngineType *engine_type) { BLI_assert(drw_texture_format_supports_framebuffer(format)); GPUTexture *tex = GPU_viewport_texture_pool_query(DST.viewport, engine_type, w, h, format); @@ -129,7 +129,7 @@ GPUTexture *DRW_texture_pool_query_2D(int w, int h, GPUTextureFormat format, Dra return tex; } -void DRW_texture_ensure_fullscreen_2D(GPUTexture **tex, GPUTextureFormat format, DRWTextureFlag flags) +void DRW_texture_ensure_fullscreen_2D(GPUTexture **tex, eGPUTextureFormat format, DRWTextureFlag flags) { if (*(tex) == NULL) { const float *size = DRW_viewport_size_get(); @@ -137,7 +137,7 @@ void DRW_texture_ensure_fullscreen_2D(GPUTexture **tex, GPUTextureFormat format, } } -void DRW_texture_ensure_2D(GPUTexture **tex, int w, int h, GPUTextureFormat format, DRWTextureFlag flags) +void DRW_texture_ensure_2D(GPUTexture **tex, int w, int h, eGPUTextureFormat format, DRWTextureFlag flags) { if (*(tex) == NULL) { *(tex) = DRW_texture_create_2D(w, h, format, flags, NULL); |