Commit Graph

2919 Commits

Author SHA1 Message Date
Jacques Lucke
7283e6fb73 Merge branch 'blender-v2.90-release' into master 2020-08-07 10:04:57 +02:00
Jacques Lucke
91694b9b58 Code Style: use "#pragma once" in source directory
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.

This patch has been generated by P1561 followed by `make format`.

Differential Revision: https://developer.blender.org/D8466
2020-08-07 09:50:34 +02:00
Dalai Felinto
56af04d31f Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-06 16:44:21 +02:00
Dalai Felinto
bc8168f4a2 Cleanup: Remove bad level calls from space image
Groundwork for upcoming fix (D8472)
2020-08-06 16:44:03 +02:00
Dalai Felinto
45e6ca3661 Cleanup: Stop accessing gpu_batch_presets_reset()
The current code is accessing this from outside the gpu "namespace". As
such it should be accessing GPU_ functions, not gpu_ functions.

This is also a place to centralize the XXX message that will be
addressed upon refactor. So we can reuse this call in other places that
need the same temporary workaround.

Groundwork for upcoming fix (D8472)
2020-08-06 16:44:03 +02:00
Campbell Barton
8a8c3e0972 Merge branch 'blender-v2.90-release' into master 2020-08-06 19:01:07 +10:00
Campbell Barton
c872e87bd4 Fix T79309: Safe Areas are not visible 2020-08-06 18:59:20 +10:00
Jeroen Bakker
2ca006f6c1 Merge branch 'blender-v2.90-release' 2020-08-05 15:59:04 +02:00
Jeroen Bakker
f7d38e2e64 Fix T77346: GPU Workaround Always Render Using Main Context
In Blender 2.90 EEVEE materials were refactored that introduced crashes on Intel
GPUs on Windows. The crash happened in the `local_context_workaround` that temporary
stored compiled materials in a binary form to reload it in the main GL context.

It has been tested that the workaround isn't needed anymore for HD6xx GPUs, but it
is still needed for HD4000.

After several unsuccesfull fixes we came to the conclusion that we could not support
the local context workaround and needed to come with a different workaround. The idea
of this patch is that in these cases there is only a single context that is used for
rendering. Threads that uses these contextes are guarded by a mutex and will block.

Impact on User Level:
* Due to main mutex lock the UI freezes when rendering or baking or feel less snappy

Reviewed By: Clément Foucault, Brecht van Lommel

Differential Revision: https://developer.blender.org/D8410
2020-08-05 15:45:42 +02:00
Clément Foucault
c961bf8975 GPUTexture: Fix missing break 2020-08-05 14:17:34 +02:00
Sergey Sharybin
85e11ca7fb Fix possible fall-through after recent change 2020-08-05 12:25:12 +02:00
Campbell Barton
db907ea888 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:17 +10:00
Campbell Barton
baf015be31 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:14 +10:00
Clément Foucault
d1b3da697d GPUTexture: Check PROXY textures for cubemap types
It can happen than some textures are not supported on some implementation
even if they fix the `GPU_max_texture_size` and `GPU_max_texture_layers`.
2020-08-05 02:26:44 +02:00
Clément Foucault
de947c5c50 GPUTexture: Improve debug print 2020-08-05 02:26:44 +02:00
Campbell Barton
83d6290800 Cleanup: remove trailing space, newlines at eof 2020-08-03 15:14:02 +10:00
Clément Foucault
6a444830a3 GPU: Convert gpu_matrix.c to C++ 2020-08-02 02:10:22 +02:00
Clément Foucault
6941e27f4a GPU: Convert gpu_shader_interface.c to C++ 2020-08-02 02:10:22 +02:00
Campbell Barton
901ee66ea1 Cleanup: use term init instead of initialize/initialise
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
2020-08-01 13:51:05 +10:00
Antonio Vazquez
3785dc59d1 Merge branch 'blender-v2.90-release' 2020-07-31 13:47:46 +02:00
Brecht Van Lommel
c565f16afb Fix T79397: blurry icons at some UI scales, after recent refactor
Solution found by Yevgeny Makarov.
2020-07-31 12:39:58 +02:00
Clément Foucault
848cbe889b Fix T79347 GPU: Segfault starting blender 2020-07-30 19:43:53 +02:00
Clément Foucault
2d38ff67d3 GPU: Fix compilation error 2020-07-30 17:08:23 +02:00
Clément Foucault
da741013a1 EEVEE: GLSL refactor/cleanup
- add the use of DRWShaderLibrary to EEVEE's glsl codebase to reduce code
complexity and duplication.
- split bsdf_common_lib.glsl into multiple sub library which are now shared
with other engines.
- the surface shader code is now more organised and have its own files.
- change default world to use a material nodetree and make lookdev shader
more clear.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D8306
2020-07-30 16:44:58 +02:00
Clément Foucault
19175f4757 GPUBatch & GPUImmediate: Use GPUShader instead of using raw OGL handle 2020-07-30 13:28:50 +02:00
Campbell Barton
dc3baf2c78 Cleanup: spelling 2020-07-30 08:43:40 +10:00
Clément Foucault
486c7b87fb Cleanup: GPU: Remove GPU_draw.h and move fluid gpu function to DRW 2020-07-29 23:21:33 +02:00
Clément Foucault
5f6fb5bb41 Cleanup: Split gpu_texture_image.c into BKE and IMB modules
This is in order to disolve GPU_draw.h into more meaningful code blocks.

All the Image related function are in `image_gpu.c`.
All the MovieClip related function are in `movieclip.c`.

The IMB module now has a connection with GPU. This is not strickly
necessary and the code could be move to `image_gpu.c` if needed.

The Image garbage collection is also ported to `image_gpu.c`.
2020-07-29 23:06:37 +02:00
Clément Foucault
7e8d493730 GPU_draw.h: cleanup before splitting 2020-07-29 23:06:37 +02:00
Clément Foucault
b9c7c904ed GPUShader: Fix linking with MSVC 2020-07-29 16:07:51 +02:00
Clément Foucault
f0687d4665 Cleanup: GPUTexture: Use UNPACK3 in texture_fluid 2020-07-29 15:54:51 +02:00
Clément Foucault
1804a6d040 GPUState: Fix compilation error on MSVC 2020-07-29 15:54:51 +02:00
Clément Foucault
2d89cd7dd5 Cleanup: GPU: Move Image based function to GPU_draw.h
This makes it less confusing what functions are for blender
structures.
2020-07-29 15:54:51 +02:00
Clément Foucault
99d0b3b793 Cleanup: GPU: Rename gpu_texture_smoke to fluid, and move back to C
The file do not have a reason to be C++ anymore.
2020-07-29 15:54:51 +02:00
Clément Foucault
e749643793 GPU: Refactor gpu_texture_image to not use GL calls
This is also a bit of code cleanup, reorganisation.

Tried to be DRYed but avoid too much code change to (hopefully) minimize
breakage.

- GPU: remove TEXTARGET_CUBE_MAP, this is no longer used in the codebase.
- GPUTexture: Move compressed texture upload to gpu_texture.cc
- GPUTexture: Add per texture Anisotropic filtering switch
2020-07-29 15:03:02 +02:00
Clément Foucault
e4ee9de638 GPU: Move gpu_shader.c to C++
We split builtin shader support to its own file to avoid
converting code (lack of designated initializer in C++)
and to reduce file size.
2020-07-29 15:03:02 +02:00
Clément Foucault
18d2db22ff GPU: Move gpu_state.c to C++ 2020-07-29 15:03:02 +02:00
Clément Foucault
45d61bdc03 GPU: Move gpu_texture.c to C++
# Conflicts:
#	source/blender/gpu/GPU_texture.h
2020-07-29 15:03:02 +02:00
Clément Foucault
56d0a554a8 GPU: Move gpu_uniformbuffer.c to C++
This also rewrite and simplify the module a bit.
2020-07-29 15:03:02 +02:00
Clément Foucault
f84342d7e1 GPU: Move gpu_vertex_buffer.c to C++ 2020-07-29 15:03:02 +02:00
Clément Foucault
959529d4b8 GPU: Move gpu_vertex_format.c to C++ 2020-07-29 15:03:02 +02:00
Campbell Barton
dcad6c9db8 Cleanup: correct assert in GPU_offscreen_read_pixels 2020-07-29 10:50:31 +10:00
Jacques Lucke
814ca40c63 Merge branch 'blender-v2.90-release' 2020-07-28 16:37:01 +02:00
Jacques Lucke
67c33caeec Fix: remove error in previous commit 2020-07-28 16:35:31 +02:00
Jacques Lucke
b274d18aec Cleanup: correct usage of extern-C blocks in various places
This removes extern-C blocks around other includes and adds
such blocks for some headers that need them.
2020-07-28 16:33:43 +02:00
Campbell Barton
2a52c2d001 Cleanup: spelling, comments 2020-07-28 21:49:37 +10:00
Campbell Barton
b18c376946 Cleanup: quiet warnings without DDS 2020-07-27 21:00:49 +10:00
Clément Foucault
0b04f0e4e6 GPU: Fix crash and missing texture due to recent C++ port
Fix T79306 DRW: small issues with yesterday commits modifying TEXTARGET
Fix T79303 Image texture node crashes EEVEE when connected to a shader output
2020-07-27 13:37:22 +02:00
Jacques Lucke
418753b6a6 GPU: fix build error due to wrong linkage specification 2020-07-27 11:40:47 +02:00
Clément Foucault
ba9c88ce18 GPUFramebuffer: Fix compilation issue with designated initializer in C++ 2020-07-27 00:08:48 +02:00