Age | Commit message (Collapse) | Author |
|
Apparently `textureSize` doesn't work with
`sampler1DArray` on this OS.
Thanks to @dave1853 for finding the source of the
problem.
|
|
|
|
This makes more sense as this module has more to it than just
GL extensions.
|
|
This is to modernize the API:
- Add meaningful name to all textures (except DRW textures).
- Remove unused err_out argument: only used for offscreen python.
- Add mipmap count to creation functions for future changes.
- Clarify the data usage in creation functions.
This is a cleanup commit, there is no functional change.
# Conflicts:
# source/blender/gpu/GPU_texture.h
|
|
Use creation + update function instead.
|
|
Quiet warning/error about int and float multiplication.
Differential Revision: https://developer.blender.org/D7893
Reviewed by Ray Molenkamp
|
|
Adds the ability to print text in bold or italics style, synthesized from a single base UI font.
Differential Revision: https://developer.blender.org/D7893
Reviewed by Brecht Van Lommel
|
|
|
|
These were stored as float but were originally cast from an int
and were often cast back to int.
Also use int pairs for dimensions values.
|
|
|
|
- Move gpuPush/Pop from GPU_draw.h into GPU_state.h
as this is for pushing/popping state.
- Add 'GPU_STANDALONE' define, to bypass use of user-preferences
for theme colors and pixelsize, as well as pbvh init/free functions.
Needed to get GHOST tests working again.
|
|
The glyph can come from a different cache.
|
|
The current code allocates and transfers a lot of memory to the GPU,
but only a small portion of this memory is actually used.
In addition, the code calls many costly gl operations during the
caching process.
This commit significantly reduce the amount of memory by allocating
and transferring a flat array without pads to the GPU.
It also calls as little as possible the gl operations during the cache.
This code also simulate a billinear filter `GL_LINEAR` using a 1D texture.
**Average drawing time:**
|before:|0.00003184 sec
|now:|0.00001943 sec
|fac:|1.6385156675048407
**5 worst times:**
|before:|[0.001075, 0.001433, 0.002143, 0.002915, 0.003242]
|now:|[0.00094, 0.000993, 0.001502, 0.002284, 0.002328]
Differential Revision: https://developer.blender.org/D6886
|
|
Two main reasons for the lag:
- Allocation of memory with transfer to GPU.
- BLF_cache_clear();
The (partial) solution is to avoid memory allocating in some setups
through the `GPU_texture_clear`.
Differential Revision: https://developer.blender.org/D6837
|
|
This reverts commit a21f5ec56245f7f1fbede4aa3c140a582c3a6a1b.
|
|
Two main reasons for the lag:
- Allocation of memory with transfer to GPU.
- BLF_cache_clear();
The memory allocation seems to be unnecessary, so I removed it.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D6837
|
|
Functions that utilize glyph cache should lock and unlock cache by
calling `blf_glyph_cache_acquire()` and `blf_glyph_cache_release()`.
Function `blf_glyph_cache_acquire()` will create glyph cache, if it doesn't exist.
Locking mutex is global and shared by all fonts.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5701
|
|
Some statements were split across multiple lines because of their
trailing comments.
In most cases it's clearer to put the comments above.
|
|
We were missing a null pointer check for invalid fonts.
|
|
|
|
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
|
|
We do not support special color fonts (like colored emoji fonts), so
don't crash when trying to create a preview for unsupported fonts.
Reviewed By: Brecht
Differential Revision: http://developer.blender.org/D4590
|
|
Reviewers: billreynish, brecht
Differential Revision: https://developer.blender.org/D4550
|
|
There are two issues at play here.
First, BLF_width computed a width that was not wide
enough to actually hold the text.
Second, blf_glyph_calc_rect_test computed an incorrect
rect->xmax when the glyph was moved to the left a bit.
We ignore the overlap on the left, but the right side
should still be adjusted accordingly.
|
|
The main problem was that the character `J` has "negative kerning".
It was cut off because it started outside of the clipping rectangle.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D4513
|
|
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
|
|
Also contains some code typo fixes (mostly, adtaptative -> adaptive,
former is nearly innexistant in English, let's stick to simple valid
words ;) ).
|
|
|
|
This changes the text hinting setting to be an enum with options
Auto / None / Slight / Full. The default is Auto which currently disables
hinting.
The hinting was tested with a new FreeType version, but this is not what
is used on the buildbots an official release environment, and the fonts
look quite bad because of that. Once FreeType has been upgraded we can
change the default.
Even then the results are not ideal, perhaps due to missing subpixel
positioning and linear color blending support in BLF.
|
|
|
|
Now disabling anti-aliasing doesn't impact sequencer, render stamp etc.
|
|
GPU_LINEAR is there for shadow font blurring, the real issue was lack of
rounding for the batch offset.
|
|
Barely any visible difference, except when drawing big custom text
with the Python API.
|
|
|
|
- Texture creation now requires explicit data type.
- GPU_texture_add_mipmap enable explicit mipmap upload.
- GPU_texture_get_mipmap_size can be used to get the size of a mipmap level
of an existing GPUTexture
- GPU_texture_read let you read back data from a gpu texture.
|
|
|
|
Caused some gpus to have issues with the font shadows.
thanks @fclem for helping tracking this one down.
|
|
and types.
In an effort to centralize all opengl calls in the codebase, this patch replaces
the raw opengl calls in bf_blenfont with GPUTexture so it's no longer depended
on opengl headers.
reviewer: Brecht
Differential Revision: https://developer.blender.org/D3483
|
|
|
|
Remove from blender/nodes, collada, blenfont & render.
|
|
|
|
Strip unindented comment blocks - mainly headers to avoid conflicts.
|
|
Fix T54838 : Text display glitch w/ fonts at different sizes.
This was cause by the cache not being flushed when changing font texture.
|
|
|
|
This could have caused overflow issue.
|
|
This was due to uninitialized texture space.
|