Code Monkey home page Code Monkey logo

nmg-vulkan's Introduction

The nmg Rust x Vulkan Engine

For the upcoming game, nmg (original prototype here)!

Build Status

nmg-vulkan is a game engine written from scratch in Rust, specialized for two things:

  1. Retro PSX-inspired graphics
  2. High-performance mech physics

"Features"

  • Modular ECS architecture
  • Softbody physics engine
  • Low-level Vulkan backend
  • Bathtub brew math module
  • Cross-platform library crate
  • Mimimal dependency count
  • Could be data oriented

Notes

  • Currently requires Rust nightly

Acknowledgements

Papers implemented:

nmg-vulkan's People

Contributors

acgaudette avatar hobogenized avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nmg-vulkan's Issues

Expected crash during improper shader loading

These validation errors (below) appear during a crash induced by running the text demo and replacing the default shaders with the font shaders (a mistake). Commit hash d824928316827fbdac5f64ce3c45fd53c6692331 on feature/text.
While undefined behavior is expected in this case, the errors only appear on my machine (tested on four machines). It's possible that it points to a separate issue.

After reviewing the log below, it looks as though these errors are being produced in the free_device_refresh() or refresh_swapchain() methods on render::Context.

DEBUG_REPORT: Object: 0x83 (Type = 9) | Cannot free buffer 0x83 that is in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00922)
DEBUG_REPORT: Object: 0x85 (Type = 9) | Cannot free buffer 0x85 that is in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00922)
DEBUG_REPORT: Object: 0x87 (Type = 9) | Cannot free buffer 0x87 that is in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00922)
DEBUG_REPORT: Object: 0xa (Type = 9) | Cannot free buffer 0xa that is in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00922)
DEBUG_REPORT: Object: 0x5 (Type = 5) | Cannot call vkDestroySemaphore on Semaphore 0x5 that is currently in use by a command buffer. The spec valid usage text states 'All submitted batches that refer to semaphore must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySemaphore-semaphore-01137)
DEBUG_REPORT: Object: 0x6c (Type = 7) | Fence 0x6c is in use. The spec valid usage text states 'All queue submission commands that refer to fence must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyFence-fence-01120)
DEBUG_REPORT: Object: 0x75 (Type = 19) | Cannot call vkDestroyPipeline on Pipeline 0x75 that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to pipeline must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyPipeline-pipeline-00765)
DEBUG_REPORT: Object: 0x80 (Type = 24) | Cannot call vkDestroyFramebuffer on Framebuffer 0x80 that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to framebuffer must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyFramebuffer-framebuffer-00892)
DEBUG_REPORT: Object: 0x74 (Type = 18) | Cannot call vkDestroyRenderPass on RenderPass 0x74 that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to renderPass must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyRenderPass-renderPass-00873)
DEBUG_REPORT: Object: 0x7d (Type = 14) | Cannot call vkDestroyImageView on ImageView 0x7d that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to imageView must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyImageView-imageView-01026)
DEBUG_REPORT: Object: 0x7feb1127d400 (Type = 6) | Attempt to free command buffer (0x7feb1127d400) which is in use. The spec valid usage text states 'All elements of pCommandBuffers must not be in the pending state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
DEBUG_REPORT: Object: 0x7b (Type = 10) | Cannot call vkDestroyImage on Image 0x7b that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to image, either directly or via a VkImageView, must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyImage-image-01000)
DEBUG_REPORT: Object: 0x73 (Type = 14) | Cannot call vkDestroyImageView on ImageView 0x73 that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to imageView must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyImageView-imageView-01026)
DEBUG_REPORT: Object: 0x81 (Type = 22) | Cannot call vkDestroyDescriptorPool on DescriptorPool 0x81 that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to descriptorPool (via any allocated descriptor sets) must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorPool-descriptorPool-00303)
DEBUG_REPORT: Object: 0x95 (Type = 19) | Cannot call vkDestroyPipeline on Pipeline 0x95 that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to pipeline must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyPipeline-pipeline-00765)
DEBUG_REPORT: Object: 0x89 (Type = 10) | Cannot call vkDestroyImage on Image 0x89 that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to image, either directly or via a VkImageView, must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyImage-image-01000)
DEBUG_REPORT: Object: 0x8d (Type = 14) | Cannot call vkDestroyImageView on ImageView 0x8d that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to imageView must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyImageView-imageView-01026)
DEBUG_REPORT: Object: 0x8f (Type = 22) | Cannot call vkDestroyDescriptorPool on DescriptorPool 0x8f that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to descriptorPool (via any allocated descriptor sets) must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroyDescriptorPool-descriptorPool-00303)
DEBUG_REPORT: Object: 0x8e (Type = 21) | Cannot call vkDestroySampler on Sampler 0x8e that is currently in use by a command buffer. The spec valid usage text states 'All submitted commands that refer to sampler must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkDestroySampler-sampler-01082)

Pause on context loss on Windows

Discovered by @hobogenized.

When running on Windows, the simulation pauses when window context is lost. However, a keyboard interrupt (in the shell) causes the simulation to resume.

After resetting to a very old commit (before the library split) we confirmed that this bug has not always existed.

I was unable to reproduce this on my OS (but I use a tiled window manager).

SPIR-V Warning in Font Shader

DEBUG_REPORT:  [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object: VK_NULL_HANDLE (Type = 0) | SPIR-V module not valid: Structure id 27 decorated as Block must follow standard uniform buffer layout rules: member 1 at offset 12 overlaps previous member ending at offset 15
  OpFunctionEnd

Check the disassembly for more details on this. Might be because you're passing a vec2 after a vec3.

Shader build repetition

Currently builds debug and text shaders on refresh, which is not necessary. Will want to separate rebuilding resources from shader building and reuse shaders for the new built resources.

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.