Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-12-09Cleanup: move public doc-strings into headers for 'gpu'Campbell Barton
Ref T92709
2021-08-16XR: Color Depth AdjustmentsPeter Kim
This addresses reduced visibility of scenes (as displayed in the VR headset) that can result from the 8-bit color depth format currently used for XR swapchain images. By switching to a swapchain format with higher color depth (RGB10_A2, RGBA16, RGBA16F) for supported runtimes, visibility in VR should be noticeably improved. However, current limitations are lack of support for these higher color depth formats by some XR runtimes, especially for OpenGL. Also important to note that GPU_offscreen_create() now explicitly takes in the texture format (eGPUTextureFormat) instead of a "high_bitdepth" boolean. Reviewed By: Julian Eisel, Clément Foucault Differential Revision: http://developer.blender.org/D9842
2021-04-30Cleanup: Rename `#if GPU_USE_PY_REFERENCES` to `#ifndef ↵Germano Cavalcante
GPU_NO_USE_PY_REFERENCES` This is safer for incremental build. And there was already a macro `GPU_USE_PY_REFERENCES` used elsewhere.
2021-04-30Python GPU: Add reference of PyObject GPU object to the GPU object itselfGermano Cavalcante
Instead of creating different python wrappers for the same GPU object, return the same `PyObject` created earlier. This also allows for more secure access to existing GPU objects. Reviewed By: brecht Differential Revision: https://developer.blender.org/D11044
2021-02-17Python: gpu module: add new submodules and typesGermano Cavalcante
This commit extends the gpu python API with: ``` gpu.types.Buffer #"__init__", "to_list" gpu.types.GPUTexture #"__init__", "clear", "read", "format" gpu.types.GPUFrameBuffer #"__init__", "bind", "clear", "is_bound", "viewport", ("__enter__", "__exit__" with "GPUFrameBufferStackContext") gpu.types.GPUUniformBuf #"__init__", "update" gpu.state #"blend_set", "blend_get", "depth_test_set", "depth_test_get", "depth_mask_set", "depth_mask_get", "viewport_set", "viewport_get", "line_width_set", "line_width_get", "point_size_set", "color_mask_set", "face_culling_set", "front_facing_set", "program_point_size_set" ``` Add these methods to existing objects: ``` gpu.types.GPUShader #"uniform_sample", "uniform_buffer" ``` Maniphest Tasks: T80481 Differential Revision: https://developer.blender.org/D8826
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-01-11Revert "Fix typo; Documentation; Expose layer for framebuffer attachament; ↵Germano Cavalcantemano-wii
Add framebuffer viewport setter; Remove framebuffer restore; Expose framebuffer push/pop stack API; Remove blend modes; Remove depth_range_set; Implement GPU_face_culling, GPU_front_facing, GPU_point_size, GPU_line_width, GPU_viewport, GPU_color_mask and GPU_depth_mask" This reverts commit 9db3d1951da15254efbbcf028176facb78118ec1. This was an accidental commit of the patch D8826
2021-01-11Fix typo; Documentation; Expose layer for framebuffer attachament; Add ↵Germano Cavalcantemano-wii
framebuffer viewport setter; Remove framebuffer restore; Expose framebuffer push/pop stack API; Remove blend modes; Remove depth_range_set; Implement GPU_face_culling, GPU_front_facing, GPU_point_size, GPU_line_width, GPU_viewport, GPU_color_mask and GPU_depth_mask
2020-10-08T81340: UBSan: load of value .. not valid for GPU enum typeAnkit Meel
The underlying type of the enum cannot be fixed here due to its usage in C code. All the values possible in the width of the underlying type are not valid for an enum. Only 0 to (2*max - 1) if all enumerators are unsigned. So the macro asks for the biggest value among the //listed// ones. If any enumerator C is set to say `A|B`, then C would be the maximum. (2*max-1) is used as the mask. The warnings (for each enum modified in this commit): GPU_vertex_buffer.h:43:1: runtime error: load of value 4294967291 which is not a valid value for type 'GPUVertBufStatus' https://github.com/llvm/llvm-project/commit/1c2c9867 Ref T81340 Reviewed By: fclem Differential Revision: https://developer.blender.org/D9067
2020-09-08GPU: Cleanup implementation castsClément Foucault
- Use the syntactic wrap/unwrap method to make code more readable. - Update comment about hidden struct behind opaque types. - Cleanup GPUDrawList type.
2020-09-08GPUFramebuffer: Make GPU_framebuffer_read_depth more flexibleClément Foucault
This is to make use of it in selection code.
2020-09-05GPUFramebuffer: Encapsulate single attachement clearClément Foucault
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-04Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fixSebastian Parborg
No functional changes
2020-09-02Cleanup: spelling, rename attachement -> attachmentCampbell Barton
2020-09-02Cleanup: spellingCampbell Barton
2020-08-30GPUFrameBuffer: Fix build error on MSVCClément Foucault
This also gets rid of the macro.
2020-08-30GPUState: Move Scissor and Viewport state to framebufferClément Foucault
This way it is way clearer what each viewport state is. There is no more save and reset. The scissor test is also saved per framebuffer. The only rule to remember is that the viewport state (size and origin) is reset for both the viewport and scissor when a texture is attached or detached from an attachment slot.
2020-08-30GPUFrameBuffer: Use debug name supportClément Foucault
This is to make it easier to navigate captures in renderdoc.
2020-08-30GPUFrameBuffer: GL backend isolationClément Foucault
This is related to the Vulkan port T68990. This is a full cleanup of the Framebuffer module and a separation of OpenGL related functions. There is some changes with how the default framebuffers are handled. Now the default framebuffers are individually wrapped inside special GLFrameBuffers. This make it easier to keep track of the currently bound framebuffer state and have some specificity for operations on these framebuffers. Another change is dropping the optimisation of only configuring the changed attachements during framebuffers update. This does not give any benefits and add some complexity to the code. This might be brought back if it has a performance impact on some systems. This also adds support for naming framebuffers but it is currently not used.
2020-08-30GPUFramebuffer: Make GPUFrameBuffer an opaque typeClément Foucault
This is in preparation of the Framebuffer GL backend. This is a just changing types and moving some code. No logic is changed... almost... it just removes the context attach. i.e: `gpu_context_add/remove_framebuffer()` This is not needed for now and was even disabled in release. This is part of T68990.
2020-08-23Cleanup: GPU: Use explicit clear value in GPU_clear* commandsClément Foucault
This replace `GPU_clear()` by `GPU_clear_color()` and `GPU_clear_depth()`. Since we always set the clear value before clearing, it is unecessary to track the clear color state. Moreover, it makes it clearer what we clear the framebuffer to.
2020-08-18Fix T77564: VSE (and compositor background) lost stereoscopy previewClément Foucault
Issue introduced on fe045b2b77dc6d7f0b552619fe824b496d34db6c. Since the stereoscopy compositing (anaglyph, ...) is only done for viewports the VSE preview and compositor need to use viewports. Reviewed by: dfelinto Differential Revision: https://developer.blender.org/D8472
2020-08-07Merge branch 'blender-v2.90-release' into masterJacques Lucke
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
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-07-28Merge branch 'blender-v2.90-release'Jacques Lucke
2020-07-28Cleanup: correct usage of extern-C blocks in various placesJacques Lucke
This removes extern-C blocks around other includes and adds such blocks for some headers that need them.
2020-07-27GPUFramebuffer: Fix compilation issue with designated initializer in C++Clément Foucault
2020-07-26Cleanup: GPU: Remove GPU_glew.h outside of GPU moduleClément Foucault
Remove use of GL* constants and types inside the codebase. There is still a few occurence to get rid of.
2020-07-26GPU: Move gpu_framebuffer.c to C++Clément Foucault
2020-07-18Cleanup: WM: Encapsulate stereo draw buffers bindingClément Foucault
2020-07-16Cleanup: GPU: Replace all glReadPixels by GPU equivalentClément Foucault
2020-07-02GPUOffScreen: Remove the sample parameterClément Foucault
This is because the DRW module is no longer compatible with drawing using MSAA. This also change the Python API.
2020-03-09GPencil: Refactor of Draw Engine, Vertex Paint and all internal functionsAntonio Vazquez
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes. Also, a huge code cleanup has been done at all levels. Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development. Differential Revision: https://developer.blender.org/D6293
2019-08-01Cleanup: misc spelling fixesCampbell Barton
T68035 by @luzpaz
2019-06-17Fix T57650 UVEdit: selection not visible if behind unselected UVsClément Foucault
Use depth buffer to order the uv edges correctly to always draw selected edges on top. We still use the double drawing workaround for points to keep the smooth antialiased display.
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
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
2019-04-10Cleanup: spellingCampbell Barton
2019-03-19Cleanup: comment blocksCampbell Barton
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
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.
2019-01-23Cleanup: use eGPU prefix for GPU enum typesCampbell Barton
2019-01-07Cleanup: add trailing commas to structsCampbell Barton
2018-07-31GPUFrameBuffer: Put active framebuffer in GPUContextClément Foucault
instead of being ThreadLocal and leading to incorrect usage. We still enforce no framebuffer when changing context. We can lift this restriction later.
2018-07-18Cleanup: style for GPU moduleCampbell Barton
2018-07-08Cleanup: rename 'ct' to 'len' for gpuCampbell Barton
2018-06-27bf_gpu: Add GPU_state module.Ray Molenkamp
This has wrappers for the most common gl* functions in the codebase, and is in preparation for D3502 Reviewers: brecht, fclem Differential Revision: https://developer.blender.org/D3501
2018-04-27WM: new offscreen window draw method to replace all existing methods.Brecht Van Lommel
For Blender 2.8 we had to be compatible with very old OpenGL versions, and triple buffer was designed to work without offscreen rendering, by copying the the backbuffer to a texture right before swapping. This way we could avoid redrawing unchanged regions by copying them from this texture on the next redraws. Triple buffer used to suffer from poor performance and driver bugs on specific cards, so alternative draw methods remained available. Now that we require newer OpenGL, we can have just a single draw method that draw each region into an offscreen buffer, and then draws those to the screen. This has some advantages: * Poor 3D view performance when using Region Overlap should be solved now, since we can also cache overlapping regions in offscreen buffers. * Page flip, anaglyph and interlace stereo drawing can be a little faster by avoiding a copy to an intermediate texture. * The new 3D view drawing already writes to an offscreen buffer, which we can draw from directly instead of duplicating it to another buffer. * Eventually we will be able to remove depth and stencil buffers from the window and save memory, though at the moment there are still some tools using it so it's not possible yet. * This also fixes a bug with Eevee sampling not progressing with stereo drawing in the 3D viewport. Differential Revision: https://developer.blender.org/D3061
2018-04-21Cleanup: styleCampbell Barton
2018-03-25GPUFramebuffer: Refactor (Part 2)Clément Foucault
This refactor modernise the use of framebuffers. It also touches a lot of files so breaking down changes we have: - GPUTexture: Allow textures to be attached to more than one GPUFrameBuffer. This allows to create and configure more FBO without the need to attach and detach texture at drawing time. - GPUFrameBuffer: The wrapper starts to mimic opengl a bit closer. This allows to configure the framebuffer inside a context other than the one that will be rendering the framebuffer. We do the actual configuration when binding the FBO. We also Keep track of config validity and save drawbuffers state in the FBO. We remove the different bind/unbind functions. These make little sense now that we have separate contexts. - DRWFrameBuffer: We replace DRW_framebuffer functions by GPU_framebuffer ones to avoid another layer of abstraction. We move the DRW convenience functions to GPUFramebuffer instead and even add new ones. The MACRO GPU_framebuffer_ensure_config is pretty much all you need to create and config a GPUFramebuffer. - DRWTexture: Due to the removal of DRWFrameBuffer, we needed to create functions to create textures for thoses framebuffers. Pool textures are now using default texture parameters for the texture type asked. - DRWManager: Make sure no framebuffer object is bound when doing cache filling. - GPUViewport: Add new color_only_fb and depth_only_fb along with FB API usage update. This let draw engines render to color/depth only target and without the need to attach/detach textures. - WM_window: Assert when a framebuffer is bound when changing context. This balance the fact we are not track ogl context inside GPUFramebuffer. - Eevee, Clay, Mode engines: Update to new API. This comes with a lot of code simplification. This also come with some cleanups in some engine codes.