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
path: root/intern
AgeCommit message (Collapse)Author
2022-03-21Fix Cycles kernel error on Metal after recent changesBrecht Van Lommel
2022-03-21Fix T96417: Cycles issue with multiscatter GGX and self intersection avoidanceBrecht Van Lommel
When the light direction is not pointing away from the geometric normal and there is a shadow terminator offset, self intersection is supposed to occur.
2022-03-21Fix T96381: Cycles GPU wrong render with camera inside multiple volumesBrecht Van Lommel
2022-03-03Fix T96139: Cycles doesn't warn if the render is pausedSergey Sharybin
Caused by 6ec83afb1db8. Technically, a regression since 3.0. Differential Revision: https://developer.blender.org/D14239
2022-03-03Fix Cycles hang in classroom scene with upcomping AMD driver version 22.10Brecht Van Lommel
This is a workaround until there is a fix in the HIP compiler or driver. Differential Revision: https://developer.blender.org/D14232
2022-03-02Fix T95608: Mac issues with drag drop on multi-monitorGermano Cavalcante
Mousemove events are sent to windows. In Windows OS, almost all mousemove events are sent to the window whose mouse cursor is over. On MacOS, the window with mousemove events is always the active window. It doesn't matter if the mouse cursor is inside or outside the window. So, in order for non-active windows to also have events, `WM_window_find_under_cursor` is called to find those windows and send the same events. The problem is that to find the window, `WM_window_find_under_cursor` only has the mouse coordinates available, it doesn't differentiate which monitor these coordinates came from. So the mouse on one monitor may incorrectly send events to a window on another monitor. The solution used is to use a native API on Mac to detect the window under the cursor. For Windows and Linux nothing has changed. Reviewed By: brecht Differential Revision: https://developer.blender.org/D14197
2022-03-01Fix T92980: missing Cycles video texture update with persistent dataBrecht Van Lommel
2022-03-01Cycles: Hide MetalRT checkbox for AMD GPUsMichael Jones
This patch hides the MetalRT checkbox for AMD GPUs, pending fixes for MetalRT argument encoding on AMD. Reviewed By: brecht Differential Revision: https://developer.blender.org/D14175
2022-02-26Ghost/Event System: Support mapping more keysGermano Cavalcante
This fixes T93051, T76405 and maybe others. Characters like '²', '<' are not recognized in Blender's shortcut keys. And sometimes simple buttons like {key .} and {key /} on the Windows keyboard, although the symbol is "known", Blender also doesn't detect for shortcuts. For Windows, some of the symbols represented by `VK_OEM_[1-8]` values, depending on the language, are not mapped by Blender. On Mac there is a fallback reading the "actual character value of the 'remappable' keys". But sometimes the character is not mapped either. On Windows, the solution now mimics the Mac and tries to read the button's character as a fallback. For unmapped characters ('²', '<', '\''), now another value is chosen as a substitute. More "substitutes" may be added over time. Differential Revision: https://developer.blender.org/D14149
2022-02-25Fix T95977: Point Info node radius wrong under rotationBrecht Van Lommel
2022-02-24Fix T95969, T91856: bake AO to vertex color artifacts after ray offset removalBrecht Van Lommel
Without ray offsets intersections at neigbhoring triangles are found, as the ray start is exactly at the vertex. There was a small offset towards the center of the triangle, but not enough. Now this offset computation is moved into Cycles and modified for better results. It's still not perfect though like any offset approach, especially with long thin triangles. Additionaly, this uses the shadow terminate offset for AO rays now, which helps remove some pre-existing artifacts.
2022-02-24Cleanup: remove unused ray offset functionBrecht Van Lommel
2022-02-23Fix OSL trace() not being fully updated for ray offsetting removalBrecht Van Lommel
This was the last place still using the ray_offset() function.
2022-02-22Fix ffmpeg tests when using ffmpeg 5.0Sebastian Parborg
2022-02-22Cleanup: compiler warningBrecht Van Lommel
2022-02-22Cleanup: clang-formatCampbell Barton
2022-02-19Revert "OCIO: Port shader creation logic to use GPUShaderCreateInfo"Clément Foucault
This reverts commit 7f7c614ecddbcb66de0bff1657366970dede99be.
2022-02-19Revert "OCIO: Fix gpu include file"Clément Foucault
This reverts commit 3cebfadb27eb4056d28211708158f9ad8a7459b7.
2022-02-18OCIO: Fix gpu include fileClément Foucault
Was the cause by ef0e21f0ae71d9ec4ba3cdf6f6a16c9575459ced
2022-02-18OCIO: Port shader creation logic to use GPUShaderCreateInfoClément Foucault
This commit should suffice to make the shader API agnostic now (given that all users of it use the GPU API). This makes the shaders not trigger a false positive error anymore since the binding slots are now garanteed by the backend and not changed at after compilation. This also bundles all uniforms into UBOs. Making them extendable without limitations of push constants. The generated uniforms from OCIO are not densely packed in the UBO to avoid complexity. Another approach would be to use GPU_uniformbuf_create_from_list but this requires converting uniforms to GPUInputs which is too complex for what it is. Reviewed by: brecht, jbakker Differential Revision: https://developer.blender.org/D14123
2022-02-18Fix graphics interop resources leak in CyclesSergey Sharybin
When new display driver is given to the PathTrace ensure that there are no GPU resources used from it by the work. This solves graphics interop descriptors leak. This aqlso fixes Invalid graphics context in cuGraphicsUnregisterResource error when doing final render on the display GPU. Fixes T95837: Regression: GPU memory accumulation in Cycles render Fixes T95733: Cycles Cuda/Optix error message with multi GPU devices. (Invalid graphics context in cuGraphicsUnregisterResource) Fixes T95651: GPU error (Invalid graphics context in cuGraphicsUnregisterResource) Fixes T95631: VRAM is not being freed when rendering (Invalid graphics context in cuGraphicsUnregisterResource) Fixes T89747: Cycles Render - Textures Disappear then Crashes the Render Maniphest Tasks: T95837, T95733, T95651, T95631, T89747 Differential Revision: https://developer.blender.org/D14146
2022-02-18Fix strict compilation warningsSergey Sharybin
2022-02-17Fix build error on some compilers after recent bugfixBrecht Van Lommel
2022-02-17Fix T95368: wrong white point adaptation for Linear ACES color spaceBrecht Van Lommel
This affected loading of EXR files with set to Linear ACES colorspace, as well as the sky texture for in some custom OpenColorIO configurations. Use the builtin OpenColorIO transform from ACES AP0 to XYZ D65 to fix this.
2022-02-17Fix part of T95654: Cycles crash with text objects in excluded view layersBrecht Van Lommel
This is a bug on the Blender side, where the depsgraph does not have proper relations for text object duplis and fails to include the required materials in the dependency graph. But at least Cycles should not crash.
2022-02-17Fix compile error on MSVCKévin Dietrich
`uint` is POSIX type, use `GLuint` like for the rest of the code.
2022-02-17Fix T94881: GPU subdivision fails with high polycount coarse meshesKévin Dietrich
Coarse meshes with high polycount would show as corrupted when GPU subdivision is used with AMD cards This was caused by the OpenSubdiv library not taking `GL_MAX_COMPUTE_WORK_GROUP_COUNT` into account when dispatching computes. AMD drivers tend to set the limit lower than NVidia ones (2^16 for the former, and 2^32 for the latter, at least on my machine). This moves the `GLComputeEvaluator` from the OpenSubdiv library into `intern/opensubdiv` and modifies it to compute a dispatch size in a similar way as for the draw code: we split the dispatch size into a 2 dimensional value based on `GL_MAX_COMPUTE_WORK_GROUP_COUNT` and manually compute an index in the shader. We could have patched the OpenSubdiv library and sent the fix upstream (which can still be done), however, moving it to our side allows us to better control the `GLComputeEvaluator` and in the future remove some redundant work that it does compared to Blender (see T94644) and probably prepare the ground for Vulkan support. As a matter of fact, this patch also removes the OpenGL initialization that OpenSubdiv would do here. This removal is not related to the bug fix, but necessary to not have to copy more files/code over. Differential Revision: https://developer.blender.org/D14131
2022-02-17Fix T76082: VR Scene Inspection: It shows me only a pink screenPeter Kim
This fixes VR pink screen issues when using the DirectX backend, caused by `wglDXRegisterObjectNV()` failing to register the shared OpenGL-DirectX render buffer. The issue is mainly present on AMD graphics, however, there have been reports on NVIDIA as well. A limited workaround for the SteamVR runtime (AMD only) was provided in rB82ab2c167844, however this patch provides a more complete solution that should apply to all OpenXR runtimes. For example, with this patch, the Windows Mixed Reality runtime that exclusively uses DirectX can now be used with AMD graphics cards. Implementation-wise, a `GL_TEXTURE_2D` render target is used as a fallback for the shared OpenGL-DirectX resource in the case that registering a render buffer (`GL_RENDERBUFFER`) fails. While using a texture render target may be less optimal than a render buffer, it enables proper display in VR using the OpenGL/DirectX interop (tested on AMD Vega 64). Reviewed By: Severin Differential Revision: https://developer.blender.org/D14100
2022-02-16Cycles: restore basic standalone GUI, now using SDLBrecht Van Lommel
GLUT does not support offscreen contexts, which is required for the new display driver. So we use SDL instead. Note that this requires using a system SDL package, the Blender precompiled SDL does not include the video subsystem. There is currently no text display support, instead info is printed to the terminal. This would require adding an embedded font and GLSL shaders, or using GUI library. Another improvement to be made is supporting OpenColorIO display transforms, right now we assume Rec.709 scene linear and display. All OpenGL, GLEW and SDL code was move out of core cycles and into app/opengl. This serves as a template for apps that want to integrate Cycles interactive rendering, with a simple OpenGLDisplayDriver example. In general this would be adapted to the graphics API and color management used by the app. Ref T91846
2022-02-15Cleanup: clang-formatBrecht Van Lommel
2022-02-14Fix T95778, the macOS minimum versions have been increased for Metal.Thomas Dinges
2022-02-14Fix Cycles assert in debug mode after recent changesBrecht Van Lommel
We sometimes call start() on already started renders, just do nothing then. Ref D14086
2022-02-12Cycles: Fix Metal kernel compilation for AMD GPUsMichael Jones
Workaround for a compilation issue preventing kernels compiling for AMD GPUs: Avoid problematic use of templates on Metal by making `gpu_parallel_active_index_array` a wrapper macro, and moving `blocksize` to be a macro parameter. Reviewed By: brecht Differential Revision: https://developer.blender.org/D14081
2022-02-11Cycles: enable Metal on AMD GPUs, set macOS minimum versionsMichael Jones
* Apple Silicon support enabled on macOS 12.2+ * AMD support enabled on macOS 12.3+ This patch also fixes a device enumeration crash on certain AMD configs which was caused by over-release of MTLDevice objects. Differential Revision: https://developer.blender.org/D14090
2022-02-11Fix Cycles compilation on 32bit ARM platformSergey Sharybin
The rbit instruction is only available starting with ARMv6T2 and the register prefix is different from what AARCH64 uses. Separate the 32 and 64 bit ARM branches, add missing ISA checks. Made sure the code works as intended on macMini with Apple silicon, and on Raspberry Pi 4 B running 32bit Raspbian OS. Differential Revision: https://developer.blender.org/D14056
2022-02-11Cycles: refactor to keep session thread alive for duration of sessionBrecht Van Lommel
Instead of creating and destroying threads when starting and stopping renders, keep a single thread alive for the duration of the session. This makes it so all display driver OpenGL resource allocation and destruction can happen in the same thread. This was implemented as part of trying to solve another bug, but it did not help. Still I prefer this behavior, to eliminate potential future issues wit graphics drivers or with future Cycles display driver implementations. Differential Revision: https://developer.blender.org/D14086
2022-02-11Fix T95420: Cycles crash with stereo render and tilesBrecht Van Lommel
For reasons unclear, destroying and then recreating a vertex buffer in the render OpenGL context is affecting the immediate mode vertex buffer in the draw manager OpenGL context. Instead just create a single vertex buffer and use it for the lifetime of the render OpenGL context. There's not really any need to have a separate one per tile as far as I can tell. Differential Revision: https://developer.blender.org/D14084
2022-02-11Fix incompatible swapchain format for Quest 2Peter Kim
When using a RGBA16 (`GL_RGBA16`, `DXGI_FORMAT_R16G16B16A16_UNORM`) swapchain format with Quest 2, no image is presented to the headset. This can occur when using the SteamVR runtime with an AMD graphics card (ex. T95374). Workaround is to move this format after the Quest 2-compatible RGBA16F formats in the candidates list so that the RGBA16F formats are chosen instead. Reviewed By: Severin Differential Revision: https://developer.blender.org/D14024
2022-02-11Fix T94268: Closing SteamVR and restarting VR Session crashes BlenderPeter Kim
Crash was caused since the function pointers `s_xrGetOpenGLGraphicsRequirementsKHR_fn`/ `s_xrGetD3D11GraphicsRequirementsKHR_fn` were static and were not updated with the correct proc address after being set the first time. As stated in the OpenXR spec: "function pointers returned by xrGetInstanceProcAddr using one XrInstance may not be valid when used with objects related to a different XrInstance". Although it would seem reasonable that the proc address would not change if the instance was the same (hence the `static XrInstance s_instance;`), in testing, repeated calls to `xrGetInstanceProcAddress()` with the same instance still can result in changes (at least for the SteamVR runtime) so the workaround is to simply set the function pointers every time, essentially trivializing their `static` designations. Reviewed By: Severin Maniphest Tasks: T94268 Differential Revision: https://developer.blender.org/D14023
2022-02-10Cycles: Expose "Use MetalRT" checkboxMichael Jones
For curve-heavy scenes, memory consumption regressed when we switched from MetalRT to bvh2. Allow users to opt in to MetalRT to workaround this. Reviewed By: brecht Differential Revision: https://developer.blender.org/D14071
2022-02-10Fix T95477: Report error instead of crashing when Metal texture size limits ↵Michael Jones
exceeded. Reviewed By: brecht Differential Revision: https://developer.blender.org/D14074
2022-02-10Cycles: Workaround for failing "bake" unit tests in MetalMichael Jones
Allocate "RenderBuffers" with MTLResourceStorageModeShared. Reviewed By: brecht Differential Revision: https://developer.blender.org/D14073
2022-02-10Workaround for T94142: Cycles Metal crash with simultaneous viewport and ↵Michael Jones
final render Disable binary archives on Apple Silicon (issue stems from instancing multiple PSOs from the same binary archive). Pipeline creation still filters through the OS shader cache, mitigating any impact on setup times after the initial render. Reviewed By: brecht Differential Revision: https://developer.blender.org/D14072
2022-02-10Fix size_t -> int -> size_t round trip in CyclesSergey Sharybin
There are two things achieved by this change: - No possible downcast of size_t to int when calculating motion steps. - Disambiguate call to `min()` which was for some reason considered ambiguous on 32bit platforms `min(int, unsigned int)`. - Do the same for the `max()` call to keep them symmetrical. On an implementation side the `min()` is defined for a fixed width integer type to disambiguate uint from size_t on 32bit platforms, and yet be able to use it for 32bit operands on 64bit platforms without upcast. This ended up in a bit bigger change as the conditional compile-in of functions is easiest if the functions is templated. Making the functions templated required to remove the other source of ambiguity which is `algorithm.h` which was pulling min/max from std. Now it is the `math.h` which is the source of truth for min/max. It was only one place which was relying on `algorithm.h` for these functions, hence the choice of `math.h` as the safest and least intrusive. Fixes 32bit platforms (such as i386) in Debian package build system. Differential Revision: https://developer.blender.org/D14062
2022-02-09Revert "Fix size_t -> int -> size_t round trip in Cycles"Sergey Sharybin
This reverts commit d74bb7be1916744ae56347b49333eac22ebb7339. Need to re-iterate to have a proper support of all platforms.
2022-02-09Fix size_t -> int -> size_t round trip in CyclesSergey Sharybin
There are two things achieved by this change: - No possible downcast of size_t to int when calculating motion steps. - Disambiguate call to min() which was for some reason considered ambiguous on 32bit platforms `min(int, unsigned int)`. On an implementation side the `min()` is defined for a fixed width integer type to disambiguate uint from size_t on 32bit platforms, and yet be able to use it for 32bit operands on 64bit platforms without upcast. Fixes 32bit platforms (such as i386) in Debian package build system. Differential Revision: https://developer.blender.org/D13992
2022-02-07Fix UI messages (typos etc.).Bastien Montagne
2022-02-04Fix uninitialized value in Cycles BVH after recent changesBrecht Van Lommel
Found by asan, unknown if it actually caused an issue.
2022-02-04Fix T93851: Cycles wrong glossy indirect pass with volumesBrecht Van Lommel
2022-02-03Cleanup: clang-formatBrecht Van Lommel