载入中...
搜索中...
未找到
GpuDrivenTypes.h
浏览该文件的文档.
1#pragma once
2
3#include <cstdint>
4#include <glm/glm.hpp>
5
6namespace eve::graphics {
7
17constexpr uint32_t kInvalidGpuDrivenSlot = 0xFFFFFFFFu;
18constexpr uint32_t kMaxGpuDrivenTextures = 1024; // sampler2D array slots (desktop limit)
19constexpr uint32_t kMaxGpuDrivenCubemaps = 64; // samplerCube array slots
20
23 glm::vec4 boundsCenterRadius; // model-space bounding sphere (xyz = center, w = radius)
24 uint32_t vertexOffset = 0; // offset into pooled vertex buffer (vertex count)
25 uint32_t vertexCount = 0;
26 uint32_t indexOffset = 0; // offset into pooled index buffer (index count)
27 uint32_t indexCount = 0;
28 uint32_t indexType = 1; // 0 = u16, 1 = u32
29 uint32_t firstIndex = 0; // VkDrawIndexedIndirectCommand.firstIndex
30 uint32_t vertexBase = 0; // VkDrawIndexedIndirectCommand.vertexOffset
31 uint32_t lodGroupId = kInvalidGpuDrivenSlot; // stage 2: LOD chain table index
32 uint32_t vgAssetId = kInvalidGpuDrivenSlot; // stage 3: virtual-geometry asset
33 uint32_t pad1 = 0;
34 uint32_t pad2 = 0;
35 uint32_t pad3 = 0;
36};
37static_assert(sizeof(GpuMeshRecord) == 64, "GpuMeshRecord must be 64B (std430 16B aligned)");
38
41 glm::vec4 tint; // rgba
42 glm::vec4 pbr; // x = metallic, y = roughness, z = receiveShadow, w = receiveLight
43 glm::vec4 texBomb; // x = cellScale, y = strength, z = rotAmount
44 glm::vec4 parallax; // x = scale, y = minLayers, z = maxLayers
45 uint32_t textureSlots[4]; // xyzw = albedo / normal / height / env bindless slots
46 uint32_t shadingModel = 0; // 0 = pbr, 1 = unlit, 2 = hair, 3 = custom
47 uint32_t flags = 0; // bit0 castShadow, bit1 castOcclusion
48 uint32_t pad0 = 0;
49 uint32_t pad1 = 0;
50};
51static_assert(sizeof(GpuMaterialRecord) == 96, "GpuMaterialRecord must be 96B (std430 16B aligned)");
52
55 glm::mat4 model;
56 uint32_t meshId = kInvalidGpuDrivenSlot; // -> GpuMeshRecord table
57 uint32_t materialId = kInvalidGpuDrivenSlot; // -> GpuMaterialRecord table
58 uint32_t flags = 0; // bit0 castShadow, bit1 receiveShadow, bit2 castOcclusion
59 uint32_t lodGroupId = kInvalidGpuDrivenSlot; // stage 2
60};
61static_assert(sizeof(GpuInstance) == 80, "GpuInstance must be 80B (std430)");
62
65 uint32_t indexCount = 0;
66 uint32_t instanceCount = 0;
67 uint32_t firstIndex = 0;
68 uint32_t vertexOffset = 0;
69 uint32_t firstInstance = 0;
70};
71static_assert(sizeof(GpuIndirectCommand) == 20, "GpuIndirectCommand must match VkDrawIndexedIndirectCommand (20B)");
72
76 std::uint32_t u0[4]; // bounds: f32(cx), f32(cy), f32(cz), f32(r)
77 std::uint32_t u1[4]; // triStart, triCount, lodLevel, parent
78 std::uint32_t u2[4]; // f32(errorR), f32(errorRScreen), childCount, 0
79 std::uint32_t u3[4]; // children[4]
80};
81static_assert(sizeof(GpuVgCluster) == 64, "GpuVgCluster must be 64B (4 x uvec4)");
82
86 const float *positions = nullptr; // xyz packed, 3 * vertexCount
87 int vertexCount = 0;
88 const float *normals = nullptr; // optional xyz packed
89 const std::uint32_t *triangles = nullptr; // global triangle stream (indices)
90 int triangleCount = 0; // index count (multiple of 3)
91 const GpuVgCluster *clusters = nullptr;
92 int clusterCount = 0;
93};
94
95} // namespace eve::graphics
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition AnimTrail.h:6
constexpr uint32_t kMaxGpuDrivenCubemaps
constexpr uint32_t kMaxGpuDrivenTextures
constexpr uint32_t kInvalidGpuDrivenSlot
GPU-driven rendering shared constants + std430 GPU layouts.
Indirect draw command; layout identical to VkDrawIndexedIndirectCommand.
Per-instance GPU record (std430). Mirrors GLSL GpuInstance.
GPU material table record (std430). Mirrors GLSL GpuMaterialRecord.
GPU mesh table record (std430). Mirrors GLSL GpuMeshRecord.
Neutral GPU upload for one virtual-geometry asset. Raw arrays so the graphics module does not depend ...
const std::uint32_t * triangles
const GpuVgCluster * clusters
GPU-packed cluster node (std430, 4 x uvec4). Mirrors the virtualgeometry module's VgGpuCluster layout...