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-02-07Cleanup: spelling in commentsCampbell Barton
2022-02-06GPUShaderCreateInfo: Add duplication error checking of dependency mergingClément Foucault
As of now we do not allow additional infos duplication. We could in the future but for now assert that this is not the case.
2022-02-06Merge branch 'blender-v3.1-release'Clément Foucault
2022-02-06GPU: Debug: Avoid double printing of compilation issuesClément Foucault
To avoid that, we simply filter using a debug group.
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-02-06Merge branch 'blender-v3.1-release'Clément Foucault
2022-02-05GPUTexture: Fix missing/wrong cases in to_data_format()Clément Foucault
2022-02-05GLShaderInterface: Fix SSBO using the ubo maskClément Foucault
This might head lead to a crash when a shader uses both ubo and ssbo.
2022-02-04GPUShader: Improve error/warning logging experienceClément Foucault
Thanks to the new `ShaderCreateInfo` we now include source files without any modification. This let us query which are the source files passed to the `print_log` function. The log will now include a file with row and column number which is interpreted as a link in most IDE. DEBUG_CONTEXT_LINES will add more lines around the error lines for more context. This is also useful if the error line is imprecise (because of driver bugs) and the reported line is not sufficient to know the location of the error. The DEBUG_DEPENDENCIES option will display the list of included files in the shader sources. Note that it will not print generated source. This commit also fixes some issues with unhelpful logs, bogus row & column numbers, other error format, and bug if row was 0.
2022-02-04GPUShader: Cleanup dependency system to not remove string allocationClément Foucault
Source files are now only referenced and listed for the driver to ingest. Shader sources now includes generated data if any. Also cleans up gpu_shader_dependency_get_builtins casts.
2022-02-04GPUFramebuffer: Bump max attachment count to 8Clément Foucault
This is needed by eevee-rewrite
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-02-01GPUShader: Expose create_info getterClément Foucault
This allows to check if a create_info extists based on its name.
2022-01-31Cleanup: comments and minor changes to GPU_select codeCampbell Barton
- Remove outdated references to glReadPixels & OpenGL. - Rename GPUPickState.{gl => gpu} - Add doc-string for MAXPICKELEMS. - Use doxygen comments & other minor doc-string improvements.
2022-01-31Cleanup: use struct for GPU the select bufferCampbell Barton
GPU_select originally used GL_SELECT which defined the format for storing the selection result. Now this is no longer the case, define our own struct - making the code easier to follow: - Avoid having to deal with arrays in both `uint*` and `uint(*)[4]` multiplying offsets by 4 in some cases & not others. - No magic numbers for the offsets of depth & selection-ID. - No need to allocate unused members to match GL_SELECT (halving the buffer size).
2022-01-31Cleanup: use enum type for selection mode & internal algorithm enumCampbell Barton
2022-01-31Cleanup: use our own conventions for tags in commentsCampbell Barton
2022-01-28Cleanup: Clang-tidy warnings.Jeroen Bakker
Silence Clang-tidy warnings in gpu module.
2022-01-28Cleanup: spelling in commentsCampbell Barton
Also minor wording improvements.
2022-01-28GPUShader: Abort in case of dependency issues.Clément Foucault
This is to avoid being flooded with compilation errors that are not helpful.
2022-01-27Fix crash on older platform due to unsupported clear commandClément Foucault
Clearing using GPU_texture_create_2d for unorm texture needs to use GPU_DATA_FLOAT to match the conversion requirements.
2022-01-27GPUShaderCreateInfo: Add optionnal check for optimized out resourcesClément Foucault
This opt-in functionnality enabled developper keep track of unused resources present in the `GPUShaderCreateInfo` descriptors of their shaders. The output is pretty noisy at the moment so we do not enforce its usage.
2022-01-27GPUShaderCreateInfo: Remove push_constant indexingClément Foucault
This is too much impractical and offers no real benefit.
2022-01-26DRW: Fix builtin uniform name mismatchClément Foucault
This lead to severe unreported regression, like volume rendering broken in workbench.
2022-01-26Cleanup: GPUShaderShared: Complete vector supportClément Foucault
Move some declaration from `GPU_shader_shared.h` to the main common file and add missing vector declarations.
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-26Fix T94900: Fix drawing artifacts sequencer+node editor.Jeroen Bakker
The VSE and node editor only uses an overlay buffer to draw to the screen. The GPUViewport assumes that platforms clears all textures during creation, but they do not on selected platforms. What would lead to drawing from uncleared memory. This patch fixes this by clearing all viewport textures during creation.
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-26Gizmo: optimize intersection tests, fix selection biasCampbell Barton
Use more efficient logic for detecting when gizmos are under the cursor. Even though this isn't a bottleneck, it runs on cursor motion in the 3D viewport, so avoiding any lag here is beneficial. The common case for cursor motion without any gizmos was always drawing two passes (one small, then again if nothing was found). Now a single draw call at the larger size is used. In isolation this gives around 1.2x-1.4x speedup. When there are multiple gizmos a depth-buffer picking is used (similar to object / bone selection) which is more involved but still only performs 2x draw calls since the result is cached for reuse. See note in gizmo_find_intersected_3d for a more detailed explanation. Also restore the depth values in the selection result as they're needed for gizmos to use selection bias. Broken since support for GL_SELECT was removed.
2022-01-26Fix error using GPU selection cache for selection pickingCampbell Barton
When calling GPU_select_cache_begin, checking the selection mode used the last used selection mode, not the one about to be used. Using border select, then picking would not use the selection cache. This wasn't noticeable by users as failing to use cache just completes the selection without it (drawing the depth buffer unnecessarily).
2022-01-26Cleanup: spelling in commentsCampbell Barton
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-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-25GPU: Add GPU_shader_create_from_info_nameJeroen Bakker
This function will be used as the way to build shaders from create_infos. The previous used method was using a private function.
2022-01-25Cleanup: Correct location of node function declarationsHans Goudey
Currently there are many function declarations in `BKE_node.h` that don't actually have implementations in blenkernel. This commit moves the declarations to `NOD_composite.h`, `NOD_texture.h`, and `NOD_shader.h` instead. This helps to clarify the purpose of the different modules. Differential Revision: https://developer.blender.org/D13869
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-24Cleanup: spelling in commentsCampbell Barton
2022-01-21Fix error in previous commit.Jeroen Bakker
2022-01-21GPU: Disable create info for 2d image overlay merge.Jeroen Bakker
This shader needs to use the same interface as the OCIO shader. On Linux and Windows this seems to be the case. On MacOS however there is a mismatch that makes the overlay texture to be completely black when switching to workbench in the Shader workspace. This is just a temporarily work-around as this should be solved. Due to the poor GPU debugging facilities on Mac we haven't been able to pin-point the root cause.
2022-01-20Cleanup: spelling in commentsCampbell Barton
2022-01-20Cleanup: clang-formatCampbell Barton
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-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: spelling in commentsCampbell Barton
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.