diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-12 20:48:52 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-12 20:48:52 +0300 |
commit | 2e4569abbc6aa19d166ed083c04e046fdc19fce5 (patch) | |
tree | a924894164afd7337e3d272e0e8ef4cedbf49250 /source/blender/gpu | |
parent | fe5efccd8fb6ce2a7e5e858e3f8becf5f98bb087 (diff) |
Fix remaining GL calls/type preventing from building due to recent cleanup
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_common.h | 4 | ||||
-rw-r--r-- | source/blender/gpu/GPU_texture.h | 1 | ||||
-rw-r--r-- | source/blender/gpu/GPU_vertex_buffer.h | 3 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_immediate.cc | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_texture.cc | 6 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_vertex_buffer.cc | 7 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_vertex_buffer_private.hh | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_vertex_format.cc | 2 | ||||
-rw-r--r-- | source/blender/gpu/opengl/gl_vertex_buffer.cc | 5 | ||||
-rw-r--r-- | source/blender/gpu/opengl/gl_vertex_buffer.hh | 2 |
10 files changed, 21 insertions, 13 deletions
diff --git a/source/blender/gpu/GPU_common.h b/source/blender/gpu/GPU_common.h index 8fd1baba2f7..1be74701176 100644 --- a/source/blender/gpu/GPU_common.h +++ b/source/blender/gpu/GPU_common.h @@ -32,10 +32,6 @@ # define TRUST_NO_ONE 1 #endif -#if defined(WITH_OPENGL) -# include <GL/glew.h> -#endif - #include "BLI_sys_types.h" #include <stdbool.h> #include <stdint.h> diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index fafa45fe0fe..99a7c6a5f0c 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -257,7 +257,6 @@ void GPU_texture_mipmap_mode(GPUTexture *tex, bool use_mipmap, bool use_filter); void GPU_texture_wrap_mode(GPUTexture *tex, bool use_repeat, bool use_clamp); void GPU_texture_swizzle_set(GPUTexture *tex, const char swizzle[4]); -int GPU_texture_target(const GPUTexture *tex); int GPU_texture_width(const GPUTexture *tex); int GPU_texture_height(const GPUTexture *tex); int GPU_texture_orig_width(const GPUTexture *tex); diff --git a/source/blender/gpu/GPU_vertex_buffer.h b/source/blender/gpu/GPU_vertex_buffer.h index 2af9929db35..36caee10072 100644 --- a/source/blender/gpu/GPU_vertex_buffer.h +++ b/source/blender/gpu/GPU_vertex_buffer.h @@ -139,6 +139,9 @@ GPUVertBufStatus GPU_vertbuf_get_status(const GPUVertBuf *verts); void GPU_vertbuf_use(GPUVertBuf *); +/* XXX do not use. */ +void GPU_vertbuf_update_sub(GPUVertBuf *verts, uint start, uint len, void *data); + /* Metrics */ uint GPU_vertbuf_get_memory_usage(void); diff --git a/source/blender/gpu/intern/gpu_immediate.cc b/source/blender/gpu/intern/gpu_immediate.cc index 9c3a88e30f0..8d781978857 100644 --- a/source/blender/gpu/intern/gpu_immediate.cc +++ b/source/blender/gpu/intern/gpu_immediate.cc @@ -416,7 +416,7 @@ static void immEndVertex(void) /* and move on to the next vertex */ printf("copying %s from vertex %u to %u\n", a->name, imm->vertex_idx - 1, imm->vertex_idx); #endif - GLubyte *data = imm->vertex_data + a->offset; + uchar *data = imm->vertex_data + a->offset; memcpy(data, data - imm->vertex_format.stride, a->sz); /* TODO: consolidate copy of adjacent attributes */ } diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc index 09dbf04210a..eb6881164b2 100644 --- a/source/blender/gpu/intern/gpu_texture.cc +++ b/source/blender/gpu/intern/gpu_texture.cc @@ -513,12 +513,6 @@ void GPU_texture_ref(GPUTexture *tex) reinterpret_cast<Texture *>(tex)->refcount++; } -/* TODO(fclem) Remove! This is broken as it is! */ -int GPU_texture_target(const GPUTexture *UNUSED(tex)) -{ - return GL_TEXTURE_2D; -} - int GPU_texture_width(const GPUTexture *tex) { return reinterpret_cast<const Texture *>(tex)->width_get(); diff --git a/source/blender/gpu/intern/gpu_vertex_buffer.cc b/source/blender/gpu/intern/gpu_vertex_buffer.cc index 4cc2af889e6..ea149aaa254 100644 --- a/source/blender/gpu/intern/gpu_vertex_buffer.cc +++ b/source/blender/gpu/intern/gpu_vertex_buffer.cc @@ -324,4 +324,11 @@ void GPU_vertbuf_use(GPUVertBuf *verts) unwrap(verts)->upload(); } +/* XXX this is just a wrapper for the use of the Hair refine workaround. + * To be used with GPU_vertbuf_use(). */ +void GPU_vertbuf_update_sub(GPUVertBuf *verts, uint start, uint len, void *data) +{ + unwrap(verts)->update_sub(start, len, data); +} + /** \} */
\ No newline at end of file diff --git a/source/blender/gpu/intern/gpu_vertex_buffer_private.hh b/source/blender/gpu/intern/gpu_vertex_buffer_private.hh index f1de0a2ac96..3cce7e79857 100644 --- a/source/blender/gpu/intern/gpu_vertex_buffer_private.hh +++ b/source/blender/gpu/intern/gpu_vertex_buffer_private.hh @@ -95,6 +95,8 @@ class VertBuf { } } + virtual void update_sub(uint start, uint len, void *data) = 0; + protected: virtual void acquire_data(void) = 0; virtual void resize_data(void) = 0; diff --git a/source/blender/gpu/intern/gpu_vertex_format.cc b/source/blender/gpu/intern/gpu_vertex_format.cc index ac8439167e3..3b0aa055588 100644 --- a/source/blender/gpu/intern/gpu_vertex_format.cc +++ b/source/blender/gpu/intern/gpu_vertex_format.cc @@ -70,7 +70,7 @@ static uint comp_sz(GPUVertCompType type) #if TRUST_NO_ONE assert(type <= GPU_COMP_F32); /* other types have irregular sizes (not bytes) */ #endif - const GLubyte sizes[] = {1, 1, 2, 2, 4, 4, 4}; + const uint sizes[] = {1, 1, 2, 2, 4, 4, 4}; return sizes[type]; } diff --git a/source/blender/gpu/opengl/gl_vertex_buffer.cc b/source/blender/gpu/opengl/gl_vertex_buffer.cc index a724c94775e..d97fc2c1600 100644 --- a/source/blender/gpu/opengl/gl_vertex_buffer.cc +++ b/source/blender/gpu/opengl/gl_vertex_buffer.cc @@ -106,4 +106,9 @@ void GLVertBuf::bind(void) } } +void GLVertBuf::update_sub(uint start, uint len, void *data) +{ + glBufferSubData(GL_ARRAY_BUFFER, start, len, data); +} + } // namespace blender::gpu
\ No newline at end of file diff --git a/source/blender/gpu/opengl/gl_vertex_buffer.hh b/source/blender/gpu/opengl/gl_vertex_buffer.hh index eee5222f467..e2bf6cd00e8 100644 --- a/source/blender/gpu/opengl/gl_vertex_buffer.hh +++ b/source/blender/gpu/opengl/gl_vertex_buffer.hh @@ -45,6 +45,8 @@ class GLVertBuf : public VertBuf { public: void bind(void); + void update_sub(uint start, uint len, void *data) override; + protected: void acquire_data(void) override; void resize_data(void) override; |