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

Support XFB in MoltenVK #2169

Draft
wants to merge 61 commits into
base: main
Choose a base branch
from
Draft

Support XFB in MoltenVK #2169

wants to merge 61 commits into from

Commits on Aug 23, 2022

  1. MSL: Add a mechanism to fix up shader outputs.

    This is analogous to the existing support for fixing up shader inputs.
    It is intended to be used with tessellation to add implicit builtins
    that are read from a later stage, despite not being written in an
    earlier stage. (Believe it or not, this is in fact legal in Vulkan.)
    
    Helps fix 8 CTS tests under `dEQP-VK.pipeline.*.no_position`. (Eight
    other tests work solely by accident without this change.)
    cdavis5e committed Aug 23, 2022
    Configuration menu
    Copy the full SHA
    10154f5 View commit details
    Browse the repository at this point in the history
  2. Merged in msl-shader-output-fixup (pull request KhronosGroup#2)

    MSL: Add a mechanism to fix up shader outputs.
    
    Approved-by: Steven Winston
    cdavis5e committed Aug 23, 2022
    Configuration menu
    Copy the full SHA
    2127a3b View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2023

  1. MSL: Deduplicate function constants.

    It is possible in SPIR-V to declare multiple specialization constants
    with the same constant ID. The most common cause of this in GLSL is
    defining a spec constant, then declaring the workgroup size to use that
    spec constant by its ID. But, MSL forbids defining multiple function
    constants with the same function constant ID. So, we must only emit one
    definition of the actual function constant (with the
    `[[function_constant(id)]]` attribute); but we can point the other
    variables at this one definition.
    
    Fixes three tests in the Vulkan CTS under
    `dEQP-VK.compute.basic.max_local_size_*`.
    cdavis5e committed Feb 16, 2023
    Configuration menu
    Copy the full SHA
    4a8543e View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2023

  1. Merged in msl-duplicate-spec-id (pull request KhronosGroup#8)

    MSL: Deduplicate function constants.
    
    Approved-by: Steven Winston
    cdavis5e committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    f195855 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2023

  1. Checkpoint for transform feedback work.

    Does analysis of outputs and sorts them into buffers. Nothing else yet.
    cdavis5e committed May 9, 2023
    Configuration menu
    Copy the full SHA
    343ff6e View commit details
    Browse the repository at this point in the history

Commits on May 10, 2023

  1. Merge remote-tracking branch 'origin/master'

    # Conflicts:
    #	main.cpp
    #	spirv_cross_c.cpp
    #	spirv_cross_c.h
    #	spirv_msl.cpp
    #	spirv_msl.hpp
    gpx1000 committed May 10, 2023
    Configuration menu
    Copy the full SHA
    048ac2d View commit details
    Browse the repository at this point in the history
  2. Get things building.

    gpx1000 committed May 10, 2023
    Configuration menu
    Copy the full SHA
    179c6e0 View commit details
    Browse the repository at this point in the history

Commits on May 11, 2023

  1. Checkpoint: Beginnings of writing XFB data.

    This only does the bare minimum needed to write XFB data (and not even
    that actually). It still needs to calculate the offset in the buffer
    where the data need to be written, and primitive types other than points
    need to be implemented.
    cdavis5e committed May 11, 2023
    Configuration menu
    Copy the full SHA
    f1c0ad2 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2023

  1. get it building.

    gpx1000 committed May 13, 2023
    Configuration menu
    Copy the full SHA
    117eaa3 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2023

  1. Merge branch 'master' into xfb

    # Conflicts:
    #	reference/shaders-msl/comp/local-size-duplicate-spec-id.comp
    #	spirv_msl.cpp
    gpx1000 committed May 15, 2023
    Configuration menu
    Copy the full SHA
    1e8cbe4 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2023

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

Commits on May 19, 2023

  1. Configuration menu
    Copy the full SHA
    f8a27d9 View commit details
    Browse the repository at this point in the history
  2. Dynamic is an undefined primitive type. xfb_primitive_type needs to b…

    …e updated to be used.
    gpx1000 committed May 19, 2023
    Configuration menu
    Copy the full SHA
    cebb964 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2023

  1. Working together with Chip

    gpx1000 committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    37c0972 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2023

  1. fix warnings from CI

    gpx1000 committed Jun 20, 2023
    Configuration menu
    Copy the full SHA
    aab161a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9d2329a View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2023

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

Commits on Jul 24, 2023

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

Commits on Aug 10, 2023

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

Commits on Aug 17, 2023

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

Commits on Aug 18, 2023

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

Commits on Aug 22, 2023

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

Commits on Aug 23, 2023

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

Commits on Sep 7, 2023

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

Commits on Sep 8, 2023

  1. Add a variable for the XFB counter buffer.

    This lets us reference it later.
    cdavis5e committed Sep 8, 2023
    Configuration menu
    Copy the full SHA
    001ff7d View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2023

  1. Really crappy checkpoint for XFB work.

    I don't expect this to build, let alone work. (Really, all these changes
    ought to be squashed when merged to SPIRV-Cross.)
    cdavis5e committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    28babde View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2023

  1. Getting closer...

    cdavis5e committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    fb520f4 View commit details
    Browse the repository at this point in the history
  2. Fix indices of triangle strips to account for winding.

    Work out how indexing works for triangle fans. A little bit closer...
    cdavis5e committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    556c9fa View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2023

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

    cdavis5e committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    579635a View commit details
    Browse the repository at this point in the history
  3. Correct instance term in index.

    It should be based on the number of primitives written.
    
    Add missing instance term to the triangle fan base index.
    cdavis5e committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    b86f512 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    66ca6c4 View commit details
    Browse the repository at this point in the history
  5. Add missing breaks.

    cdavis5e committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    948651b View commit details
    Browse the repository at this point in the history
  6. Add missing commas.

    cdavis5e committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    e74800f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b352521 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2798c48 View commit details
    Browse the repository at this point in the history
  9. Make sure the local copy of the output is declared.

    We need to use a local copy because the vertex may need to be written
    more than once.
    cdavis5e committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    b931900 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2023

  1. Don't add captured outputs to the regular output struct.

    Instead, go through the local variables we declared earlier.
    
    Almost done.
    cdavis5e committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    ab2b37b View commit details
    Browse the repository at this point in the history
  2. Add offsets and padding to transform feedback structs.

    This gives them the correct layout in memory.
    cdavis5e committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    a1d92e7 View commit details
    Browse the repository at this point in the history
  3. Use mark_as_packable() to mark the buffer structs as needing repacking.

    That way, any nested structs get repacked as well.
    cdavis5e committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    2959f3a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    16dd1f1 View commit details
    Browse the repository at this point in the history
  5. Only create a per-patch output block for tessellation control shaders.

    This is the only type of shader that can even have such outputs. Not
    only does this save some work in most cases, it also fixes a problem
    with the next patch.
    cdavis5e committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    742f725 View commit details
    Browse the repository at this point in the history
  6. Make sure the local variable for an output block gets created.

    We still rely on it to pass around and collect the output. To avoid
    duplicates, only do this if we would not do this normally.
    cdavis5e committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    8f66f30 View commit details
    Browse the repository at this point in the history
  7. Simplify the code to add members to the XFB buffer blocks.

    Use the offset from the `XfbOutput` struct instead of querying it again
    from the ID.
    
    Use the `member_index` local instead of using `size() - 1` when setting
    member decorations.
    
    Don't set the qualified name for builtin block variabless--we handle
    those a different way.
    
    Use the member index from the `XfbOutput` when inspecing the original
    block type instead of the `member_index` local. This one was a real bug;
    honestly, I don't know how it even worked before.
    cdavis5e committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    2e14c91 View commit details
    Browse the repository at this point in the history
  8. Make sure captured outputs passed as implicit arguments have correct …

    …types.
    
    Make sure they use the `thread` AS and that they have the `packed_`
    prefix, if necessary.
    cdavis5e committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    8dbf250 View commit details
    Browse the repository at this point in the history
  9. Only use qualified name for builtins in the entry point().

    Add missing changes from previous patch.
    cdavis5e committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    b020270 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3521814 View commit details
    Browse the repository at this point in the history
  11. Clang-format the changes.

    cdavis5e committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    bf4f823 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    109959e View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2023

  1. Merge branch 'main' into xfb

    cdavis5e committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    3bd855f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1154932 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a547b52 View commit details
    Browse the repository at this point in the history
  4. Attempt to fix MSVC build.

    cdavis5e committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    64fa0b6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dada588 View commit details
    Browse the repository at this point in the history
  6. Attempt to work around weird brokenness that only happens...

    ...on the builder and not for me.
    cdavis5e committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    adb3a7b View commit details
    Browse the repository at this point in the history
  7. Try again to get the stupid compiler on the builder to see that std::…

    …hash<enum> is supposed to just work.
    cdavis5e committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    fec7607 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    0393302 View commit details
    Browse the repository at this point in the history
  9. hypothesis was correct for unordered_map stands to reason unordered_s…

    …et also doesn't support enum in C++11 for hash key
    gpx1000 committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    739a140 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2023

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

Commits on Nov 29, 2023

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

Commits on Dec 17, 2023

  1. Unfinished support for XFB+tessellation.

    Only gets the base of the primitive so far.
    cdavis5e committed Dec 17, 2023
    Configuration menu
    Copy the full SHA
    8bcfd32 View commit details
    Browse the repository at this point in the history