From b2171de6e53eef9583b91e0a0313e8a6c9730dcb Mon Sep 17 00:00:00 2001 From: chyyran Date: Sat, 31 Aug 2024 17:02:30 -0400 Subject: [PATCH] c: allow access to gl_plain_uniforms resources --- CMakeLists.txt | 2 +- spirv_cross_c.cpp | 7 +++++++ spirv_cross_c.h | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d5bf1f6b7..bb7473c1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,7 +246,7 @@ set(spirv-cross-util-sources ${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_util.hpp) set(spirv-cross-abi-major 0) -set(spirv-cross-abi-minor 62) +set(spirv-cross-abi-minor 63) set(spirv-cross-abi-patch 0) set(SPIRV_CROSS_VERSION ${spirv-cross-abi-major}.${spirv-cross-abi-minor}.${spirv-cross-abi-patch}) diff --git a/spirv_cross_c.cpp b/spirv_cross_c.cpp index b506ceeeb..09c2af887 100644 --- a/spirv_cross_c.cpp +++ b/spirv_cross_c.cpp @@ -198,6 +198,8 @@ struct spvc_resources_s : ScratchMemoryAllocation SmallVector separate_images; SmallVector separate_samplers; SmallVector acceleration_structures; + SmallVector gl_plain_uniforms; + SmallVector builtin_inputs; SmallVector builtin_outputs; @@ -1855,6 +1857,8 @@ bool spvc_resources_s::copy_resources(const ShaderResources &resources) return false; if (!copy_resources(acceleration_structures, resources.acceleration_structures)) return false; + if (!copy_resources(gl_plain_uniforms, resources.gl_plain_uniforms)) + return false; if (!copy_resources(builtin_inputs, resources.builtin_inputs)) return false; if (!copy_resources(builtin_outputs, resources.builtin_outputs)) @@ -2006,6 +2010,9 @@ spvc_result spvc_resources_get_resource_list_for_type(spvc_resources resources, list = &resources->shader_record_buffers; break; + case SPVC_RESOURCE_TYPE_GL_PLAIN_UNIFORM: + list = &resources->gl_plain_uniforms; + default: break; } diff --git a/spirv_cross_c.h b/spirv_cross_c.h index a25b0b5b9..749d60e57 100644 --- a/spirv_cross_c.h +++ b/spirv_cross_c.h @@ -40,7 +40,7 @@ extern "C" { /* Bumped if ABI or API breaks backwards compatibility. */ #define SPVC_C_API_VERSION_MAJOR 0 /* Bumped if APIs or enumerations are added in a backwards compatible way. */ -#define SPVC_C_API_VERSION_MINOR 62 +#define SPVC_C_API_VERSION_MINOR 63 /* Bumped if internal implementation details change. */ #define SPVC_C_API_VERSION_PATCH 0 @@ -226,6 +226,7 @@ typedef enum spvc_resource_type SPVC_RESOURCE_TYPE_ACCELERATION_STRUCTURE = 12, SPVC_RESOURCE_TYPE_RAY_QUERY = 13, SPVC_RESOURCE_TYPE_SHADER_RECORD_BUFFER = 14, + SPVC_RESOURCE_TYPE_GL_PLAIN_UNIFORM = 15, SPVC_RESOURCE_TYPE_INT_MAX = 0x7fffffff } spvc_resource_type;