Cleanup: GPU: Remove GPU_draw.h and move fluid gpu function to DRW
This commit is contained in:
parent
5f6fb5bb41
commit
486c7b87fb
Notes:
blender-bot
2023-02-14 10:35:28 +01:00
Referenced by commit 201b4051ba
, Fluid: Fix missing WITH_FLUID in draw code
|
@ -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,
|
||||
|
|
|
@ -72,7 +72,6 @@
|
|||
#include "DEG_depsgraph.h"
|
||||
#include "DEG_depsgraph_query.h"
|
||||
|
||||
#include "GPU_draw.h"
|
||||
#include "GPU_texture.h"
|
||||
|
||||
#ifdef WITH_OPENEXR
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
|
||||
#include "BKE_colorband.h"
|
||||
|
||||
#include "GPU_draw.h"
|
||||
#include "GPU_texture.h"
|
||||
|
||||
#ifdef WITH_FLUID
|
||||
|
@ -276,7 +275,7 @@ static GPUTexture *create_flame_texture(FluidDomainSettings *fds, int highres)
|
|||
/** \name Public API
|
||||
* \{ */
|
||||
|
||||
void GPU_free_smoke(FluidModifierData *fmd)
|
||||
void DRW_smoke_free(FluidModifierData *fmd)
|
||||
{
|
||||
if (fmd->type & MOD_FLUID_TYPE_DOMAIN && fmd->domain) {
|
||||
if (fmd->domain->tex_density) {
|
||||
|
@ -316,7 +315,7 @@ void GPU_free_smoke(FluidModifierData *fmd)
|
|||
}
|
||||
}
|
||||
|
||||
void GPU_create_smoke_coba_field(FluidModifierData *fmd)
|
||||
void DRW_smoke_ensure_coba_field(FluidModifierData *fmd)
|
||||
{
|
||||
#ifndef WITH_FLUID
|
||||
UNUSED_VARS(fmd);
|
||||
|
@ -334,7 +333,7 @@ void GPU_create_smoke_coba_field(FluidModifierData *fmd)
|
|||
#endif
|
||||
}
|
||||
|
||||
void GPU_create_smoke(FluidModifierData *fmd, int highres)
|
||||
void DRW_smoke_ensure(FluidModifierData *fmd, int highres)
|
||||
{
|
||||
#ifndef WITH_FLUID
|
||||
UNUSED_VARS(fmd, highres);
|
||||
|
@ -368,7 +367,7 @@ void GPU_create_smoke(FluidModifierData *fmd, int highres)
|
|||
#endif /* WITH_FLUID */
|
||||
}
|
||||
|
||||
void GPU_create_smoke_velocity(FluidModifierData *fmd)
|
||||
void DRW_smoke_ensure_velocity(FluidModifierData *fmd)
|
||||
{
|
||||
#ifndef WITH_FLUID
|
||||
UNUSED_VARS(fmd);
|
||||
|
@ -393,8 +392,8 @@ void GPU_create_smoke_velocity(FluidModifierData *fmd)
|
|||
#endif /* WITH_FLUID */
|
||||
}
|
||||
|
||||
/* TODO Unify with the other GPU_free_smoke. */
|
||||
void GPU_free_smoke_velocity(FluidModifierData *fmd)
|
||||
/* 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) {
|
|
@ -47,7 +47,6 @@
|
|||
#endif
|
||||
|
||||
#include "GPU_buffers.h"
|
||||
#include "GPU_draw.h"
|
||||
#include "GPU_material.h"
|
||||
|
||||
#include "intern/gpu_codegen.h"
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -68,8 +68,6 @@
|
|||
#include "ED_screen.h"
|
||||
#include "ED_uvedit.h"
|
||||
|
||||
#include "GPU_draw.h"
|
||||
|
||||
#include "object_intern.h"
|
||||
|
||||
/* prototypes */
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -74,7 +74,6 @@
|
|||
#include "RNA_access.h"
|
||||
#include "RNA_define.h"
|
||||
|
||||
#include "GPU_draw.h"
|
||||
#include "GPU_immediate.h"
|
||||
#include "GPU_state.h"
|
||||
|
||||
|
|
|
@ -57,8 +57,6 @@
|
|||
|
||||
#include "UI_view2d.h"
|
||||
|
||||
#include "GPU_draw.h"
|
||||
|
||||
#include "paint_intern.h"
|
||||
|
||||
/* Brush Painting for 2D image editor */
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -69,7 +69,6 @@
|
|||
|
||||
#include "DEG_depsgraph.h"
|
||||
|
||||
#include "GPU_draw.h"
|
||||
#include "GPU_immediate.h"
|
||||
#include "GPU_state.h"
|
||||
|
||||
|
|
|
@ -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"};
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "GPU_draw.h"
|
||||
#include "GPU_glew.h"
|
||||
#include "GPU_immediate.h"
|
||||
#include "GPU_select.h"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
#include "../node_shader_util.h"
|
||||
|
||||
#include "GPU_draw.h"
|
||||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_tex_environment_in[] = {
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
#include "../node_shader_util.h"
|
||||
|
||||
#include "GPU_draw.h"
|
||||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_tex_image_in[] = {
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in New Issue