Blender  V3.3
gpu_compute.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "GPU_compute.h"
8 
9 #include "gpu_backend.hh"
10 
12  uint groups_x_len,
13  uint groups_y_len,
14  uint groups_z_len)
15 {
17  GPU_shader_bind(shader);
18  gpu_backend.compute_dispatch(groups_x_len, groups_y_len, groups_z_len);
19 }
20 
22 {
24  blender::gpu::StorageBuf *indirect_buf = reinterpret_cast<blender::gpu::StorageBuf *>(
25  indirect_buf_);
26 
27  GPU_shader_bind(shader);
28  gpu_backend.compute_dispatch_indirect(indirect_buf);
29 }
unsigned int uint
Definition: BLI_sys_types.h:67
struct GPUShader GPUShader
Definition: GPU_shader.h:20
void GPU_shader_bind(GPUShader *shader)
Definition: gpu_shader.cc:491
struct GPUStorageBuf GPUStorageBuf
static GPUBackend * get()
Definition: gpu_context.cc:292
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_indirect(GPUShader *shader, GPUStorageBuf *indirect_buf_)
Definition: gpu_compute.cc:21
void GPU_compute_dispatch(GPUShader *shader, uint groups_x_len, uint groups_y_len, uint groups_z_len)
Definition: gpu_compute.cc:11