Commit Graph

2763 Commits

Author SHA1 Message Date
Clément Foucault
bdda53fdb2 GPU: Texture: Replace internal sampler state by explicit state object
This makes it easier to track as well as allowing us to sample the same
texture with different sampling parameters (which should fix the related
T73942 in the long run).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7831
2020-06-02 10:47:56 +02:00
Clément Foucault
3923062d13 Cleanup: GPU: Fix warning 2020-05-28 14:04:52 +02:00
Clément Foucault
59b730b643 GPU: Fix compilation warning about uninitialized values 2020-05-28 13:42:11 +02:00
Clément Foucault
c19cc7ef81 GPUTexture: Make GPU_texture_clear workaround fast.
This way we have a convenient way to clear individual textures.
2020-05-25 18:37:44 +02:00
Brecht Van Lommel
5267ce8e03 Merge branch 'blender-v2.83-release' 2020-05-19 23:42:32 +02:00
Brecht Van Lommel
8d63d7337c Fix unnecessary buffer reallocation in sculpt mode, causing an assert
Probably did not cause an actual, the assert is a performance warning.

Ref T76858
2020-05-19 23:36:12 +02:00
Hans Goudey
8e0a57f9bd Merge branch 'blender-v2.83-release' 2020-05-19 16:40:53 -04:00
Clément Foucault
13125e0948 GPU: Attempt to fix Crash on startup with Intel HD Graphics 620/630
This only enables the workarounds that we know have effects on intels.
We could add the other workarounds if needed.

Related task T72098
2020-05-19 22:24:25 +02:00
Sebastian Parborg
82bda82ec4 Fix T76541: OpenGl Depth Picking not selecting frontmost object
The issue was that we used GL_ALWAYS for depth checking here which would
lead to the depth information from objects being messed up.

It would not represent which object was closest to the camera.

Reviewed By: Clément Foucault, Jeroen Bakker, Campbell Barton

Differential Revision: http://developer.blender.org/D7710
2020-05-19 12:22:28 +02:00
Ray Molenkamp
393050e8e5 Merge remote-tracking branch 'origin/blender-v2.83-release' 2020-05-18 16:37:57 -06:00
Brecht Van Lommel
c4ee94328f Fix invalid bit shift when GPU shader attribute is not found 2020-05-18 21:22:02 +02:00
Brecht Van Lommel
e0ae229acb Fix potential crash due to dyntopo GPU buffer invalid memory access
When the number of triangles in a node became zero, the wireframe batch was
not freed along with the triangles batch and could still reference a freed
vertex buffer.

Ref T76858
2020-05-18 21:01:41 +02:00
Clément Foucault
dcf67fdf7f UI: Widget: Make emboss offset dependent of line width 2020-05-18 15:27:30 +02:00
Clément Foucault
27b23148fa UI: Widgets: Reduce constants count in shader 2020-05-18 15:27:29 +02:00
Clément Foucault
6ede93bab3 Cleanup: Put GPU_state_init inside gpu_state.c
Also put glDisable(GL_DITHER) in it since we don't even use it (but is
enabled by default).

Also leave GL_MULTISAMPLE on by default since it has no impact on non-MSAA
framebuffers.
2020-05-18 15:27:29 +02:00
Philipp Oeser
b67f649077 Merge branch 'blender-v2.83-release' 2020-05-15 16:02:12 +02:00
Philipp Oeser
266caa1820 Fix T76755: texture paint on udims crash
Caused by rB5593efec01c2.

Use first texture if we dont have an ImageUser (instead of multiview
one). Same fix as in rB9ace7e243978 / T74925.

Maniphest Tasks: T76755

Differential Revision: https://developer.blender.org/D7743
2020-05-15 15:56:35 +02:00
Pablo Dobarro
dc4983dfdd Merge branch 'blender-v2.83-release' 2020-05-14 16:49:18 +02:00
Pablo Dobarro
78e3b7c28d Sculpt: Render Face Sets always as flat shading
This removes the smooth shading rendering from the face set overlay when
smooth shading is enabled.

Reviewed By: jbakker

Maniphest Tasks: T74906, T74622, T75331, T76530

Differential Revision: https://developer.blender.org/D7105
2020-05-14 16:47:50 +02:00
Clément Foucault
bd80c21635 Merge branch 'blender-v2.83-release' 2020-05-14 16:23:24 +02:00
Clément Foucault
ada03e8673 UI: Fix Unreported missing background for azone arrow
This was caused by the sRGB viewport changes. The fix is to modify the
alpha values manually. The shader was also missing a srgb fix.
2020-05-14 16:16:29 +02:00
Sebastian Parborg
36d9f7e375 Fix T76541: OpenGl Depth Picking not selecting frontmost object
The issue was that we used GL_ALWAYS for depth checking here which would
lead to the depth information from objects being messed up.

It would not represent which object was closest to the camera.

Reviewed By: Clément Foucault, Jeroen Bakker, Campbell Barton

Differential Revision: http://developer.blender.org/D7710
2020-05-14 13:46:23 +02:00
Jacques Lucke
6f985574b7 Cleanup: take includes out of 'extern "C"' blocks
Surrounding includes with an 'extern "C"' block is not necessary anymore.
Also that made it harder to add any C++ code to some headers, or include headers
that have "optional" C++ code like `MEM_guardedalloc.h`.

I tested compilation on linux and windows (and got help from @LazyDodo).
If this still breaks compilation due to some linker error, the header containing
the symbol in question is probably missing an 'extern "C"' block.

Differential Revision: https://developer.blender.org/D7653
2020-05-08 18:22:41 +02:00
Brecht Van Lommel
04c04b6f4d Merge branch 'blender-v2.83-release' 2020-05-07 22:06:22 +02:00
Brecht Van Lommel
05fafb05b1 Fix T76510: Eevee OpenVDB render artifacts due to texture clamping 2020-05-07 22:02:39 +02:00
Campbell Barton
f55e92107a Cleanup: warnings 2020-05-05 16:05:51 +10:00
Hans Goudey
d8011902f4 Merge branch 'blender-v2.83-release' 2020-05-04 10:21:07 -04:00
Jeroen Bakker
37182c369a GPU: Set Default Buffer Size Immediate Mode
We set the default buffer size for strict buffers to 0. This increased
the performance on intel but reduced the performance on old AMD cards.
This patch sets back the default buffer size for strict buffers. After
testing I didn't detect a slow-down anymore.

Note that today new firmwares were pushed to the device what might fix
some issues.
2020-05-04 16:00:47 +02:00
mano-wii
d1226a6d9d Revert "Possible fix for T76113: Use GL_STATIC_DRAW in immBegin"
This reverts commit 7df51ca11a.
Did not solve the main problem.
2020-05-04 08:41:07 -03:00
Campbell Barton
d388c1c524 Cleanup: sort file lists 2020-05-03 13:45:40 +10:00
mano-wii
7df51ca11a Possible fix for T76113: Use GL_STATIC_DRAW in immBegin
This fixes a freeze when closing temporary windows with `AMD Radeon HD 7570M`
The performance is practically the same between calls (with a micro advantage for `GL_STATIC_DRAW`)
I couldn't check the difference in memory usage.
The ideal would be profile in different setups.
But due to the seriousness of the bug, these tests were postponed.
2020-05-02 10:21:38 -03:00
Campbell Barton
02c77e4e5c Fix animation player checkerboard drawing with alpha channels
Was using uninitialized theme values.
2020-04-30 17:45:02 +10:00
Christian Rauch
0da05720de GPU: add assert for immBegin buffer size & context 2020-04-27 15:27:53 +10:00
Clément Foucault
066b0248df Merge branch 'blender-v2.83-release' 2020-04-26 12:26:26 +02:00
Clément Foucault
05b94c9c54 GPU: Add better support for texture copy fallback
Depth texture copy using glCopyTexSubImage2D is undefined behavior since
you cannot bind GL_DEPTH_ATTACHMENT to glReadBuffer.

Using glBlitFramebuffer as a fallback.
2020-04-26 12:25:52 +02:00
Clément Foucault
826f6dd9ee Merge branch 'blender-v2.83-release' 2020-04-23 23:08:20 +02:00
Clément Foucault
d712f1f83a GPU: Add Polyline shader (wide line emulation)
This new shader is able to emulate smooth wide lines drawing using a
geometry shader.

This shader needs viewportSize and lineWidth uniforms to be set.

There is multiple variants to replace the usage of wide lines for most
shaders.

This patch only fix the gizmo_types files and the navigation gizmo.
Other areas could be fixed afterward, I just limited the patch size.

Fix T57570.

Reviewed By: billreynish

Differential Revision: https://developer.blender.org/D7487
2020-04-23 23:07:48 +02:00
Clément Foucault
f6f4ab3ebf Merge branch 'blender-v2.83-release' 2020-04-22 21:42:09 +02:00
Clément Foucault
f7753bf97f GPU: Add GPU_texture_copy
This allow to copy entire texture in a faster way than using framebuffer
blitting.

This uses ARB_copy_image extension if available and fallback to
glCopyTexSubImage2D for older gl version.

Both method should be as fast if not faster than the framebuffer blitting.
2020-04-22 21:41:10 +02:00
Sebastián Barschkis
cdc399a055 Merge branch 'blender-v2.83-release' 2020-04-22 17:05:04 +02:00
Sergey Sharybin
0fe3e38b57 Cleanup: Spelling in function name
Should be no functional changes.
2020-04-22 16:32:45 +02:00
Bastien Montagne
dcb45992bf Merge branch 'blender-v2.83-release' 2020-04-20 15:27:27 +02:00
Jeroen Bakker
915866f0d9 Fix T75914: Assert Knife Tool
Actually the assert was incorrect. It tested for an active buffer, but
an batch would also be ok.
2020-04-20 15:10:21 +02:00
Campbell Barton
9d3b1d361d Merge branch 'blender-v2.83-release' 2020-04-20 12:15:03 +10:00
Campbell Barton
23bb42a06e Cleanup: accidental value declaration with struct type 2020-04-20 12:11:12 +10:00
Pablo Dobarro
9776b8a05e Merge branch 'blender-v2.83-release' 2020-04-20 02:19:42 +02:00
Pablo Dobarro
44a386b88c Fix T75329: Missing show_face_sets checks for Multires
These values were hardcoded before Face Sets were enabled for Multires,
so enable the show_face_sets checks now.

Reviewed By: jbakker

Maniphest Tasks: T75329

Differential Revision: https://developer.blender.org/D7444
2020-04-20 02:12:28 +02:00
Clément Foucault
59d7fbb052 Merge branch 'blender-v2.83-release' 2020-04-17 21:54:26 +02:00
Clément Foucault
cad1ddc1e8 GPU: Fix typo making RG16F use 16 bytes instead of 4 2020-04-17 20:28:55 +02:00
Clément Foucault
2fc8daff10 GPU: Fix missing SRGB8_ALPHA8 debug string 2020-04-17 20:27:58 +02:00