Skip to content
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

WIP: Implementing Acceleration Structures #1967

Open
wants to merge 43 commits into
base: main
Choose a base branch
from

Commits on Jul 5, 2023

  1. Setup for Implementing Acceleration Structures

    Just setup for acceleration structures by adding the definitions of the extension where it is needed. I also added the physical device features and properties that are needed.
    AntarticCoder committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    72902a9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a65c358 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2023

  1. Implemented Creation, Destruction, and Build sizes

    This commit adds a few items which are:
    
    * A list of functions that are needed to be implemented
    * An implementation of the vkGetAccelerationStructureBuildSizesKHR function
    * Fixed the parameters for the create and destroy acceleration structure in MVKDevice
    * Added the current functions in vulkan.mm
    AntarticCoder committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    0cf8c17 View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2023

  1. Starting to Implement Acceleration Structure Commands

    This commit adds:
    
    * A .h and .mm file for Acceleration Structure commands
    * An acceleration structure command encoder into `MVKCommandBuffer`
    * An actual acceleration structure handle
    * And some other items that are not complete, or need to removed
    AntarticCoder committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    a1b0961 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2023

  1. Fixed missing symbol for getPoolType in MVKCmdBuildAccelerationStructure

    Fixed the missing symbol for getPoolType in MVKCmdBuildAccelerationStructure by including it in MVKCommandPool.h. I also added the Build Acceleration structure command into definitions file.
    AntarticCoder committed Jul 8, 2023
    Configuration menu
    Copy the full SHA
    d409fbf View commit details
    Browse the repository at this point in the history
  2. Implemented the encoding for Building Acceleration Structures

    Finished up what was needed for the MVKCmdBuildAccelerationStructure. The only 2 issues at the moment are the scratch buffer and the scratch buffer offset, to which a solution has been proposed. I plan to discuss this in the PR thread before trying out anything.
    AntarticCoder committed Jul 8, 2023
    Configuration menu
    Copy the full SHA
    0e50b28 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2023

  1. Added Copy acceleration structure command

    This commit adds the copy acceleration structure, but does not add the commands that copy memory to and from an acceleration structure. As well as that I've added 2 files for a map that will store the device address along with the buffer. This map will also come in handy when getting the device address for the acceleration structure
    AntarticCoder committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    0fb82af View commit details
    Browse the repository at this point in the history
  2. MVKMap half-done implementation

    A half done implementation of MVKMap. MVKMap aims to use the same API as std::unordered_map, and I used MVKSmallVector as an example of how to write MVKMap. I hope there aren't any bugs however, I'll probably do some tests off of the repository once I'm done
    AntarticCoder committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    eab6f6f View commit details
    Browse the repository at this point in the history
  3. Using std::unordered_map to store the Buffer Device Addresses

    This commit finished off the build acceleration structure command. This is because in MVKDevice, we are now using a std::unordered_map instead of a custom map implementation.
    AntarticCoder committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    43a987c View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2023

  1. Implemented Acceleration Structure Compatibility

    Added in a function to check for acceleration structure compatibility. Also made sure to properly add the device features for acceleration structures.
    AntarticCoder committed Jul 11, 2023
    Configuration menu
    Copy the full SHA
    555bf47 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2023

  1. Fixed getBufferAtAddress to allow for offsets

    This commit fixes getBufferAtAddress, because the address could be offset, however that was not valid before. Something to keep in mind is that the performance  maybe really bad, however I believe that until we start running Ray queries or Raytracing Pipelines, we can keep the find function as it is. Note that we're also using a custom hash function because std::pair does not have a default hash. I'm to worried about collisions because only one buffer can occupy between  these 2 addresses.
    AntarticCoder committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    b4d977b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6fa1ea0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6166b9b View commit details
    Browse the repository at this point in the history
  4. Update to xrOS versioning system from main

    This commit just adds the xrOS version to the MVK_EXTENSION and to mvkOSVersionIsAtLeast
    AntarticCoder committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    28a5c0a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9d1d547 View commit details
    Browse the repository at this point in the history
  6. Take in more parameters for CmdBuildAccelerationStructure

    This commit just changes build acceleration structure, to allow for the different options/parameters to be take into account. I plan to amend this commit.
    AntarticCoder committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    257a75f View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2023

  1. Implemented GPU addresses for Acceleration Structures

    This commit adds "imaginary" gpu addresses for acceleration structures. This allows us to easily implement the rest of the copy commands, as well as the get address function that are required for this vulkan extension. The only thing I'm worried about is how to defragment the memory, because when we destroy an acceleration structure, pushing all the keys can be costly. Hopefully we find a better way to store addresses.
    AntarticCoder committed Jul 14, 2023
    Configuration menu
    Copy the full SHA
    5a85fdd View commit details
    Browse the repository at this point in the history
  2. Added Get Acceleration structure function

    Simply added the vulkan function GetAccelerationStructureDeviceAddress, next I'll be adding 2 more copy commands.
    AntarticCoder committed Jul 14, 2023
    Configuration menu
    Copy the full SHA
    6c7aa5d View commit details
    Browse the repository at this point in the history
  3. Copy Acceleration Structure to Memory

    This commit adds a command which allows for copying of acceleration structures to another memory address, which contains an acceleration structure. This commit also adds all needed functions into MVKInstance.mm so that they can be used.
    AntarticCoder committed Jul 14, 2023
    Configuration menu
    Copy the full SHA
    be2aca6 View commit details
    Browse the repository at this point in the history
  4. Code Cleanup and Copy modes for Acceleration Structures

    This commit cleans up the code, and now accepts copy modes for acceleration structures. However, only 2 copy modes are supported which are clone, and compact.
    AntarticCoder committed Jul 14, 2023
    Configuration menu
    Copy the full SHA
    96f89a5 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2023

  1. Copy Memory to Acceleration Structure

    This commit adds the last copy command, that being copy memory to acceleration structure. This command is almost the same as the other copy commands, and I'm getting close to finishing up this PR.
    AntarticCoder committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    94c62f5 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2023

  1. Fixed Copy Memory to Acceleration Structure

    This commit fixes a glaring issue with copying accelerations structures to memory. Previously, I would copy the acceleration structure to another acceleration structure, however the proper thing to do was to copy a buffer to an acceleration structure. This however has not fixed copy acceleration structure to memory.
    AntarticCoder committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    df8d8b3 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2023

  1. Fixed Copy Acceleration Structure to Memory

    This commit quickly fixes copying acceleration structures to memory, however I'm not sure if my implementation is right.
    AntarticCoder committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    89a92fb View commit details
    Browse the repository at this point in the history
  2. Acceleration structures with Levels

    This commit adds the functionality for a bottom and top level acceleration structure, which are not quite finished, but I'm pushing this because I'm unable to stash this.
    AntarticCoder committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    c6d97c2 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2023

  1. Added command uses and MTLHeaps

    This commit does not do much, however I'm updating to the next macos update, so I'd like to push so I don't lose everything.
    AntarticCoder committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    1cf021e View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2023

  1. Configuration menu
    Copy the full SHA
    333f41b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6662762 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1696c18 View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2023

  1. Configuration menu
    Copy the full SHA
    607cde1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3937822 View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2024

  1. Configuration menu
    Copy the full SHA
    22766de View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2024

  1. Quick Save

    AntarticCoder committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    4664dad View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2024

  1. Configuration menu
    Copy the full SHA
    65dea0c View commit details
    Browse the repository at this point in the history

Commits on Mar 30, 2024

  1. Configuration menu
    Copy the full SHA
    2b560f1 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2024

  1. Buggy Implementation on Get Build Sizes

    Still not finished, just quickly saving my work on get build sizes
    AntarticCoder committed May 29, 2024
    Configuration menu
    Copy the full SHA
    4362ea1 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2024

  1. Implemented AABB Geometry for Build and Get Sizes

    This commit is pretty small and just adds AABBs to be allowed to be pushed to the acceleration structure.
    AntarticCoder committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    3f1fbde View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2024

  1. Configuration menu
    Copy the full SHA
    2ab8afb View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. Implement Write Acc Structure Properties - WIP

    This commit adds the device command 'kCmdWriteAccelerationStructuresPropertiesKHR'.
    AntarticCoder committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    4dea75c View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2024

  1. Configuration menu
    Copy the full SHA
    9ffc537 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b61a72c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    562a9fd View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    abcf618 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Merge pull request #1 from AntarticCoder/address-map

    Implement new address map for buffers
    AntarticCoder authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    043deba View commit details
    Browse the repository at this point in the history