Skip to content

Commit

Permalink
feat(spvc): update to 0.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Spasi committed Jan 18, 2020
1 parent 4624a6f commit 4c5c32f
Show file tree
Hide file tree
Showing 6 changed files with 851 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class Spvc {

public static final int SPVC_C_API_VERSION_MAJOR = 0;

public static final int SPVC_C_API_VERSION_MINOR = 21;
public static final int SPVC_C_API_VERSION_MINOR = 23;

public static final int SPVC_C_API_VERSION_PATCH = 0;

Expand Down Expand Up @@ -489,6 +489,7 @@ public class Spvc {
* <h5>Enum values:</h5>
*
* <ul>
* <li>{@link #SPVC_HLSL_BINDING_AUTO_NONE_BIT HLSL_BINDING_AUTO_NONE_BIT}</li>
* <li>{@link #SPVC_HLSL_BINDING_AUTO_PUSH_CONSTANT_BIT HLSL_BINDING_AUTO_PUSH_CONSTANT_BIT} -
* Push constant (root constant) resources will be declared as CBVs (b-space) without a register() declaration.
*
Expand All @@ -507,13 +508,20 @@ public class Spvc {
* </ul>
*/
public static final int
SPVC_HLSL_BINDING_AUTO_NONE_BIT = 0,
SPVC_HLSL_BINDING_AUTO_PUSH_CONSTANT_BIT = 1 << 0,
SPVC_HLSL_BINDING_AUTO_CBV_BIT = 1 << 1,
SPVC_HLSL_BINDING_AUTO_SRV_BIT = 1 << 2,
SPVC_HLSL_BINDING_AUTO_UAV_BIT = 1 << 3,
SPVC_HLSL_BINDING_AUTO_SAMPLER_BIT = 1 << 4,
SPVC_HLSL_BINDING_AUTO_ALL = 0x7FFFFFFF;

/** Special constant used in an HLSL {@code ResourceBinding} {@code desc_set} element to indicate the bindings for the push constants. */
public static final int SPVC_HLSL_PUSH_CONSTANT_DESC_SET = ~0;

/** Special constant used in an HLSL {@code ResourceBinding} binding element to indicate the bindings for the push constants. */
public static final int SPVC_HLSL_PUSH_CONSTANT_BINDING = 0;

/**
* Maps to the various spirv_cross::Compiler*::Option structures. See C++ API for defaults and details.
*
Expand Down Expand Up @@ -573,6 +581,7 @@ public class Spvc {
* <li>{@link #SPVC_COMPILER_OPTION_MSL_INVARIANT_FP_MATH COMPILER_OPTION_MSL_INVARIANT_FP_MATH}</li>
* <li>{@link #SPVC_COMPILER_OPTION_MSL_EMULATE_CUBEMAP_ARRAY COMPILER_OPTION_MSL_EMULATE_CUBEMAP_ARRAY}</li>
* <li>{@link #SPVC_COMPILER_OPTION_MSL_ENABLE_DECORATION_BINDING COMPILER_OPTION_MSL_ENABLE_DECORATION_BINDING}</li>
* <li>{@link #SPVC_COMPILER_OPTION_MSL_FORCE_ACTIVE_ARGUMENT_BUFFER_RESOURCES COMPILER_OPTION_MSL_FORCE_ACTIVE_ARGUMENT_BUFFER_RESOURCES}</li>
* </ul>
*/
public static final int
Expand Down Expand Up @@ -626,7 +635,8 @@ public class Spvc {
SPVC_COMPILER_OPTION_MSL_IOS_FRAMEBUFFER_FETCH_SUBPASS = 46 | SPVC_COMPILER_OPTION_MSL_BIT,
SPVC_COMPILER_OPTION_MSL_INVARIANT_FP_MATH = 47 | SPVC_COMPILER_OPTION_MSL_BIT,
SPVC_COMPILER_OPTION_MSL_EMULATE_CUBEMAP_ARRAY = 48 | SPVC_COMPILER_OPTION_MSL_BIT,
SPVC_COMPILER_OPTION_MSL_ENABLE_DECORATION_BINDING = 49 | SPVC_COMPILER_OPTION_MSL_BIT;
SPVC_COMPILER_OPTION_MSL_ENABLE_DECORATION_BINDING = 49 | SPVC_COMPILER_OPTION_MSL_BIT,
SPVC_COMPILER_OPTION_MSL_FORCE_ACTIVE_ARGUMENT_BUFFER_RESOURCES = 50 | SPVC_COMPILER_OPTION_MSL_BIT;

protected Spvc() {
throw new UnsupportedOperationException();
Expand All @@ -648,6 +658,7 @@ private Functions() {}
msl_get_aux_buffer_struct_version = apiGetFunctionAddress(SPVC, "spvc_msl_get_aux_buffer_struct_version"),
msl_constexpr_sampler_init = apiGetFunctionAddress(SPVC, "spvc_msl_constexpr_sampler_init"),
msl_sampler_ycbcr_conversion_init = apiGetFunctionAddress(SPVC, "spvc_msl_sampler_ycbcr_conversion_init"),
hlsl_resource_binding_init = apiGetFunctionAddress(SPVC, "spvc_hlsl_resource_binding_init"),
context_create = apiGetFunctionAddress(SPVC, "spvc_context_create"),
context_destroy = apiGetFunctionAddress(SPVC, "spvc_context_destroy"),
context_release_allocations = apiGetFunctionAddress(SPVC, "spvc_context_release_allocations"),
Expand All @@ -668,6 +679,8 @@ private Functions() {}
compiler_hlsl_add_vertex_attribute_remap = apiGetFunctionAddress(SPVC, "spvc_compiler_hlsl_add_vertex_attribute_remap"),
compiler_hlsl_remap_num_workgroups_builtin = apiGetFunctionAddress(SPVC, "spvc_compiler_hlsl_remap_num_workgroups_builtin"),
compiler_hlsl_set_resource_binding_flags = apiGetFunctionAddress(SPVC, "spvc_compiler_hlsl_set_resource_binding_flags"),
compiler_hlsl_add_resource_binding = apiGetFunctionAddress(SPVC, "spvc_compiler_hlsl_add_resource_binding"),
compiler_hlsl_is_resource_used = apiGetFunctionAddress(SPVC, "spvc_compiler_hlsl_is_resource_used"),
compiler_msl_is_rasterization_disabled = apiGetFunctionAddress(SPVC, "spvc_compiler_msl_is_rasterization_disabled"),
compiler_msl_needs_swizzle_buffer = apiGetFunctionAddress(SPVC, "spvc_compiler_msl_needs_swizzle_buffer"),
compiler_msl_needs_buffer_size_buffer = apiGetFunctionAddress(SPVC, "spvc_compiler_msl_needs_buffer_size_buffer"),
Expand Down Expand Up @@ -874,6 +887,23 @@ public static void spvc_msl_sampler_ycbcr_conversion_init(@NativeType("SpvcMslSa
nspvc_msl_sampler_ycbcr_conversion_init(conv.address());
}

// --- [ spvc_hlsl_resource_binding_init ] ---

/** Unsafe version of: {@link #spvc_hlsl_resource_binding_init hlsl_resource_binding_init} */
public static void nspvc_hlsl_resource_binding_init(long binding) {
long __functionAddress = Functions.hlsl_resource_binding_init;
invokePV(binding, __functionAddress);
}

/**
* Initializes the resource binding struct.
*
* <p>The defaults are non-zero.</p>
*/
public static void spvc_hlsl_resource_binding_init(@NativeType("spvc_hlsl_resource_binding *") SpvcHLSLResourceBinding binding) {
nspvc_hlsl_resource_binding_init(binding.address());
}

// --- [ spvc_context_create ] ---

/** Unsafe version of: {@link #spvc_context_create context_create} */
Expand Down Expand Up @@ -1222,6 +1252,32 @@ public static int spvc_compiler_hlsl_set_resource_binding_flags(@NativeType("spv
return invokePI(compiler, flags, __functionAddress);
}

// --- [ spvc_compiler_hlsl_add_resource_binding ] ---

public static int nspvc_compiler_hlsl_add_resource_binding(long compiler, long binding) {
long __functionAddress = Functions.compiler_hlsl_add_resource_binding;
if (CHECKS) {
check(compiler);
}
return invokePPI(compiler, binding, __functionAddress);
}

@NativeType("spvc_result")
public static int spvc_compiler_hlsl_add_resource_binding(@NativeType("spvc_compiler") long compiler, @NativeType("spvc_hlsl_resource_binding const *") SpvcHLSLResourceBinding binding) {
return nspvc_compiler_hlsl_add_resource_binding(compiler, binding.address());
}

// --- [ spvc_compiler_hlsl_is_resource_used ] ---

@NativeType("spvc_bool")
public static boolean spvc_compiler_hlsl_is_resource_used(@NativeType("spvc_compiler") long compiler, @NativeType("SpvExecutionModel") int model, @NativeType("unsigned") int set, @NativeType("unsigned") int binding) {
long __functionAddress = Functions.compiler_hlsl_is_resource_used;
if (CHECKS) {
check(compiler);
}
return invokePZ(compiler, model, set, binding, __functionAddress);
}

// --- [ spvc_compiler_msl_is_rasterization_disabled ] ---

/** MSL specifics. Maps to C++ API. */
Expand Down
Loading

0 comments on commit 4c5c32f

Please sign in to comment.