-
Notifications
You must be signed in to change notification settings - Fork 7
Working inside linux #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
5c85f33
05ae79f
299428f
27021eb
917e7f3
2a9099b
b2e8098
32ca63a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .cache/ | ||
| /build/ | ||
| clang-toolchain.cmake | ||
| CMakeUserPresets.json | ||
| recent_gltf.txt | ||
| recent_skybox.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,7 +207,7 @@ Add the following CMake user preset file in your project directory. I'll assume | |
| "inherits": "default", | ||
| "cacheVariables": { | ||
| "CMAKE_C_COMPILER": "/usr/bin/clang-18", | ||
| "CMAKE_CXX_COMPILER": "/usr/bin/clang++-18", | ||
| "CMAKE_CXX_COMPILER": "/usr/bin/clang++", | ||
| "CMAKE_CXX_FLAGS": "-stdlib=libc++", | ||
| "CMAKE_EXE_LINKER_FLAGS": "-stdlib=libc++ -lc++abi", | ||
| "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/triplets", | ||
|
|
@@ -326,4 +326,4 @@ This project is **licensed under the GPL-v3 License**. See the [LICENSE](LICENSE | |
|
|
||
| [^1]: I like this term because it's hilarious for several reasons, but it's no joke! It has the **significantly faster glTF model loading speed than the other the viewers** I've tested. See [Performance Comparison](https://github.com/stripe2933/vk-gltf-viewer/blob/master/docs/performance-comparison.md) page for details. | ||
| [^2]: Applied for standard glTF 2.0 asset only. Asset with material related extensions may require additional draw calls for pipeline changing. | ||
| [^3]: On Apple GPU platform prior to the MoltenVK 1.2.11 (which enables the Metal Argument Buffer by default), [`maxPerStageDescriptorUpdateAfterBindStorageImages` is 8](https://vulkan.gpuinfo.org/displaycoreproperty.php?platform=macos&name=maxPerStageDescriptorUpdateAfterBindStorageImages&core=1.2). It limited the cubemap resoluton and prefilteredmap roughnesslevels. Instead, it can use `VK_AMD_shader_image_load_store_lod` extension to replace the descriptor indexing based cubemap mipmapping and prefilteredmap generation. | ||
| [^3]: On Apple GPU platform prior to the MoltenVK 1.2.11 (which enables the Metal Argument Buffer by default), [`maxPerStageDescriptorUpdateAfterBindStorageImages` is 8](https://vulkan.gpuinfo.org/displaycoreproperty.php?platform=macos&name=maxPerStageDescriptorUpdateAfterBindStorageImages&core=1.2). It limited the cubemap resoluton and prefilteredmap roughnesslevels. Instead, it can use `VK_AMD_shader_image_load_store_lod` extension to replace the descriptor indexing based cubemap mipmapping and prefilteredmap generation. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this line has been changed? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,10 +46,15 @@ constexpr std::uint32_t FRAMES_IN_FLIGHT = 2; | |
| vk_gltf_viewer::MainApp::MainApp() { | ||
| const vulkan::pipeline::BrdfmapComputer brdfmapComputer { gpu.device }; | ||
|
|
||
| const vk::raii::DescriptorPool descriptorPool { | ||
| gpu.device, | ||
| brdfmapComputer.descriptorSetLayout.getPoolSize().getDescriptorPoolCreateInfo(), | ||
| }; | ||
|
|
||
| vk::DescriptorPoolCreateInfo descriptorPoolCreateInfo = brdfmapComputer.descriptorSetLayout.getPoolSize().getDescriptorPoolCreateInfo(); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would not be work. You should pass
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok thanks :) |
||
| descriptorPoolCreateInfo.flags |= vk::DescriptorPoolCreateFlagBits::eFreeDescriptorSet; | ||
|
|
||
| const vk::raii::DescriptorPool descriptorPool { | ||
| gpu.device, | ||
| descriptorPoolCreateInfo, | ||
| }; | ||
|
|
||
|
|
||
| const auto [brdfmapSet] = allocateDescriptorSets(*gpu.device, *descriptorPool, std::tie(brdfmapComputer.descriptorSetLayout)); | ||
| gpu.device.updateDescriptorSets( | ||
|
|
@@ -173,7 +178,7 @@ vk_gltf_viewer::MainApp::MainApp() { | |
| #elif __APPLE__ | ||
| "/Library/Fonts/Arial Unicode.ttf", | ||
| #elif __linux__ | ||
| "/usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf", | ||
| "/usr/share/fonts/noto/NotoSansMono-Medium.ttf", | ||
| #else | ||
| #error "Type your own font file in here!" | ||
| #endif | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -523,15 +523,25 @@ auto vk_gltf_viewer::vulkan::Frame::createFramebuffers() const -> std::vector<vk | |
| | std::ranges::to<std::vector>(); | ||
| } | ||
|
|
||
|
|
||
| auto vk_gltf_viewer::vulkan::Frame::createDescriptorPool() const -> decltype(descriptorPool) { | ||
| return { | ||
| gpu.device, | ||
| (2 * getPoolSizes(sharedData.jumpFloodComputer.descriptorSetLayout, sharedData.outlineRenderer.descriptorSetLayout) | ||
| + sharedData.weightedBlendedCompositionRenderer.descriptorSetLayout.getPoolSize()) | ||
| .getDescriptorPoolCreateInfo(), | ||
| }; | ||
|
|
||
| auto poolCreateInfo = | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| (2 * getPoolSizes(sharedData.jumpFloodComputer.descriptorSetLayout, sharedData.outlineRenderer.descriptorSetLayout) | ||
| + sharedData.weightedBlendedCompositionRenderer.descriptorSetLayout.getPoolSize()) | ||
| .getDescriptorPoolCreateInfo(); | ||
|
|
||
| auto& createInfo = poolCreateInfo.get(); | ||
| createInfo.flags |= vk::DescriptorPoolCreateFlagBits::eFreeDescriptorSet; | ||
|
|
||
| return { | ||
| gpu.device, | ||
| poolCreateInfo | ||
| }; | ||
|
|
||
| } | ||
|
|
||
|
|
||
| auto vk_gltf_viewer::vulkan::Frame::recordScenePrepassCommands(vk::CommandBuffer cb) const -> void { | ||
| boost::container::static_vector<vk::ImageMemoryBarrier, 3> memoryBarriers; | ||
|
|
||
|
|
@@ -1007,4 +1017,4 @@ auto vk_gltf_viewer::vulkan::Frame::recordSwapchainExtentDependentImageLayoutTra | |
| sceneWeightedBlendedAttachmentGroup.getColorAttachment(1).resolveImage, vku::fullSubresourceRange(), | ||
| }, | ||
| }); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,7 @@ import :vulkan.pipeline.BrdfmapComputer; | |||||
|
|
||||||
| import std; | ||||||
|
|
||||||
| #define COMPILED_SHADER_DIR "shader" | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it already defined by Line 194 in 713156e
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
yeah sorry for not being careful temporarily put it there because i was getting error there while calling binary as ./build/vk-gltf-viewer |
||||||
| vk_gltf_viewer::vulkan::pipeline::BrdfmapComputer::DescriptorSetLayout::DescriptorSetLayout( | ||||||
| const vk::raii::Device &device | ||||||
| ) : vku::DescriptorSetLayout<vk::DescriptorType::eStorageImage> { | ||||||
|
|
@@ -47,4 +48,4 @@ auto vk_gltf_viewer::vulkan::pipeline::BrdfmapComputer::compute( | |||||
| commandBuffer.bindPipeline(vk::PipelineBindPoint::eCompute, *pipeline); | ||||||
| commandBuffer.bindDescriptorSets(vk::PipelineBindPoint::eCompute, *pipelineLayout, 0, descriptorSet, {}); | ||||||
| commandBuffer.dispatch(imageSize.width / 16, imageSize.height / 16, 1); | ||||||
| } | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also change clang-18 to clang?