Blender V5.3
gpu_compute.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "GPU_compute.hh"
10
11#include "gpu_backend.hh"
12#include "gpu_debug_private.hh"
13
14namespace blender {
15
17 uint groups_x_len,
18 uint groups_y_len,
19 uint groups_z_len,
20 const gpu::shader::SpecializationConstants *constants_state)
21{
22 gpu::GPUBackend &gpu_backend = *gpu::GPUBackend::get();
23 GPU_shader_bind(shader, constants_state);
24#ifndef NDEBUG
26#endif
27 gpu_backend.compute_dispatch(groups_x_len, groups_y_len, groups_z_len);
28}
29
31 gpu::StorageBuf *indirect_buf_,
32 const gpu::shader::SpecializationConstants *constants_state)
33{
34 gpu::GPUBackend &gpu_backend = *gpu::GPUBackend::get();
35 gpu::StorageBuf *indirect_buf = reinterpret_cast<gpu::StorageBuf *>(indirect_buf_);
36
37 GPU_shader_bind(shader, constants_state);
38#ifndef NDEBUG
40#endif
41 gpu_backend.compute_dispatch_indirect(indirect_buf);
42}
43
44} // namespace blender
virtual void compute_dispatch_indirect(StorageBuf *indirect_buf)=0
virtual void compute_dispatch(int groups_x_len, int groups_y_len, int groups_z_len)=0
static GPUBackend * get()
void debug_validate_binding_image_format()
Definition gpu_debug.cc:193
BMesh Iterators.
unsigned int uint
Definition BKE_text.h:55
void GPU_compute_dispatch(gpu::Shader *shader, uint groups_x_len, uint groups_y_len, uint groups_z_len, const gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_compute_dispatch_indirect(gpu::Shader *shader, gpu::StorageBuf *indirect_buf_, const gpu::shader::SpecializationConstants *constants_state)
void GPU_shader_bind(gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants_state=nullptr)