From 486c7b87fb06bf6c9e3c15166751d8b987d7f00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 29 Jul 2020 23:21:33 +0200 Subject: Cleanup: GPU: Remove GPU_draw.h and move fluid gpu function to DRW --- source/blender/blenkernel/intern/image_gpu.c | 2 - source/blender/blenkernel/intern/movieclip.c | 1 - source/blender/draw/CMakeLists.txt | 1 + source/blender/draw/engines/eevee/eevee_volumes.c | 5 +- .../blender/draw/engines/overlay/overlay_extra.c | 6 +- .../draw/engines/workbench/workbench_materials.c | 1 - .../draw/engines/workbench/workbench_volume.c | 8 +- source/blender/draw/intern/DRW_render.h | 1 - source/blender/draw/intern/draw_common.h | 11 + source/blender/draw/intern/draw_fluid.c | 417 ++++++++++++++++++++ source/blender/draw/intern/draw_manager_data.c | 1 - source/blender/editors/object/object_bake.c | 2 - source/blender/editors/object/object_bake_api.c | 2 - source/blender/editors/object/object_remesh.c | 1 - source/blender/editors/sculpt_paint/paint_cursor.c | 1 - source/blender/editors/sculpt_paint/paint_image.c | 1 - .../blender/editors/sculpt_paint/paint_image_2d.c | 2 - .../editors/sculpt_paint/paint_image_proj.c | 2 - source/blender/editors/sculpt_paint/sculpt_cloth.c | 1 - .../sculpt_paint/sculpt_multiplane_scrape.c | 1 - source/blender/editors/space_image/image_ops.c | 1 - source/blender/editors/space_image/image_undo.c | 2 - source/blender/editors/space_view3d/view3d_draw.c | 1 - source/blender/gpu/CMakeLists.txt | 2 - source/blender/gpu/GPU_draw.h | 48 --- source/blender/gpu/intern/gpu_framebuffer.cc | 1 - source/blender/gpu/intern/gpu_select_pick.c | 1 - source/blender/gpu/intern/gpu_texture.cc | 1 - source/blender/gpu/intern/gpu_texture_fluid.c | 418 --------------------- source/blender/makesrna/intern/rna_image.c | 1 - source/blender/makesrna/intern/rna_userdef.c | 1 - .../shader/nodes/node_shader_tex_environment.c | 2 - .../nodes/shader/nodes/node_shader_tex_image.c | 2 - source/blender/windowmanager/intern/wm_draw.c | 1 - source/blender/windowmanager/intern/wm_init_exit.c | 1 - 35 files changed, 436 insertions(+), 514 deletions(-) create mode 100644 source/blender/draw/intern/draw_fluid.c delete mode 100644 source/blender/gpu/GPU_draw.h delete mode 100644 source/blender/gpu/intern/gpu_texture_fluid.c diff --git a/source/blender/blenkernel/intern/image_gpu.c b/source/blender/blenkernel/intern/image_gpu.c index b02b6e1453c..6999051d77b 100644 --- a/source/blender/blenkernel/intern/image_gpu.c +++ b/source/blender/blenkernel/intern/image_gpu.c @@ -729,7 +729,6 @@ static void gpu_texture_update_from_ibuf( * quicker than fully updating the texture for high resolution images. */ void BKE_image_update_gputexture(Image *ima, ImageUser *iuser, int x, int y, int w, int h) { -#ifndef GPU_STANDALONE ImBuf *ibuf = BKE_image_acquire_ibuf(ima, iuser, NULL); ImageTile *tile = BKE_image_get_tile_from_iuser(ima, iuser); @@ -751,7 +750,6 @@ void BKE_image_update_gputexture(Image *ima, ImageUser *iuser, int x, int y, int } BKE_image_release_ibuf(ima, ibuf, NULL); -#endif } /* these two functions are called on entering and exiting texture paint mode, diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index e21e0a7d510..5b4dbc66cc2 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -72,7 +72,6 @@ #include "DEG_depsgraph.h" #include "DEG_depsgraph_query.h" -#include "GPU_draw.h" #include "GPU_texture.h" #ifdef WITH_OPENEXR diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt index cfcd4e0c65a..c942e12020d 100644 --- a/source/blender/draw/CMakeLists.txt +++ b/source/blender/draw/CMakeLists.txt @@ -64,6 +64,7 @@ set(SRC intern/draw_color_management.c intern/draw_common.c intern/draw_debug.c + intern/draw_fluid.c intern/draw_hair.c intern/draw_instance_data.c intern/draw_manager.c diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c index 6d964806894..2ed1416c429 100644 --- a/source/blender/draw/engines/eevee/eevee_volumes.c +++ b/source/blender/draw/engines/eevee/eevee_volumes.c @@ -44,7 +44,6 @@ #include "DEG_depsgraph_query.h" -#include "GPU_draw.h" #include "GPU_extensions.h" #include "GPU_material.h" #include "GPU_texture.h" @@ -504,7 +503,7 @@ static bool eevee_volume_object_mesh_init(Scene *scene, #endif if (fds->fluid && (fds->type == FLUID_DOMAIN_TYPE_GAS) /* && show_smoke */) { - GPU_create_smoke(fmd, fds->flags & FLUID_DOMAIN_USE_NOISE); + DRW_smoke_ensure(fmd, fds->flags & FLUID_DOMAIN_USE_NOISE); BLI_addtail(&e_data.smoke_domains, BLI_genericNodeN(fmd)); } @@ -836,7 +835,7 @@ void EEVEE_volumes_free_smoke_textures(void) /* Free Smoke Textures after rendering */ LISTBASE_FOREACH (LinkData *, link, &e_data.smoke_domains) { FluidModifierData *fmd = (FluidModifierData *)link->data; - GPU_free_smoke(fmd); + DRW_smoke_free(fmd); } BLI_freelistN(&e_data.smoke_domains); } diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c index 94e88c61b78..1e766b3cc39 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.c +++ b/source/blender/draw/engines/overlay/overlay_extra.c @@ -53,8 +53,6 @@ #include "ED_view3d.h" -#include "GPU_draw.h" - #include "overlay_private.h" #include "draw_common.h" @@ -1422,7 +1420,7 @@ static void OVERLAY_volume_extra(OVERLAY_ExtraCallBuffers *cb, line_count /= fds->res[axis]; } - GPU_create_smoke_velocity(fmd); + DRW_smoke_ensure_velocity(fmd); GPUShader *sh = OVERLAY_shader_volume_velocity(use_needle); DRWShadingGroup *grp = DRW_shgroup_create(sh, data->psl->extra_ps[0]); @@ -1452,7 +1450,7 @@ static void OVERLAY_volume_free_smoke_textures(OVERLAY_Data *data) LinkData *link; while ((link = BLI_pophead(&data->stl->pd->smoke_domains))) { FluidModifierData *fmd = (FluidModifierData *)link->data; - GPU_free_smoke_velocity(fmd); + DRW_smoke_free_velocity(fmd); MEM_freeN(link); } } diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c index b59e20e9df3..824c3dc5ff1 100644 --- a/source/blender/draw/engines/workbench/workbench_materials.c +++ b/source/blender/draw/engines/workbench/workbench_materials.c @@ -33,7 +33,6 @@ #include "DNA_mesh_types.h" #include "DNA_node_types.h" -#include "GPU_draw.h" #include "GPU_uniformbuffer.h" #include "ED_uvedit.h" diff --git a/source/blender/draw/engines/workbench/workbench_volume.c b/source/blender/draw/engines/workbench/workbench_volume.c index 20d231a14a0..d3c4d51dbd4 100644 --- a/source/blender/draw/engines/workbench/workbench_volume.c +++ b/source/blender/draw/engines/workbench/workbench_volume.c @@ -38,8 +38,6 @@ #include "BKE_volume.h" #include "BKE_volume_render.h" -#include "GPU_draw.h" - void workbench_volume_engine_init(WORKBENCH_Data *vedata) { WORKBENCH_TextureList *txl = vedata->txl; @@ -79,10 +77,10 @@ static void workbench_volume_modifier_cache_populate(WORKBENCH_Data *vedata, wpd->volumes_do = true; if (fds->use_coba) { - GPU_create_smoke_coba_field(fmd); + DRW_smoke_ensure_coba_field(fmd); } else { - GPU_create_smoke(fmd, fds->flags & FLUID_DOMAIN_USE_NOISE); + DRW_smoke_ensure(fmd, fds->flags & FLUID_DOMAIN_USE_NOISE); } if ((!fds->use_coba && (fds->tex_density == NULL && fds->tex_color == NULL)) || @@ -290,7 +288,7 @@ void workbench_volume_draw_finish(WORKBENCH_Data *vedata) * all viewport in a redraw at least. */ LISTBASE_FOREACH (LinkData *, link, &wpd->smoke_domains) { FluidModifierData *fmd = (FluidModifierData *)link->data; - GPU_free_smoke(fmd); + DRW_smoke_free(fmd); } BLI_freelistN(&wpd->smoke_domains); } diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index 84a2a5f7fda..7a889d9399e 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -45,7 +45,6 @@ #include "DNA_scene_types.h" #include "DNA_world_types.h" -#include "GPU_draw.h" #include "GPU_framebuffer.h" #include "GPU_primitive.h" #include "GPU_shader.h" diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h index 81c0e97a1a8..6017cee0674 100644 --- a/source/blender/draw/intern/draw_common.h +++ b/source/blender/draw/intern/draw_common.h @@ -27,6 +27,7 @@ struct DRWPass; struct DRWShadingGroup; struct GPUMaterial; struct ModifierData; +struct FluidModifierData; struct Object; struct ParticleSystem; struct ViewLayer; @@ -188,6 +189,16 @@ void DRW_hair_init(void); void DRW_hair_update(void); void DRW_hair_free(void); +/* draw_fluid.c */ + +/* Fluid simulation. */ +void DRW_smoke_ensure(struct FluidModifierData *fmd, int highres); +void DRW_smoke_ensure_coba_field(struct FluidModifierData *fmd); +void DRW_smoke_ensure_velocity(struct FluidModifierData *fmd); + +void DRW_smoke_free(struct FluidModifierData *fmd); +void DRW_smoke_free_velocity(struct FluidModifierData *fmd); + /* draw_common.c */ struct DRW_Global { /** If needed, contains all global/Theme colors diff --git a/source/blender/draw/intern/draw_fluid.c b/source/blender/draw/intern/draw_fluid.c new file mode 100644 index 00000000000..2d82ed37c95 --- /dev/null +++ b/source/blender/draw/intern/draw_fluid.c @@ -0,0 +1,417 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2005 Blender Foundation. + * All rights reserved. + */ + +/** \file + * \ingroup gpu + * + * GPU fluid drawing functions. + */ + +#include + +#include "BLI_math.h" +#include "BLI_utildefines.h" + +#include "DNA_fluid_types.h" +#include "DNA_modifier_types.h" + +#include "MEM_guardedalloc.h" + +#include "BKE_colorband.h" + +#include "GPU_texture.h" + +#ifdef WITH_FLUID +# include "manta_fluid_API.h" +#endif + +/* -------------------------------------------------------------------- */ +/** \name Private API + * \{ */ + +#ifdef WITH_FLUID + +enum { + TFUNC_FLAME_SPECTRUM = 0, + TFUNC_COLOR_RAMP = 1, +}; + +# define TFUNC_WIDTH 256 + +static void create_flame_spectrum_texture(float *data) +{ +# define FIRE_THRESH 7 +# define MAX_FIRE_ALPHA 0.06f +# define FULL_ON_FIRE 100 + + float *spec_pixels = (float *)MEM_mallocN(TFUNC_WIDTH * 4 * 16 * 16 * sizeof(float), + "spec_pixels"); + + blackbody_temperature_to_rgb_table(data, TFUNC_WIDTH, 1500, 3000); + + for (int i = 0; i < 16; i++) { + for (int j = 0; j < 16; j++) { + for (int k = 0; k < TFUNC_WIDTH; k++) { + int index = (j * TFUNC_WIDTH * 16 + i * TFUNC_WIDTH + k) * 4; + if (k >= FIRE_THRESH) { + spec_pixels[index] = (data[k * 4]); + spec_pixels[index + 1] = (data[k * 4 + 1]); + spec_pixels[index + 2] = (data[k * 4 + 2]); + spec_pixels[index + 3] = MAX_FIRE_ALPHA * + ((k > FULL_ON_FIRE) ? + 1.0f : + (k - FIRE_THRESH) / ((float)FULL_ON_FIRE - FIRE_THRESH)); + } + else { + zero_v4(&spec_pixels[index]); + } + } + } + } + + memcpy(data, spec_pixels, sizeof(float) * 4 * TFUNC_WIDTH); + + MEM_freeN(spec_pixels); + +# undef FIRE_THRESH +# undef MAX_FIRE_ALPHA +# undef FULL_ON_FIRE +} + +static void create_color_ramp(const struct ColorBand *coba, float *data) +{ + for (int i = 0; i < TFUNC_WIDTH; i++) { + BKE_colorband_evaluate(coba, (float)i / TFUNC_WIDTH, &data[i * 4]); + straight_to_premul_v4(&data[i * 4]); + } +} + +static GPUTexture *create_transfer_function(int type, const struct ColorBand *coba) +{ + float *data = (float *)MEM_mallocN(sizeof(float) * 4 * TFUNC_WIDTH, __func__); + + switch (type) { + case TFUNC_FLAME_SPECTRUM: + create_flame_spectrum_texture(data); + break; + case TFUNC_COLOR_RAMP: + create_color_ramp(coba, data); + break; + } + + GPUTexture *tex = GPU_texture_create_1d(TFUNC_WIDTH, GPU_SRGB8_A8, data, NULL); + + MEM_freeN(data); + + return tex; +} + +static void swizzle_texture_channel_single(GPUTexture *tex) +{ + /* Swizzle texture channels so that we get useful RGBA values when sampling + * a texture with fewer channels, e.g. when using density as color. */ + GPU_texture_bind(tex, 0); + GPU_texture_swizzle_set(tex, "rrr1"); + GPU_texture_unbind(tex); +} + +static GPUTexture *create_field_texture(FluidDomainSettings *fds) +{ + float *field = NULL; + + switch (fds->coba_field) { + case FLUID_DOMAIN_FIELD_DENSITY: + field = manta_smoke_get_density(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_HEAT: + field = manta_smoke_get_heat(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_FUEL: + field = manta_smoke_get_fuel(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_REACT: + field = manta_smoke_get_react(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_FLAME: + field = manta_smoke_get_flame(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_VELOCITY_X: + field = manta_get_velocity_x(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_VELOCITY_Y: + field = manta_get_velocity_y(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_VELOCITY_Z: + field = manta_get_velocity_z(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_COLOR_R: + field = manta_smoke_get_color_r(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_COLOR_G: + field = manta_smoke_get_color_g(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_COLOR_B: + field = manta_smoke_get_color_b(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_FORCE_X: + field = manta_get_force_x(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_FORCE_Y: + field = manta_get_force_y(fds->fluid); + break; + case FLUID_DOMAIN_FIELD_FORCE_Z: + field = manta_get_force_z(fds->fluid); + break; + default: + return NULL; + } + + GPUTexture *tex = GPU_texture_create_nD( + UNPACK3(fds->res), 3, field, GPU_R8, GPU_DATA_FLOAT, 0, true, NULL); + + swizzle_texture_channel_single(tex); + return tex; +} + +static GPUTexture *create_density_texture(FluidDomainSettings *fds, int highres) +{ + int *dim = (highres) ? fds->res_noise : fds->res; + + float *data; + if (highres) { + data = manta_noise_get_density(fds->fluid); + } + else { + data = manta_smoke_get_density(fds->fluid); + } + + GPUTexture *tex = GPU_texture_create_nD( + UNPACK3(dim), 3, data, GPU_R8, GPU_DATA_FLOAT, 0, true, NULL); + + swizzle_texture_channel_single(tex); + + return tex; +} + +static GPUTexture *create_color_texture(FluidDomainSettings *fds, int highres) +{ + const bool has_color = (highres) ? manta_noise_has_colors(fds->fluid) : + manta_smoke_has_colors(fds->fluid); + + if (!has_color) { + return NULL; + } + + int cell_count = (highres) ? manta_noise_get_cells(fds->fluid) : fds->total_cells; + int *dim = (highres) ? fds->res_noise : fds->res; + float *data = (float *)MEM_callocN(sizeof(float) * cell_count * 4, "smokeColorTexture"); + + if (data == NULL) { + return NULL; + } + + if (highres) { + manta_noise_get_rgba(fds->fluid, data, 0); + } + else { + manta_smoke_get_rgba(fds->fluid, data, 0); + } + + GPUTexture *tex = GPU_texture_create_nD( + dim[0], dim[1], dim[2], 3, data, GPU_RGBA8, GPU_DATA_FLOAT, 0, true, NULL); + + MEM_freeN(data); + + return tex; +} + +static GPUTexture *create_flame_texture(FluidDomainSettings *fds, int highres) +{ + float *source = NULL; + const bool has_fuel = (highres) ? manta_noise_has_fuel(fds->fluid) : + manta_smoke_has_fuel(fds->fluid); + int *dim = (highres) ? fds->res_noise : fds->res; + + if (!has_fuel) { + return NULL; + } + + if (highres) { + source = manta_noise_get_flame(fds->fluid); + } + else { + source = manta_smoke_get_flame(fds->fluid); + } + + GPUTexture *tex = GPU_texture_create_nD( + dim[0], dim[1], dim[2], 3, source, GPU_R8, GPU_DATA_FLOAT, 0, true, NULL); + + swizzle_texture_channel_single(tex); + + return tex; +} + +#endif /* WITH_FLUID */ + +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Public API + * \{ */ + +void DRW_smoke_free(FluidModifierData *fmd) +{ + if (fmd->type & MOD_FLUID_TYPE_DOMAIN && fmd->domain) { + if (fmd->domain->tex_density) { + GPU_texture_free(fmd->domain->tex_density); + fmd->domain->tex_density = NULL; + } + + if (fmd->domain->tex_color) { + GPU_texture_free(fmd->domain->tex_color); + fmd->domain->tex_color = NULL; + } + + if (fmd->domain->tex_shadow) { + GPU_texture_free(fmd->domain->tex_shadow); + fmd->domain->tex_shadow = NULL; + } + + if (fmd->domain->tex_flame) { + GPU_texture_free(fmd->domain->tex_flame); + fmd->domain->tex_flame = NULL; + } + + if (fmd->domain->tex_flame_coba) { + GPU_texture_free(fmd->domain->tex_flame_coba); + fmd->domain->tex_flame_coba = NULL; + } + + if (fmd->domain->tex_coba) { + GPU_texture_free(fmd->domain->tex_coba); + fmd->domain->tex_coba = NULL; + } + + if (fmd->domain->tex_field) { + GPU_texture_free(fmd->domain->tex_field); + fmd->domain->tex_field = NULL; + } + } +} + +void DRW_smoke_ensure_coba_field(FluidModifierData *fmd) +{ +#ifndef WITH_FLUID + UNUSED_VARS(fmd); +#else + if (fmd->type & MOD_FLUID_TYPE_DOMAIN) { + FluidDomainSettings *fds = fmd->domain; + + if (!fds->tex_field) { + fds->tex_field = create_field_texture(fds); + } + if (!fds->tex_coba) { + fds->tex_coba = create_transfer_function(TFUNC_COLOR_RAMP, fds->coba); + } + } +#endif +} + +void DRW_smoke_ensure(FluidModifierData *fmd, int highres) +{ +#ifndef WITH_FLUID + UNUSED_VARS(fmd, highres); +#else + if (fmd->type & MOD_FLUID_TYPE_DOMAIN) { + FluidDomainSettings *fds = fmd->domain; + + if (!fds->tex_density) { + fds->tex_density = create_density_texture(fds, highres); + } + if (!fds->tex_color) { + fds->tex_color = create_color_texture(fds, highres); + } + if (!fds->tex_flame) { + fds->tex_flame = create_flame_texture(fds, highres); + } + if (!fds->tex_flame_coba && fds->tex_flame) { + fds->tex_flame_coba = create_transfer_function(TFUNC_FLAME_SPECTRUM, NULL); + } + if (!fds->tex_shadow) { + fds->tex_shadow = GPU_texture_create_nD(UNPACK3(fds->res), + 3, + manta_smoke_get_shadow(fds->fluid), + GPU_R8, + GPU_DATA_FLOAT, + 0, + true, + NULL); + } + } +#endif /* WITH_FLUID */ +} + +void DRW_smoke_ensure_velocity(FluidModifierData *fmd) +{ +#ifndef WITH_FLUID + UNUSED_VARS(fmd); +#else + if (fmd->type & MOD_FLUID_TYPE_DOMAIN) { + FluidDomainSettings *fds = fmd->domain; + + const float *vel_x = manta_get_velocity_x(fds->fluid); + const float *vel_y = manta_get_velocity_y(fds->fluid); + const float *vel_z = manta_get_velocity_z(fds->fluid); + + if (ELEM(NULL, vel_x, vel_y, vel_z)) { + return; + } + + if (!fds->tex_velocity_x) { + fds->tex_velocity_x = GPU_texture_create_3d(UNPACK3(fds->res), GPU_R16F, vel_x, NULL); + fds->tex_velocity_y = GPU_texture_create_3d(UNPACK3(fds->res), GPU_R16F, vel_y, NULL); + fds->tex_velocity_z = GPU_texture_create_3d(UNPACK3(fds->res), GPU_R16F, vel_z, NULL); + } + } +#endif /* WITH_FLUID */ +} + +/* TODO Unify with the other DRW_smoke_free. */ +void DRW_smoke_free_velocity(FluidModifierData *fmd) +{ + if (fmd->type & MOD_FLUID_TYPE_DOMAIN && fmd->domain) { + if (fmd->domain->tex_velocity_x) { + GPU_texture_free(fmd->domain->tex_velocity_x); + } + + if (fmd->domain->tex_velocity_y) { + GPU_texture_free(fmd->domain->tex_velocity_y); + } + + if (fmd->domain->tex_velocity_z) { + GPU_texture_free(fmd->domain->tex_velocity_z); + } + + fmd->domain->tex_velocity_x = NULL; + fmd->domain->tex_velocity_y = NULL; + fmd->domain->tex_velocity_z = NULL; + } +} + +/** \} */ diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index dc41f34e0ea..3184d6155d2 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -47,7 +47,6 @@ #endif #include "GPU_buffers.h" -#include "GPU_draw.h" #include "GPU_material.h" #include "intern/gpu_codegen.h" diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index d67bd54bd69..ae1aae27b7f 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -60,8 +60,6 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" -#include "GPU_draw.h" /* BKE_image_free_gputextures */ - #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index 7b122cd7b93..926a47b1ec8 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -68,8 +68,6 @@ #include "ED_screen.h" #include "ED_uvedit.h" -#include "GPU_draw.h" - #include "object_intern.h" /* prototypes */ diff --git a/source/blender/editors/object/object_remesh.c b/source/blender/editors/object/object_remesh.c index 8981851394d..28f58a34814 100644 --- a/source/blender/editors/object/object_remesh.c +++ b/source/blender/editors/object/object_remesh.c @@ -72,7 +72,6 @@ #include "RNA_define.h" #include "RNA_enum_types.h" -#include "GPU_draw.h" #include "GPU_immediate.h" #include "GPU_immediate_util.h" #include "GPU_matrix.h" diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index d0082769575..da39fbcf0ce 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -56,7 +56,6 @@ #include "DEG_depsgraph.h" -#include "GPU_draw.h" #include "GPU_immediate.h" #include "GPU_immediate_util.h" #include "GPU_matrix.h" diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 4a1153e0ca1..34c9cac67c8 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -74,7 +74,6 @@ #include "RNA_access.h" #include "RNA_define.h" -#include "GPU_draw.h" #include "GPU_immediate.h" #include "GPU_state.h" diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index 0bd6a00cf47..6d588d1450b 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -57,8 +57,6 @@ #include "UI_view2d.h" -#include "GPU_draw.h" - #include "paint_intern.h" /* Brush Painting for 2D image editor */ diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index b7df628b2ff..5991032536b 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -100,8 +100,6 @@ #include "RNA_define.h" #include "RNA_enum_types.h" -#include "GPU_draw.h" - #include "IMB_colormanagement.h" //#include "bmesh_tools.h" diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.c b/source/blender/editors/sculpt_paint/sculpt_cloth.c index 91293b78dae..d91d9ba8438 100644 --- a/source/blender/editors/sculpt_paint/sculpt_cloth.c +++ b/source/blender/editors/sculpt_paint/sculpt_cloth.c @@ -85,7 +85,6 @@ #include "RNA_access.h" #include "RNA_define.h" -#include "GPU_draw.h" #include "GPU_immediate.h" #include "GPU_immediate_util.h" #include "GPU_matrix.h" diff --git a/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c b/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c index b52036d753c..bc3f8537289 100644 --- a/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c +++ b/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c @@ -47,7 +47,6 @@ #include "paint_intern.h" #include "sculpt_intern.h" -#include "GPU_draw.h" #include "GPU_immediate.h" #include "GPU_immediate_util.h" #include "GPU_matrix.h" diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 705b28adc4f..d05fe215840 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -69,7 +69,6 @@ #include "DEG_depsgraph.h" -#include "GPU_draw.h" #include "GPU_immediate.h" #include "GPU_state.h" diff --git a/source/blender/editors/space_image/image_undo.c b/source/blender/editors/space_image/image_undo.c index b34f0e8613f..27b84307f7d 100644 --- a/source/blender/editors/space_image/image_undo.c +++ b/source/blender/editors/space_image/image_undo.c @@ -60,8 +60,6 @@ #include "ED_undo.h" #include "ED_util.h" -#include "GPU_draw.h" - #include "WM_api.h" static CLG_LogRef LOG = {"ed.image.undo"}; diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index fa1568c61f2..411b18717bf 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -75,7 +75,6 @@ #include "GPU_batch.h" #include "GPU_batch_presets.h" -#include "GPU_draw.h" #include "GPU_framebuffer.h" #include "GPU_immediate.h" #include "GPU_immediate_util.h" diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 5e980f07c38..c333a83360a 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -80,7 +80,6 @@ set(SRC intern/gpu_shader_interface.c intern/gpu_state.cc intern/gpu_texture.cc - intern/gpu_texture_fluid.c intern/gpu_uniformbuffer.cc intern/gpu_vertex_buffer.cc intern/gpu_vertex_format.cc @@ -94,7 +93,6 @@ set(SRC GPU_common.h GPU_context.h GPU_debug.h - GPU_draw.h GPU_element.h GPU_extensions.h GPU_framebuffer.h diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h deleted file mode 100644 index 3a22588e703..00000000000 --- a/source/blender/gpu/GPU_draw.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2005 Blender Foundation. - * All rights reserved. - */ - -/** \file - * \ingroup gpu - */ - -#ifndef __GPU_DRAW_H__ -#define __GPU_DRAW_H__ - -#include "BLI_utildefines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct FluidModifierData; - -/* Fluid simulation. */ -void GPU_create_smoke(struct FluidModifierData *fmd, int highres); -void GPU_create_smoke_coba_field(struct FluidModifierData *fmd); -void GPU_create_smoke_velocity(struct FluidModifierData *fmd); - -/* Image updates and free. */ -void GPU_free_smoke(struct FluidModifierData *fmd); -void GPU_free_smoke_velocity(struct FluidModifierData *fmd); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index 8864b8daf6a..35432b0a8f9 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -28,7 +28,6 @@ #include "BLI_utildefines.h" #include "GPU_batch.h" -#include "GPU_draw.h" #include "GPU_extensions.h" #include "GPU_framebuffer.h" #include "GPU_shader.h" diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c index c6d8545527c..3025b5d66da 100644 --- a/source/blender/gpu/intern/gpu_select_pick.c +++ b/source/blender/gpu/intern/gpu_select_pick.c @@ -27,7 +27,6 @@ #include #include -#include "GPU_draw.h" #include "GPU_glew.h" #include "GPU_immediate.h" #include "GPU_select.h" diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc index 7237cbd8999..8a3a8a382f8 100644 --- a/source/blender/gpu/intern/gpu_texture.cc +++ b/source/blender/gpu/intern/gpu_texture.cc @@ -37,7 +37,6 @@ #include "GPU_batch.h" #include "GPU_context.h" #include "GPU_debug.h" -#include "GPU_draw.h" #include "GPU_extensions.h" #include "GPU_framebuffer.h" #include "GPU_glew.h" diff --git a/source/blender/gpu/intern/gpu_texture_fluid.c b/source/blender/gpu/intern/gpu_texture_fluid.c deleted file mode 100644 index ecbf46d0ad9..00000000000 --- a/source/blender/gpu/intern/gpu_texture_fluid.c +++ /dev/null @@ -1,418 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2005 Blender Foundation. - * All rights reserved. - */ - -/** \file - * \ingroup gpu - * - * GPU fluid drawing functions. - */ - -#include - -#include "BLI_math.h" -#include "BLI_utildefines.h" - -#include "DNA_fluid_types.h" -#include "DNA_modifier_types.h" - -#include "MEM_guardedalloc.h" - -#include "BKE_colorband.h" - -#include "GPU_draw.h" -#include "GPU_texture.h" - -#ifdef WITH_FLUID -# include "manta_fluid_API.h" -#endif - -/* -------------------------------------------------------------------- */ -/** \name Private API - * \{ */ - -#ifdef WITH_FLUID - -enum { - TFUNC_FLAME_SPECTRUM = 0, - TFUNC_COLOR_RAMP = 1, -}; - -# define TFUNC_WIDTH 256 - -static void create_flame_spectrum_texture(float *data) -{ -# define FIRE_THRESH 7 -# define MAX_FIRE_ALPHA 0.06f -# define FULL_ON_FIRE 100 - - float *spec_pixels = (float *)MEM_mallocN(TFUNC_WIDTH * 4 * 16 * 16 * sizeof(float), - "spec_pixels"); - - blackbody_temperature_to_rgb_table(data, TFUNC_WIDTH, 1500, 3000); - - for (int i = 0; i < 16; i++) { - for (int j = 0; j < 16; j++) { - for (int k = 0; k < TFUNC_WIDTH; k++) { - int index = (j * TFUNC_WIDTH * 16 + i * TFUNC_WIDTH + k) * 4; - if (k >= FIRE_THRESH) { - spec_pixels[index] = (data[k * 4]); - spec_pixels[index + 1] = (data[k * 4 + 1]); - spec_pixels[index + 2] = (data[k * 4 + 2]); - spec_pixels[index + 3] = MAX_FIRE_ALPHA * - ((k > FULL_ON_FIRE) ? - 1.0f : - (k - FIRE_THRESH) / ((float)FULL_ON_FIRE - FIRE_THRESH)); - } - else { - zero_v4(&spec_pixels[index]); - } - } - } - } - - memcpy(data, spec_pixels, sizeof(float) * 4 * TFUNC_WIDTH); - - MEM_freeN(spec_pixels); - -# undef FIRE_THRESH -# undef MAX_FIRE_ALPHA -# undef FULL_ON_FIRE -} - -static void create_color_ramp(const struct ColorBand *coba, float *data) -{ - for (int i = 0; i < TFUNC_WIDTH; i++) { - BKE_colorband_evaluate(coba, (float)i / TFUNC_WIDTH, &data[i * 4]); - straight_to_premul_v4(&data[i * 4]); - } -} - -static GPUTexture *create_transfer_function(int type, const struct ColorBand *coba) -{ - float *data = (float *)MEM_mallocN(sizeof(float) * 4 * TFUNC_WIDTH, __func__); - - switch (type) { - case TFUNC_FLAME_SPECTRUM: - create_flame_spectrum_texture(data); - break; - case TFUNC_COLOR_RAMP: - create_color_ramp(coba, data); - break; - } - - GPUTexture *tex = GPU_texture_create_1d(TFUNC_WIDTH, GPU_SRGB8_A8, data, NULL); - - MEM_freeN(data); - - return tex; -} - -static void swizzle_texture_channel_single(GPUTexture *tex) -{ - /* Swizzle texture channels so that we get useful RGBA values when sampling - * a texture with fewer channels, e.g. when using density as color. */ - GPU_texture_bind(tex, 0); - GPU_texture_swizzle_set(tex, "rrr1"); - GPU_texture_unbind(tex); -} - -static GPUTexture *create_field_texture(FluidDomainSettings *fds) -{ - float *field = NULL; - - switch (fds->coba_field) { - case FLUID_DOMAIN_FIELD_DENSITY: - field = manta_smoke_get_density(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_HEAT: - field = manta_smoke_get_heat(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_FUEL: - field = manta_smoke_get_fuel(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_REACT: - field = manta_smoke_get_react(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_FLAME: - field = manta_smoke_get_flame(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_VELOCITY_X: - field = manta_get_velocity_x(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_VELOCITY_Y: - field = manta_get_velocity_y(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_VELOCITY_Z: - field = manta_get_velocity_z(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_COLOR_R: - field = manta_smoke_get_color_r(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_COLOR_G: - field = manta_smoke_get_color_g(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_COLOR_B: - field = manta_smoke_get_color_b(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_FORCE_X: - field = manta_get_force_x(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_FORCE_Y: - field = manta_get_force_y(fds->fluid); - break; - case FLUID_DOMAIN_FIELD_FORCE_Z: - field = manta_get_force_z(fds->fluid); - break; - default: - return NULL; - } - - GPUTexture *tex = GPU_texture_create_nD( - UNPACK3(fds->res), 3, field, GPU_R8, GPU_DATA_FLOAT, 0, true, NULL); - - swizzle_texture_channel_single(tex); - return tex; -} - -static GPUTexture *create_density_texture(FluidDomainSettings *fds, int highres) -{ - int *dim = (highres) ? fds->res_noise : fds->res; - - float *data; - if (highres) { - data = manta_noise_get_density(fds->fluid); - } - else { - data = manta_smoke_get_density(fds->fluid); - } - - GPUTexture *tex = GPU_texture_create_nD( - UNPACK3(dim), 3, data, GPU_R8, GPU_DATA_FLOAT, 0, true, NULL); - - swizzle_texture_channel_single(tex); - - return tex; -} - -static GPUTexture *create_color_texture(FluidDomainSettings *fds, int highres) -{ - const bool has_color = (highres) ? manta_noise_has_colors(fds->fluid) : - manta_smoke_has_colors(fds->fluid); - - if (!has_color) { - return NULL; - } - - int cell_count = (highres) ? manta_noise_get_cells(fds->fluid) : fds->total_cells; - int *dim = (highres) ? fds->res_noise : fds->res; - float *data = (float *)MEM_callocN(sizeof(float) * cell_count * 4, "smokeColorTexture"); - - if (data == NULL) { - return NULL; - } - - if (highres) { - manta_noise_get_rgba(fds->fluid, data, 0); - } - else { - manta_smoke_get_rgba(fds->fluid, data, 0); - } - - GPUTexture *tex = GPU_texture_create_nD( - dim[0], dim[1], dim[2], 3, data, GPU_RGBA8, GPU_DATA_FLOAT, 0, true, NULL); - - MEM_freeN(data); - - return tex; -} - -static GPUTexture *create_flame_texture(FluidDomainSettings *fds, int highres) -{ - float *source = NULL; - const bool has_fuel = (highres) ? manta_noise_has_fuel(fds->fluid) : - manta_smoke_has_fuel(fds->fluid); - int *dim = (highres) ? fds->res_noise : fds->res; - - if (!has_fuel) { - return NULL; - } - - if (highres) { - source = manta_noise_get_flame(fds->fluid); - } - else { - source = manta_smoke_get_flame(fds->fluid); - } - - GPUTexture *tex = GPU_texture_create_nD( - dim[0], dim[1], dim[2], 3, source, GPU_R8, GPU_DATA_FLOAT, 0, true, NULL); - - swizzle_texture_channel_single(tex); - - return tex; -} - -#endif /* WITH_FLUID */ - -/** \} */ - -/* -------------------------------------------------------------------- */ -/** \name Public API - * \{ */ - -void GPU_free_smoke(FluidModifierData *fmd) -{ - if (fmd->type & MOD_FLUID_TYPE_DOMAIN && fmd->domain) { - if (fmd->domain->tex_density) { - GPU_texture_free(fmd->domain->tex_density); - fmd->domain->tex_density = NULL; - } - - if (fmd->domain->tex_color) { - GPU_texture_free(fmd->domain->tex_color); - fmd->domain->tex_color = NULL; - } - - if (fmd->domain->tex_shadow) { - GPU_texture_free(fmd->domain->tex_shadow); - fmd->domain->tex_shadow = NULL; - } - - if (fmd->domain->tex_flame) { - GPU_texture_free(fmd->domain->tex_flame); - fmd->domain->tex_flame = NULL; - } - - if (fmd->domain->tex_flame_coba) { - GPU_texture_free(fmd->domain->tex_flame_coba); - fmd->domain->tex_flame_coba = NULL; - } - - if (fmd->domain->tex_coba) { - GPU_texture_free(fmd->domain->tex_coba); - fmd->domain->tex_coba = NULL; - } - - if (fmd->domain->tex_field) { - GPU_texture_free(fmd->domain->tex_field); - fmd->domain->tex_field = NULL; - } - } -} - -void GPU_create_smoke_coba_field(FluidModifierData *fmd) -{ -#ifndef WITH_FLUID - UNUSED_VARS(fmd); -#else - if (fmd->type & MOD_FLUID_TYPE_DOMAIN) { - FluidDomainSettings *fds = fmd->domain; - - if (!fds->tex_field) { - fds->tex_field = create_field_texture(fds); - } - if (!fds->tex_coba) { - fds->tex_coba = create_transfer_function(TFUNC_COLOR_RAMP, fds->coba); - } - } -#endif -} - -void GPU_create_smoke(FluidModifierData *fmd, int highres) -{ -#ifndef WITH_FLUID - UNUSED_VARS(fmd, highres); -#else - if (fmd->type & MOD_FLUID_TYPE_DOMAIN) { - FluidDomainSettings *fds = fmd->domain; - - if (!fds->tex_density) { - fds->tex_density = create_density_texture(fds, highres); - } - if (!fds->tex_color) { - fds->tex_color = create_color_texture(fds, highres); - } - if (!fds->tex_flame) { - fds->tex_flame = create_flame_texture(fds, highres); - } - if (!fds->tex_flame_coba && fds->tex_flame) { - fds->tex_flame_coba = create_transfer_function(TFUNC_FLAME_SPECTRUM, NULL); - } - if (!fds->tex_shadow) { - fds->tex_shadow = GPU_texture_create_nD(UNPACK3(fds->res), - 3, - manta_smoke_get_shadow(fds->fluid), - GPU_R8, - GPU_DATA_FLOAT, - 0, - true, - NULL); - } - } -#endif /* WITH_FLUID */ -} - -void GPU_create_smoke_velocity(FluidModifierData *fmd) -{ -#ifndef WITH_FLUID - UNUSED_VARS(fmd); -#else - if (fmd->type & MOD_FLUID_TYPE_DOMAIN) { - FluidDomainSettings *fds = fmd->domain; - - const float *vel_x = manta_get_velocity_x(fds->fluid); - const float *vel_y = manta_get_velocity_y(fds->fluid); - const float *vel_z = manta_get_velocity_z(fds->fluid); - - if (ELEM(NULL, vel_x, vel_y, vel_z)) { - return; - } - - if (!fds->tex_velocity_x) { - fds->tex_velocity_x = GPU_texture_create_3d(UNPACK3(fds->res), GPU_R16F, vel_x, NULL); - fds->tex_velocity_y = GPU_texture_create_3d(UNPACK3(fds->res), GPU_R16F, vel_y, NULL); - fds->tex_velocity_z = GPU_texture_create_3d(UNPACK3(fds->res), GPU_R16F, vel_z, NULL); - } - } -#endif /* WITH_FLUID */ -} - -/* TODO Unify with the other GPU_free_smoke. */ -void GPU_free_smoke_velocity(FluidModifierData *fmd) -{ - if (fmd->type & MOD_FLUID_TYPE_DOMAIN && fmd->domain) { - if (fmd->domain->tex_velocity_x) { - GPU_texture_free(fmd->domain->tex_velocity_x); - } - - if (fmd->domain->tex_velocity_y) { - GPU_texture_free(fmd->domain->tex_velocity_y); - } - - if (fmd->domain->tex_velocity_z) { - GPU_texture_free(fmd->domain->tex_velocity_z); - } - - fmd->domain->tex_velocity_x = NULL; - fmd->domain->tex_velocity_y = NULL; - fmd->domain->tex_velocity_z = NULL; - } -} - -/** \} */ diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 23f9f70e470..1c43815d3a2 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -67,7 +67,6 @@ static const EnumPropertyItem image_source_items[] = { # include "BKE_global.h" -# include "GPU_draw.h" # include "GPU_texture.h" # include "IMB_imbuf.h" diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 490bcb88f22..6ce6098d0c3 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -188,7 +188,6 @@ static const EnumPropertyItem rna_enum_userdef_viewport_aa_items[] = { # include "DEG_depsgraph.h" -# include "GPU_draw.h" # include "GPU_extensions.h" # include "GPU_select.h" # include "GPU_texture.h" diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c index 771b7d5920a..38e79ebe94d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c @@ -19,8 +19,6 @@ #include "../node_shader_util.h" -#include "GPU_draw.h" - /* **************** OUTPUT ******************** */ static bNodeSocketTemplate sh_node_tex_environment_in[] = { diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.c b/source/blender/nodes/shader/nodes/node_shader_tex_image.c index ff2ecf785d7..1a78d2f5bf2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c @@ -19,8 +19,6 @@ #include "../node_shader_util.h" -#include "GPU_draw.h" - /* **************** OUTPUT ******************** */ static bNodeSocketTemplate sh_node_tex_image_in[] = { diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 43364c84ec6..4db6eb6af91 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -51,7 +51,6 @@ #include "ED_screen.h" #include "ED_view3d.h" -#include "GPU_draw.h" #include "GPU_framebuffer.h" #include "GPU_immediate.h" #include "GPU_state.h" diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index a15ca81ddef..0390bc1e4ef 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -121,7 +121,6 @@ #include "UI_interface.h" #include "UI_resources.h" -#include "GPU_draw.h" #include "GPU_init_exit.h" #include "GPU_material.h" -- cgit v1.2.3