Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
And move it to GPU module.
|
|
This reduce the base size of the shaderinterface from 400 to 136 bytes.
Improves memory usage and cache coherency when querying a lot of uniforms
at once.
|
|
Useful when UI code needs to extend the clipping range.
|
|
Differential Revision: https://developer.blender.org/D6311
|
|
Previously, we had one global `GPU_matrix` stack, so the API was not
thread safe. This patch makes the stack be per `GPUContext`, effectively
making it local per thread (`GPUContext` is located in thread local
storage).
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5405
|
|
|
|
Pre-calculates values needed for unprojecting to avoid
a matrix invert and extracting projection matrix dimensions for
every call to GPU_matrix_unproject.
Use for gizmo selection drawing.
|
|
This is normally already calculated so add a version that takes the
inverted matrix.
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
|
|
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
|
|
Needed for clang formatting to workaround bug/limit, see: T53211
|
|
|
|
|
|
|
|
This does not include all the struct and type renaming. Only files were
renamed.
gwn_batch.c/h was fusioned with GPU_batch.c/h
gwn_immediate.c/h was fusioned with GPU_immediate.c/h
gwn_imm_util.c/h was fusioned with GPU_immediate_util.c/h
|
|
Thanks to @sergey for review
|
|
|
|
|
|
Avoids requiring glew headers in Python API.
|
|
Raise exception when stack limits are reached.
|
|
Use consistent prefix for gawain API names as well as
some abbreviations to avoid over-long names, see: D2678
|
|
Since the change to core profile this is no longer supported.
|
|
|
|
|
|
With the explicit calls we don't need to worry about current state
outside of the GPU module now. In fact. we don't need to worry about
current matrix mode in core profile at all.
Legacy OpenGL now has some code which ensures current matrix mode
when using explicit calls to push/pop matrix.
|
|
There are two major things in this commit.
First one is to have proper stack for projection matrices. This is
something what OpenGL specification grants to have at least 2 elements
for and what is required to have for proper editor drawing without
refactoring the way how we restore projection matrix.
Supporting this stack have following advantages:
- Our GPU stack is closer to OpenGL specs, making it easier to follow
by other developers who are always familiar with OpenGL.
- Makes it easier to port all editors to a new API.
- Should help us getting rid of extra matrix push/pop added in
various commits to 2.8 branch.
The new API follows the following convention:
- gpuPushMatrix/gpuPopMatrix ALWAYS deals with model view matrix
and nothing more.
While this name does not fully indicate that it's only model view
matrix operator, it matches behavior of other matrix operations
such as transform which also doesn't indicate what matrix type
they are operating on.
- Projection matrix has dedicated calls for push/pop which are
gpuPushProjectionMatrix/gpuPopProjectionMatrix.
|
|
- remove 2D-specific variants of BuiltinUniform enum
- rename remaining builtins to exclude "_3D" since they can be used by 2D or 3D shaders
Follow up to D2626
|
|
Without this gpuGet functions would cast everything
(no type or size checks and override const variables).
|
|
See GPU_matrix.h & gpu_matrix.c for the important changes. Other files are mostly just updated to use the latest API.
- remove unused functions, defines, enums, comments
- remove "3D" from function names
- init to Identity transform (otherwise empty stack)
- gpuMatrixReset lets outside code return to initial state
Part of T49450
Follow up to D2626 and 49fc9cff3b90
|
|
|
|
* Brings us closer to core profile, all matrices are working, and apart
from a problem with text drawing, Blender is working fine.
* Reduce the coding overhead of having to setup/teardown when
alternating between 2D and 3D drawing sessions.
* Gives us fewer modes and states we need to keep track of.
Unfortunatelly this also "rejects a fundamental change" the original
design was trying to make - that 2D is different from 3D and
deserves its own best implementation.
That said, it is still aligned with the function API design as
originally implemented (i.e., it still uses gpuTranslate2D, ...).
Finally, if you build with core profile and this patch you get:
https://developer.blender.org/F545352
[The text glitch is an unrelated issue].
Reviewers: merwin, sergey, brecht
Differential Revision: https://developer.blender.org/D2626
|
|
... even though 3x3 feels better.
This is a compromise to get core profile up & running sooner. Eventually I'd like to finish the original 3x3 plans, but this commit will let us get on with other tasks.
External API stays (almost) the same. Our GLSL shaders can use this without any changes.
Part of T49450 and T51164
|
|
This eliminates tons of glGetUniformLocation calls from the drawing loop. Vast majority of code can keep making the same function calls. They're just faster now!
- Batch_Uniform*
- immUniform*
- gpuBindMatrices
- and others
|
|
It helped during the transition, but we don't need this anymore. Evolution of T49450
|
|
- init projection matrices with identity
- fix copy/paste mistake in GetProjectionMatrix3D
- add extra matrices needed by material GLSL
Working toward T49450
|
|
Still using legacy GL within the GPU library itself, but we'll be able to switch soon.
Part of T49450
|
|
Now using the correct GL enum.
Part of T49450
|
|
GPU lib should not depend on editor (glutil) code.
|
|
Make an existing 4x4 matrix the current projection.
Found a need for this while converting code to new API.
Part of T49450
|
|
For functions that expect a 4x4 matrix, you can pass in that, or array[16], or float*, or... Casting at each call site can get annoying, and obscures the logic.
The C11 section still needs work, but the non-C11 macros help on the system I tested on (Mac/clang).
Part of T49450
|
|
No longer needed since 231b5d96bbfd77253941dd37cc4929e4e119d706 tracks dirty state of legacy matrix stacks.
Part of T49450
|