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-09-06Cleanup: spelling in comments, formatting, move comments into headersCampbell Barton
2022-09-01Metal: MTLShader and MTLShaderGenerator implementation.Thomas Dinges
Full support for translation and compilation of shaders in Metal, using GPUShaderCreateInfo. Includes render pipeline state creation and management, enabling all standard GPU viewport rendering features in Metal. Authored by Apple: Michael Parkin-White, Marco Giordano Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D15563
2022-08-16GPU: ShaderCreateInfo: Use variadic template instead of default argumentsClément Foucault
This should reduce the issue described in T100431. This is also cleaner and without arbitrary argument limit.
2022-08-09DRW: DebugDraw: Port module to C++ and add GPU capabilitiesClément Foucault
This is a complete rewrite of the draw debug drawing module in C++. It uses `GPUStorageBuf` to store the data to be drawn and use indirect drawing. This makes it easier to do a mirror API for GPU shaders. The C++ API class is exposed through `draw_debug.hh` and should be used when possible in new code. However, the debug drawing will not work for platform not yet supporting `GPUStorageBuf`. Also keep in mind that this module must only be used in debug build for performance and compatibility reasons.
2022-07-29Realtime Compositor: Add needed GPU module changesOmar Emara
This patch implements the necessary changes to the GPU module that are needed by the realtime compositor. A new function GPU_material_from_callbacks was added to construct a GPU material from a number of callbacks. A callback to construct the material graph by adding and linking the necessary GPU material nodes. And the existing code generator callback. This essentially allows the construction of GPU materials independent of node trees and without the need to do any node tree localization. A new composite source output to the code generator was added. This output contains the serialization of nodes that are tagged with GPU_NODE_TAG_COMPOSITOR, which are the nodes linked to the newly added composite output links. Two new GPU uniform setters were added for int2 and matrix3 types. Shader create info now supports generated compute sources. Shaders starting with gpu_shader_compositor are now considered part of the shader library. Additionally, two fixes were implemented. First, GPU setter node de-duplication now appropriately increments the reference count of the references resources. Second, unlinked sockets now get their value from their associated GPU node stack instead of the socket itself. Differential Revision: https://developer.blender.org/D14690 Reviewed By: Clement
2022-07-15GPU: Fix shader builder on hardware that does not have all featuresClément Foucault
2022-05-01GPUShaderCreateInfo: Add validation for overlapping vertex attributeClément Foucault
Those are usually not supported but some driver silently fix them and most just silently fail (rendering error).
2022-04-20Cleanup: spelling in commentsCampbell Barton
2022-04-20Cleanup: unused argument warningCampbell Barton
2022-04-19GPU: Fix Adresse Sanitizer errorsClément Foucault
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-04-13pyGPU: Port 'StageInterfaceInfo' and 'ShaderCreateInfo' typesGermano Cavalcante
In order to allow GLSL Cross Compilation across platforms, expose in Python the `GPUShaderCreateInfo` strategy as detailed in https://wiki.blender.org/wiki/EEVEE_%26_Viewport/GPU_Module/GLSL_Cross_Compilation The new features can be listed as follows: ``` >>> gpu.types.GPUShaderCreateInfo. define( fragment_out( fragment_source( push_constant( sampler( typedef_source( uniform_buf( vertex_in( vertex_out( vertex_source( >>> gpu.types.GPUStageInterfaceInfo. flat( name no_perspective( smooth( >>> gpu.shader.create_from_info( ``` Reviewed By: fclem, campbellbarton Differential Revision: https://developer.blender.org/D14497
2022-03-31Cleanup: spelling, trailing space for comment-blocksCampbell Barton
2022-03-30GPUShaderCreateInfo: Add DepthWrite optionClément Foucault
This option lets specify explicitely how the fragment shader will change the fragment's depth.
2022-03-18GPUShaderCreateInfo: Add explicit early_fragment_testClément Foucault
2022-03-11Cleanup: fix source comment typosBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D14307
2022-03-02Cleanup: use back-slash for doxygen commands, color after parametersCampbell Barton
2022-02-23Cleanup: Remove repeated word in commentsCampbell Barton
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-07Cleanup: spelling in commentsCampbell Barton
2022-02-04GPUShaderCreateInfo: Merge changes from eevee-rewriteClément Foucault
This includes multiple commits: - Fix crash when using std::cerr for error output - Add auto_resource_location which overrides all resources location (not vert input) - Improve codestyle of error reporting. - Add type conversion to string and to `eGPUType` - Add comparison operator (will be used for hash collision resolution). - Add members related to generated code (codegen)
2022-02-01GPUShader: Rename createInfo storage QualifiersClément Foucault
Using opt-in instead of opt-out to make code easier to read. Add combined flag enum. Making restrict an inverse flag option because it is so rare to use it.
2022-02-01GPUShader: Improve builtins support in GPUShaderCreateInfoClément Foucault
- Scan all static shaders for builtins on startup. - Add possibility to manually add builtins. - `ShaderCreateInfo.builtins_` contain builtins from all stages.
2022-01-27GPUShaderCreateInfo: Remove push_constant indexingClément Foucault
This is too much impractical and offers no real benefit.
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-26Cleanup: spelling in commentsCampbell Barton
2022-01-25GPUShader: Add optionnal single shader stage interface for in and outClément Foucault
This makes optionnal the use of a different interface for the geometry shader stage output. When the vertex and geometry interface instance name matches, a `_in` and `_out` suffix is added to the end of the instance name. This makes it easier to have optional geometry shader stages. # Conflicts: # source/blender/gpu/intern/gpu_shader_create_info.hh
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-24GPUShaderCreateInfo: Add manual validation of bindpointsClément Foucault
Some drivers/glsl compilers will not warn about multiple resources using the same binding, creating silent errors. This patch checks for this case and outputs a descriptive error message if a particular createInfo merge error is founds. Other validation can be added later.
2022-01-19GPUShaderCreateInfo: Rework geometry shader layout supportClément Foucault
This merge the description into one struct only that can be more easily copied during `finalize()`. The in and out layout parameters are better named and extended with the invocation count (with fallback support)
2022-01-18Cleanup: spelling in commentsCampbell 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