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
49 lines
1.3 KiB
C++
49 lines
1.3 KiB
C++
/* SPDX-FileCopyrightText: 2025 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*
|
|
* Generate and cache shaders generated from the intermediate node graph.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "GPU_material.hh"
|
|
#include "GPU_shader.hh"
|
|
|
|
struct GPUNodeGraph;
|
|
|
|
struct GPUPass;
|
|
|
|
enum eGPUPassStatus {
|
|
GPU_PASS_FAILED = 0,
|
|
GPU_PASS_QUEUED,
|
|
GPU_PASS_SUCCESS,
|
|
};
|
|
|
|
GPUPass *GPU_generate_pass(GPUMaterial *material,
|
|
GPUNodeGraph *graph,
|
|
const char *debug_name,
|
|
eGPUMaterialEngine engine,
|
|
bool deferred_compilation,
|
|
GPUCodegenCallbackFn finalize_source_cb,
|
|
void *thunk,
|
|
bool optimize_graph);
|
|
|
|
eGPUPassStatus GPU_pass_status(GPUPass *pass);
|
|
bool GPU_pass_should_optimize(GPUPass *pass);
|
|
void GPU_pass_ensure_its_ready(GPUPass *pass);
|
|
GPUShader *GPU_pass_shader_get(GPUPass *pass);
|
|
void GPU_pass_acquire(GPUPass *pass);
|
|
void GPU_pass_release(GPUPass *pass);
|
|
|
|
uint64_t GPU_pass_global_compilation_count();
|
|
uint64_t GPU_pass_compilation_timestamp(GPUPass *pass);
|
|
|
|
void GPU_pass_cache_init();
|
|
void GPU_pass_cache_update();
|
|
void GPU_pass_cache_wait_for_all();
|
|
void GPU_pass_cache_free();
|