Add Chromium-only Blender WebEngine parity work
This commit is contained in:
56
blender-5.2.0/source/blender/gpu/GPU_compute.hh
Normal file
56
blender-5.2.0/source/blender/gpu/GPU_compute.hh
Normal file
@@ -0,0 +1,56 @@
|
||||
/* 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.hh"
|
||||
#include "GPU_storage_buffer.hh"
|
||||
|
||||
namespace blender {
|
||||
|
||||
/**
|
||||
* 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(gpu::Shader *shader,
|
||||
uint groups_x_len,
|
||||
uint groups_y_len,
|
||||
uint groups_z_len,
|
||||
const gpu::shader::SpecializationConstants *constants_state = nullptr);
|
||||
|
||||
/**
|
||||
* Dispatch a compute shader task. The size of the dispatch is sourced from a \a indirect_buf
|
||||
* which must follow this layout:
|
||||
* \code{.c}
|
||||
* struct DispatchIndirectCommand {
|
||||
* uint groups_x_len;
|
||||
* uint groups_y_len;
|
||||
* uint groups_z_len;
|
||||
* };
|
||||
* \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(
|
||||
gpu::Shader *shader,
|
||||
gpu::StorageBuf *indirect_buf,
|
||||
const gpu::shader::SpecializationConstants *constants_state = nullptr);
|
||||
|
||||
} // namespace blender
|
||||
Reference in New Issue
Block a user