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')
-rw-r--r--source/blender/gpu/intern/gpu_batch.cc3
-rw-r--r--source/blender/gpu/intern/gpu_immediate.cc2
-rw-r--r--source/blender/gpu/intern/gpu_state.cc7
-rw-r--r--source/blender/gpu/intern/gpu_vertex_format.cc1
4 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/gpu/intern/gpu_batch.cc b/source/blender/gpu/intern/gpu_batch.cc
index de079a89de7..1f873570f4a 100644
--- a/source/blender/gpu/intern/gpu_batch.cc
+++ b/source/blender/gpu/intern/gpu_batch.cc
@@ -235,14 +235,12 @@ void GPU_batch_draw(GPUBatch *batch)
{
GPU_shader_bind(batch->shader);
GPU_batch_draw_advanced(batch, 0, 0, 0, 0);
- GPU_shader_unbind();
}
void GPU_batch_draw_range(GPUBatch *batch, int v_first, int v_count)
{
GPU_shader_bind(batch->shader);
GPU_batch_draw_advanced(batch, v_first, v_count, 0, 0);
- GPU_shader_unbind();
}
/* Draw multiple instance of a batch without having any instance attributes. */
@@ -252,7 +250,6 @@ void GPU_batch_draw_instanced(GPUBatch *batch, int i_count)
GPU_shader_bind(batch->shader);
GPU_batch_draw_advanced(batch, 0, 0, 0, i_count);
- GPU_shader_unbind();
}
void GPU_batch_draw_advanced(
diff --git a/source/blender/gpu/intern/gpu_immediate.cc b/source/blender/gpu/intern/gpu_immediate.cc
index 0a488c0dfc0..9c3a88e30f0 100644
--- a/source/blender/gpu/intern/gpu_immediate.cc
+++ b/source/blender/gpu/intern/gpu_immediate.cc
@@ -186,7 +186,7 @@ void immEnd(void)
if (imm->batch) {
if (imm->vertex_idx < imm->vertex_len) {
- GPU_vertbuf_data_resize(imm->batch->verts[0], imm->vertex_len);
+ GPU_vertbuf_data_resize(imm->batch->verts[0], imm->vertex_idx);
/* TODO: resize only if vertex count is much smaller */
}
GPU_batch_set_shader(imm->batch, imm->shader);
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc
index 529c8795327..be523020e8a 100644
--- a/source/blender/gpu/intern/gpu_state.cc
+++ b/source/blender/gpu/intern/gpu_state.cc
@@ -173,12 +173,15 @@ void GPU_line_width(float width)
void GPU_point_size(float size)
{
- SET_MUTABLE_STATE(point_size, size * PIXELSIZE);
+ GPUStateManager *stack = Context::get()->state_manager;
+ auto &state = stack->mutable_state;
+ /* Keep the sign of point_size since it represents the enable state. */
+ state.point_size = size * ((state.point_size > 0.0) ? 1.0f : -1.0f);
}
/* Programmable point size
* - shaders set their own point size when enabled
- * - use glPointSize when disabled */
+ * - use GPU_point_size when disabled */
/* TODO remove and use program point size everywhere */
void GPU_program_point_size(bool enable)
{
diff --git a/source/blender/gpu/intern/gpu_vertex_format.cc b/source/blender/gpu/intern/gpu_vertex_format.cc
index 220c48457bc..ac8439167e3 100644
--- a/source/blender/gpu/intern/gpu_vertex_format.cc
+++ b/source/blender/gpu/intern/gpu_vertex_format.cc
@@ -51,6 +51,7 @@ void GPU_vertformat_clear(GPUVertFormat *format)
format->packed = false;
format->name_offset = 0;
format->name_len = 0;
+ format->deinterleaved = false;
for (uint i = 0; i < GPU_VERT_ATTR_MAX_LEN; i++) {
format->attrs[i].name_len = 0;