GithubHelp home page GithubHelp logo

andrejnau / flycube Goto Github PK

View Code? Open in Web Editor NEW
369.0 4.0 19.0 863.06 MB

Graphics API wrapper is written in C++ on top of DirectX 12, Vulkan and Metal. Provides main features including ray tracing.

License: MIT License

CMake 4.03% HLSL 0.24% C++ 77.48% C 0.28% Objective-C 3.39% Objective-C++ 14.17% Swift 0.40%
d3d12 directx12 directx-12 dxr vulkan rtx graphics-api graphics-programming raytracing graphics-engine

flycube's Issues

Vulkan validation errors in sample

I'm not sure if this is a big deal as the sample still works but there are a bunch of vulkan validation errors when starting the Triangle sample:

Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca6a9fa678, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x67c11f000000001a, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdBindPipeline() to VkCommandBuffer 0x1ca6a9fa678[] that is invalid because bound VkFramebuffer 0x67c11f000000001a[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca6a9fa678, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x892cdd0000000018, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdBindPipeline() to VkCommandBuffer 0x1ca6a9fa678[] that is invalid because bound VkImageView 0x892cdd0000000018[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca6a9fa678, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x67c11f000000001a, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdBindDescriptorSets() to VkCommandBuffer 0x1ca6a9fa678[] that is invalid because bound VkFramebuffer 0x67c11f000000001a[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca6a9fa678, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x892cdd0000000018, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdBindDescriptorSets() to VkCommandBuffer 0x1ca6a9fa678[] that is invalid because bound VkImageView 0x892cdd0000000018[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca6a9fa678, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x67c11f000000001a, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdDrawIndexed() to VkCommandBuffer 0x1ca6a9fa678[] that is invalid because bound VkFramebuffer 0x67c11f000000001a[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca6a9fa678, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x892cdd0000000018, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdDrawIndexed() to VkCommandBuffer 0x1ca6a9fa678[] that is invalid because bound VkImageView 0x892cdd0000000018[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca6a9fa678, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x67c11f000000001a, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdEndRenderPass() to VkCommandBuffer 0x1ca6a9fa678[] that is invalid because bound VkFramebuffer 0x67c11f000000001a[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca6a9fa678, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x892cdd0000000018, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdEndRenderPass() to VkCommandBuffer 0x1ca6a9fa678[] that is invalid because bound VkImageView 0x892cdd0000000018[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca73bd66a8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x203fc60000000023, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdBindPipeline() to VkCommandBuffer 0x1ca73bd66a8[] that is invalid because bound VkFramebuffer 0x203fc60000000023[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca73bd66a8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xf89e70000000022, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdBindPipeline() to VkCommandBuffer 0x1ca73bd66a8[] that is invalid because bound VkImageView 0xf89e70000000022[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca73bd66a8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x203fc60000000023, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdBindDescriptorSets() to VkCommandBuffer 0x1ca73bd66a8[] that is invalid because bound VkFramebuffer 0x203fc60000000023[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca73bd66a8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xf89e70000000022, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdBindDescriptorSets() to VkCommandBuffer 0x1ca73bd66a8[] that is invalid because bound VkImageView 0xf89e70000000022[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca73bd66a8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x203fc60000000023, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdDrawIndexed() to VkCommandBuffer 0x1ca73bd66a8[] that is invalid because bound VkFramebuffer 0x203fc60000000023[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca73bd66a8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xf89e70000000022, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdDrawIndexed() to VkCommandBuffer 0x1ca73bd66a8[] that is invalid because bound VkImageView 0xf89e70000000022[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca73bd66a8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x203fc60000000023, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdEndRenderPass() to VkCommandBuffer 0x1ca73bd66a8[] that is invalid because bound VkFramebuffer 0x203fc60000000023[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca73bd66a8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xf89e70000000022, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdEndRenderPass() to VkCommandBuffer 0x1ca73bd66a8[] that is invalid because bound VkImageView 0xf89e70000000022[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca73b51d08, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x8483000000000025, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdBindPipeline() to VkCommandBuffer 0x1ca73b51d08[] that is invalid because bound VkFramebuffer 0x8483000000000025[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca73b51d08, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x73cd210000000024, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdBindPipeline() to VkCommandBuffer 0x1ca73b51d08[] that is invalid because bound VkImageView 0x73cd210000000024[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca73b51d08, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x8483000000000025, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdBindDescriptorSets() to VkCommandBuffer 0x1ca73b51d08[] that is invalid because bound VkFramebuffer 0x8483000000000025[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca73b51d08, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x73cd210000000024, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdBindDescriptorSets() to VkCommandBuffer 0x1ca73b51d08[] that is invalid because bound VkImageView 0x73cd210000000024[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca73b51d08, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x8483000000000025, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdDrawIndexed() to VkCommandBuffer 0x1ca73b51d08[] that is invalid because bound VkFramebuffer 0x8483000000000025[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca73b51d08, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x73cd210000000024, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdDrawIndexed() to VkCommandBuffer 0x1ca73b51d08[] that is invalid because bound VkImageView 0x73cd210000000024[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca73b51d08, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x8483000000000025, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkCmdEndRenderPass() to VkCommandBuffer 0x1ca73b51d08[] that is invalid because bound VkFramebuffer 0x8483000000000025[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca73b51d08, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x73cd210000000024, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkCmdEndRenderPass() to VkCommandBuffer 0x1ca73b51d08[] that is invalid because bound VkImageView 0x73cd210000000024[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca6a9fa678, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x67c11f000000001a, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkEndCommandBuffer() to VkCommandBuffer 0x1ca6a9fa678[] that is invalid because bound VkFramebuffer 0x67c11f000000001a[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca6a9fa678, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x892cdd0000000018, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkEndCommandBuffer() to VkCommandBuffer 0x1ca6a9fa678[] that is invalid because bound VkImageView 0x892cdd0000000018[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca73bd66a8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x203fc60000000023, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkEndCommandBuffer() to VkCommandBuffer 0x1ca73bd66a8[] that is invalid because bound VkFramebuffer 0x203fc60000000023[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca73bd66a8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xf89e70000000022, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkEndCommandBuffer() to VkCommandBuffer 0x1ca73bd66a8[] that is invalid because bound VkImageView 0xf89e70000000022[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkFramebuffer ] Object 0: handle = 0x1ca73b51d08, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x8483000000000025, type = VK_OBJECT_TYPE_FRAMEBUFFER; | MessageID = 0x47172512 | You are adding vkEndCommandBuffer() to VkCommandBuffer 0x1ca73b51d08[] that is invalid because bound VkFramebuffer 0x8483000000000025[] was destroyed.
Validation Error Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkImageView ] Object 0: handle = 0x1ca73b51d08, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x73cd210000000024, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x7bb837f8 | You are adding vkEndCommandBuffer() to VkCommandBuffer 0x1ca73b51d08[] that is invalid because bound VkImageView 0x73cd210000000024[] was destroyed.

Some suggestions

Hi, this library is very cool !
After using it, I have some suggestions:

  • Make VKResource and MTLResource abstract, move implementation to image/buffer/sampler/accel subclasses. After change:
    • Resource subclasses cost less memory.
    • Most branching logic can be removed, because all methods of Resource are virtual.
  • Add build targets for each underlying graphics API, then we can build dynamic libraries.
  • Add CopyTextureToBuffer(), which is useful.
  • Make debug layer optional. For now, debug layer is always enabled when debugger attached, which is slow.
  • Add depth range parameter for SetViewport().
  • Remove glm from acceleration structure dependency, user may prefer other math library.
  • Required CMake version is too high(3.28), lower to 3.1x?
  • Use CMake fetchContent instead of git submodules for external dependencies, which is more flexible.
    I've forked the repo, trying to accomplish all the above. I'll open a pull request if helpful.

Window resizing doesn't work for SponzaPbr demo

There's a crash with the following log:

Exception thrown at 0x00007FF8E3BA4B89 in SponzaPbr.exe: Microsoft C++ exception: _com_error at memory location 0x0000001DCE2F4C68.
DXGI ERROR: IDXGIFactory::CreateSwapChain: Only one flip model swap chain can be associate with an HWND, IWindow, or composition surface at a time. ClearState() and Flush() may need to be called on the D3D11 device context to trigger deferred destruction of old swapchains. [ MISCELLANEOUS ERROR #297: ]
Exception thrown at 0x00007FF8E3BA4B89 in SponzaPbr.exe: Microsoft C++ exception: _com_error at memory location 0x0000001DCE2F4CE0.

HRESULT failed in "F:\\SponzaPbr\\3rdparty\\FlyCube\\src\\Core\\Swapchain\\DXSwapchain.cpp" @ 28
--> hr = 0x80070005

Feature Request: Change VULKAN_SUPPORT from variable, to option

Hi! I love what you're doing,

One thing I've noticed is that, I can't seem to disable vulkan support, from a higher-level cmake project. At the moment, the way it's defined, I am not sure it's possible. It's written as:

set(VULKAN_SUPPORT ON)

However, it might be worthwhile changing it to
option(VULKAN_SUPPORT "Vulkan Support" ON)

This would be similar to how GLFW exposes their BUILD_EXAMPLES variable, and how you are able to disable examples being built from your cmake/3rdparty/glfw cmake file.

Thanks! :)
David

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.