Age | Commit message (Collapse) | Author |
|
|
|
This could have caused overflow issue.
|
|
This was due to uninitialized texture space.
|
|
|
|
|
|
Previous code was assuming that the glyph texture would remain bound to
GL_TEXTURE0 until the cache would be drawn. This is not always the case,
so better save the texture and rebind it before drawing.
|
|
Reduce the number of sampled required for blurring by using filtered
texture samples.
This changes the result a bit but it is not noticable.
|
|
This port the Blurring of blf fonts to the final drawing shader.
We add a bit of extra padding to each glyph so that jittering the texture
coord does not sample the neighbor glyphs.
|
|
Flush the text cache so that we have proper scissor test and ordering.
|
|
Overall 10% more performance on general UI drawing time.
This commit can introduce ordering problem on some elements.
In this case you need to flush the widget cache to ensure the element that
is going to be drawn is drawn on top of any widget base.
To flush the cache use UI_widgetbase_draw_cache_flush.
This is already done for BLF and Icons.
|
|
- Undo that changes modes currently asserts,
since undo is now screen data.
Most likely we will change how object mode and workspaces work
since it's not practical/maintainable at the moment.
- Removed view_layer from particle settings
(wasn't needed and complicated undo).
|
|
"this is not the commit you're looking for"
|
|
This was breaking the first drawcall after a simple/non-simple shader
switch.
|
|
Using FT_Set_Char_Size is slow. Calling it only when needed is more clever.
|
|
This adds less than a megabyte of mem usage.
FT_Get_Kerning was the 2nd hotspot when profilling. This commit completly
remove this cost.
One concern though: I don't know if the kerning data is constant for every
sizes but it seems to be the case. I tested different fonts at different
dpi scalling and saw no differences.
|
|
- use x/y/width/height/max as a suffix.
- replace 'num' prefix /w 'len' suffix.
|
|
- batching -> batch_draw.
- ct & size -> len.
- start/end -> begin/end (follow GL convention).
|
|
I've made a separate version of the geom shader that works with full
3D modelviewmat.
This commit also includes some fixup inside blf_batching_start().
|
|
You can now use BLF_batching_start and BLF_batching_end to batch every
drawcall to BLF together minimizing the overhead introduced by BLF and the
opengl driver.
These calls cannot be nested (for now).
If the modelview matrix changes, previously batched calls are issued and a
the process resume with the new matrix.
However the projection matrix MUST not change and gl scissors as well.
|
|
This is not a perfect win just yet. It's now calling glBufferSubData for
every call (instead of using glMapBufferRange which is almost faster), but
with this system we will be able to batch drawcalls together.
See next commit.
|
|
There is no point to not call strlen if the number of char is large.
|
|
This means smaller imm buffer usage.
This does not reduce the number of drawcalls.
This uses geometry shader which is slow for the GPU but given we are really
CPU bound on this case, it should not matter.
A perfect implementation would:
- Set the glyph coord in a bufferTexture and just send the glyph ID to the
GPU to read the bufferTexture.
- Use GWN_draw_primitive and draw 2*strllen triangle and just retrieve the
glyph ID and color based on gl_VertexID / 6.
- Stream fixed size buffer that the Driver can discard quickly but this is
the same as improving IMM directly.
|
|
|
|
BLF is a low level module, which might (and is) used without Blender.
Thanks Campbell for review!
|
|
|
|
This includes a few modification:
- The biggest one is call glActiveTexture before doing any call to
glBindTexture for rendering purpose (uniform value depends on it).
This is also better to know what's going on when rendering UI. So if
there is missing UI elements because of this commit look for this first.
This allows us to have "less calls" to glActiveTexture (I did not
measure the final count) and less checks inside GPU_texture.
- Remove use of GL_TEXTURE0 as a uniform value in a few places.
- Be more strict and use BLI_assert for bad usage of GPU_texture functions.
- Disable filtering for integer and stencil textures (not supported by
OGL specs).
- Replace bools inside GPUTexture by a bitflag supporting more options to
identify texture types.
|
|
It's unlikely to ever be intentional to square the source alpha, as happens
with glBlendFunc, so this changes the blending throughout the code.
|
|
|
|
|
|
Fix some cases that still assumed there to be a global DPI, instead of a per
window DPI that needs to be set before reading U.dpi.
|
|
Use consistent prefix for gawain API names as well as
some abbreviations to avoid over-long names, see: D2678
|
|
|
|
This is as per our code style states ans as majority of the team
prefers types to be used.
|
|
The issue was going to the fact that GL_ALPHA was deprecated in core profile
and common solution online is to use GL_RED instead. That is what is done in
this commit.
|
|
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
|
|
Conflicts:
source/blender/alembic/intern/abc_exporter.cc
|
|
Causes crash if the font size isn't set after clearing (see T51200)
|
|
|
|
This is a workaround while the PRIM_QUADS_XXX are still in the code
|
|
Single quads are drawn as a TRIANGLE_FAN, with 4 verts in the same order.
Multiple quads now use PRIM_QUADS_XXX and will need further work. Only 8 places still use this.
Part of T49043
|
|
See intern/gawain for the API change. Other files are updated to use the new name. Also updated every call site to the recommended style:
unsigned int foo = VertexFormat_add_attrib(format, "foo", COMP_ ... )
|
|
|
|
Take advantage of 2D functions, rotation about the X Y or Z axis, uniform scale factors.
We no longer need to call gpuMatrixBegin_legacy() before using the new API locally in functions.
related to T49450
|
|
Pretty sure source/blender is now finished, with all legacy matrix calls confined to gpu_matrix.c.
This was the easy part, but doing it first makes the next part much easier. TODO and XXX notes describe what is left.
glMatrixMode is still in place, since the new API does not share this concept of modes. Similar for glOrtho and glFrustum which I'll tackle very soon.
Part of T49450
|
|
|
|
|
|
We had two versions of several BLF functions -- one for a specific font ID & another for the default font.
New BLF_default function lets us simplify this API & delete the redundant code.
|
|
So we don't need two versions of all other BLF functions -- one for specific font ID & another for the default font.
|
|
blenderplayer uses BLF but not Editor UI, so we got a link error for the missing UI_GetThemeColor function.
Moved the new function from BLF to UI.
@Blendify reported problem in IRC
|
|
For anything fancier than regular Theme colors (shading, alpha, etc.) do this:
unsigned char color[4]
UI_GetThemeColor[Fancy]4ubv(... color)
BLF_color4ubv(fontid, color)
That way the BLF color API stays simple.
|