From dd171f7743b9bf7f430e8bc74fe9b39784d76774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Foucault?= Date: Sun, 12 Feb 2023 23:39:48 +0100 Subject: [PATCH] Cleanup: GPUShader: Rename `GPU_shader_uniform_vector` Rename to `GPU_shader_uniform_float/int_ex` to make more sense as a general purpose function. --- intern/cycles/blender/display_driver.cpp | 4 ++-- source/blender/draw/intern/draw_command.cc | 8 +++---- .../blender/draw/intern/draw_manager_exec.c | 22 ++++++++--------- .../editors/interface/interface_icons.cc | 8 +++---- source/blender/editors/mask/mask_draw.c | 2 +- source/blender/gpu/GPU_shader.h | 4 ++-- source/blender/gpu/intern/gpu_immediate.cc | 2 +- source/blender/gpu/intern/gpu_matrix.cc | 13 +++++----- source/blender/gpu/intern/gpu_shader.cc | 24 +++++++++---------- source/blender/gpu/metal/mtl_batch.mm | 20 ++++++++-------- source/blender/gpu/metal/mtl_immediate.mm | 20 ++++++++-------- source/blender/python/gpu/gpu_py_shader.c | 10 ++++---- source/blender/windowmanager/intern/wm_draw.c | 6 ++--- .../blender/windowmanager/intern/wm_gesture.c | 2 +- 14 files changed, 73 insertions(+), 72 deletions(-) diff --git a/intern/cycles/blender/display_driver.cpp b/intern/cycles/blender/display_driver.cpp index e5b496dab87..9b8f031bc25 100644 --- a/intern/cycles/blender/display_driver.cpp +++ b/intern/cycles/blender/display_driver.cpp @@ -106,11 +106,11 @@ GPUShader *BlenderFallbackDisplayShader::bind(int width, int height) /* Bind shader now to enable uniform assignment. */ GPU_shader_bind(shader_program_); float slot = 0; - GPU_shader_uniform_vector_int(shader_program_, image_texture_location_, 1, 1, &slot); + GPU_shader_uniform_int_ex(shader_program_, image_texture_location_, 1, 1, &slot); float size[2]; size[0] = width; size[1] = height; - GPU_shader_uniform_vector(shader_program_, fullscreen_location_, 2, 1, size); + GPU_shader_uniform_float_ex(shader_program_, fullscreen_location_, 2, 1, size); return shader_program_; } diff --git a/source/blender/draw/intern/draw_command.cc b/source/blender/draw/intern/draw_command.cc index c06ff88537a..86a0480b3f7 100644 --- a/source/blender/draw/intern/draw_command.cc +++ b/source/blender/draw/intern/draw_command.cc @@ -76,16 +76,16 @@ void PushConstant::execute(RecordingState &state) const } switch (type) { case PushConstant::Type::IntValue: - GPU_shader_uniform_vector_int(state.shader, location, comp_len, array_len, int4_value); + GPU_shader_uniform_int_ex(state.shader, location, comp_len, array_len, int4_value); break; case PushConstant::Type::IntReference: - GPU_shader_uniform_vector_int(state.shader, location, comp_len, array_len, int_ref); + GPU_shader_uniform_int_ex(state.shader, location, comp_len, array_len, int_ref); break; case PushConstant::Type::FloatValue: - GPU_shader_uniform_vector(state.shader, location, comp_len, array_len, float4_value); + GPU_shader_uniform_float_ex(state.shader, location, comp_len, array_len, float4_value); break; case PushConstant::Type::FloatReference: - GPU_shader_uniform_vector(state.shader, location, comp_len, array_len, float_ref); + GPU_shader_uniform_float_ex(state.shader, location, comp_len, array_len, float_ref); break; } } diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 35a83d5635a..4139ffcb261 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -522,10 +522,10 @@ BLI_INLINE void draw_legacy_matrix_update(DRWShadingGroup *shgroup, /* Still supported for compatibility with gpu_shader_* but should be forbidden. */ DRWObjectMatrix *ob_mats = DRW_memblock_elem_from_handle(DST.vmempool->obmats, handle); if (obmat_loc != -1) { - GPU_shader_uniform_vector(shgroup->shader, obmat_loc, 16, 1, (float *)ob_mats->model); + GPU_shader_uniform_float_ex(shgroup->shader, obmat_loc, 16, 1, (float *)ob_mats->model); } if (obinv_loc != -1) { - GPU_shader_uniform_vector(shgroup->shader, obinv_loc, 16, 1, (float *)ob_mats->modelinverse); + GPU_shader_uniform_float_ex(shgroup->shader, obinv_loc, 16, 1, (float *)ob_mats->modelinverse); } } @@ -549,7 +549,7 @@ BLI_INLINE void draw_geometry_execute(DRWShadingGroup *shgroup, if (baseinst_loc != -1) { /* Fallback when ARB_shader_draw_parameters is not supported. */ - GPU_shader_uniform_vector_int(shgroup->shader, baseinst_loc, 1, 1, (int *)&inst_first); + GPU_shader_uniform_int_ex(shgroup->shader, baseinst_loc, 1, 1, (int *)&inst_first); /* Avoids VAO reconfiguration on older hardware. (see GPU_batch_draw_advanced) */ inst_first = 0; } @@ -615,7 +615,7 @@ static void draw_update_uniforms(DRWShadingGroup *shgroup, memcpy(&mat4_stack[array_index], uni->fvalue, sizeof(float) * uni->length); /* Flush array data to shader. */ if (array_index <= 0) { - GPU_shader_uniform_vector(shgroup->shader, uni->location, 16, 1, mat4_stack); + GPU_shader_uniform_float_ex(shgroup->shader, uni->location, 16, 1, mat4_stack); array_uniform_loc = -1; } continue; @@ -626,23 +626,23 @@ static void draw_update_uniforms(DRWShadingGroup *shgroup, case DRW_UNIFORM_INT_COPY: BLI_assert(uni->arraysize == 1); if (uni->arraysize == 1) { - GPU_shader_uniform_vector_int( + GPU_shader_uniform_int_ex( shgroup->shader, uni->location, uni->length, uni->arraysize, uni->ivalue); } break; case DRW_UNIFORM_INT: - GPU_shader_uniform_vector_int( + GPU_shader_uniform_int_ex( shgroup->shader, uni->location, uni->length, uni->arraysize, uni->pvalue); break; case DRW_UNIFORM_FLOAT_COPY: BLI_assert(uni->arraysize == 1); if (uni->arraysize == 1) { - GPU_shader_uniform_vector( + GPU_shader_uniform_float_ex( shgroup->shader, uni->location, uni->length, uni->arraysize, uni->fvalue); } break; case DRW_UNIFORM_FLOAT: - GPU_shader_uniform_vector( + GPU_shader_uniform_float_ex( shgroup->shader, uni->location, uni->length, uni->arraysize, uni->pvalue); break; case DRW_UNIFORM_TEXTURE: @@ -690,7 +690,7 @@ static void draw_update_uniforms(DRWShadingGroup *shgroup, case DRW_UNIFORM_RESOURCE_CHUNK: { state->chunkid_loc = uni->location; int zero = 0; - GPU_shader_uniform_vector_int(shgroup->shader, uni->location, 1, 1, &zero); + GPU_shader_uniform_int_ex(shgroup->shader, uni->location, 1, 1, &zero); break; } case DRW_UNIFORM_RESOURCE_ID: @@ -809,7 +809,7 @@ static void draw_call_resource_bind(DRWCommandsState *state, const DRWResourceHa int chunk = DRW_handle_chunk_get(handle); if (state->resource_chunk != chunk) { if (state->chunkid_loc != -1) { - GPU_shader_uniform_vector_int(DST.shader, state->chunkid_loc, 1, 1, &chunk); + GPU_shader_uniform_int_ex(DST.shader, state->chunkid_loc, 1, 1, &chunk); } if (state->obmats_loc != -1) { GPU_uniformbuf_unbind(DST.vmempool->matrices_ubo[state->resource_chunk]); @@ -829,7 +829,7 @@ static void draw_call_resource_bind(DRWCommandsState *state, const DRWResourceHa if (state->resourceid_loc != -1) { int id = DRW_handle_id_get(handle); if (state->resource_id != id) { - GPU_shader_uniform_vector_int(DST.shader, state->resourceid_loc, 1, 1, &id); + GPU_shader_uniform_int_ex(DST.shader, state->resourceid_loc, 1, 1, &id); state->resource_id = id; } } diff --git a/source/blender/editors/interface/interface_icons.cc b/source/blender/editors/interface/interface_icons.cc index 634f45283f6..7e0b17aa128 100644 --- a/source/blender/editors/interface/interface_icons.cc +++ b/source/blender/editors/interface/interface_icons.cc @@ -1804,18 +1804,18 @@ static void icon_draw_texture(float x, if (rgb) { const float color[4] = {rgb[0], rgb[1], rgb[2], alpha}; - GPU_shader_uniform_vector(shader, color_loc, 4, 1, color); + GPU_shader_uniform_float_ex(shader, color_loc, 4, 1, color); } else { const float color[4] = {alpha, alpha, alpha, alpha}; - GPU_shader_uniform_vector(shader, color_loc, 4, 1, color); + GPU_shader_uniform_float_ex(shader, color_loc, 4, 1, color); } const float tex_color[4] = {x1, y1, x2, y2}; const float geom_color[4] = {x, y, x + w, y + h}; - GPU_shader_uniform_vector(shader, rect_tex_loc, 4, 1, tex_color); - GPU_shader_uniform_vector(shader, rect_geom_loc, 4, 1, geom_color); + GPU_shader_uniform_float_ex(shader, rect_tex_loc, 4, 1, tex_color); + GPU_shader_uniform_float_ex(shader, rect_geom_loc, 4, 1, geom_color); GPU_shader_uniform_1f(shader, "text_width", text_width); GPU_texture_bind_ex(texture, GPU_SAMPLER_ICON, img_binding, false); diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 77014fde8a8..ea4050d0ba0 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -722,7 +722,7 @@ void ED_mask_draw_region( GPU_matrix_mul(stabmat); } IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR); - GPU_shader_uniform_vector( + GPU_shader_uniform_float_ex( state.shader, GPU_shader_get_uniform(state.shader, "shuffle"), 4, 1, buf_col); if (overlay_mode == MASK_OVERLAY_COMBINED) { diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h index c8a8f817f96..b9be4a5ec55 100644 --- a/source/blender/gpu/GPU_shader.h +++ b/source/blender/gpu/GPU_shader.h @@ -128,9 +128,9 @@ int GPU_shader_get_uniform(GPUShader *shader, const char *name); * Sets a generic push constant (a.k.a. uniform). * \a length and \a array_size should match the create info push_constant declaration. */ -void GPU_shader_uniform_vector( +void GPU_shader_uniform_float_ex( GPUShader *shader, int location, int length, int array_size, const float *value); -void GPU_shader_uniform_vector_int( +void GPU_shader_uniform_int_ex( GPUShader *shader, int location, int length, int array_size, const int *value); /** diff --git a/source/blender/gpu/intern/gpu_immediate.cc b/source/blender/gpu/intern/gpu_immediate.cc index ada34fdaeee..645a920fc83 100644 --- a/source/blender/gpu/intern/gpu_immediate.cc +++ b/source/blender/gpu/intern/gpu_immediate.cc @@ -625,7 +625,7 @@ void immUniformColor4f(float r, float g, float b, float a) int32_t uniform_loc = GPU_shader_get_builtin_uniform(imm->shader, GPU_UNIFORM_COLOR); BLI_assert(uniform_loc != -1); float data[4] = {r, g, b, a}; - GPU_shader_uniform_vector(imm->shader, uniform_loc, 4, 1, data); + GPU_shader_uniform_float_ex(imm->shader, uniform_loc, 4, 1, data); /* For wide Line workaround. */ copy_v4_v4(imm->uniform_color, data); } diff --git a/source/blender/gpu/intern/gpu_matrix.cc b/source/blender/gpu/intern/gpu_matrix.cc index b46860cf0f4..d285ff5ef99 100644 --- a/source/blender/gpu/intern/gpu_matrix.cc +++ b/source/blender/gpu/intern/gpu_matrix.cc @@ -623,30 +623,31 @@ void GPU_matrix_bind(GPUShader *shader) int32_t P_inv = GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_PROJECTION_INV); if (MV != -1) { - GPU_shader_uniform_vector( + GPU_shader_uniform_float_ex( shader, MV, 16, 1, (const float *)GPU_matrix_model_view_get(nullptr)); } if (P != -1) { - GPU_shader_uniform_vector(shader, P, 16, 1, (const float *)GPU_matrix_projection_get(nullptr)); + GPU_shader_uniform_float_ex( + shader, P, 16, 1, (const float *)GPU_matrix_projection_get(nullptr)); } if (MVP != -1) { - GPU_shader_uniform_vector( + GPU_shader_uniform_float_ex( shader, MVP, 16, 1, (const float *)GPU_matrix_model_view_projection_get(nullptr)); } if (N != -1) { - GPU_shader_uniform_vector(shader, N, 9, 1, (const float *)GPU_matrix_normal_get(nullptr)); + GPU_shader_uniform_float_ex(shader, N, 9, 1, (const float *)GPU_matrix_normal_get(nullptr)); } if (MV_inv != -1) { Mat4 m; GPU_matrix_model_view_get(m); invert_m4(m); - GPU_shader_uniform_vector(shader, MV_inv, 16, 1, (const float *)m); + GPU_shader_uniform_float_ex(shader, MV_inv, 16, 1, (const float *)m); } if (P_inv != -1) { Mat4 m; GPU_matrix_projection_get(m); invert_m4(m); - GPU_shader_uniform_vector(shader, P_inv, 16, 1, (const float *)m); + GPU_shader_uniform_float_ex(shader, P_inv, 16, 1, (const float *)m); } gpu_matrix_state_active_set_dirty(false); diff --git a/source/blender/gpu/intern/gpu_shader.cc b/source/blender/gpu/intern/gpu_shader.cc index 2875763fb5e..0edc2072302 100644 --- a/source/blender/gpu/intern/gpu_shader.cc +++ b/source/blender/gpu/intern/gpu_shader.cc @@ -618,13 +618,13 @@ int GPU_shader_get_program(GPUShader *shader) /** \name Uniforms setters * \{ */ -void GPU_shader_uniform_vector( +void GPU_shader_uniform_float_ex( GPUShader *shader, int loc, int len, int array_size, const float *value) { unwrap(shader)->uniform_float(loc, len, array_size, value); } -void GPU_shader_uniform_vector_int( +void GPU_shader_uniform_int_ex( GPUShader *shader, int loc, int len, int array_size, const int *value) { unwrap(shader)->uniform_int(loc, len, array_size, value); @@ -633,7 +633,7 @@ void GPU_shader_uniform_vector_int( void GPU_shader_uniform_1i(GPUShader *sh, const char *name, int value) { const int loc = GPU_shader_get_uniform(sh, name); - GPU_shader_uniform_vector_int(sh, loc, 1, 1, &value); + GPU_shader_uniform_int_ex(sh, loc, 1, 1, &value); } void GPU_shader_uniform_1b(GPUShader *sh, const char *name, bool value) @@ -662,37 +662,37 @@ void GPU_shader_uniform_4f(GPUShader *sh, const char *name, float x, float y, fl void GPU_shader_uniform_1f(GPUShader *sh, const char *name, float value) { const int loc = GPU_shader_get_uniform(sh, name); - GPU_shader_uniform_vector(sh, loc, 1, 1, &value); + GPU_shader_uniform_float_ex(sh, loc, 1, 1, &value); } void GPU_shader_uniform_2fv(GPUShader *sh, const char *name, const float data[2]) { const int loc = GPU_shader_get_uniform(sh, name); - GPU_shader_uniform_vector(sh, loc, 2, 1, data); + GPU_shader_uniform_float_ex(sh, loc, 2, 1, data); } void GPU_shader_uniform_3fv(GPUShader *sh, const char *name, const float data[3]) { const int loc = GPU_shader_get_uniform(sh, name); - GPU_shader_uniform_vector(sh, loc, 3, 1, data); + GPU_shader_uniform_float_ex(sh, loc, 3, 1, data); } void GPU_shader_uniform_4fv(GPUShader *sh, const char *name, const float data[4]) { const int loc = GPU_shader_get_uniform(sh, name); - GPU_shader_uniform_vector(sh, loc, 4, 1, data); + GPU_shader_uniform_float_ex(sh, loc, 4, 1, data); } void GPU_shader_uniform_2iv(GPUShader *sh, const char *name, const int data[2]) { const int loc = GPU_shader_get_uniform(sh, name); - GPU_shader_uniform_vector_int(sh, loc, 2, 1, data); + GPU_shader_uniform_int_ex(sh, loc, 2, 1, data); } void GPU_shader_uniform_mat4(GPUShader *sh, const char *name, const float data[4][4]) { const int loc = GPU_shader_get_uniform(sh, name); - GPU_shader_uniform_vector(sh, loc, 16, 1, (const float *)data); + GPU_shader_uniform_float_ex(sh, loc, 16, 1, (const float *)data); } void GPU_shader_uniform_mat3_as_mat4(GPUShader *sh, const char *name, const float data[3][3]) @@ -705,13 +705,13 @@ void GPU_shader_uniform_mat3_as_mat4(GPUShader *sh, const char *name, const floa void GPU_shader_uniform_2fv_array(GPUShader *sh, const char *name, int len, const float (*val)[2]) { const int loc = GPU_shader_get_uniform(sh, name); - GPU_shader_uniform_vector(sh, loc, 2, len, (const float *)val); + GPU_shader_uniform_float_ex(sh, loc, 2, len, (const float *)val); } void GPU_shader_uniform_4fv_array(GPUShader *sh, const char *name, int len, const float (*val)[4]) { const int loc = GPU_shader_get_uniform(sh, name); - GPU_shader_uniform_vector(sh, loc, 4, len, (const float *)val); + GPU_shader_uniform_float_ex(sh, loc, 4, len, (const float *)val); } /** \} */ @@ -741,7 +741,7 @@ void Shader::set_srgb_uniform(GPUShader *shader) { int32_t loc = GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_SRGB_TRANSFORM); if (loc != -1) { - GPU_shader_uniform_vector_int(shader, loc, 1, 1, &g_shader_builtin_srgb_transform); + GPU_shader_uniform_int_ex(shader, loc, 1, 1, &g_shader_builtin_srgb_transform); } g_shader_builtin_srgb_is_dirty = false; } diff --git a/source/blender/gpu/metal/mtl_batch.mm b/source/blender/gpu/metal/mtl_batch.mm index 13496e8ad6f..07aaa5cfe62 100644 --- a/source/blender/gpu/metal/mtl_batch.mm +++ b/source/blender/gpu/metal/mtl_batch.mm @@ -530,16 +530,16 @@ id MTLBatch::bind(uint v_first, uint v_count, uint i_fi /* Set SSBO-fetch-mode status uniforms. */ BLI_assert(active_shader_->uni_ssbo_input_prim_type_loc != -1); BLI_assert(active_shader_->uni_ssbo_input_vert_count_loc != -1); - GPU_shader_uniform_vector_int(reinterpret_cast(wrap(active_shader_)), - active_shader_->uni_ssbo_input_prim_type_loc, - 1, - 1, - (const int *)(&final_prim_type)); - GPU_shader_uniform_vector_int(reinterpret_cast(wrap(active_shader_)), - active_shader_->uni_ssbo_input_vert_count_loc, - 1, - 1, - (const int *)(&v_count)); + GPU_shader_uniform_int_ex(reinterpret_cast(wrap(active_shader_)), + active_shader_->uni_ssbo_input_prim_type_loc, + 1, + 1, + (const int *)(&final_prim_type)); + GPU_shader_uniform_int_ex(reinterpret_cast(wrap(active_shader_)), + active_shader_->uni_ssbo_input_vert_count_loc, + 1, + 1, + (const int *)(&v_count)); } /* Ensure Context Render Pipeline State is fully setup and ready to execute the draw. diff --git a/source/blender/gpu/metal/mtl_immediate.mm b/source/blender/gpu/metal/mtl_immediate.mm index f0809e6e9d3..985b962cc99 100644 --- a/source/blender/gpu/metal/mtl_immediate.mm +++ b/source/blender/gpu/metal/mtl_immediate.mm @@ -248,16 +248,16 @@ void MTLImmediate::end() "ssbo_input_prim_type uniform location invalid!"); BLI_assert_msg(active_mtl_shader->uni_ssbo_input_vert_count_loc != -1, "ssbo_input_vert_count uniform location invalid!"); - GPU_shader_uniform_vector_int(reinterpret_cast(wrap(active_mtl_shader)), - active_mtl_shader->uni_ssbo_input_prim_type_loc, - 1, - 1, - (const int *)(&this->prim_type)); - GPU_shader_uniform_vector_int(reinterpret_cast(wrap(active_mtl_shader)), - active_mtl_shader->uni_ssbo_input_vert_count_loc, - 1, - 1, - (const int *)(&this->vertex_idx)); + GPU_shader_uniform_int_ex(reinterpret_cast(wrap(active_mtl_shader)), + active_mtl_shader->uni_ssbo_input_prim_type_loc, + 1, + 1, + (const int *)(&this->prim_type)); + GPU_shader_uniform_int_ex(reinterpret_cast(wrap(active_mtl_shader)), + active_mtl_shader->uni_ssbo_input_vert_count_loc, + 1, + 1, + (const int *)(&this->vertex_idx)); } MTLPrimitiveType mtl_prim_type = gpu_prim_type_to_metal(this->prim_type); diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c index 2c13e271e36..80c22bd7a97 100644 --- a/source/blender/python/gpu/gpu_py_shader.c +++ b/source/blender/python/gpu/gpu_py_shader.c @@ -269,7 +269,7 @@ static PyObject *pygpu_shader_uniform_vector_float(BPyGPUShader *self, PyObject } GPU_shader_bind(self->shader); - GPU_shader_uniform_vector(self->shader, location, length, count, pybuffer.buf); + GPU_shader_uniform_float_ex(self->shader, location, length, count, pybuffer.buf); PyBuffer_Release(&pybuffer); @@ -292,7 +292,7 @@ static PyObject *pygpu_shader_uniform_vector_int(BPyGPUShader *self, PyObject *a } GPU_shader_bind(self->shader); - GPU_shader_uniform_vector_int(self->shader, location, length, count, pybuffer.buf); + GPU_shader_uniform_int_ex(self->shader, location, length, count, pybuffer.buf); PyBuffer_Release(&pybuffer); @@ -367,7 +367,7 @@ static PyObject *pygpu_shader_uniform_bool(BPyGPUShader *self, PyObject *args) } GPU_shader_bind(self->shader); - GPU_shader_uniform_vector_int(self->shader, location, length, 1, values); + GPU_shader_uniform_int_ex(self->shader, location, length, 1, values); Py_RETURN_NONE; } @@ -437,7 +437,7 @@ static PyObject *pygpu_shader_uniform_float(BPyGPUShader *self, PyObject *args) } GPU_shader_bind(self->shader); - GPU_shader_uniform_vector(self->shader, location, length, 1, values); + GPU_shader_uniform_float_ex(self->shader, location, length, 1, values); Py_RETURN_NONE; } @@ -509,7 +509,7 @@ static PyObject *pygpu_shader_uniform_int(BPyGPUShader *self, PyObject *args) } GPU_shader_bind(self->shader); - GPU_shader_uniform_vector_int(self->shader, location, length, 1, values); + GPU_shader_uniform_int_ex(self->shader, location, length, 1, values); Py_RETURN_NONE; } diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 5ce080e575a..ebe670bfa21 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -846,9 +846,9 @@ void wm_draw_region_blend(ARegion *region, int view, bool blend) GPU_texture_bind(texture, texture_bind_loc); - GPU_shader_uniform_vector(shader, rect_tex_loc, 4, 1, rectt); - GPU_shader_uniform_vector(shader, rect_geo_loc, 4, 1, rectg); - GPU_shader_uniform_vector(shader, color_loc, 4, 1, (const float[4]){1, 1, 1, 1}); + GPU_shader_uniform_float_ex(shader, rect_tex_loc, 4, 1, rectt); + GPU_shader_uniform_float_ex(shader, rect_geo_loc, 4, 1, rectg); + GPU_shader_uniform_float_ex(shader, color_loc, 4, 1, (const float[4]){1, 1, 1, 1}); GPUBatch *quad = GPU_batch_preset_quad(); GPU_batch_set_shader(quad, shader); diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index bb03c2c1413..fecbcca3c90 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -326,7 +326,7 @@ static void draw_filled_lasso(wmGesture *gt) IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR); GPU_shader_bind(state.shader); - GPU_shader_uniform_vector( + GPU_shader_uniform_float_ex( state.shader, GPU_shader_get_uniform(state.shader, "shuffle"), 4, 1, red); immDrawPixelsTexTiled(