#include "dawn/native/IndirectDrawValidationEncoder.h"
#include <algorithm>
#include <cstdint>
#include <cstdlib>
#include <limits>
#include <memory>
#include <utility>
#include <vector>
#include "dawn/common/Constants.h"
#include "dawn/common/Math.h"
#include "dawn/native/BindGroup.h"
#include "dawn/native/BindGroupLayout.h"
#include "dawn/native/CommandEncoder.h"
#include "dawn/native/ComputePassEncoder.h"
#include "dawn/native/ComputePipeline.h"
#include "dawn/native/Device.h"
#include "dawn/native/InternalPipelineStore.h"
#include "dawn/native/Queue.h"
#include "dawn/native/RenderPipeline.h"
#include "dawn/native/utils/WGPUHelpers.h"
#include "partition_alloc/pointers/raw_ptr.h"
namespace dawn::native {
namespace {
constexpr uint64_t kWorkgroupSize = …;
constexpr uint32_t kDuplicateBaseVertexInstance = …;
constexpr uint32_t kIndexedDraw = …;
constexpr uint32_t kValidationEnabled = …;
constexpr uint32_t kIndirectFirstInstanceEnabled = …;
constexpr uint32_t kUseFirstIndexToEmulateIndexBufferOffset = …;
constexpr uint32_t kIndirectDrawCountBuffer = …;
struct IndirectDraw { … };
static_assert …;
static_assert …;
struct BatchInfo { … };
struct MultiDrawConstants { … };
constexpr uint32_t kIndirectDrawByteSize = …;
static const char sRenderValidationShaderSource[] = …;
static constexpr uint32_t GetOutputIndirectDrawSize(IndirectDrawMetadata::DrawType drawType,
bool duplicateBaseVertexInstance) { … }
ResultOrError<dawn::Ref<ComputePipelineBase>> CreateRenderValidationPipelines(
DeviceBase* device,
const char* entryPoint,
std::initializer_list<dawn::native::utils::BindingLayoutEntryInitializationHelper> entries) { … }
ResultOrError<ComputePipelineBase*> GetOrCreateIndirectDrawValidationPipeline(DeviceBase* device) { … }
ResultOrError<ComputePipelineBase*> GetOrCreateMultiDrawValidationPipeline(DeviceBase* device) { … }
size_t GetBatchDataSize(uint32_t numDraws) { … }
}
uint32_t ComputeMaxDrawCallsPerIndirectValidationBatch(const CombinedLimits& limits) { … }
MaybeError EncodeIndirectDrawValidationCommands(DeviceBase* device,
CommandEncoder* commandEncoder,
RenderPassResourceUsageTracker* usageTracker,
IndirectDrawMetadata* indirectDrawMetadata) { … }
}