GPU: remove 'GPU_SHADER_3D_IMAGE_MODULATE_ALPHA'
`GPU_SHADER_3D_IMAGE_MODULATE_ALPHA` can be seamlessly replaced by `GPU_SHADER_3D_IMAGE_COLOR` with no real harm done.
This commit is contained in:
parent
1fcc673230
commit
755e728a98
Notes:
blender-bot
2023-02-14 07:08:26 +01:00
Referenced by commit b23fceff7d
, GPU/DRW: Fix test
|
@ -1210,10 +1210,10 @@ static void draw_plane_marker_image(Scene *scene,
|
|||
imm_format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
||||
|
||||
/* Use 3D image for correct display of planar tracked images. */
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_IMAGE_MODULATE_ALPHA);
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_IMAGE_COLOR);
|
||||
|
||||
immBindTexture("image", texture);
|
||||
immUniform1f("alpha", plane_track->image_opacity);
|
||||
immUniformColor4f(1.0f, 1.0f, 1.0f, plane_track->image_opacity);
|
||||
|
||||
immBegin(GPU_PRIM_TRI_FAN, 4);
|
||||
|
||||
|
|
|
@ -281,7 +281,6 @@ set(GLSL_SRC
|
|||
shaders/gpu_shader_image_desaturate_frag.glsl
|
||||
shaders/gpu_shader_image_overlays_merge_frag.glsl
|
||||
shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl
|
||||
shaders/gpu_shader_image_modulate_alpha_frag.glsl
|
||||
shaders/gpu_shader_image_shuffle_color_frag.glsl
|
||||
shaders/gpu_shader_image_color_frag.glsl
|
||||
shaders/gpu_shader_image_varying_color_frag.glsl
|
||||
|
@ -589,7 +588,6 @@ set(SRC_SHADER_CREATE_INFOS
|
|||
shaders/infos/gpu_shader_3D_depth_only_info.hh
|
||||
shaders/infos/gpu_shader_3D_flat_color_info.hh
|
||||
shaders/infos/gpu_shader_3D_image_info.hh
|
||||
shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh
|
||||
shaders/infos/gpu_shader_3D_point_info.hh
|
||||
shaders/infos/gpu_shader_3D_polyline_info.hh
|
||||
shaders/infos/gpu_shader_3D_smooth_color_info.hh
|
||||
|
|
|
@ -295,15 +295,6 @@ typedef enum eGPUBuiltinShader {
|
|||
* \param pos: in vec3
|
||||
*/
|
||||
GPU_SHADER_3D_IMAGE_COLOR,
|
||||
/**
|
||||
* Draw texture with alpha. Take a 3D position and a 2D texture coordinate for each vertex.
|
||||
*
|
||||
* \param alpha: uniform float
|
||||
* \param image: uniform sampler2D
|
||||
* \param texCoord: in vec2
|
||||
* \param pos: in vec3
|
||||
*/
|
||||
GPU_SHADER_3D_IMAGE_MODULATE_ALPHA,
|
||||
/* points */
|
||||
/**
|
||||
* Draw round points with a constant size.
|
||||
|
|
|
@ -141,11 +141,6 @@ static const GPUShaderStages builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = {
|
|||
.name = "GPU_SHADER_3D_IMAGE_COLOR",
|
||||
.create_info = "gpu_shader_3D_image_color",
|
||||
},
|
||||
[GPU_SHADER_3D_IMAGE_MODULATE_ALPHA] =
|
||||
{
|
||||
.name = "GPU_SHADER_3D_IMAGE_MODULATE_ALPHA",
|
||||
.create_info = "gpu_shader_3D_image_modulate_alpha",
|
||||
},
|
||||
[GPU_SHADER_2D_CHECKER] =
|
||||
{
|
||||
.name = "GPU_SHADER_2D_CHECKER",
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
void main()
|
||||
{
|
||||
fragColor = texture(image, texCoord_interp);
|
||||
fragColor.a *= alpha;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
* Copyright 2022 Blender Foundation. All rights reserved. */
|
||||
|
||||
/** \file
|
||||
* \ingroup gpu
|
||||
*/
|
||||
|
||||
#include "gpu_interface_info.hh"
|
||||
#include "gpu_shader_create_info.hh"
|
||||
|
||||
GPU_SHADER_CREATE_INFO(gpu_shader_3D_image_modulate_alpha)
|
||||
.vertex_in(0, Type::VEC3, "pos")
|
||||
.vertex_in(1, Type::VEC2, "texCoord")
|
||||
.vertex_out(smooth_tex_coord_interp_iface)
|
||||
.fragment_out(0, Type::VEC4, "fragColor")
|
||||
.push_constant(Type::MAT4, "ModelViewProjectionMatrix")
|
||||
.push_constant(Type::FLOAT, "alpha")
|
||||
.sampler(0, ImageType::FLOAT_2D, "image", Frequency::PASS)
|
||||
.vertex_source("gpu_shader_3D_image_vert.glsl")
|
||||
.fragment_source("gpu_shader_image_modulate_alpha_frag.glsl")
|
||||
.do_static_compilation(true);
|
|
@ -225,10 +225,9 @@ static void wm_software_cursor_draw_bitmap(const int event_xy[2],
|
|||
imm_format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
||||
|
||||
/* Use 3D image for correct display of planar tracked images. */
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_IMAGE_MODULATE_ALPHA);
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_IMAGE);
|
||||
|
||||
immBindTexture("image", texture);
|
||||
immUniform1f("alpha", 1.0f);
|
||||
|
||||
immBegin(GPU_PRIM_TRI_FAN, 4);
|
||||
|
||||
|
|
Loading…
Reference in New Issue