diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-29 01:08:10 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-30 14:42:21 +0300 |
commit | 77f5210f22332b3594fabe08bee5809fc8333dba (patch) | |
tree | 82f8fbba7d762d30363a40eb9d41f0df828d7586 /source/blender/gpu/GPU_element.h | |
parent | dc0c490b7601b4dced13be6a9877f68ee9712736 (diff) |
GPU: Remove GPU_INDEX_U8
This type of indices is not natively supported on modern GPU and
gives warning on some implementation. The memory savings it
provides is also quite minimal and unlikely to be visible on
nowadays hardware.
This remove some uneeded struct members and makes primitive
restart always enabled by default. This can be broken by addons
if they are not careful enough but many other states have this
problem.
Also leverage GL_PRIMITIVE_RESTART_FIXED_INDEX if
ARB_ES3_compatibility is supported. This removes all API calls
to change restart index depending on indices length.
Diffstat (limited to 'source/blender/gpu/GPU_element.h')
-rw-r--r-- | source/blender/gpu/GPU_element.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/source/blender/gpu/GPU_element.h b/source/blender/gpu/GPU_element.h index d1a199f8193..4ac89d2658b 100644 --- a/source/blender/gpu/GPU_element.h +++ b/source/blender/gpu/GPU_element.h @@ -30,10 +30,7 @@ #define GPU_TRACK_INDEX_RANGE 1 -#define GPU_PRIM_RESTART 0xFFFFFFFF - typedef enum { - GPU_INDEX_U8, /* GL has this, Vulkan does not */ GPU_INDEX_U16, GPU_INDEX_U32, } GPUIndexBufType; @@ -43,13 +40,10 @@ typedef struct GPUIndexBuf { #if GPU_TRACK_INDEX_RANGE GPUIndexBufType index_type; uint32_t gl_index_type; - uint min_index; - uint max_index; uint base_index; #endif uint32_t ibo_id; /* 0 indicates not yet sent to VRAM */ void *data; /* non-NULL indicates not yet sent to VRAM */ - bool use_prim_restart; } GPUIndexBuf; void GPU_indexbuf_use(GPUIndexBuf *); @@ -61,12 +55,10 @@ typedef struct GPUIndexBufBuilder { uint index_len; GPUPrimType prim_type; uint *data; - bool use_prim_restart; } GPUIndexBufBuilder; /* supports all primitive types. */ -void GPU_indexbuf_init_ex( - GPUIndexBufBuilder *, GPUPrimType, uint index_len, uint vertex_len, bool use_prim_restart); +void GPU_indexbuf_init_ex(GPUIndexBufBuilder *, GPUPrimType, uint index_len, uint vertex_len); /* supports only GPU_PRIM_POINTS, GPU_PRIM_LINES and GPU_PRIM_TRIS. */ void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len); |