Skip to content
Snippets Groups Projects
Commit 39f01e54 authored by Vanessa Karolek's avatar Vanessa Karolek
Browse files

[#92] add simple mesh to main.cpp for first AS testing

parent 113be317
No related branches found
No related tags found
1 merge request!75Resolve "RTX-Module"
Pipeline #26911 failed
projects/rtx/resources/cube/boards2_vcyc_jpg.jpg

132 B

File added
File added
File added
File added
Source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
...@@ -54,12 +54,44 @@ int main(int argc, const char** argv) { ...@@ -54,12 +54,44 @@ int main(int argc, const char** argv) {
); );
// init RTXModule // init RTXModule
vk::PhysicalDevice physicalDevice = core.getContext().getPhysicalDevice(); // rtxModule.init(&core);
rtxModule.init(physicalDevice);
vkcv::scene::Scene scene = vkcv::scene::Scene::load(core, std::filesystem::path( // vkcv::scene::Scene scene = vkcv::scene::Scene::load(core, std::filesystem::path(
argc > 1 ? argv[1] : "resources/Sponza/Sponza.gltf" // argc > 1 ? argv[1] : "resources/Sponza/Sponza.gltf"
)); // ));
// TODO: replace by bigger scene
vkcv::asset::Scene mesh;
const char* path = argc > 1 ? argv[1] : "resources/cube/cube.gltf";
int result = vkcv::asset::loadScene(path, mesh);
if (result == 1) {
std::cout << "Mesh loading successful!" << std::endl;
} else {
std::cerr << "Mesh loading failed: " << result << std::endl;
return 1;
}
assert(!mesh.vertexGroups.empty());
auto vertexBuffer = core.createBuffer<uint8_t>(
vkcv::BufferType::VERTEX,
mesh.vertexGroups[0].vertexBuffer.data.size(),
vkcv::BufferMemoryType::DEVICE_LOCAL
);
vk::Buffer vertexBufferHandle = vertexBuffer.getVulkanHandle();
vertexBuffer.fill(mesh.vertexGroups[0].vertexBuffer.data);
auto indexBuffer = core.createBuffer<uint8_t>(
vkcv::BufferType::INDEX,
mesh.vertexGroups[0].indexBuffer.data.size(),
vkcv::BufferMemoryType::DEVICE_LOCAL
);
indexBuffer.fill(mesh.vertexGroups[0].indexBuffer.data);
const vkcv::AttachmentDescription present_color_attachment( const vkcv::AttachmentDescription present_color_attachment(
vkcv::AttachmentOperation::STORE, vkcv::AttachmentOperation::STORE,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment