KiCad PCB EDA Suite
Loading...
Searching...
No Matches
rhi_compute.cpp File Reference
#include <rhi/rhi_compute.h>
#include <array>
#include <unordered_set>

Go to the source code of this file.

Functions

bool RhiValidateComputeBindGroupLayout (const RHI_BIND_GROUP_LAYOUT_DESC &aLayout)
 Validate a compute bind group layout.
 
bool RhiValidateComputePipelineDesc (const RHI_COMPUTE_PIPELINE_DESC &aDesc)
 Validate the portable contract without accessing a GPU or inspecting shader bytecode.
 
bool RhiValidateComputeJob (const RHI_COMPUTE_JOB &aJob, const RHI_COMPUTE_DEVICE_LIMITS &aLimits, const RHI_COMPUTE_JOB_LOOKUP &aLookup)
 Check a whole job against live resources before any of it executes, so a bad job has no partial effect.
 
static std::vector< uint8_t > copyBytes (const void *aData, size_t aBytes)
 

Function Documentation

◆ copyBytes()

static std::vector< uint8_t > copyBytes ( const void * aData,
size_t aBytes )
static

◆ RhiValidateComputeBindGroupLayout()

bool RhiValidateComputeBindGroupLayout ( const RHI_BIND_GROUP_LAYOUT_DESC & aLayout)

Validate a compute bind group layout.

Every entry must be visible to compute and no buffer may use binding 0, which Metal reserves for push constants.

Definition at line 26 of file rhi_compute.cpp.

References RHI_BINDING_ENTRY::binding, COMBINED_TEXTURE_SAMPLER, COMPUTE, RHI_BIND_GROUP_LAYOUT_DESC::entries, RHI_BINDING_ENTRY::stages, RHI_BINDING_ENTRY::type, and RHI_BIND_GROUP_LAYOUT_DESC::Validate().

Referenced by BOOST_AUTO_TEST_CASE(), GPU_COMPUTE::CreateBindGroupLayout(), and RhiValidateComputePipelineDesc().

◆ RhiValidateComputeJob()

bool RhiValidateComputeJob ( const RHI_COMPUTE_JOB & aJob,
const RHI_COMPUTE_DEVICE_LIMITS & aLimits,
const RHI_COMPUTE_JOB_LOOKUP & aLookup )

Check a whole job against live resources before any of it executes, so a bad job has no partial effect.

Push constants must be pushed in full after each Bind() and before the next Dispatch().

Definition at line 79 of file rhi_compute.cpp.

References actual, RHI_COMPUTE_PIPELINE_DESC::bindGroupLayouts, RHI_COMPUTE_JOB::Commands(), expected, RHI_COMPUTE_JOB_LOOKUP::groupLayout, RHI_COMPUTE_JOB::IsValid(), RHI_COMPUTE_DEVICE_LIMITS::maxDispatchGroups, RHI_COMPUTE_JOB_LOOKUP::pipeline, RHI_COMPUTE_PIPELINE_DESC::pushConstantBytes, and RHI_COMPUTE_JOB_LOOKUP::storageRange.

Referenced by RHI_VULKAN_DEVICE::ExecuteCompute().

◆ RhiValidateComputePipelineDesc()