diff options
author | Ton Roosendaal <ton@blender.org> | 2018-04-19 18:34:44 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-19 18:35:25 +0300 |
commit | 51b796ff1528c52cc8b4079fab1003671652a4d9 (patch) | |
tree | 0dfc2d2dabe5e77959264f5b6667897569290a41 /source/blender/gpu/GPU_buffers.h | |
parent | 785e8a636a293941a4295e669cb5aeecfafae039 (diff) |
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
Diffstat (limited to 'source/blender/gpu/GPU_buffers.h')
-rw-r--r-- | source/blender/gpu/GPU_buffers.h | 188 |
1 files changed, 7 insertions, 181 deletions
diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h index 0d8a7a45ee9..f496c92f283 100644 --- a/source/blender/gpu/GPU_buffers.h +++ b/source/blender/gpu/GPU_buffers.h @@ -32,192 +32,19 @@ #ifndef __GPU_BUFFERS_H__ #define __GPU_BUFFERS_H__ -#ifdef DEBUG -/* #define DEBUG_VBO(X) printf(X)*/ -# define DEBUG_VBO(X) -#else -# define DEBUG_VBO(X) -#endif - #include <stddef.h> struct BMesh; struct CCGElem; struct CCGKey; struct DMFlagMat; -struct DerivedMesh; -struct GSet; -struct GPUVertPointLink; -struct GPUDrawObject; struct GridCommonGPUBuffer; -struct PBVH; -struct Gwn_Batch; +struct GSet; +struct MLoop; +struct MLoopTri; +struct MPoly; struct MVert; - -typedef struct GPUBuffer { - size_t size; /* in bytes */ - unsigned int id; /* used with vertex buffer objects */ -} GPUBuffer; - -typedef struct GPUBufferMaterial { - /* range of points used for this material */ - unsigned int start; - unsigned int totelements; - unsigned int totloops; - unsigned int *polys; /* array of polygons for this material */ - unsigned int totpolys; /* total polygons in polys */ - unsigned int totvisiblepolys; /* total visible polygons */ - - /* original material index */ - short mat_nr; -} GPUBufferMaterial; - -void GPU_buffer_material_finalize(struct GPUDrawObject *gdo, GPUBufferMaterial *matinfo, int totmat); - -/* meshes are split up by material since changing materials requires - * GL state changes that can't occur in the middle of drawing an - * array. - * - * some simplifying assumptions are made: - * - all quads are treated as two triangles. - * - no vertex sharing is used; each triangle gets its own copy of the - * vertices it uses (this makes it easy to deal with a vertex used - * by faces with different properties, such as smooth/solid shading, - * different MCols, etc.) - * - * to avoid confusion between the original MVert vertices and the - * arrays of OpenGL vertices, the latter are referred to here and in - * the source as `points'. similarly, the OpenGL triangles generated - * for MFaces are referred to as triangles rather than faces. - */ -typedef struct GPUDrawObject { - GPUBuffer *points; - GPUBuffer *normals; - GPUBuffer *uv; - GPUBuffer *uv_tex; - GPUBuffer *colors; - GPUBuffer *edges; - GPUBuffer *uvedges; - GPUBuffer *triangles; /* triangle index buffer */ - - /* for each original vertex, the list of related points */ - struct GPUVertPointLink *vert_points; - - /* see: USE_GPU_POINT_LINK define */ -#if 0 - /* storage for the vert_points lists */ - struct GPUVertPointLink *vert_points_mem; - int vert_points_usage; -#endif - - int colType; - - GPUBufferMaterial *materials; - int totmaterial; - - unsigned int tot_triangle_point; - unsigned int tot_loose_point; - /* different than total loops since ngons get tesselated still */ - unsigned int tot_loop_verts; - - /* caches of the original DerivedMesh values */ - unsigned int totvert; - unsigned int totedge; - - unsigned int loose_edge_offset; - unsigned int tot_loose_edge_drawn; - unsigned int tot_edge_drawn; - - /* for subsurf, offset where drawing of interior edges starts */ - unsigned int interior_offset; - unsigned int totinterior; -} GPUDrawObject; - -/* currently unused */ -// #define USE_GPU_POINT_LINK - -typedef struct GPUVertPointLink { -#ifdef USE_GPU_POINT_LINK - struct GPUVertPointLink *next; -#endif - /* -1 means uninitialized */ - int point_index; -} GPUVertPointLink; - - - -/* used for GLSL materials */ -typedef struct GPUAttrib { - int index; - int info_index; - int size; - int type; -} GPUAttrib; - -void GPU_global_buffer_pool_free(void); -void GPU_global_buffer_pool_free_unused(void); - -GPUBuffer *GPU_buffer_alloc(size_t size); -void GPU_buffer_free(GPUBuffer *buffer); - -void GPU_drawobject_free(struct DerivedMesh *dm); - -/* flag that controls data type to fill buffer with, a modifier will prepare. */ -typedef enum { - GPU_BUFFER_VERTEX = 0, - GPU_BUFFER_NORMAL, - GPU_BUFFER_COLOR, - GPU_BUFFER_UV, - GPU_BUFFER_UV_TEXPAINT, - GPU_BUFFER_EDGE, - GPU_BUFFER_UVEDGE, - GPU_BUFFER_TRIANGLES -} GPUBufferType; - -typedef enum { - GPU_BINDING_ARRAY = 0, - GPU_BINDING_INDEX = 1, -} GPUBindingType; - -typedef enum { - GPU_ATTR_INFO_SRGB = (1 << 0), -} GPUAttrInfo; - -/* called before drawing */ -void GPU_vertex_setup(struct DerivedMesh *dm); -void GPU_normal_setup(struct DerivedMesh *dm); -void GPU_uv_setup(struct DerivedMesh *dm); -void GPU_texpaint_uv_setup(struct DerivedMesh *dm); -/* colType is the cddata MCol type to use! */ -void GPU_color_setup(struct DerivedMesh *dm, int colType); -void GPU_buffer_bind_as_color(GPUBuffer *buffer); -void GPU_edge_setup(struct DerivedMesh *dm); /* does not mix with other data */ -void GPU_uvedge_setup(struct DerivedMesh *dm); - -void GPU_triangle_setup(struct DerivedMesh *dm); - -int GPU_attrib_element_size(GPUAttrib data[], int numdata); -void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numdata, int element_size); - -void GPU_buffer_bind(GPUBuffer *buffer, GPUBindingType binding); -void GPU_buffer_unbind(GPUBuffer *buffer, GPUBindingType binding); - -/* can't lock more than one buffer at once */ -void *GPU_buffer_lock(GPUBuffer *buffer, GPUBindingType binding); -void *GPU_buffer_lock_stream(GPUBuffer *buffer, GPUBindingType binding); -void GPU_buffer_unlock(GPUBuffer *buffer, GPUBindingType binding); - -/* switch color rendering on=1/off=0 */ -void GPU_color_switch(int mode); - -/* used for drawing edges */ -void GPU_buffer_draw_elements(GPUBuffer *elements, unsigned int mode, int start, int count); - -/* called after drawing */ -void GPU_buffers_unbind(void); - -/* only unbind interleaved data */ -void GPU_interleaved_attrib_unbind(void); +struct PBVH; /* Buffers for non-DerivedMesh drawing */ typedef struct GPU_PBVH_Buffers GPU_PBVH_Buffers; @@ -264,9 +91,6 @@ void GPU_pbvh_grid_buffers_update( const int update_flags); /* draw */ -void GPU_pbvh_buffers_draw( - GPU_PBVH_Buffers *buffers, DMSetMaterial setMaterial, - bool wireframe, bool fast); struct Gwn_Batch *GPU_pbvh_buffers_batch_get(GPU_PBVH_Buffers *buffers, bool fast); /* debug PBVH draw */ @@ -278,4 +102,6 @@ bool GPU_pbvh_buffers_mask_changed(GPU_PBVH_Buffers *buffers, bool show_mask); void GPU_pbvh_buffers_free(GPU_PBVH_Buffers *buffers); void GPU_pbvh_multires_buffers_free(struct GridCommonGPUBuffer **grid_common_gpu_buffer); +void GPU_pbvh_fix_linking(void); + #endif |