载入中...
搜索中...
未找到
GpuDrivenTypes.h
浏览该文件的文档.
1#pragma once
2
4
5#include <cstdint>
6#include <glm/glm.hpp>
7
8namespace eve::graphics {
9
19constexpr uint32_t kInvalidGpuDrivenSlot = 0xFFFFFFFFu;
20constexpr uint32_t kMaxGpuDrivenTextures = 1024; // sampler2D array slots (desktop limit)
21constexpr uint32_t kMaxGpuDrivenCubemaps = 64; // samplerCube array slots
22
26
34
46
56
58
60 glm::vec4 boundsCenterRadius; // model-space bounding sphere (xyz = center, w = radius)
61 uint32_t vertexOffset = 0; // offset into pooled vertex buffer (vertex count)
62 uint32_t vertexCount = 0;
63 uint32_t indexOffset = 0; // offset into pooled index buffer (index count)
64 uint32_t indexCount = 0;
65 uint32_t indexType = 1; // 0 = u16, 1 = u32
66 uint32_t firstIndex = 0; // VkDrawIndexedIndirectCommand.firstIndex
67 uint32_t vertexBase = 0; // VkDrawIndexedIndirectCommand.vertexOffset
68 uint32_t lodGroupId = kInvalidGpuDrivenSlot; // stage 2: LOD chain table index
69 uint32_t vgAssetId = kInvalidGpuDrivenSlot; // stage 3: virtual-geometry asset
70 uint32_t pad1 = 0;
71 uint32_t pad2 = 0;
72 uint32_t pad3 = 0;
73};
74static_assert(sizeof(GpuMeshRecord) == 64, "GpuMeshRecord must be 64B (std430 16B aligned)");
75
78 glm::vec4 tangent; // xyz authored tangent, w = tangent frame present
79 glm::vec4 bitangent; // xyz authored bitangent
80 glm::vec4 factors0; // variation, occlusion, detail xyz (first two components)
81 glm::vec4 factors1; // detail z, motion highlight, stream flags, reserved
82 glm::vec4 deformation0; // pivot xyz, bending
83 glm::vec4 deformation1; // branch, flutter, authored variation, bounds height
84 glm::vec4 deformation2; // bounds radius, reserved
85};
86static_assert(sizeof(GpuVegetationVertexRecord) == 112, "GpuVegetationVertexRecord must be 112B (std430 16B aligned)");
87
89
91 glm::vec4 tint; // rgba
92 glm::vec4 pbr; // x = metallic, y = roughness, z = receiveShadow, w = receiveLight
93 glm::vec4 texBomb; // x = cellScale, y = strength, z = rotAmount
94 glm::vec4 parallax; // x = scale, y = minLayers, z = maxLayers
95 glm::vec4 surface; // x = alpha cutoff, y = surface mode (0 opaque, 1 masked, 2 transparent)
96 uint32_t textureSlots[4]; // xyzw = albedo / normal / height / env bindless slots
97 uint32_t shadingModel = 0; // 0 = pbr, 1 = unlit, 2 = hair, 3 = custom
98 uint32_t flags = 0; // bit0 castShadow, bit1 castOcclusion, bit2 cylindrical camera-facing card
99 uint32_t pad0 = 0;
100 uint32_t pad1 = 0;
101};
102static_assert(sizeof(GpuMaterialRecord) == 112, "GpuMaterialRecord must be 112B (std430 16B aligned)");
103
105
107 glm::mat4 model;
108 uint32_t meshId = kInvalidGpuDrivenSlot; // -> GpuMeshRecord table
109 uint32_t materialId = kInvalidGpuDrivenSlot; // -> GpuMaterialRecord table
110 uint32_t flags = 0; // bit0 castShadow, bit1 receiveShadow, bit2 castOcclusion
111 uint32_t lodGroupId = kInvalidGpuDrivenSlot; // stage 2
113 glm::vec4 reflectionProbeCenter[2]{}; // xyz = center, w = intensity
114 glm::vec4 reflectionProbeExtent[2]{}; // xyz = extent, w = blend distance
115 glm::vec4 color{1.f}; // per-instance linear RGBA multiplier
116 glm::vec4 terrainWave{}; // x = time*speed, y = wave size, z = strength, w = enabled
117 glm::vec4 terrainWaveTint{1.f}; // Unity TerrainData waving-grass linear tint
118};
119static_assert(sizeof(GpuInstance) == 208, "GpuInstance must be 208B (std430)");
120
122
124 uint32_t indexCount = 0;
125 uint32_t instanceCount = 0;
126 uint32_t firstIndex = 0;
127 uint32_t vertexOffset = 0;
128 uint32_t firstInstance = 0;
129};
130static_assert(sizeof(GpuIndirectCommand) == 20, "GpuIndirectCommand must match VkDrawIndexedIndirectCommand (20B)");
131
134
136 std::uint32_t u0[4]; // bounds: f32(cx), f32(cy), f32(cz), f32(r)
137 std::uint32_t u1[4]; // triStart, triCount, lodLevel, parent
138 std::uint32_t u2[4]; // f32(errorR), f32(errorRScreen), childCount, 0
139 std::uint32_t u3[4]; // children[4]
140};
141static_assert(sizeof(GpuVgCluster) == 64, "GpuVgCluster must be 64B (4 x uvec4)");
142
146
148 const float* positions = nullptr; // xyz packed, 3 * vertexCount
149 int vertexCount = 0;
150 const float* normals = nullptr; // optional xyz packed
151 const std::uint32_t* triangles = nullptr; // global triangle stream (indices)
152 int triangleCount = 0; // index count (multiple of 3)
153 const GpuVgCluster* clusters = nullptr;
155};
156
157} // namespace eve::graphics
float u
Definition Grass.cpp:233
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
constexpr uint32_t kMaxGpuDrivenCubemaps
constexpr uint32_t kMaxGpuDrivenTextures
constexpr uint32_t kInvalidGpuDrivenSlot
GPU-driven rendering shared constants + std430 GPU layouts.
GpuResidentSubmitStatus
Structured result for direct resident-instance submission.
constexpr uint64_t kGpuResidentStorageOffsetAlignment
Portable alignment required for resident storage-buffer slice offsets.
GpuResidentBackend
Backend identity for a transient, non-owning resident GPU buffer view.
Transient backend buffer slice shared between sibling GPU modules. @ownership Non-owning; nativeHandl...
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.
Direct-render description for a GPU-authored array of GpuInstance records. @ownership buckets and buf...
const GpuResidentInstanceBucket * buckets
One contiguous mesh/material bucket in a sorted resident instance buffer.
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...