Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Chehui Chou
    @deadshot465_gitlab
    If there's anyone, does someone know how to use cmd_push_constants?
    It expects a &[u8] but I don't know how to convert my own struct to an &[u8]
    matrixbot
    @matrixbot
    Ralith try the bytemuck crate
    Chehui Chou
    @deadshot465_gitlab
    So should I implement Pod trait for my own struct?
    matrixbot
    @matrixbot
    Ralith you should do whatever the crate's docs tell you to do
    Chehui Chou
    @deadshot465_gitlab
    thanks
    Chehui Chou
    @deadshot465_gitlab
    Does anyone have no problems in debug build but have problems in release build?
    I haven't finished my program but I tried to use cargo build --release to make a release build, and suddenly there are tons of error messages about RenderPass and GraphicsPipelines
    But I didn't change the code and there are no error messages in debug build
    There are errors like [2020-09-20T17:52:55Z ERROR demo_game_rs::game::graphics::vk::graphics] Validation Error: [ VUID-VkRenderPassCreateInfo-attachment-00834 ] Object 0: handle = 0x16629e6ed68, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xfca478c2 | Resolve: vkCreateRenderPass() attachment 38 must be less than the total number of attachments 3. The Vulkan spec states: If the attachment member of any element of pInputAttachments, pColorAttachments, pResolveAttachments or pDepthStencilAttachment, or any element of pPreserveAttachments in any element of pSubpasses is not VK_ATTACHMENT_UNUSED, it must be less than attachmentCount (https://vulkan.lunarg.com/doc/view/1.2.148.0/windows/1.2-extensions/vkspec.html#VUID-VkRenderPassCreateInfo-attachment-00834)
    But I never set the number of attachment to 38 or whatsoever
    matrixbot
    @matrixbot
    Ralith sounds like you're invoking UB
    Ralith a typical cause would be passing references to temporaries which no longer exist
    Chehui Chou
    @deadshot465_gitlab
    Yeah I was explicitly calling build() on create infos and they worked fine in debug builds, but didn't work in release builds
    After avoiding most explicit build() and making sure references exist until the structure is created everything works fine now
    Thank you
    matrixbot
    @matrixbot
    Ralith yep, that's the right pattern to follow
    Chehui Chou
    @deadshot465_gitlab
    But why does it work in debug builds though
    Shouldn't lifetime problems happen regardless of build mode?
    matrixbot
    @matrixbot
    Ralith dereferencing a dangling raw pointer is undefined behavior
    Ralith undefined behavior is, by definition, unpredictable
    Ralith it can do different things depending on compile mode, target environment, phase of moon, etc
    Chehui Chou
    @deadshot465_gitlab
    So it worked only because of...coincidence or the situation permits that?
    matrixbot
    @matrixbot
    Ralith undefined behavior doing what you intended by coincidence is common, yeah; typically followed by changing when you least expect it
    Mike Krasnenkov
    @agmike
    Hello. I'm trying to properly handle 1.2 features which reside in pNext chain, like VkPhysicalDeviceImagelessFramebufferFeatures. Is there a way to parse such chain returned by vulkan?
    Or do I need to walk through it manually
    I've seen internals such as ptr_chain_iter, but they are not exposed
    matrixbot
    @matrixbot
    Ralith vulkan never creates pNext chains
    Ralith it's up to you to construct them and pass them in
    Ralith otherwise the memory management situation would be a nightmare
    Mike Krasnenkov
    @agmike
    But isn't that how vkGetPhysicalDeviceProperties2 works?
    I would imagine the pointers are all pointing to static data somewhere in the driver
    it looks like vulkan-hpp provides the getters for them https://github.com/KhronosGroup/Vulkan-Hpp#structure-pointer-chains
    Mike Krasnenkov
    @agmike
    Aaah, I see, I got it all backwards
    So to get the properties and features I construct the chain and then vulkan fills it in.
    Mike Krasnenkov
    @agmike
    Well then, sorry for the disturbance :)
    matrixbot
    @matrixbot
    Ralith np
    Chehui Chou
    @deadshot465_gitlab
    What's the correct way to use extension methods like cmd_set_checkpoint_nv?
    Like for DebugUtils we can use ash::vk::extensions::DebugUtils, but it seems that I can't find similar thing for NVIDIA extensions, so right now I don't know how to use those extensions in ash...
    Chehui Chou
    @deadshot465_gitlab
    ash::vk::NvDeviceDiagnosticCheckpointsFn::cmd_set_checkpoint_nv takes &self and I don't know where to get that &self
    matrixbot
    @matrixbot
    Ralith functions that take &self are called methods; the &self comes from the value that you call them on
    Chehui Chou
    @deadshot465_gitlab
    Yes, I mean I didn't know how to get an instance of NvDeviceDiagnosticCheckpointsFn
    Thanks though
    Chehui Chou
    @deadshot465_gitlab
    Has anyone tried to compile and run their Vulkan applications on macOS recently? After it compiles, I tried to run it on macOS (both in x86_64 and via Rosetta 2), but whenever it reaches vkGetPhysicalDeviceFeatures I will get a segmentation fault. Not sure if it's a probelm in VulkanSDK for macOS, or a problem in ash.
    Chehui Chou
    @deadshot465_gitlab
    スクリーンショット 2020-12-05 8.24.14.png
    madmaxio
    @madmaxio
    There is metal backend there?
    Not vulkan
    Chehui Chou
    @deadshot465_gitlab
    It's MoltenVK
    Chehui Chou
    @deadshot465_gitlab
    Nevermind I found the culprit
    left_adjoint
    @leftadjoint
    Since an ash::Instance underlying value is a handle, is there some issue with adding an Eq implementation for it?