Files
test2/source/blender/gpu/GPU_compute.h
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00

57 lines
1.4 KiB
C

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*
* GPU Compute Pipeline
*
* Allows to dispatch compute shader tasks on the GPU.
* Every dispatch is sent to the active `GPUContext`.
*/
#pragma once
#include "BLI_sys_types.h"
#include "GPU_shader.h"
#include "GPU_storage_buffer.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Dispatch a compute shader task.
* The number of work groups (aka thread groups) is bounded by `GPU_max_work_group_count()` which
* might be different in each of the 3 dimensions.
*/
void GPU_compute_dispatch(GPUShader *shader,
uint groups_x_len,
uint groups_y_len,
uint groups_z_len);
/**
* Dispatch a compute shader task. The size of the dispatch is sourced from a \a indirect_buf
* which must follow this layout:
* \code{.c}
* typedef struct {
* uint groups_x_len;
* uint groups_y_len;
* uint groups_z_len;
* } DispatchIndirectCommand;
* \encode
*
* \note The writes to the \a indirect_buf do not need to be synchronized as a memory barrier is
* emitted internally.
*
* The number of work groups (aka thread groups) is bounded by `GPU_max_work_group_count()` which
* might be different in each of the 3 dimensions.
*/
void GPU_compute_dispatch_indirect(GPUShader *shader, GPUStorageBuf *indirect_buf);
#ifdef __cplusplus
}
#endif