Age | Commit message (Collapse) | Author |
|
This is a first part of the Shader Create Info system could be.
A shader create info provides a way to define shader structure, resources
and interfaces. This makes for a quick way to provide backend agnostic
binding informations while also making shader variations easy to declare.
- Clear source input (only one file). Cleans up the GPU api since we can create a
shader from one descriptor
- Resources and interfaces are generated by the backend (much simpler than parsing).
- Bindings are explicit from position in the array.
- GPUShaderInterface becomes a trivial translation of enums and string copy.
- No external dependency to third party lib.
- Cleaner code, less fragmentation of resources in several libs.
- Easy to modify / extend at runtime.
- no parser involve, very easy to code.
- Does not hold any data, can be static and kept on disc.
- Could hold precompiled bytecode for static shaders.
This also includes a new global dependency system.
GLSL shaders can include other sources by using #pragma BLENDER_REQUIRE(...).
This patch already migrated several builtin shaders. Other shaders should be migrated
one at a time, and could be done inside master.
There is a new compile directive `WITH_GPU_SHADER_BUILDER` this is an optional
directive for linting shaders to increase turn around time.
What is remaining:
- pyGPU API {T94975}
- Migration of other shaders. This could be a community effort.
Reviewed By: jbakker
Maniphest Tasks: T94975
Differential Revision: https://developer.blender.org/D13360
|
|
Ref T92709
|
|
|
|
|
|
D9054 did multiple consecutive `immBegin()`/`immEnd()` draw calls to draw
multiple lines at varying thickness. This would only work for the first line,
then they'd all get a 1px thickness (at least on macOS).
Issue was that `wide_line_workaround_end()` called `immBindShader()` directly
to restore the old shader (which the workaround overrides). However this
doesn't set `imm->builtin_shader_bound` which has to be done for the workaround
to work on the next `immBegin()` call. Instead `immBindBuiltinProgram()` can be
called.
Differential Revision: https://developer.blender.org/D10520
Reviewed by: Clément Foucault
|
|
Conflicts:
source/blender/editors/render/render_opengl.c
source/blender/sequencer/intern/effects.c
|
|
The issue was the use of alpha values of 0 when there were no blending
enabled.
This patch just disables the smoothing of the wires in this case.
|
|
Replace `NULL` with `nullptr` in C++ code.
No functional changes.
|
|
|
|
Following the most widely used convention for including todo's in
the code, that is: `TODO(name):`, `FIXME(name)` ... etc.
|
|
This makes wide line supported on MacOS and other implementation that
does not support wide line by default.
This workaround works for all Line types but only if using one of the 5
default shaders.
The workaround is completely isolated and invisible to the outside. It has
no side effect.
Note: This does not affect the GPUBatch drawing.
|
|
|
|
|
|
This makes the GPUContext follow the same naming convention as the rest
of the module.
Also add a static getter for extra bonus style (no need for casts):
- Context::get()
- GLContext::get()
|
|
This avoids unecessary complexity.
Also makes the GPUImmediate threadsafe by using a threadlocal imm variable.
|
|
to avoid more typecasts.
|
|
This is just a cleanup to isolate the internals of the vertbuf.
This adds some getters to avoid refactor of existing code.
|
|
|
|
This is part of the Vulkan backend task T68990.
This is mostly a cleanup, however, there is a small change:
We don't use a special Vertex Array binding function for Immediate
anymore and just reuse the one for batches.
This might create a bit more state changes but this could be fixed
easily if it causes perf regression.
# Conflicts:
# source/blender/gpu/intern/gpu_context.cc
|
|
|
|
|
|
|
|
|
|
|
|
Also add new flags to communicate specific behavior to future backend.
|
|
This remove the use of batch->program and replace it with batch->shader.
This will allow GL abstraction latter.
|
|
|
|
|
|
|
|
|
|
|