156 - Misc Improvement Pass
Channel: StableCoder
Date: 29/03/2022

This is a more relaxing session, where, after the heavier Resource/CreateInfo refactor work, a number of smaller issues and bugs are dealt with that had been discovered through that work.

1. Shader Leak Plugged

    When the Vulkan Shader create info structs are created when importing
    data from Yaml, an allocation on the heap would be created for the
    descriptor bindings, but would never be properly freed again.

    This fixes that by adding destruction functions for the struct type, and
    propagating that call down to the Shader graphics resource destruction
    call.

2. Replaced variadic templated subresource check func

    The templated variadic function was a remnant of the time when all
    resources had unique object types and thus passing each one would
    require a unique function to go through them.

    With all resources now being based off the same foeResource handle type,
    this is no longer required, and instead a simpler non-variadic function
    can be used to iterate through all the given resources in an array and
    return the 'worst' subresource state instead.

3. Made ECS ID header fully C-compatible

    The original ECS ID header was only C++ compatible as it also pulled in
    and used the limits and strings of the STL.

    Most of the header has been moved into the 'id.h' header and contains
    all the same data, just derived without the use of the limits library.

    The only items not found in this new header are the functions converting
    IDs to hexadecimal strings. which have instead been moved to the
    'id_to_string.h' C++-only header.

4. Added C-compatability compilation test files

    Where there were already test programs for libraries, if there are
    C-compatible headers present as well, a new .c file would be added to
    those programs.

    These new files would only include the C-only header files, to ensure
    that they are, in fact, compilable in C (C17 at least).

5. Changed order of log data when output to stdout

    The log severity is now first instead of the log category so that
    warning, error and fatal messages can more easily be seen.

--

2022/03/13