Commit Graph

79769 Commits

Author SHA1 Message Date
Campbell Barton
955a4142ec Cleanup: use doxy comments in object.c 2020-09-07 14:33:24 +10:00
Campbell Barton
c350d1eb13 Cleanup: remove redundant scene argument in BKE_object_add 2020-09-07 14:09:50 +10:00
Campbell Barton
c695523687 Fix OBJECT_OT_data_instance_add creating empty data-blocks
ED_object_add_type creates empty object data, add
ED_object_add_type_with_obdata which can take existing object data.
2020-09-07 13:56:22 +10:00
Clément Foucault
d268a43b25 Cleanup: GPUVertBuf: Replace GPU_vertbuf_create by GPU_vertbuf_calloc
This is a simple cleanup to make naming consistent with the rest of the
module.
2020-09-06 22:13:06 +02:00
Clément Foucault
158cea83b5 GLTexture: Fix crash with --debug-gpu on windows + nvidia
The combination of DSA + CubeMap seems to not please this driver.
2020-09-06 22:13:06 +02:00
Clément Foucault
7ffff04e49 GPUVertBuf: Make GPUVertBuf private to the GPU module
This is just a cleanup to isolate the internals of the vertbuf.
This adds some getters to avoid refactor of existing code.
2020-09-06 22:13:06 +02:00
Clément Foucault
98fc3f263c Cleanup: GLBackend: Fix missing override keywords producing warnings 2020-09-06 22:13:06 +02:00
Clément Foucault
4ea93029c6 GPUIndexBuf: GL backend Isolation
This is part of the Vulkan backend task T68990.

There is no real change, only making some code re-organisation.
This also make the IndexBuf completely abstract from outside the
GPU module.
2020-09-06 22:13:06 +02:00
Clément Foucault
84d67bd0a9 Cleanup: GPU: Rename GPU_element to GPU_index_buffer
Makes it follow the functions names.
2020-09-06 22:13:06 +02:00
Campbell Barton
e56ff76db5 Viewport: support dropping object-data to create instances
This allows orphan object data for example (meshes, curves, etc)
to be dropped into the 3D View from the outliner,
creating a new object instance.

Previously the only way to do this was to add the same type of object
then swap it's data through the ID selector drop-down.
2020-09-06 18:42:16 +10:00
Howard Trickey
5faf72bb71 Fix T75827, boolean of non-manifold objects leaves stray edges.
Well, this only fixes the example if one uses the new Exact mode,
but since that is available, seems fair to call this fixed.
Since these were not closed-volume operands, the Exact mode needed
some adjustment to the threshold used for "inside-outside" tests
for the case of deciding if the cutter is inside the other shape
for a Difference.
2020-09-05 16:01:39 -04:00
Clément Foucault
8c4f7e6d04 GLState: Use unsigned long long instead of unsigned long for shifts
This fix a compilation warning on msvc.
2020-09-05 18:50:07 +02:00
Campbell Barton
ffec86bb62 Cleanup: clang-format 2020-09-06 02:21:27 +10:00
Campbell Barton
3a8d9198b3 Cleanup: spelling 2020-09-06 02:19:58 +10:00
Julian Eisel
69377784f5 Fix T67265: Status bar is overlapped by workspace layout
The issue was that the screen geometry calculations scaled down the
areas, but the header would become too small. So it would be upscaled
again towards the lower screen edge (where the status-bar is at). Now we
do another pass over the geometry calculations, until all areas fit into
the screen, or until some rather arbitrary maximum is reached.

This fixes the issue for common cases. Extreme cases, with many
vertically stashed editors and a too small window to show all, are still
not too well supported. Blender keeps working but the status-bar is
still overlapped. We could deal with this better but what's there now
should be good enough.
2020-09-05 18:16:50 +02:00
Julian Eisel
7d8a252c17 Cleanup: Add const to BKE screen function 2020-09-05 18:16:50 +02:00
Clément Foucault
581c35bea8 GLState: Fix compilation warning on MSVC 2020-09-05 18:16:13 +02:00
Clément Foucault
03b36abbe6 GLTexture: Fix undefined behavior when binding textures the first time 2020-09-05 18:13:33 +02:00
Clément Foucault
9764d3e4dc GLDebug: Trim NVidia debug output
These buffer detailed infos are not needed unless going deep into
perf. profiling, in which case you can still disable this compile option.

This makes user report log much more readable.
2020-09-05 17:49:14 +02:00
Clément Foucault
71872e3809 GLTexture: Add Feedback loop check
The check is better than before as we take into
consideration the attached mip level.
2020-09-05 17:49:14 +02:00
Clément Foucault
14926a81b6 Cleanup: GPUFramebuffer: Remove unused variable 2020-09-05 17:49:14 +02:00
Clément Foucault
64490bdedb GLTexture: Add direct state access support 2020-09-05 17:49:14 +02:00
Clément Foucault
558e1158e7 GLState: Add texture multibind and remove redundant binds 2020-09-05 17:49:14 +02:00
Clément Foucault
6560a1c35e Math Utils: Add bitscan 64bit version 2020-09-05 17:49:14 +02:00
Clément Foucault
65a593f6ef GPUDebug: Only enable resource checking in debug mode 2020-09-05 17:49:14 +02:00
Clément Foucault
8e4c0efbe3 Cleanup: GPUTexture: Move debug messages outside of creation function
# Conflicts:
#	source/blender/gpu/intern/gpu_framebuffer.cc
2020-09-05 17:49:14 +02:00
Clément Foucault
ab95cdaba9 GPUTexture: Change texture creation API
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
2020-09-05 17:49:14 +02:00
Clément Foucault
bac4606937 Cleanup: GPUTexture: Remove use of GPU_texture_create_nD
Use creation + update function instead.
2020-09-05 17:49:14 +02:00
Clément Foucault
7d4adbdfab GLTexture: Add validation for empty slots before drawing
This is to have better error detection in debug builds.
This is not a replacement for a full check like in renderdoc but it
might catch some issues early on.
2020-09-05 17:49:14 +02:00
Clément Foucault
cc0410193d GPUTexture: Implement back 3D texture resize
But this time implement it outside the texture module.
This makes more sense as only the volume textures need this feature.
2020-09-05 17:49:14 +02:00
Clément Foucault
78dcd92edb BLI: Math: Add equals_v3v3_int 2020-09-05 17:49:14 +02:00
Clément Foucault
895ec05212 Cleanup: GPUTexture: Clean framebuffer attachment 2020-09-05 17:49:14 +02:00
Clément Foucault
13305fb513 Cleanup: GPUFrameBuffer: Use Texture class instead of gl calls 2020-09-05 17:49:14 +02:00
Clément Foucault
b100b77fda GLTexture: Add back texture proxy check
Cleanup the feature itself:
- Check 3D textures size against the correct limit.
- Add check for compressed textures.
2020-09-05 17:49:14 +02:00
Clément Foucault
31c77a14af GPUTexture: Add support for samplers
This just add back the support.
This commit also includes a bit of cleanup.

# Conflicts:
#	source/blender/gpu/GPU_texture.h
2020-09-05 17:49:14 +02:00
Clément Foucault
c766d9b9dc GPUTexture: GL Backend Isolation
This is a massive cleanup needed for vulkan support T68990. It provides:

- More meaningful enums with conversion functions.
- Less hacky supports of arrays and cubemaps (all considered layered).
- More inline with the stateless design of vulkan and modern GL.
- Methods Fallbacks are using framebuffer functions that are wrapped
  instead of implementing inside the texture module.

What is not in there:
- API change.
- Samplers support (breaks a few effects).

# Conflicts:
#	source/blender/gpu/GPU_texture.h
2020-09-05 17:49:14 +02:00
Clément Foucault
db21c12abe GPUFramebuffer: Encapsulate single attachement clear
This is in preparation of using it to clear single texture.

Also includes minor cleanups about not using tex target in
assert and adding enum operators.
2020-09-05 17:49:14 +02:00
Clément Foucault
22a84a673a Cleanup: EEVEE: Use correct array size and use equals_v2v2_int 2020-09-05 17:49:14 +02:00
Clément Foucault
a92d77acf7 GPUTexture: Add skeleton of the new GLTexture class 2020-09-05 17:49:14 +02:00
Clément Foucault
f72c1c4547 GPUTexture: Remove bind to edit calls
This is going to be unecessary after the GPU opengl texture backend refactor.

For now add a save/restore mechanism to leave the state untouched.

Also remove some calls where the caller would bind to particular binding
point and set the shader uniform.
2020-09-05 17:49:14 +02:00
Howard Trickey
da6e6e0432 New boolean: Fix second example in T79404.
The code to detect non-trivial coplanar intersection sometimes
falsely said there wasn't one. This caused some coplanar intersections
to be missed. Also added a test for this case.
2020-09-04 20:59:36 -04:00
Julian Eisel
e6f0b60c2e UI Code Quality: Use derived struct for number buttons
For the man rationale behind this design, see 49f088e2d0. Further,
this removes users of uiBut.a1/uiBut.a2, which is a very ugly design
choice (hard to reason about).

Note that I had to do rather ugly, specific exceptions for the number
buttons in `ui_def_but_rna()`. But once all users of a1/a2 are removed,
this special handling shouldn't be needed anymore.
I also had to move a sanity check out of the button definition. It's now
moved into a new debug only sanity checking function executed when
finishing the layout definition (block end).
2020-09-04 21:26:31 +02:00
Julian Eisel
47881791be UI Code Quality: Store curve-button gradient type in derived struct
We want to move away from using `uiBut.a1`/`a2`, which is a hard to
reason about design.

Part of T74432.

Also correct comment.
2020-09-04 21:26:30 +02:00
Sebastian Parborg
120f4507f6 Fix building on windows after cleanup changes in tiff.c 2020-09-04 21:24:06 +02:00
Sebastian Parborg
0b3ef67b79 Cleanup: Remove redundant redeclaration in collada
No functional changes.
2020-09-04 21:18:37 +02:00
Sebastian Parborg
2115232a16 Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fix
No functional changes
2020-09-04 21:04:16 +02:00
Germano Cavalcante
e43d482cc9 Fix T80426: Crash when deleting custom orientation
Indices referencing other orientations were not being updated,
2020-09-04 15:01:04 -03:00
Brecht Van Lommel
e58ec74046 Cleanup: fix compiler warnings for MSVC 2020-09-04 17:10:50 +02:00
Hans Goudey
417695e4a8 Curve Profile: Miscellaneous cleanup
- Declare variables where they are initialized
- Use consistent variable and static function names
- Use helper functions more for common operations
- Remove use of BezTriple struct, use CurveProfilePoint instead
- Apply small simplifications to code in some situations
2020-09-04 10:56:56 -05:00
Sybren A. Stüvel
ce67a9d39f Cleanup: Clang-Tidy bugprone-copy-constructor-init fix
No expected functional changes.
2020-09-04 17:17:57 +02:00