-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmesh_preprocessor.h
More file actions
37 lines (28 loc) · 974 Bytes
/
mesh_preprocessor.h
File metadata and controls
37 lines (28 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include "otcv.h"
#include "otcv_utils.h"
#include "expandable_descriptor_pool.h"
#include "static_ubo.h"
class MeshPreprocessor {
public:
MeshPreprocessor(const std::string& shader_path);
~MeshPreprocessor();
void generate_aabb(
otcv::Buffer* positions,
const std::vector<uint32_t>& vertex_offsets,
const std::vector<uint32_t>& vertex_counts,
otcv::ResourceState position_source_state,
otcv::ResourceState position_target_state,
otcv::ResourceState aabb_buffer_target_state);
std::shared_ptr<SSBO> AABB_SSBO() { return _aabb_ssbo; }
private:
otcv::ShaderBlob _mesh_presprocess_blob;
otcv::ComputePipeline* _aabb_pipeline;
std::shared_ptr<NaiveExpandableDescriptorPool> _mesh_preprocess_desc_pool;
otcv::DescriptorSet* _aabb_in_desc_set;
otcv::DescriptorSet* _aabb_out_desc_set;
std::shared_ptr<SSBO> _mesh_info_ssbo;
std::shared_ptr<SSBO> _aabb_ssbo;
otcv::CommandBuffer* _cmd_buf;
const uint32_t _compute_group_size = 64;
};