Blender V4.5
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
13void GPU_compute_dispatch(GPUShader *shader,
14 uint groups_x_len,
15 uint groups_y_len,
16 uint groups_z_len,
18{
20 GPU_shader_bind(shader, constants_state);
21 gpu_backend.compute_dispatch(groups_x_len, groups_y_len, groups_z_len);
22}
23
25 GPUShader *shader,
26 GPUStorageBuf *indirect_buf_,
28{
30 blender::gpu::StorageBuf *indirect_buf = reinterpret_cast<blender::gpu::StorageBuf *>(
31 indirect_buf_);
32
33 GPU_shader_bind(shader, constants_state);
34 gpu_backend.compute_dispatch_indirect(indirect_buf);
35}
unsigned int uint
void GPU_shader_bind(GPUShader *shader, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr)
static GPUBackend * get()
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
void GPU_compute_dispatch(GPUShader *shader, uint groups_x_len, uint groups_y_len, uint groups_z_len, const blender::gpu::shader::SpecializationConstants *constants_state)
void GPU_compute_dispatch_indirect(GPUShader *shader, GPUStorageBuf *indirect_buf_, const blender::gpu::shader::SpecializationConstants *constants_state)