diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-01-28 17:02:36 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-01-28 17:03:45 +0300 |
commit | 3b2a1ff716a0b927731ca75d9538d6da54637b6b (patch) | |
tree | 089d88bd74a4927584dad5b65c7722129f1a16f7 /source/blender/draw | |
parent | 75e61e5a6dc70107eaf784a369f225ca062fdcd5 (diff) |
Image Engine: Remove unused shader parameter Color.
This change removes an unused shader parameter that also collided when a
local varialble with the same name was used on different platforms.
Diffstat (limited to 'source/blender/draw')
4 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh b/source/blender/draw/engines/image/image_drawing_mode.hh index c0d829b9307..f501bc78b11 100644 --- a/source/blender/draw/engines/image/image_drawing_mode.hh +++ b/source/blender/draw/engines/image/image_drawing_mode.hh @@ -94,7 +94,6 @@ template<typename TextureMethod> class ScreenSpaceDrawingMode : public AbstractD DRWShadingGroup *shgrp = DRW_shgroup_create(shader, instance_data->passes.image_pass); DRW_shgroup_uniform_vec2_copy(shgrp, "farNearDistances", sh_params.far_near); - DRW_shgroup_uniform_vec4_copy(shgrp, "col", ShaderParameters::color); DRW_shgroup_uniform_vec4_copy(shgrp, "shuffle", sh_params.shuffle); DRW_shgroup_uniform_int_copy(shgrp, "drawFlags", sh_params.flags); DRW_shgroup_uniform_bool_copy(shgrp, "imgPremultiplied", sh_params.use_premul_alpha); diff --git a/source/blender/draw/engines/image/image_shader_params.hh b/source/blender/draw/engines/image/image_shader_params.hh index 46371c598f3..9f3da3f9e9e 100644 --- a/source/blender/draw/engines/image/image_shader_params.hh +++ b/source/blender/draw/engines/image/image_shader_params.hh @@ -35,8 +35,6 @@ #include "image_space.hh" struct ShaderParameters { - constexpr static float color[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - int flags = 0; float shuffle[4]; float far_near[2]; diff --git a/source/blender/draw/engines/image/shaders/image_engine_frag.glsl b/source/blender/draw/engines/image/shaders/image_engine_frag.glsl index bcdc8445b26..b0ac7af457f 100644 --- a/source/blender/draw/engines/image/shaders/image_engine_frag.glsl +++ b/source/blender/draw/engines/image/shaders/image_engine_frag.glsl @@ -34,7 +34,7 @@ void main() } if ((drawFlags & IMAGE_DRAW_FLAG_SHUFFLING) != 0) { - tex_color = col * dot(tex_color, shuffle); + tex_color = vec4(dot(tex_color, shuffle)); } if ((drawFlags & IMAGE_DRAW_FLAG_SHOW_ALPHA) == 0) { tex_color.a = 1.0; diff --git a/source/blender/draw/engines/image/shaders/infos/engine_image_info.hh b/source/blender/draw/engines/image/shaders/infos/engine_image_info.hh index e691abfadcf..1dd20a9a95b 100644 --- a/source/blender/draw/engines/image/shaders/infos/engine_image_info.hh +++ b/source/blender/draw/engines/image/shaders/infos/engine_image_info.hh @@ -10,7 +10,6 @@ GPU_SHADER_CREATE_INFO(image_engine_shader) .vertex_out(image_engine_iface) .fragment_out(0, Type::VEC4, "fragColor") .push_constant(Type::VEC4, "shuffle") - .push_constant(Type::VEC4, "col") .push_constant(Type::VEC2, "maxUv") .push_constant(Type::VEC2, "farNearDistances") .push_constant(Type::INT, "drawFlags") @@ -19,4 +18,4 @@ GPU_SHADER_CREATE_INFO(image_engine_shader) .vertex_source("image_engine_vert.glsl") .fragment_source("image_engine_frag.glsl") .additional_info("draw_modelmat") - .do_static_compilation(true);
\ No newline at end of file + .do_static_compilation(true); |