载入中...
搜索中...
未找到
GpuDrivenTypes.h
浏览该文件的文档.
1#pragma once
2
4
5#include <cstdint>
6// Prefer narrow GLM headers over <glm/glm.hpp> (that pull pulls AVX512 intrinsics).
7#include <glm/ext/vector_uint4.hpp>
8#include <glm/mat4x4.hpp>
9#include <glm/vec4.hpp>
10
11namespace eve::graphics {
12
25
27 glm::vec4 boundsCenterRadius; // model-space bounding sphere (xyz = center, w = radius)
28 uint32_t vertexOffset = 0; // offset into pooled vertex buffer (vertex count)
29 uint32_t vertexCount = 0;
30 uint32_t indexOffset = 0; // offset into pooled index buffer (index count)
31 uint32_t indexCount = 0;
32 uint32_t indexType = 1; // 0 = u16, 1 = u32
33 uint32_t firstIndex = 0; // VkDrawIndexedIndirectCommand.firstIndex
34 uint32_t vertexBase = 0; // VkDrawIndexedIndirectCommand.vertexOffset
35 uint32_t lodGroupId = kInvalidGpuDrivenSlot; // stage 2: LOD chain table index
36 uint32_t vgAssetId = kInvalidGpuDrivenSlot; // stage 3: virtual-geometry asset
37 uint32_t pad1 = 0;
38 uint32_t pad2 = 0;
39 uint32_t pad3 = 0;
40};
41static_assert(sizeof(GpuMeshRecord) == 64, "GpuMeshRecord must be 64B (std430 16B aligned)");
42
45 glm::vec4 tangent; // xyz authored tangent, w = tangent frame present
46 glm::vec4 bitangent; // xyz authored bitangent
47 glm::vec4 factors0; // variation, occlusion, detail xyz (first two components)
48 glm::vec4 factors1; // detail z, motion highlight, stream flags, reserved
49 glm::vec4 deformation0; // pivot xyz, bending
50 glm::vec4 deformation1; // branch, flutter, authored variation, bounds height
51 glm::vec4 deformation2; // bounds radius, reserved
52};
53static_assert(sizeof(GpuVegetationVertexRecord) == 112, "GpuVegetationVertexRecord must be 112B (std430 16B aligned)");
54
56
58 glm::vec4 tint; // rgba
59 glm::vec4 pbr; // x = metallic, y = roughness, z = receiveShadow, w = receiveLight
60 glm::vec4 texBomb; // x = cellScale, y = strength, z = rotAmount
61 glm::vec4 parallax; // x = scale, y = minLayers, z = maxLayers
62 glm::vec4 surface; // x = alpha cutoff, y = surface mode (0 opaque, 1 masked, 2 transparent)
63 uint32_t textureSlots[4]; // xyzw = albedo / normal / height / env bindless slots
64 uint32_t shadingModel = 0; // 0 = pbr, 1 = unlit, 2 = hair, 3 = custom
65 uint32_t flags = 0; // bit0 castShadow, bit1 castOcclusion, bit2 cylindrical camera-facing card
66 uint32_t pad0 = 0;
67 uint32_t pad1 = 0;
68};
69static_assert(sizeof(GpuMaterialRecord) == 112, "GpuMaterialRecord must be 112B (std430 16B aligned)");
70
72
74 glm::mat4 model;
75 uint32_t meshId = kInvalidGpuDrivenSlot; // -> GpuMeshRecord table
76 uint32_t materialId = kInvalidGpuDrivenSlot; // -> GpuMaterialRecord table
77 uint32_t flags = 0; // bit0 castShadow, bit1 receiveShadow, bit2 castOcclusion
78 uint32_t lodGroupId = kInvalidGpuDrivenSlot; // stage 2
80 glm::vec4 reflectionProbeCenter[2]{}; // xyz = center, w = intensity
81 glm::vec4 reflectionProbeExtent[2]{}; // xyz = extent, w = blend distance
82 glm::vec4 color{1.f}; // per-instance linear RGBA multiplier
83 glm::vec4 terrainWave{}; // x = time*speed, y = wave size, z = strength, w = enabled
84 glm::vec4 terrainWaveTint{1.f}; // Unity TerrainData waving-grass linear tint
85};
86static_assert(sizeof(GpuInstance) == 208, "GpuInstance must be 208B (std430)");
87
89
91 uint32_t indexCount = 0;
92 uint32_t instanceCount = 0;
93 uint32_t firstIndex = 0;
94 uint32_t vertexOffset = 0;
95 uint32_t firstInstance = 0;
96};
97static_assert(sizeof(GpuIndirectCommand) == 20, "GpuIndirectCommand must match VkDrawIndexedIndirectCommand (20B)");
98
101
103 std::uint32_t u0[4]; // bounds: f32(cx), f32(cy), f32(cz), f32(r)
104 std::uint32_t u1[4]; // triStart, triCount, lodLevel, parent
105 std::uint32_t u2[4]; // f32(errorR), f32(errorRScreen), childCount, 0
106 std::uint32_t u3[4]; // children[4]
107};
108static_assert(sizeof(GpuVgCluster) == 64, "GpuVgCluster must be 64B (4 x uvec4)");
109
113
115 const float* positions = nullptr; // xyz packed, 3 * vertexCount
116 int vertexCount = 0;
117 const float* normals = nullptr; // optional xyz packed
118 const std::uint32_t* triangles = nullptr; // global triangle stream (indices)
119 int triangleCount = 0; // index count (multiple of 3)
120 const GpuVgCluster* clusters = nullptr;
122};
123
124} // namespace eve::graphics
float u
Definition Grass.cpp:233
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
constexpr uint32_t kInvalidGpuDrivenSlot
GPU-driven API surface without GLM layout records.
Indirect draw command; layout identical to VkDrawIndexedIndirectCommand.
Per-instance GPU record (std430). Mirrors GLSL GpuInstance.
GPU material table record (std430). Mirrors GLSL GpuMaterialRecord.
GPU-driven rendering std430 GPU layouts.
Optional per-vertex streams used by vegetation-capable GPU-driven shaders.
Neutral GPU upload for one virtual-geometry asset. Raw arrays so the graphics module does not depend ...
const std::uint32_t * triangles
GPU-packed cluster node (std430, 4 x uvec4). Mirrors the virtualgeometry module's VgGpuCluster layout...