载入中...
搜索中...
未找到
IndirectBuilder.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
6
7#include <cstdint>
8#include <vector>
9#include <algorithm>
10
11namespace eve::graphics {
12
25public:
27 void reset();
28
30 void add(uint32_t seq, uint32_t meshId, uint32_t materialId, uint32_t pipelineId);
31
36 uint32_t build(const std::vector<GpuMeshRecord> &meshTable);
37
39 const std::vector<uint32_t> &sortedInstanceOrder() const { return order_; }
40
42 const std::vector<GpuIndirectCommand> &commands() const { return commands_; }
44 uint32_t drawCount() const { return uint32_t(commands_.size()); }
45
46private:
47 struct Entry {
48 uint64_t key = 0;
49 uint32_t seq = 0;
50 uint32_t meshId = kInvalidGpuDrivenSlot;
51 uint32_t materialId = kInvalidGpuDrivenSlot;
52 uint32_t pipelineId = 0;
53 };
54
55 static uint64_t makeKey(uint32_t seq, uint32_t meshId, uint32_t materialId,
56 uint32_t pipelineId) {
57 return (uint64_t(pipelineId & 0xFF) << 56) |
58 (uint64_t(materialId & 0xFFFF) << 40) |
59 (uint64_t(meshId & 0xFFFF) << 24) | (seq & 0xFFFFFF);
60 }
61
62 std::vector<Entry> entries_;
63 std::vector<uint32_t> order_;
64 std::vector<GpuIndirectCommand> commands_;
65};
66
67} // namespace eve::graphics
#define EVENGINE_API_BACKENDS
Definition Export.h:108
std::uint32_t key
CPU-side builder for GPU-driven indirect draws (stage 1).
uint32_t drawCount() const
Draws count.
const std::vector< GpuIndirectCommand > & commands() const
Commands.
const std::vector< uint32_t > & sortedInstanceOrder() const
Instance indices in the sorted order the caller must upload.
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
constexpr uint32_t kInvalidGpuDrivenSlot
GPU-driven rendering shared constants + std430 GPU layouts.