diff options
Diffstat (limited to 'source/blender/gpu')
26 files changed, 66 insertions, 54 deletions
diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index abb7330d292..b7dc3210c41 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -82,8 +82,8 @@ set(SRC intern/gpu_select_sample_query.cc intern/gpu_shader.cc intern/gpu_shader_builtin.c - intern/gpu_shader_log.cc intern/gpu_shader_interface.cc + intern/gpu_shader_log.cc intern/gpu_state.cc intern/gpu_texture.cc intern/gpu_uniform_buffer.cc @@ -103,8 +103,8 @@ set(SRC opengl/gl_index_buffer.cc opengl/gl_query.cc opengl/gl_shader.cc - opengl/gl_shader_log.cc opengl/gl_shader_interface.cc + opengl/gl_shader_log.cc opengl/gl_state.cc opengl/gl_texture.cc opengl/gl_uniform_buffer.cc diff --git a/source/blender/gpu/GPU_primitive.h b/source/blender/gpu/GPU_primitive.h index b1d70326b45..f64a673d461 100644 --- a/source/blender/gpu/GPU_primitive.h +++ b/source/blender/gpu/GPU_primitive.h @@ -57,7 +57,7 @@ typedef enum { } GPUPrimClass; /** - * TODO Improve error checking by validating that the shader is suited for this primitive type. + * TODO: Improve error checking by validating that the shader is suited for this primitive type. * GPUPrimClass GPU_primtype_class(GPUPrimType); * bool GPU_primtype_belongs_to_class(GPUPrimType, GPUPrimClass); */ diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 13d0139e406..43483916236 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -707,7 +707,7 @@ void GPU_pbvh_grid_buffers_update(GPU_PBVH_Buffers *buffers, float fno[3]; short no_short[3]; - /* Note: Clockwise indices ordering, that's why we invert order here. */ + /* NOTE: Clockwise indices ordering, that's why we invert order here. */ normal_quad_v3(fno, co[3], co[2], co[1], co[0]); normal_float_to_short_v3(no_short, fno); @@ -916,7 +916,7 @@ void GPU_pbvh_bmesh_buffers_update(GPU_PBVH_Buffers *buffers, return; } - /* TODO, make mask layer optional for bmesh buffer */ + /* TODO: make mask layer optional for bmesh buffer. */ const int cd_vert_mask_offset = CustomData_get_offset(&bm->vdata, CD_PAINT_MASK); /* Fill vertex buffer */ diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index a2072e504fd..d12cecd129e 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -810,7 +810,7 @@ static char *code_generate_geometry(GPUNodeGraph *graph, } LISTBASE_FOREACH (GPUMaterialAttribute *, attr, &graph->attributes) { - /* TODO let shader choose what to do depending on what the attribute is. */ + /* TODO: let shader choose what to do depending on what the attribute is. */ BLI_dynstr_appendf(ds, "dataAttrOut.var%d = dataAttrIn[vert].var%d;\\\n", attr->id, attr->id); } BLI_dynstr_append(ds, "}\n\n"); @@ -938,9 +938,9 @@ GPUPass *GPU_generate_pass(GPUMaterial *material, return pass; } -static int count_active_texture_sampler(GPUShader *shader, char *source) +static int count_active_texture_sampler(GPUShader *shader, const char *source) { - char *code = source; + const char *code = source; /* Remember this is per stage. */ GSet *sampler_ids = BLI_gset_int_new(__func__); diff --git a/source/blender/gpu/intern/gpu_context.cc b/source/blender/gpu/intern/gpu_context.cc index b5a437b46f7..943a6151ced 100644 --- a/source/blender/gpu/intern/gpu_context.cc +++ b/source/blender/gpu/intern/gpu_context.cc @@ -28,7 +28,7 @@ * - free can be called from any thread */ -/* TODO Create cmake option. */ +/* TODO: Create cmake option. */ #define WITH_OPENGL_BACKEND 1 #include "BLI_assert.h" @@ -99,7 +99,7 @@ Context *Context::get() GPUContext *GPU_context_create(void *ghost_window) { if (GPUBackend::get() == nullptr) { - /* TODO move where it make sense. */ + /* TODO: move where it make sense. */ GPU_backend_init(GPU_BACKEND_OPENGL); } @@ -182,7 +182,7 @@ void GPU_backend_init(eGPUBackendType backend_type) void GPU_backend_exit(void) { - /* TODO assert no resource left. Currently UI textures are still not freed in their context + /* TODO: assert no resource left. Currently UI textures are still not freed in their context * correctly. */ delete g_backend; g_backend = nullptr; diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index 1293cc0953d..4bb13d01c2d 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -609,7 +609,13 @@ GPUOffScreen *GPU_offscreen_create( } if ((depth && !ofs->depth) || !ofs->color) { - BLI_snprintf(err_out, 256, "GPUTexture: Texture allocation failed."); + const char error[] = "GPUTexture: Texture allocation failed."; + if (err_out) { + BLI_snprintf(err_out, 256, error); + } + else { + fprintf(stderr, error); + } GPU_offscreen_free(ofs); return nullptr; } diff --git a/source/blender/gpu/intern/gpu_material_library.c b/source/blender/gpu/intern/gpu_material_library.c index 3c216c1a991..73a80c62bdc 100644 --- a/source/blender/gpu/intern/gpu_material_library.c +++ b/source/blender/gpu/intern/gpu_material_library.c @@ -684,7 +684,7 @@ static GPUMaterialLibrary *gpu_material_libraries[] = { static GHash *FUNCTION_HASH = NULL; -char *gpu_str_skip_token(char *str, char *token, int max) +const char *gpu_str_skip_token(const char *str, char *token, int max) { int len = 0; @@ -752,7 +752,7 @@ static void gpu_parse_material_library(GHash *hash, GPUMaterialLibrary *library) eGPUType type; GPUFunctionQual qual; int i; - char *code = library->code; + const char *code = library->code; while ((code = strstr(code, "void "))) { function = MEM_callocN(sizeof(GPUFunction), "GPUFunction"); diff --git a/source/blender/gpu/intern/gpu_material_library.h b/source/blender/gpu/intern/gpu_material_library.h index da7b1636fa3..782d89d6f2a 100644 --- a/source/blender/gpu/intern/gpu_material_library.h +++ b/source/blender/gpu/intern/gpu_material_library.h @@ -62,5 +62,5 @@ char *gpu_material_library_generate_code(struct GSet *used_libraries, const char /* Code Parsing */ -char *gpu_str_skip_token(char *str, char *token, int max); +const char *gpu_str_skip_token(const char *str, char *token, int max); const char *gpu_data_type_to_string(const eGPUType type); diff --git a/source/blender/gpu/intern/gpu_node_graph.c b/source/blender/gpu/intern/gpu_node_graph.c index b220c60e979..585cb296bac 100644 --- a/source/blender/gpu/intern/gpu_node_graph.c +++ b/source/blender/gpu/intern/gpu_node_graph.c @@ -88,7 +88,7 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, const eGPUType name = outnode->name; input = outnode->inputs.first; - if ((STR_ELEM(name, "set_value", "set_rgb", "set_rgba")) && (input->type == type)) { + if (STR_ELEM(name, "set_value", "set_rgb", "set_rgba") && (input->type == type)) { input = MEM_dupallocN(outnode->inputs.first); if (input->link) { input->link->users++; @@ -174,7 +174,7 @@ static const char *gpu_uniform_set_function_from_type(eNodeSocketDatatype type) case SOCK_RGBA: return "set_rgba"; default: - BLI_assert(!"No gpu function for non-supported eNodeSocketDatatype"); + BLI_assert_msg(0, "No gpu function for non-supported eNodeSocketDatatype"); return NULL; } } @@ -259,7 +259,7 @@ static void gpu_node_output(GPUNode *node, const eGPUType type, GPUNodeLink **li output->link->link_type = GPU_NODE_LINK_OUTPUT; output->link->output = output; - /* note: the caller owns the reference to the link, GPUOutput + /* NOTE: the caller owns the reference to the link, GPUOutput * merely points to it, and if the node is destroyed it will * set that pointer to NULL */ } diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc index 5c33066c720..9ee8a8b8d32 100644 --- a/source/blender/gpu/intern/gpu_state.cc +++ b/source/blender/gpu/intern/gpu_state.cc @@ -187,7 +187,7 @@ void GPU_point_size(float size) /* Programmable point size * - shaders set their own point size when enabled * - use GPU_point_size when disabled */ -/* TODO remove and use program point size everywhere */ +/* TODO: remove and use program point size everywhere. */ void GPU_program_point_size(bool enable) { StateManager *stack = Context::get()->state_manager; diff --git a/source/blender/gpu/intern/gpu_state_private.hh b/source/blender/gpu/intern/gpu_state_private.hh index b79350a6506..b96b71a7ac4 100644 --- a/source/blender/gpu/intern/gpu_state_private.hh +++ b/source/blender/gpu/intern/gpu_state_private.hh @@ -96,7 +96,7 @@ inline GPUState operator~(const GPUState &a) union GPUStateMutable { struct { /* Viewport State */ - /** TODO remove */ + /** TODO: remove. */ float depth_range[2]; /** Positive if using program point size. */ /* TODO(fclem): should be passed as uniform to all shaders. */ diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc index de5a9f95b65..6564cbda694 100644 --- a/source/blender/gpu/intern/gpu_texture.cc +++ b/source/blender/gpu/intern/gpu_texture.cc @@ -154,7 +154,7 @@ void Texture::attach_to(FrameBuffer *fb, GPUAttachmentType type) return; } } - BLI_assert(!"GPU: Error: Texture: Not enough attachment"); + BLI_assert_msg(0, "GPU: Error: Texture: Not enough attachment"); } void Texture::detach_from(FrameBuffer *fb) @@ -166,7 +166,7 @@ void Texture::detach_from(FrameBuffer *fb) return; } } - BLI_assert(!"GPU: Error: Texture: Framebuffer is not attached"); + BLI_assert_msg(0, "GPU: Error: Texture: Framebuffer is not attached"); } void Texture::update(eGPUDataFormat format, const void *data) @@ -600,7 +600,7 @@ void GPU_texture_py_reference_set(GPUTexture *tex, void **py_ref) } #endif -/* TODO remove */ +/* TODO: remove. */ int GPU_texture_opengl_bindcode(const GPUTexture *tex) { return reinterpret_cast<const Texture *>(tex)->gl_bindcode_get(); diff --git a/source/blender/gpu/intern/gpu_texture_private.hh b/source/blender/gpu/intern/gpu_texture_private.hh index a8f2e482bdd..2b8a5a5cc12 100644 --- a/source/blender/gpu/intern/gpu_texture_private.hh +++ b/source/blender/gpu/intern/gpu_texture_private.hh @@ -155,7 +155,7 @@ class Texture { void mip_size_get(int mip, int r_size[3]) const { - /* TODO assert if lvl is below the limit of 1px in each dimension. */ + /* TODO: assert if lvl is below the limit of 1px in each dimension. */ int div = 1 << mip; r_size[0] = max_ii(1, w_ / div); @@ -559,7 +559,7 @@ static inline eGPUTextureFormat to_texture_format(const GPUVertFormat *format) case GPU_COMP_I16: return GPU_RGBA16I; case GPU_COMP_U16: - /* Note: Checking the fetch mode to select the right GPU texture format. This can be + /* NOTE: Checking the fetch mode to select the right GPU texture format. This can be * added to other formats as well. */ switch (format->attrs[0].fetch_mode) { case GPU_FETCH_INT: diff --git a/source/blender/gpu/intern/gpu_uniform_buffer.cc b/source/blender/gpu/intern/gpu_uniform_buffer.cc index 3edb090d81c..3a9269d1753 100644 --- a/source/blender/gpu/intern/gpu_uniform_buffer.cc +++ b/source/blender/gpu/intern/gpu_uniform_buffer.cc @@ -114,11 +114,11 @@ static void buffer_from_list_inputs_sort(ListBase *inputs) if (input->type == GPU_MAT3) { /* Alignment for mat3 is not handled currently, so not supported */ - BLI_assert(!"mat3 not supported in UBO"); + BLI_assert_msg(0, "mat3 not supported in UBO"); continue; } if (input->type > MAX_UBO_GPU_TYPE) { - BLI_assert(!"GPU type not supported in UBO"); + BLI_assert_msg(0, "GPU type not supported in UBO"); continue; } diff --git a/source/blender/gpu/intern/gpu_vertex_buffer.cc b/source/blender/gpu/intern/gpu_vertex_buffer.cc index 2c21d2bf9af..7ff68242c17 100644 --- a/source/blender/gpu/intern/gpu_vertex_buffer.cc +++ b/source/blender/gpu/intern/gpu_vertex_buffer.cc @@ -28,8 +28,8 @@ #include "gpu_backend.hh" #include "gpu_vertex_format_private.h" -#include "gl_vertex_buffer.hh" /* TODO remove */ -#include "gpu_context_private.hh" /* TODO remove */ +#include "gl_vertex_buffer.hh" /* TODO: remove. */ +#include "gpu_context_private.hh" /* TODO: remove. */ #include "gpu_vertex_buffer_private.hh" @@ -287,7 +287,7 @@ void GPU_vertbuf_attr_get_raw_data(GPUVertBuf *verts_, uint a_idx, GPUVertBufRaw /* NOTE: Be careful when using this. The data needs to match the expected format. */ void *GPU_vertbuf_get_data(const GPUVertBuf *verts) { - /* TODO Assert that the format has no padding. */ + /* TODO: Assert that the format has no padding. */ return unwrap(verts)->data; } @@ -296,7 +296,7 @@ void *GPU_vertbuf_get_data(const GPUVertBuf *verts) void *GPU_vertbuf_steal_data(GPUVertBuf *verts_) { VertBuf *verts = unwrap(verts_); - /* TODO Assert that the format has no padding. */ + /* TODO: Assert that the format has no padding. */ BLI_assert(verts->data); void *data = verts->data; verts->data = nullptr; diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c index ddf31b6ffa7..96bf1ec40b0 100644 --- a/source/blender/gpu/intern/gpu_viewport.c +++ b/source/blender/gpu/intern/gpu_viewport.c @@ -248,7 +248,7 @@ void *GPU_viewport_engine_data_create(GPUViewport *viewport, void *engine_type) } } - BLI_assert(!"Too many draw engines enabled at the same time"); + BLI_assert_msg(0, "Too many draw engines enabled at the same time"); return NULL; } diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc index 1ae68d6813c..42b85da1f93 100644 --- a/source/blender/gpu/opengl/gl_backend.cc +++ b/source/blender/gpu/opengl/gl_backend.cc @@ -90,7 +90,7 @@ void GLBackend::platform_init() device |= GPU_DEVICE_INTEL_UHD; } } - else if ((strstr(renderer, "Mesa DRI R")) || + else if (strstr(renderer, "Mesa DRI R") || (strstr(renderer, "Radeon") && strstr(vendor, "X.Org")) || (strstr(renderer, "AMD") && strstr(vendor, "X.Org")) || (strstr(renderer, "Gallium ") && strstr(renderer, " on ATI ")) || @@ -365,8 +365,8 @@ static void detect_workarounds() (strstr(version, "Build 20.19.15.4285"))) { GCaps.use_main_context_workaround = true; } - /* See T70187: merging vertices fail. This has been tested from 18.2.2 till 19.3.0~dev of the - * Mesa driver */ + /* See T70187: merging vertices fail. This has been tested from `18.2.2` till `19.3.0~dev` + * of the Mesa driver */ if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE) && (strstr(version, "Mesa 18.") || strstr(version, "Mesa 19.0") || strstr(version, "Mesa 19.1") || strstr(version, "Mesa 19.2"))) { diff --git a/source/blender/gpu/opengl/gl_context.cc b/source/blender/gpu/opengl/gl_context.cc index 6c9c6e10774..23654cb96f3 100644 --- a/source/blender/gpu/opengl/gl_context.cc +++ b/source/blender/gpu/opengl/gl_context.cc @@ -39,7 +39,7 @@ #include "gl_state.hh" #include "gl_uniform_buffer.hh" -#include "gl_backend.hh" /* TODO remove */ +#include "gl_backend.hh" /* TODO: remove. */ #include "gl_context.hh" using namespace blender; diff --git a/source/blender/gpu/opengl/gl_debug.cc b/source/blender/gpu/opengl/gl_debug.cc index ac42a950945..3e259235515 100644 --- a/source/blender/gpu/opengl/gl_debug.cc +++ b/source/blender/gpu/opengl/gl_debug.cc @@ -81,9 +81,11 @@ static void APIENTRY debug_callback(GLenum UNUSED(source), return; } - if (TRIM_NVIDIA_BUFFER_INFO && - GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) && - STRPREFIX(message, "Buffer detailed info")) { + /* NOTE: callback function can be triggered during before the platform is initialized. + * In this case invoking `GPU_type_matches` would fail and + * therefore the message is checked before the platform matching. */ + if (TRIM_NVIDIA_BUFFER_INFO && STRPREFIX(message, "Buffer detailed info") && + GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_ANY, GPU_DRIVER_OFFICIAL)) { /** Suppress buffer infos flooding the output. */ return; } diff --git a/source/blender/gpu/opengl/gl_drawlist.hh b/source/blender/gpu/opengl/gl_drawlist.hh index db4b9c03c3c..6f80fdd5a8a 100644 --- a/source/blender/gpu/opengl/gl_drawlist.hh +++ b/source/blender/gpu/opengl/gl_drawlist.hh @@ -72,7 +72,7 @@ class GLDrawList : public DrawList { GLuint buffer_id_; /** Length of whole the buffer (in byte). */ GLsizeiptr buffer_size_; - /** Offset of data_ inside the whole buffer (in byte). */ + /** Offset of `data_` inside the whole buffer (in byte). */ GLintptr data_offset_; /** To free the buffer_id_. */ diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc index e87b22985bd..8da114d9270 100644 --- a/source/blender/gpu/opengl/gl_framebuffer.cc +++ b/source/blender/gpu/opengl/gl_framebuffer.cc @@ -268,7 +268,7 @@ void GLFrameBuffer::bind(bool enabled_srgb) } if (context_ != GLContext::get()) { - BLI_assert(!"Trying to use the same frame-buffer in multiple context"); + BLI_assert_msg(0, "Trying to use the same frame-buffer in multiple context"); return; } @@ -379,7 +379,7 @@ void GLFrameBuffer::clear_attachment(GPUAttachmentType type, glClearBufferfv(GL_DEPTH, 0, &depth); } else { - BLI_assert(!"Unhandled data format"); + BLI_assert_msg(0, "Unhandled data format"); } } else { @@ -395,7 +395,7 @@ void GLFrameBuffer::clear_attachment(GPUAttachmentType type, glClearBufferiv(GL_COLOR, slot, (GLint *)clear_value); break; default: - BLI_assert(!"Unhandled data format"); + BLI_assert_msg(0, "Unhandled data format"); break; } } diff --git a/source/blender/gpu/opengl/gl_query.cc b/source/blender/gpu/opengl/gl_query.cc index 8a42719c665..da9770b4cc1 100644 --- a/source/blender/gpu/opengl/gl_query.cc +++ b/source/blender/gpu/opengl/gl_query.cc @@ -41,7 +41,7 @@ void GLQueryPool::init(GPUQueryType type) query_issued_ = 0; } -#if 0 /* TODO to avoid realloc of permanent query pool. */ +#if 0 /* TODO: to avoid realloc of permanent query pool. */ void GLQueryPool::reset(GPUQueryType type) { initialized_ = false; @@ -50,7 +50,7 @@ void GLQueryPool::reset(GPUQueryType type) void GLQueryPool::begin_query() { - /* TODO add assert about expected usage. */ + /* TODO: add assert about expected usage. */ while (query_issued_ >= query_ids_.size()) { int64_t prev_size = query_ids_.size(); query_ids_.resize(prev_size + QUERY_CHUNCK_LEN); @@ -61,7 +61,7 @@ void GLQueryPool::begin_query() void GLQueryPool::end_query() { - /* TODO add assert about expected usage. */ + /* TODO: add assert about expected usage. */ glEndQuery(gl_type_); } @@ -70,7 +70,7 @@ void GLQueryPool::get_occlusion_result(MutableSpan<uint32_t> r_values) BLI_assert(r_values.size() == query_issued_); for (int i = 0; i < query_issued_; i++) { - /* Note: This is a sync point. */ + /* NOTE: This is a sync point. */ glGetQueryObjectuiv(query_ids_[i], GL_QUERY_RESULT, &r_values[i]); } } diff --git a/source/blender/gpu/opengl/gl_state.cc b/source/blender/gpu/opengl/gl_state.cc index b837eae4871..1106e3dab50 100644 --- a/source/blender/gpu/opengl/gl_state.cc +++ b/source/blender/gpu/opengl/gl_state.cc @@ -131,7 +131,7 @@ void GLStateManager::set_state(const GPUState &state) set_shadow_bias(state.shadow_bias); } - /* TODO remove */ + /* TODO: remove. */ if (changed.polygon_smooth) { if (state.polygon_smooth) { glEnable(GL_POLYGON_SMOOTH); @@ -156,7 +156,7 @@ void GLStateManager::set_mutable_state(const GPUStateMutable &state) { GPUStateMutable changed = state ^ current_mutable_; - /* TODO remove, should be uniform. */ + /* TODO: remove, should be uniform. */ if (float_as_uint(changed.point_size) != 0) { if (state.point_size > 0.0f) { glEnable(GL_PROGRAM_POINT_SIZE); @@ -168,12 +168,12 @@ void GLStateManager::set_mutable_state(const GPUStateMutable &state) } if (changed.line_width != 0) { - /* TODO remove, should use wide line shader. */ + /* TODO: remove, should use wide line shader. */ glLineWidth(clamp_f(state.line_width, line_width_range_[0], line_width_range_[1])); } if (changed.depth_range[0] != 0 || changed.depth_range[1] != 0) { - /* TODO remove, should modify the projection matrix instead. */ + /* TODO: remove, should modify the projection matrix instead. */ glDepthRange(UNPACK2(state.depth_range)); } diff --git a/source/blender/gpu/opengl/gl_texture.cc b/source/blender/gpu/opengl/gl_texture.cc index ddc45a6a904..db1fda63c28 100644 --- a/source/blender/gpu/opengl/gl_texture.cc +++ b/source/blender/gpu/opengl/gl_texture.cc @@ -32,7 +32,7 @@ #include "gl_backend.hh" #include "gl_debug.hh" #include "gl_state.hh" -#include "gpu_vertex_buffer_private.hh" /* TODO should be `gl_vertex_buffer.hh` */ +#include "gpu_vertex_buffer_private.hh" /* TODO: should be `gl_vertex_buffer.hh`. */ #include "gl_texture.hh" @@ -347,7 +347,7 @@ void GLTexture::copy_to(Texture *dst_) BLI_assert((dst->w_ == src->w_) && (dst->h_ == src->h_) && (dst->d_ == src->d_)); BLI_assert(dst->format_ == src->format_); BLI_assert(dst->type_ == src->type_); - /* TODO support array / 3D textures. */ + /* TODO: support array / 3D textures. */ BLI_assert(dst->d_ == 0); if (GLContext::copy_image_support) { diff --git a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl index 9ce2a1be015..aae7f641af8 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl @@ -18,6 +18,7 @@ in vec2 P2; in vec2 P3; in ivec4 colid_doarrow; in ivec2 domuted; +in float dim_factor; uniform vec4 colors[6]; @@ -39,6 +40,7 @@ uniform vec2 bezierPts[4]; uniform vec4 colors[3]; uniform bool doArrow; uniform bool doMuted; +uniform float dim_factor; # define colShadow colors[0] # define colStart colors[1] @@ -98,6 +100,8 @@ void main(void) } } + finalColor[3] *= dim_factor; + /* Expand into a line */ gl_Position.xy += exp_axis * expandSize * expand_dist; diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_world_normals.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_world_normals.glsl index d33465fa846..40e46bc250c 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_world_normals.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_world_normals.glsl @@ -1,4 +1,4 @@ -/* TODO : clean this ifdef mess */ +/* TODO: clean this `ifdef` mess. */ void world_normals_get(out vec3 N) { #ifndef VOLUMETRICS |