Commit Graph

9 Commits

Author SHA1 Message Date
Clément Foucault
fb3904ce45 GPU: Shader Codegen: Split different graph includes
This allows to reduce the number of includes for each
tree graph (surface, volume, displacement) and
reduce the code size significantly for most vertex
shaders, speeding up compile time.

Rel #145347

Pull Request: https://projects.blender.org/blender/blender/pulls/146419
2025-09-22 10:24:10 +02:00
Clément Foucault
680fec144c Cleanup: GPU: Remove prefix 'e' from enum types
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/146034
2025-09-15 15:11:02 +02:00
Miguel Pozo
9f59a36181 Revert "GPU: Improve the do_static_compilation_ check coverage"
This reverts commit 162a24e05d.

Needs testing.
There are asserts triggering on startup.
2025-08-25 16:31:43 +02:00
Miguel Pozo
162a24e05d GPU: Improve the do_static_compilation_ check coverage
Since we use StaticShader now in many places, the check is often
bypassed.

Ensure that any compiled shader is either marked as static or as a
GPUPass.

Pull Request: https://projects.blender.org/blender/blender/pulls/144950
2025-08-25 15:55:26 +02:00
Miguel Pozo
e6638d6e5e Refactor: GPU: GPUMaterial & GPUPass compilation
Cleanup and simplification of GPUMaterial and GPUPass compilation.
See #133674 for details/goals.

- Remove the `draw_manage_shader` thread.
  Deferred compilation is now handled by the gpu::ShaderCompiler
  through the batch compilation API.
  Batch management is handled by the `GPUPassCache`.
- Simplify `GPUMaterial` status tracking so it just queries the
  `GPUPass` status.
- Split the `GPUPass` and the `GPUCodegen` code.
- Replaced the (broken) `GPU_material_recalc_flag_get` with the new
  `GPU_pass_compilation_timestamp`.
- Add the `GPU_pass_cache_wait_for_all` and
  `GPU_shader_batch_wait_for_all`, and remove the busy waits from
   EEVEE.
- Remove many unused functions, properties, includes...

Pull Request: https://projects.blender.org/blender/blender/pulls/135637
2025-05-22 17:53:22 +02:00
Miguel Pozo
4919221456 GPU: Batch Compilation: Show compiled GPUMaterials as soon as possible
Request one separate compilation batch for each GPUPass so users can
get a better sense of the compilation progress, and to better distribute
texture loading over time.

Pull Request: https://projects.blender.org/blender/blender/pulls/125012
2024-07-25 19:18:07 +02:00
Miguel Pozo
fb98edf322 GPU: Add GPU_material_batch_compile
Add `GPU_material_batch` API.
It uses the new `GPU_shader_batch` from #122232 internally and it
works in the same way.

Note: This doesn't implement parallel material optimizations.

Pull Request: https://projects.blender.org/blender/blender/pulls/122793
2024-06-07 16:11:50 +02:00
Miguel Pozo
aa37e46152 Draw: Use GPUPass for default material fallback detection
Update #121137 to store the reused GPUPass on its own GPUMaterial,
instead of replacing the GPUMaterial itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/121790
2024-05-15 16:01:05 +02:00
Hans Goudey
8b514bccd1 Cleanup: Move remaining GPU headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/119807
2024-03-23 01:24:18 +01:00