Blender Git Loki

Blender Git "tmp-drw-callbatching" branch commits.

Page: 2 / 3

August 17, 2019, 12:48 (GMT)
DRW: Make DRWCall use resource handle
August 17, 2019, 12:48 (GMT)
DRW: Upload model matrices via UBO

The UBO is still not used so nothing should fail for now.
August 17, 2019, 12:48 (GMT)
DRW: Put Transform Feedback buffer into DRWUniform

Since the transform feedback must be the same for the whole SHgroup, and
since it is optional, put it in DRWUniform to make things cleaner.
August 17, 2019, 12:48 (GMT)
Cleanup: DRW: Remove unused vars and reduce size of DRWUniform
August 17, 2019, 12:48 (GMT)
Cleanup: DRW: move DRWShadingGroup uniform locations to DRWUniform
August 17, 2019, 12:48 (GMT)
DRW: Use int instead of uint for DRWCall

This let us tag non-instancing calls by tagging them with -1
August 17, 2019, 12:48 (GMT)
DRW: Make workaround for drivers with broken gl_InstanceID
August 17, 2019, 12:48 (GMT)
DRW: Remove common_view_lib uniform default values

Thoses default values makes the uniform never disabled so they
are updated even if not used.
August 17, 2019, 12:48 (GMT)
DRW: Fix eevee shaders and promote DRAW_ID to builtin uniform

Also rename DRAWID to BASE_INSTANCE

The Base instance uniform is necessary because fragment shaders
does not have the gl_BaseInstance builtin input variable.

So we need a workaround for those
August 17, 2019, 12:48 (GMT)
DRW: Put DRWCalls into DRWCallChunks

This is in order to improve cache coherence and make it possible
to sort and merge drawcalls in the future.
August 17, 2019, 12:48 (GMT)
DRW: Remove DRWCallSate in favor of DRWResourceHandle
August 17, 2019, 12:48 (GMT)
DRW: Replace single DRWUniform alloc by DRWUniformChunk

This is in order to improve cache coherence and lower memory
usage.

The savings in memory are used to be able to do vec4_copy
uniforms.
August 17, 2019, 12:48 (GMT)
DRW: Make DRWCullingState referenced by DRWResourceHandle
August 17, 2019, 12:48 (GMT)
GPU: Add API to use multidrawindirect using GPUbatch

This new API record a list of command that use the same batch and submit
it to the GPU in one call.
August 17, 2019, 12:48 (GMT)
Cleanup: GPU: Avoid implicit matrix multiplication
August 17, 2019, 12:48 (GMT)
DRW: Refactor to support draw call batching

This refactor improve draw structures CPU/Memory efficiency and lower the
driver overhead of doing many drawcalls.

- Model Matrix is now part of big UBOs that contain 1024 matrices.
- Object Infos follow the same improvement.
- Matrices are indexed by gl_BaseInstanceARB or a fallback uniform.
- All these resources are using a single 32bit identifier (DRWResourceHandle).
- DRWUniform & DRWCall are alloced in chunks to improve cache coherence & memory usage.
- DRWUniform now support up to vec4_copy.
- Draw calls are batch together if their resource id are consecutive.

This has a great impact on CPU usage when using lots of instances. Even if the biggest
bottleneck in these situations is the depsgraph iteration, the driver overhead when doing
thousands of drawcalls is still high.

This only improve situations where the CPU is the bottleneck: small geometry, lots of
instances.

The next step is to sort the drawcall inside a DRWCallChunk to improve the batching process
when instancing order is pretty random.

Reviewers: brecht, antoniov

Differential Revision: https://developer.blender.org/D4997
August 17, 2019, 12:48 (GMT)
Object Mode: Outlines: Rewrite id pass generation

This makes the ID pass for outline detection use the new
resource_id in order to differenciate drawcalls.

Since the drawcalls have IDs in the range of [0..511] this means objects
with the same id will have their outlines merges. This will be fixed in
next commit.

Lightprobes have their outlines disabled for now.
August 17, 2019, 12:48 (GMT)
GPU: Make Eevee shader pass resourceID to the fragment shader

this way we don't need a fallback uniform and the overcome the
impossibility to do draw call merging with these shaders.
August 17, 2019, 12:48 (GMT)
Cleanup: DRW: Break rendering loop into smaller functions
August 17, 2019, 12:48 (GMT)
DRW: Refactor replacing DRWCall by DRWCommand

DRWCall was fat and not very flexible. DRWCommand is very small and makes
it possible to have many kind of DRWCommand making the DRWManager more
extensible. Like adding the possibility of changing the stencil mask or
clear framebuffers in between drawcalls.

This commit breaks shgroup z sorting.
Tehnyt: Miika HämäläinenViimeksi p?ivitetty: 07.11.2014 14:18 MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2020