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
2022-04-14GPU: Make nodetree GLSL Codegen render engine agnosticClément Foucault
This commit removes all EEVEE specific code from the `gpu_shader_material*.glsl` files. It defines a clear interface to evaluate the closure nodes leaving more flexibility to the render engine. Some of the long standing workaround are fixed: - bump mapping support is no longer duplicating a lot of node and is instead compiled into a function call. - bump rewiring to Normal socket is no longer needed as we now use a global `g_data.N` for that. Closure sampling with upstread weight eval is now supported if the engine needs it. This also makes all the material GLSL sources use `GPUSource` for better debugging experience. The `GPUFunction` parsing now happens in `GPUSource` creation. The whole `GPUCodegen` now uses the `ShaderCreateInfo` and is object type agnostic. Is has also been rewritten in C++. This patch changes a view behavior for EEVEE: - Mix shader node factor imput is now clamped. - Tangent Vector displacement behavior is now matching cycles. - The chosen BSDF used for SSR might change. - Hair shading may have very small changes on very large hairs when using hair polygon stripes. - ShaderToRGB node will remove any SSR and SSS form a shader. - SSS radius input now is no longer a scaling factor but defines an average radius. The SSS kernel "shape" (radii) are still defined by the socket default values. Appart from the listed changes no other regressions are expected.
2022-03-30Overlay: Port Armature shader to ShaderCreateInfoClément Foucault
Should have no regression.
2022-03-30Overlay: Port Edit Mode shaders to ShaderCreateInfoClément Foucault
This should have no regression.
2022-03-30GPU: ShaderBuilder: Fix compilation on non-Mac platformClément Foucault
Regression introduced in rB664eb1936946a077498a17c22576763c664e3186
2022-03-26GPU: ShaderBuilder: Fix compilation on MacClément Foucault
This is less than ideal as it seems to link against all of blender disregarding the stubs.
2022-03-25Cleanup: sort cmake file listsCampbell Barton
2022-03-23CMake: add missing headers to source listCampbell Barton
2022-03-22Metal: Make GLSL shader source MSL compliant alsoJason Fielder
Metal shading language follows the C++ 14 standard and in some cases requires a greater level of explicitness than GLSL. There are also some small language differences: - Explicit type-casts (C++ requirements) - Explicit constant values (C++ requirements, e.g. floating point values using 0.0 instead of 0). - Metal/OpenGL compatibility paths - GLSL Function prototypes - Explicit accessors for vector types when sampling textures. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14378
2022-03-22Metal: Initial Implementation of Metal Backend for GPU Module.Jason Fielder
Adding WITH_METAL option to CMAKE to guard compilation for macOS only. Implemented stub METALBackend to mirror GPUBackend interface and added capabilities initialisation, along with API initialisation paths. Global rendering coordination commands added to backend with GPU_render_begin and GPU_render_end() commands globally wrapping GPU work. This is required for Metal to ensure temporary resources are generated within an NSAutoReleasePool and freed accordingly. Authored by Apple: Michael Parkin-White, Vil Harvey, Marco Giordano, Michael Jones, Morteza Mostajabodaveh, Jason Fielder Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14293
2022-03-20GPencil: Use ShaderCreateInfo for antialiasing shadersClément Foucault
Simple port. Shouldn't break anything.
2022-03-20GPencil: Use ShaderCreateInfo for vfx shadersClément Foucault
Simple port. Shouldn't break anything.
2022-03-18GPU/GL: Add StorageBuf implementationClément Foucault
Almost 1:1 identical to UniformBuf implementation.
2022-02-23CMake: include missing filesCampbell Barton
Also use SRC_ prefix for source variables so cmake_consistency_check.py detects these files as being known to CMake.
2022-02-19OCIO: 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-19Merge branch 'blender-v3.1-release'Clément Foucault
# Conflicts: # intern/opencolorio/ocio_shader_shared.hh
2022-02-19Revert "OCIO: Port shader creation logic to use GPUShaderCreateInfo"Clément Foucault
This reverts commit 7f7c614ecddbcb66de0bff1657366970dede99be.
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-17OCIO: 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-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-02-06GPU: move gpu_shader_shared_utils.h to the public section of the moduleClément Foucault
This is then easier to include in other modules.
2022-01-28Image Engine: Use GPUShaderCreateInfo.Jeroen Bakker
Ported the image engine shaders to use the GPUShaderCreateInfo struct. No functional changes.
2022-01-28Cleanup: indentation for CMake filesCampbell Barton
Also minor white-space & case changes.
2022-01-26GPUShader: Add GLSL source modification pass to support enumsClément Foucault
This uses a light parser / string modification pass to convert C++ enum declaration syntax to GLSL compatible one. GLSL having no support for enums, we are forced to convert the enum values to a series of constant uints. The parser (not really one by the way), being stupidly simple, will not change anything to the values and thus make some C++ syntax (like omitting the values) not work. The string replacement happens on all GLSL files on startup. I did not measure significant changes in blender startup speed. There is plans to do all of this at compile time. We limit the scope of the search to `.h` and `.hh` files to prevent confusing syntax in `.glsl` files. There is basic error reporting with file, line and char logging for easy debuggabiliy. The requirements to use this enum sharing system are already listed in `gpu_shader_shared_utils.h` and repeated on top of the preprocessor function.
2022-01-26D13910: Workbench: Port shaders to use GPUShaderCreateInfoClément Foucault
Also adds a few things to GPUShader for easily create shaders. Heavy usage of macros to compose the createInfo and avoid duplications and copy paste bugs. This makes the link between the shader request functions (in workbench_shader.cc) and the actual createInfo a bit obscure since the names are composed and not searchable. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D13910
2022-01-25Cycles: add Point Info nodeBrecht Van Lommel
With (center) position, radius and random value outputs. Eevee does not yet support rendering point clouds, but an untested implementation of this node was added for when it does. Ref T92573
2022-01-25Draw: Migrate hair refine compute shader to use create info.Jeroen Bakker
This patch migrates the draw manager hair refine compute shader to use GPUShaderCreateInfo. Reviewed By: fclem Differential Revision: https://developer.blender.org/D13915
2022-01-24Cleanup: sort cmake file listsCampbell Barton
2022-01-18GPU: Create Info for GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR.Jeroen Bakker
This patch converts GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR shader to use the GPUShaderCreateInfo pattern. It can be used as a reference when converting other shaders. In this special case the flat uniform vector cannot be used anymore as it doesn't fit as push constants. To solve this a uniform buffer is used.
2022-01-18Cleanup: quite old-style-declaration warning, strip trailing spaceCampbell Barton
2022-01-17Revert "Revert "GPUShaderCreateInfo for interface abstraction""Jeroen Bakker
This reverts commit edee5a947b7ea3e1324aa334a22c7c9bbf47f5f7. Fixes compilation error (Missing file BLI_float2.hh)
2022-01-17Revert "GPUShaderCreateInfo for interface abstraction"Jeroen Bakker
This reverts commit 8fb2ff458ba579dba08bfdf57d043ad158b5db07. Missing some files.
2022-01-17GPUShaderCreateInfo for interface abstractionJeroen Bakker
This is a first part of the Shader Create Info system could be. A shader create info provides a way to define shader structure, resources and interfaces. This makes for a quick way to provide backend agnostic binding informations while also making shader variations easy to declare. - Clear source input (only one file). Cleans up the GPU api since we can create a shader from one descriptor - Resources and interfaces are generated by the backend (much simpler than parsing). - Bindings are explicit from position in the array. - GPUShaderInterface becomes a trivial translation of enums and string copy. - No external dependency to third party lib. - Cleaner code, less fragmentation of resources in several libs. - Easy to modify / extend at runtime. - no parser involve, very easy to code. - Does not hold any data, can be static and kept on disc. - Could hold precompiled bytecode for static shaders. This also includes a new global dependency system. GLSL shaders can include other sources by using #pragma BLENDER_REQUIRE(...). This patch already migrated several builtin shaders. Other shaders should be migrated one at a time, and could be done inside master. There is a new compile directive `WITH_GPU_SHADER_BUILDER` this is an optional directive for linting shaders to increase turn around time. What is remaining: - pyGPU API {T94975} - Migration of other shaders. This could be a community effort. Reviewed By: jbakker Maniphest Tasks: T94975 Differential Revision: https://developer.blender.org/D13360
2022-01-10Remove GPU_SHADER_2D_POINT_FIXED_SIZE_UNIFORM_COLOR.Jeroen Bakker
Shader isn't used and not accessible via py-api.
2022-01-10Remove GPU_SHADER_2D_POINT_VARYING_SIZE_VARYING_COLOR.Jeroen Bakker
Shader isn't used and not accessible via py-api.
2022-01-10Remove GPU_SHADER_2D_POINT_UNIFORM_SIZE_VARYING_COLOR_OUTLINE_AA.Jeroen Bakker
Shader isn't used and not accessible via py-api.
2022-01-10Remove GPU_SHADER_3D_POINT_VARYING_SIZE_UNIFORM_COLOR.Jeroen Bakker
Shader isn't used and not accessible via the py-api.
2022-01-10Remove GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA.Jeroen Bakker
Shader isn't used and isn't accessible via py-api.
2022-01-10Cleanup: Remove unused source files.Jeroen Bakker
2022-01-10Fix compile error in gpu test.Jeroen Bakker
2022-01-06Cleanup: remove unnecessary slashes and quotes from paths in CMakeCampbell Barton
2021-11-05Merge branch 'blender-v3.0-release'Bastien Montagne
2021-11-05Cleanup (UI): Add/use type for operator context enumJulian Eisel
Adds a `wmOperatorCallContext` typedef for the existing `WM_OP_XXX` operator context enum. This adds type safety, allows the compiler to produce better warnings and helps understanding what a variable is for. Differential Revision: https://developer.blender.org/D13113 Reviewed by: Campbell Barton
2021-11-05Fix T92807: Incorrect display planar tracking.Jeroen Bakker
Issue introduced in {7e66616b7e15} where the shader was replaced with a 2d image shader. This patch reverts several commits that removed the 3d image shader.
2021-09-30Nodes: Add Float Curve for GN and Shader nodes.Charlie Jolly
Replacement for float curve in legacy Attribute Curve Map node. Float Curve defaults to [0.0-1.0] range. Reviewed By: JacquesLucke, brecht Differential Revision: https://developer.blender.org/D12683
2021-09-23Cleanup: Remove hardcoded values and rename keyframe shape shadersDalai Felinto
No functional change. The shader is complicated by itself, having hardcoded values makes it even more cryptic. I also renamed the shader because the shader is not for the keyfarme diamond only, but for all the keyframe shapes. Differential Revision: https://developer.blender.org/D12615
2021-07-08CMake: add missing headers, sort file listsCampbell Barton
2021-06-28GPU: Refactored +cleanup compilation log parsing.Jeroen Bakker
Old implementation has a single parser of many different formats. With the introduction of Vulkan this would lead to another parser in the same function. This patch separates the log parsing using a visitor pattern so the log parsing can be configured per GPU backend or even per driver. With Vulkan we manage the compiler our self so the parsing will become more straight forward. The OpenGL part depends on many factors (OS, Driver) and perhaps even GPU.
2021-06-28GPU: Separate compiler log from shader.Jeroen Bakker
Current compiler log parser is to complex to follow. Moving it to its own compile unit before refactoring.
2021-06-28GPU: Testcases for builtin shaders.Jeroen Bakker
Adding compiler test (does it compile?) test for all builtin shaders.
2021-06-08GPU: Thread safe index buffer builders.Jeroen Bakker
Current index builder is designed to be used in a single thread. This makes all index buffer extractions single threaded. This patch adds a thread safe solution enabling multithreaded building of index buffers. To reduce locking the solution would provide a task/thread local index buffer builder (called sub builder). When a thread is finished this thread local index buffer builder can be joined with the initial index buffer builder. `GPU_indexbuf_subbuilder_init`: Initialized a sub builder. The index list is shared between the parent and sub buffer, but the counters are localized. Ensuring that updating counters would not need any locking. `GPU_indexbuf_subbuilder_finish`: merge the information of the sub builder back to the parent builder. Needs to be invoked outside the worker thread, or when sure that all worker threads have been finished. Internal the function is not thread safe. For testing purposes the extract_points extractor has been migrated to the new API. Herefore changes to the mesh extractor were needed. * When creating tasks, the task number of current task is stored in ExtractTaskData including the total number of tasks. * Adding two functions in `MeshExtract`. ** `task_init` will initialize the task specific userdata. ** `task_finish` should merge back the task specific userdata back. * adding task_id parameter to the iteration functions so they can access the correct task data without any need for locking. There is no noticeable change in end user performance. Reviewed By: mano-wii Differential Revision: https://developer.blender.org/D11499