Age | Commit message (Collapse) | Author |
|
Otherwise we disable this feature. This is because some driver
does not support any vertex storage buffers but still support
8 ssbo in fragment shader.
|
|
This is a new implementation of the draw manager using modern
rendering practices and GPU driven culling.
This only ports features that are not considered deprecated or to be
removed.
The old DRW API is kept working along side this new one, and does not
interfeer with it. However this needed some more hacking inside the
draw_view_lib.glsl. At least the create info are well separated.
The reviewer might start by looking at `draw_pass_test.cc` to see the
API in usage.
Important files are `draw_pass.hh`, `draw_command.hh`,
`draw_command_shared.hh`.
In a nutshell (for a developper used to old DRW API):
- `DRWShadingGroups` are replaced by `Pass<T>::Sub`.
- Contrary to DRWShadingGroups, all commands recorded inside a pass or
sub-pass (even binds / push_constant / uniforms) will be executed in order.
- All memory is managed per object (except for Sub-Pass which are managed
by their parent pass) and not from draw manager pools. So passes "can"
potentially be recorded once and submitted multiple time (but this is
not really encouraged for now). The only implicit link is between resource
lifetime and `ResourceHandles`
- Sub passes can be any level deep.
- IMPORTANT: All state propagate from sub pass to subpass. There is no
state stack concept anymore. Ensure the correct render state is set before
drawing anything using `Pass::state_set()`.
- The drawcalls now needs a `ResourceHandle` instead of an `Object *`.
This is to remove any implicit dependency between `Pass` and `Manager`.
This was a huge problem in old implementation since the manager did not
know what to pull from the object. Now it is explicitly requested by the
engine.
- The pases need to be submitted to a `draw::Manager` instance which can
be retrieved using `DRW_manager_get()` (for now).
Internally:
- All object data are stored in contiguous storage buffers. Removing a lot
of complexity in the pass submission.
- Draw calls are sorted and visibility tested on GPU. Making more modern
culling and better instancing usage possible in the future.
- Unit Tests have been added for regression testing and avoid most API
breakage.
- `draw::View` now contains culling data for all objects in the scene
allowing caching for multiple views.
- Bounding box and sphere final setup is moved to GPU.
- Some global resources locations have been hardcoded to reduce complexity.
What is missing:
- ~~Workaround for lack of gl_BaseInstanceARB.~~ Done
- ~~Object Uniform Attributes.~~ Done (Not in this patch)
- Workaround for hardware supporting a maximum of 8 SSBO.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D15817
|
|
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
|
|
GPUCapabilities expansion.
- Adding in compatibility paths to support minimum per-vertex strides for vertex formats. OpenGL supports a minimum stride of 1 byte, in Metal, this minimum stride is 4 bytes. Meaing a vertex format must be atleast 4-bytes in size.
- Replacing transform feedback compile-time check to conditional look-up, given TF is supported on macOS with Metal.
- 3D texture size safety check added as a general capability, rather than being in the gl backend only. Also required for Metal.
Authored by Apple: Michael Parkin-White
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D14510
|
|
Implementation also contains a number of optimisations and feature enablements specific to the Metal API and Apple Silicon GPUs.
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D15369
|
|
With the new `attrs_info_get` method, we can get information about
the attributes used in a `GPUShader` and thus have more freedom in the
automatic creation of `GPUVertFormat`s
Reviewed By: fclem, campbellbarton
Differential Revision: https://developer.blender.org/D15764
|
|
This checks for the availability of `gl_BaseInstanceARB` or equivalent.
Disabling for any workaround that disables shader_image_load_store_support
as a preventive measure.
|
|
This is for completion and to be used by the new draw manager.
|
|
This is not expected to be fast. This is only for inspecting the content
of the buffer for debugging or validation purpose.
|
|
|
|
Ref T99382
Differential Revision: https://developer.blender.org/D15390
|
|
|
|
|
|
With libepoxy we can choose between EGL and GLX at runtime, as well as
dynamically open EGL and GLX libraries without linking to them.
This will make it possible to build with Wayland, EGL, GLVND support while
still running on systems that only have X11, GLX and libGL. It also paves
the way for headless rendering through EGL.
libepoxy is a new library dependency, and is included in the precompiled
libraries. GLEW is no longer a dependency, and WITH_SYSTEM_GLEW was removed.
Includes contributions by Brecht Van Lommel, Ray Molenkamp, Campbell Barton
and Sergey Sharybin.
Ref T76428
Differential Revision: https://developer.blender.org/D15291
|
|
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.
|
|
|
|
This updates image bind tracking to be the same as texture binds.
Adding a new bind flag to avoid conflict when the texture is used in
both slots.
Fixes a gl error in glBindImageTextures about invalid image binds.
|
|
This path is not used by any existing code so it isn't necessary to
backport.
|
|
This allows rendering a batch with parameters computed by the GPU.
Contains GL backend implementation.
|
|
Currently Blender generates mipmaps that override the existing ones.
This patch disables generating new mipmaps for compressed textures.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D14459
|
|
This causes an assert with libepoxy, but was wrong already regardless.
Refactor logic to work as follows:
* GPU_exit() deletes backend resources
* Destroy UI GPU resources with the context active
* Call GPU_backend_exit() after deleting the context
Ref D15291
Differential Revision: https://developer.blender.org/D15465
|
|
|
|
|
|
pass coordination.
MTLFrameBuffer has been implemented to support creation of RenderCommandEncoders, along with supporting functionality in the Metal Context.
Optimisation stubs for GPU_framebuffer_bind_ext has been added, which enables specific assignment of attachment load-store ops at the bind level, rather than on a framebuffer object as a whole.
Begin and end frame markers are used to encapsulate frame boundaries for explicit workload submission. This is required for explicit APIs where implicit flushing of work does not occur.
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D15027
|
|
|
|
Intel iGPU (HD4000) supports OpenGL 4.4 but doesn't support conservative
depth. (GL_ARB_conservative_depth). This change will only check for the
availability of the extension.
|
|
Added Windows/Intel GPU to the list of work-a-rounds. This will
reduce the performance when using Intel GPUs on all platforms.
|
|
|
|
|
|
|
|
Thanks Germano for pointing it out.
|
|
|
|
It is a know issue that split normals aren't supported when using high
quality normals in the viewport. Some AMD platforms were pushed to use
high quality normals to work around a driver bug where 1010102 texture
formats `GL_INT_2_10_10_10_REV` wasn't uploaded to the GPU.
This change will remove commonly used polaris platforms from the
work-around. This has been tested with a RX480 against the latest AMD
whql drivers (22.5.1). Users need to ensure that they use the latest
drivers that are available on their platform.
Although this change doesn't fix the underlying issue to support edit
normals when high quality normals are enabled. It will not force that
common platforms cannot use a feature as their platform is forced into
using a work-around.
|
|
This allows using the Graphic API to copy buffer data.
The GPU module do not expose untyped buffers even if that's what most API
do, so the copy function need to be strongly typed.
Contains GL backend implementation.
|
|
|
|
|
|
This is often needed and somehow cumbersome to set up. This will allow some
code simplifications.
|
|
|
|
Related to the partial revert done for T97272. It seems also that the
workaround should be enabled for any MACOS platform.
|
|
GLSL has different max number of ssbo per glsl stage.
This patch checks if the number of compute ssbo blocks matches
our requirements for the GPU Subdiv, before enabling it.
Some platforms allow more ssbo bindings then blocks per stage.
|
|
GLSL has different max number of ssbo per glsl stage.
This patch checks if the number of compute ssbo blocks matches
our requirements for the GPU Subdiv, before enabling it.
Some platforms allow more ssbo bindings then blocks per stage.
|
|
GPU code used `sz` as an abbreviation for size, as well as a few other
places. Use size where this represents a size in bytes, see: T85728.
|
|
Revert change from [0] that assumed UNORM was a mis-spelling of UNIFORM.
[0]: 2c75857f9fc0dc5d524e4a0407e0a68856e5906e
|
|
Viewports where cleared explicitly due to compatibility reasons with Intel iGPUs.
This slowed down other platforms as well, this wasn't noticeable on all platforms.
This patch will be more selective when to enable the workaround.
Currently only for iGPUs on Mac + Linux.
|
|
This workaround and the issue was described in D4490. This makes sure
any shader using `shaderCreateInfo` will benefit from the same workaround.
|
|
The bitwise XOR used to compute the delta (`changed`) might produce NaN and
thus produce undefined behavior when comparing to another float (because of
float promotion).
|
|
Fix T97449 GPU subdivision: Crash on adding subdivision surface modifier
|
|
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.
|
|
This patch fixes a typo in commit e59f754c169d which incorrectly uses `GPU_TEXTURE_ARRAY` instead of `GPU_FORMAT_COMPRESSED`.
`GPU_FORMAT_COMPRESSED` and `GPU_TEXTURE_ARRAY` both currently evaluate to 16, so this patch does not change anything functionally; however, this patch will prevent issues from arising in the future.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D14384
|
|
Guard shader storage related gets and bypass a buggy enum.
Fix T95592 OpenGL Invalid Enum
|