Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/gpu/intern/gpu_vertex_buffer.cc')
-rw-r--r--source/blender/gpu/intern/gpu_vertex_buffer.cc29
1 files changed, 18 insertions, 11 deletions
diff --git a/source/blender/gpu/intern/gpu_vertex_buffer.cc b/source/blender/gpu/intern/gpu_vertex_buffer.cc
index 4cc2af889e6..09b9eba9f95 100644
--- a/source/blender/gpu/intern/gpu_vertex_buffer.cc
+++ b/source/blender/gpu/intern/gpu_vertex_buffer.cc
@@ -66,13 +66,13 @@ void VertBuf::init(const GPUVertFormat *format, GPUUsageType usage)
flag |= GPU_VERTBUF_INIT;
}
-void VertBuf::clear(void)
+void VertBuf::clear()
{
this->release_data();
flag = GPU_VERTBUF_INVALID;
}
-VertBuf *VertBuf::duplicate(void)
+VertBuf *VertBuf::duplicate()
{
VertBuf *dst = GPUBackend::get()->vertbuf_alloc();
/* Full copy. */
@@ -107,7 +107,7 @@ void VertBuf::resize(uint vert_len)
flag |= GPU_VERTBUF_DATA_DIRTY;
}
-void VertBuf::upload(void)
+void VertBuf::upload()
{
this->upload_data();
}
@@ -125,7 +125,7 @@ using namespace blender::gpu;
/* -------- Creation & deletion -------- */
-GPUVertBuf *GPU_vertbuf_calloc(void)
+GPUVertBuf *GPU_vertbuf_calloc()
{
return wrap(GPUBackend::get()->vertbuf_alloc());
}
@@ -191,7 +191,7 @@ void GPU_vertbuf_data_resize(GPUVertBuf *verts, uint v_len)
void GPU_vertbuf_data_len_set(GPUVertBuf *verts_, uint v_len)
{
VertBuf *verts = unwrap(verts_);
- BLI_assert(verts->data != NULL); /* Only for dynamic data. */
+ BLI_assert(verts->data != nullptr); /* Only for dynamic data. */
BLI_assert(v_len <= verts->vertex_alloc);
verts->vertex_len = v_len;
}
@@ -203,7 +203,7 @@ void GPU_vertbuf_attr_set(GPUVertBuf *verts_, uint a_idx, uint v_idx, const void
const GPUVertAttr *a = &format->attrs[a_idx];
BLI_assert(v_idx < verts->vertex_alloc);
BLI_assert(a_idx < format->attr_len);
- BLI_assert(verts->data != NULL);
+ BLI_assert(verts->data != nullptr);
verts->flag |= GPU_VERTBUF_DATA_DIRTY;
memcpy(verts->data + a->offset + v_idx * format->stride, data, a->sz);
}
@@ -225,7 +225,7 @@ void GPU_vertbuf_vert_set(GPUVertBuf *verts_, uint v_idx, const void *data)
VertBuf *verts = unwrap(verts_);
const GPUVertFormat *format = &verts->format;
BLI_assert(v_idx < verts->vertex_alloc);
- BLI_assert(verts->data != NULL);
+ BLI_assert(verts->data != nullptr);
verts->flag |= GPU_VERTBUF_DATA_DIRTY;
memcpy(verts->data + v_idx * format->stride, data, format->stride);
}
@@ -236,7 +236,7 @@ void GPU_vertbuf_attr_fill_stride(GPUVertBuf *verts_, uint a_idx, uint stride, c
const GPUVertFormat *format = &verts->format;
const GPUVertAttr *a = &format->attrs[a_idx];
BLI_assert(a_idx < format->attr_len);
- BLI_assert(verts->data != NULL);
+ BLI_assert(verts->data != nullptr);
verts->flag |= GPU_VERTBUF_DATA_DIRTY;
const uint vertex_len = verts->vertex_len;
@@ -259,7 +259,7 @@ void GPU_vertbuf_attr_get_raw_data(GPUVertBuf *verts_, uint a_idx, GPUVertBufRaw
const GPUVertFormat *format = &verts->format;
const GPUVertAttr *a = &format->attrs[a_idx];
BLI_assert(a_idx < format->attr_len);
- BLI_assert(verts->data != NULL);
+ BLI_assert(verts->data != nullptr);
verts->flag |= GPU_VERTBUF_DATA_DIRTY;
verts->flag &= ~GPU_VERTBUF_DATA_UPLOADED;
@@ -313,7 +313,7 @@ GPUVertBufStatus GPU_vertbuf_get_status(const GPUVertBuf *verts)
return unwrap(verts)->flag;
}
-uint GPU_vertbuf_get_memory_usage(void)
+uint GPU_vertbuf_get_memory_usage()
{
return VertBuf::memory_usage;
}
@@ -324,4 +324,11 @@ void GPU_vertbuf_use(GPUVertBuf *verts)
unwrap(verts)->upload();
}
-/** \} */ \ No newline at end of file
+/* 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);
+}
+
+/** \} */