diff --git a/Cargo.toml b/Cargo.toml index 302f79c..f479ab8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "saxaboom" -version = "0.1.0+irconverter-1.1" +version = "0.1.0+irconverter-2.0" authors = ["Traverse Research "] edition = "2021" license = "Apache-2.0" diff --git a/bindings_generator/vendor/metal_irconverter/LICENSE.txt b/bindings_generator/vendor/metal_irconverter/LICENSE.txt index 6c877ff..97849a6 100644 --- a/bindings_generator/vendor/metal_irconverter/LICENSE.txt +++ b/bindings_generator/vendor/metal_irconverter/LICENSE.txt @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright © 2023 Apple Inc. + Copyright © 2023-2024 Apple Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_comparison_function.h b/bindings_generator/vendor/metal_irconverter/ir_comparison_function.h index ee93dda..34fff6e 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_comparison_function.h +++ b/bindings_generator/vendor/metal_irconverter/ir_comparison_function.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_descriptor_range_flags.h b/bindings_generator/vendor/metal_irconverter/ir_descriptor_range_flags.h index f5d8957..5ee3d73 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_descriptor_range_flags.h +++ b/bindings_generator/vendor/metal_irconverter/ir_descriptor_range_flags.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_filter.h b/bindings_generator/vendor/metal_irconverter/ir_filter.h index 4cc2aab..31ac45d 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_filter.h +++ b/bindings_generator/vendor/metal_irconverter/ir_filter.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_format.h b/bindings_generator/vendor/metal_irconverter/ir_format.h index 307a062..f0b6e17 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_format.h +++ b/bindings_generator/vendor/metal_irconverter/ir_format.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_input_classification.h b/bindings_generator/vendor/metal_irconverter/ir_input_classification.h index cd9ed77..139d68b 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_input_classification.h +++ b/bindings_generator/vendor/metal_irconverter/ir_input_classification.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_input_primitive.h b/bindings_generator/vendor/metal_irconverter/ir_input_primitive.h index 376aa96..55137da 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_input_primitive.h +++ b/bindings_generator/vendor/metal_irconverter/ir_input_primitive.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_input_topology.h b/bindings_generator/vendor/metal_irconverter/ir_input_topology.h index d120c7c..88e400d 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_input_topology.h +++ b/bindings_generator/vendor/metal_irconverter/ir_input_topology.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_root_descriptor_flags.h b/bindings_generator/vendor/metal_irconverter/ir_root_descriptor_flags.h index d4f690b..2fd0474 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_root_descriptor_flags.h +++ b/bindings_generator/vendor/metal_irconverter/ir_root_descriptor_flags.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_root_signature_flags.h b/bindings_generator/vendor/metal_irconverter/ir_root_signature_flags.h index 95acf57..069a8e2 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_root_signature_flags.h +++ b/bindings_generator/vendor/metal_irconverter/ir_root_signature_flags.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_shader_visibility.h b/bindings_generator/vendor/metal_irconverter/ir_shader_visibility.h index e251c92..b275b4b 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_shader_visibility.h +++ b/bindings_generator/vendor/metal_irconverter/ir_shader_visibility.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_tessellator_domain.h b/bindings_generator/vendor/metal_irconverter/ir_tessellator_domain.h index 8ed5d51..c3cac0f 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_tessellator_domain.h +++ b/bindings_generator/vendor/metal_irconverter/ir_tessellator_domain.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_tessellator_output_primitive.h b/bindings_generator/vendor/metal_irconverter/ir_tessellator_output_primitive.h index 261e332..a656a8e 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_tessellator_output_primitive.h +++ b/bindings_generator/vendor/metal_irconverter/ir_tessellator_output_primitive.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_tessellator_partitioning.h b/bindings_generator/vendor/metal_irconverter/ir_tessellator_partitioning.h index e221f18..10216d8 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_tessellator_partitioning.h +++ b/bindings_generator/vendor/metal_irconverter/ir_tessellator_partitioning.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_texture_address_mode.h b/bindings_generator/vendor/metal_irconverter/ir_texture_address_mode.h index d3961b3..5f6f0fa 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_texture_address_mode.h +++ b/bindings_generator/vendor/metal_irconverter/ir_texture_address_mode.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter/ir_version.h b/bindings_generator/vendor/metal_irconverter/ir_version.h index 2c325dc..56afc49 100644 --- a/bindings_generator/vendor/metal_irconverter/ir_version.h +++ b/bindings_generator/vendor/metal_irconverter/ir_version.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ #ifndef IRVERSION_H #define IRVERSION_H -#define IR_VERSION_MAJOR 1 -#define IR_VERSION_MINOR 1 +#define IR_VERSION_MAJOR 2 +#define IR_VERSION_MINOR 0 #define IR_VERSION_PATCH 0 #define IR_SUPPORTS_VERSION(major, minor, patch) \ diff --git a/bindings_generator/vendor/metal_irconverter/metal_irconverter.h b/bindings_generator/vendor/metal_irconverter/metal_irconverter.h index 806cae2..f0a8a60 100644 --- a/bindings_generator/vendor/metal_irconverter/metal_irconverter.h +++ b/bindings_generator/vendor/metal_irconverter/metal_irconverter.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -128,7 +128,7 @@ typedef struct IRVertexInputTable { uint32_t NumDescriptorRanges; const IRDescriptorRange* pDescriptorRanges; -} IRVertexInput; +} IRVertexInputTable; typedef struct IRRootConstants { @@ -188,7 +188,7 @@ typedef enum IRCompatibilityFlags IRCompatibilityFlagSamplerLODBias = (1 << 3), IRCompatibilityFlagPositionInvariance = (1 << 4), IRCompatibilityFlagSampleNanToZero = (1 << 5), - + IRCompatibilityFlagTexWriteRoundingRTZ = (1 << 6), } IRCompatibilityFlags; typedef struct IRStaticSamplerDescriptor @@ -284,8 +284,8 @@ typedef struct IRInputElementDescriptor1 IRFormat format; uint32_t inputSlot; uint32_t alignedByteOffset; - IRInputClassification inputSlotClass; uint32_t instanceDataStepRate; + IRInputClassification inputSlotClass; } IRInputElementDescriptor1; @@ -343,6 +343,7 @@ enum IRErrorCode IRErrorCodeUnableToLinkModule, IRErrorCodeUnrecognizedDXILHeader, IRErrorCodeInvalidRaytracingAttribute, + IRErrorCodeNullHullShaderInputOutputMismatch, IRErrorCodeUnknown }; @@ -454,7 +455,7 @@ void IRCompilerDestroy(IRCompiler* compiler); * @param entryPointName optional entry point name to compile when converting a library with multiple entry points. * @param input input IR object. * @param error on return, if the compiler generates any errors, this optional out parameter contains error information. If an error occurs and this parameter is non-NULL, you must free it by calling IRErrorDestroy. - * @return an IR Object containing MetalIR compiled from the input IR, or NULL if an error occurs. You must destroy this object by calling IRObjectDestroy. + * @return an IR Object containing MetalIR compiled and linked from the input IR, or NULL if an error occurs. You must destroy this object by calling IRObjectDestroy. */ IRObject* IRCompilerAllocCompileAndLink(IRCompiler* compiler, const char* entryPointName, const IRObject* input, IRError** error); @@ -546,7 +547,7 @@ void IRCompilerSetHitgroupType(IRCompiler* compiler, IRHitGroupType hitGroupType #define IRIntrinsicMaskClosestHitAll 0x7FFFFFFF #define IRIntrinsicMaskMissShaderAll 0x7FFF -#define IRIntrinsicMaskCallableShaderAll 0x7FFF +#define IRIntrinsicMaskCallableShaderAll 0x703F #define IRIntrinsicMaskAnyHitShaderAll ((uint64_t)-1) #define IRRayTracingUnlimitedRecursionDepth (-1) @@ -695,6 +696,13 @@ void IRCompilerSetMinimumGPUFamily(IRCompiler* compiler, IRGPUFamily family); */ void IRCompilerIgnoreRootSignature(IRCompiler* compiler, bool ignoreEmbeddedRootSignature); +/** + * Set compiler settings to ignore debug information. + * @param compiler compiler for which to set the flags. + * @param ignoreDebugInformation whether dxil debug information should be ignored. Defaults to false. + */ +void IRCompilerIgnoreDebugInformation(IRCompiler* compiler, bool ignoreDebugInformation); + typedef enum IROperatingSystem { IROperatingSystem_macOS, @@ -752,7 +760,7 @@ dispatch_data_t IRMetalLibGetBytecodeData(const IRMetalLibBinary* lib); #endif // __APPLE__ /** - * Serialize an MetalIR object's shader bytecode to disk. + * Serialize a MetalIR object's shader bytecode to disk. * @param outputPath path into which to write the serialized MetalIR. * @param obj IRObject containing the bytecode to serialize. * @param stage shader stage to serialize. @@ -1256,13 +1264,34 @@ const char* IRVersionedRootSignatureDescriptorAllocStringAndSerialize(IRVersione void IRVersionedRootSignatureDescriptorFreeString(const char* serialized); /** - * Deserialized a string representation of a root signature into a root signature object. + * Deserialize a string representation of a root signature into a root signature object. * @param serialized a string representation of a root signature. * @param rootSignatureDescriptor root signature object into which to deserialize the root signature. * @return true if deserialization is successful, false otherwise. */ bool IRVersionedRootSignatureDescriptorDeserialize(const char* serialized, IRVersionedRootSignatureDescriptor* rootSignatureDescriptor); +/** + * Serialize an input layout descriptor version 1 into a string. + * @param inputLayoutDescriptor descriptor to serialize. + * @return a string representation of the input layout descriptor. You need to release this string by calling IRInputLayoutDescriptor1FreeString. + */ +const char* IRInputLayoutDescriptor1AllocStringAndSerialize(IRInputLayoutDescriptor1* inputLayoutDescriptor); + +/** + * Release a string allocated by IRInputLayoutDescriptor1AllocStringAndSerialize. + * @param serialized string to release. + */ +void IRInputLayoutDescriptor1FreeString(const char* serialized); + +/** + * Deserialize a string representation of an input layout descriptor version 1 into an IRInputLayoutDescriptor1 structure. + * @param serialized a string representation of an input layout descriptor version 1. + * @param inputLayoutDescriptor input layout descriptor version 1 object into which to deserialized the input layout descriptor. + * @return true if deserialization is successful, false otherwise. + */ +bool IRInputLayoutDescriptor1Deserialize(const char* serialized, IRInputLayoutDescriptor1* inputLayoutDescriptor); + #ifdef __cplusplus } #endif diff --git a/bindings_generator/vendor/metal_irconverter_runtime/LICENSE.txt b/bindings_generator/vendor/metal_irconverter_runtime/LICENSE.txt index 6c877ff..97849a6 100644 --- a/bindings_generator/vendor/metal_irconverter_runtime/LICENSE.txt +++ b/bindings_generator/vendor/metal_irconverter_runtime/LICENSE.txt @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright © 2023 Apple Inc. + Copyright © 2023-2024 Apple Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/bindings_generator/vendor/metal_irconverter_runtime/ir_raytracing.h b/bindings_generator/vendor/metal_irconverter_runtime/ir_raytracing.h index f855092..72d0f6d 100644 --- a/bindings_generator/vendor/metal_irconverter_runtime/ir_raytracing.h +++ b/bindings_generator/vendor/metal_irconverter_runtime/ir_raytracing.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -157,6 +157,9 @@ void IRRaytracingUpdateInstanceContributions(IRRaytracingAccelerationStructureGP #ifndef __METAL_VERSION__ +extern const char* kIRRayDispatchIndirectionKernelName; +extern const uint64_t kIRRayDispatchArgumentsBindPoint; + /** * Encode an acceleration structure into the argument buffer. * @param entry the pointer to the descriptor table entry to encode the acceleration structure reference into. @@ -195,11 +198,11 @@ void IRShaderIdentifierInit(IRShaderIdentifier* identifier, uint64_t shaderHandl */ void IRShaderIdentifierInitWithCustomIntersection(IRShaderIdentifier* identifier, uint64_t shaderHandle, uint64_t intersectionShaderHandle) IR_OVERLOADABLE; +#ifdef IR_PRIVATE_IMPLEMENTATION + const char* kIRRayDispatchIndirectionKernelName = "RaygenIndirection"; const uint64_t kIRRayDispatchArgumentsBindPoint = 3; -#ifdef IR_PRIVATE_IMPLEMENTATION - IR_INLINE void IRShaderIdentifierInit(IRShaderIdentifier* identifier, uint64_t shaderHandle) IR_OVERLOADABLE { diff --git a/bindings_generator/vendor/metal_irconverter_runtime/ir_tessellator_tables.h b/bindings_generator/vendor/metal_irconverter_runtime/ir_tessellator_tables.h index d82b4fc..708a7aa 100644 --- a/bindings_generator/vendor/metal_irconverter_runtime/ir_tessellator_tables.h +++ b/bindings_generator/vendor/metal_irconverter_runtime/ir_tessellator_tables.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,9 +25,9 @@ extern "C" { #include #endif // __cplusplus -const uint64_t kIRRuntimeTessellatorTablesBindPoint = 7; -const uint32_t kIRRuntimeTessellatorTablesCountsAndOffsetLength = 32768; -const uint32_t kIRRuntimeTessellatorTablesLookupTableLength = 701114; +extern const uint64_t kIRRuntimeTessellatorTablesBindPoint; +extern const uint32_t kIRRuntimeTessellatorTablesCountsAndOffsetLength; +extern const uint32_t kIRRuntimeTessellatorTablesLookupTableLength; /** * Query the size in bytes necessary to store the tessellator tables. @@ -4209,6 +4209,10 @@ static const uint8_t kIRTessellatorTablesLookupTable[] = { 0,1,0,0,1,3,1,2,2,3,2,2,3,3,3,2,4,3,4,2,5,3,5,2,6,3,6,2,7,3,7,2,8,3,8,2,9,3,9,2,10,3,10,2,11,3,11,2,12,3,12,2,13,3,13,2,14,3,14,2,15,3,15,2,16,3,16,2,17,3,17,2,18,3,18,2,19,3,19,2,20,3,20,2,21,3,21,2,22,3,22,2,23,3,23,2,24,3,24,2,25,3,25,2,26,3,26,2,27,3,27,2,28,3,28,2,29,3,29,2,30,3,30,2,31,3,31,2,32,3,31,0,33,3,32,2,34,3,33,2,35,3,34,2,36,3,35,2,37,3,36,2,38,3,37,2,39,3,38,2,40,3,39,2,41,3,40,2,42,3,41,2,43,3,42,2,44,3,43,2,45,3,44,2,46,3,45,2,47,3,46,2,48,3,47,2,49,3,48,2,50,3,49,2,51,3,50,2,52,3,51,2,53,3,52,2,54,3,53,2,55,3,54,2,56,3,55,2,57,3,56,2,58,3,57,2,59,3,58,2,60,3,59,2,61,3,60,2,62,3,61,2,63,3,62,2,64,3,// in:64 out:64 }; +const uint64_t kIRRuntimeTessellatorTablesBindPoint = 7; +const uint32_t kIRRuntimeTessellatorTablesCountsAndOffsetLength = 32768; +const uint32_t kIRRuntimeTessellatorTablesLookupTableLength = 701114; + IR_INLINE uint64_t IRRuntimeTessellatorTablesSize(void) { diff --git a/bindings_generator/vendor/metal_irconverter_runtime/metal_irconverter_runtime.h b/bindings_generator/vendor/metal_irconverter_runtime/metal_irconverter_runtime.h index ec35832..a537132 100644 --- a/bindings_generator/vendor/metal_irconverter_runtime/metal_irconverter_runtime.h +++ b/bindings_generator/vendor/metal_irconverter_runtime/metal_irconverter_runtime.h @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------------------------------------------------------------------------------------- // -// Copyright 2023 Apple Inc. +// Copyright 2023-2024 Apple Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -73,6 +73,18 @@ extern "C" { #define IR_INLINE __attribute__((always_inline)) #define IR_OVERLOADABLE __attribute__((overloadable)) +extern const uint64_t kIRArgumentBufferBindPoint; +extern const uint64_t kIRDescriptorHeapBindPoint; +extern const uint64_t kIRSamplerHeapBindPoint; +extern const uint64_t kIRArgumentBufferHullDomainBindPoint; +extern const uint64_t kIRArgumentBufferDrawArgumentsBindPoint; +extern const uint64_t kIRArgumentBufferUniformsBindPoint; +extern const uint64_t kIRVertexBufferBindPoint; +extern const uint64_t kIRStageInAttributeStartIndex; +extern const char* kIRIndirectTriangleIntersectionFunctionName; +extern const char* kIRIndirectProceduralIntersectionFunctionName; +extern const uint16_t kIRNonIndexedDraw; + typedef struct IRDescriptorTableEntry { uint64_t gpuVA; @@ -240,7 +252,7 @@ typedef struct IRRuntimeDrawParams typedef struct IRRuntimeDrawInfo { // Vertex pipelines only require the index type. - uint16_t indexType; + uint16_t indexType; // set to kIRNonIndexedDraw to indicate a non-indexed draw call // Required by all mesh shader-based pipelines. uint8_t primitiveTopology; @@ -485,25 +497,6 @@ renderpipelinestate_t IRRuntimeNewGeometryTessellationEmulationPipeline(device_t const IRGeometryTessellationEmulationPipelineDescriptor* descriptor, nserror_t* error) API_AVAILABLE(macosx(14), ios(17)); -static const uint64_t kIRArgumentBufferBindPoint = 2; -static const uint64_t kIRArgumentBufferHullDomainBindPoint = 3; -static const uint64_t kIRDescriptorHeapBindPoint = 0; -static const uint64_t kIRSamplerHeapBindPoint = 1; -static const uint64_t kIRArgumentBufferDrawArgumentsBindPoint = 4; -static const uint64_t kIRArgumentBufferUniformsBindPoint = 5; -static const uint64_t kIRVertexBufferBindPoint = 6; -static const uint64_t kIRStageInAttributeStartIndex = 11; -static const char* kIRIndirectTriangleIntersectionFunctionName = "irconverter.wrapper.intersection.function.triangle"; -static const char* kIRIndirectProceduralIntersectionFunctionName = "irconverter.wrapper.intersection.function.procedural"; - - -static const uint64_t kIRBufSizeOffset = 0; -static const uint64_t kIRBufSizeMask = 0xffffffff; -static const uint64_t kIRTexViewOffset = 32; -static const uint64_t kIRTexViewMask = 0xff; -static const uint64_t kIRTypedBufferOffset = 63; - - #ifdef IR_PRIVATE_IMPLEMENTATION #ifndef IR_RUNTIME_METALCPP @@ -513,6 +506,26 @@ static const uint64_t kIRTypedBufferOffset = 63; #endif +const uint64_t kIRArgumentBufferBindPoint = 2; +const uint64_t kIRArgumentBufferHullDomainBindPoint = 3; +const uint64_t kIRDescriptorHeapBindPoint = 0; +const uint64_t kIRSamplerHeapBindPoint = 1; +const uint64_t kIRArgumentBufferDrawArgumentsBindPoint = 4; +const uint64_t kIRArgumentBufferUniformsBindPoint = 5; +const uint64_t kIRVertexBufferBindPoint = 6; +const uint64_t kIRStageInAttributeStartIndex = 11; +const char* kIRIndirectTriangleIntersectionFunctionName = "irconverter.wrapper.intersection.function.triangle"; +const char* kIRIndirectProceduralIntersectionFunctionName = "irconverter.wrapper.intersection.function.procedural"; +const uint16_t kIRNonIndexedDraw = 0; + + +const uint64_t kIRBufSizeOffset = 0; +const uint64_t kIRBufSizeMask = 0xffffffff; +const uint64_t kIRTexViewOffset = 32; +const uint64_t kIRTexViewMask = 0xff; +const uint64_t kIRTypedBufferOffset = 63; + + IR_INLINE void IRRuntimeCreateAppendBufferView(device_t device, buffer_t appendBuffer, uint64_t appendBufferOffset, uint32_t initialCounterValue, IRBufferView* outBufferView) { @@ -651,7 +664,7 @@ void IRRuntimeDrawPrimitives(renderencoder_t enc, primitivetype_t primitiveType, { IRRuntimeDrawArgument da = { (uint32_t)vertexCount, (uint32_t)instanceCount, (uint32_t)vertexStart, (uint32_t)baseInstance }; IRRuntimeDrawParams dp = { .draw = da }; - IRRuntimeDrawInfo di = { 0, (uint8_t)primitiveType, 0, 0, 0 }; + IRRuntimeDrawInfo di = { kIRNonIndexedDraw, (uint8_t)primitiveType, 0, 0, 0 }; #ifdef IR_RUNTIME_METALCPP enc->setVertexBytes( &dp, sizeof( IRRuntimeDrawParams ), kIRArgumentBufferDrawArgumentsBindPoint ); @@ -679,11 +692,14 @@ void IRRuntimeDrawPrimitives(renderencoder_t enc, primitivetype_t primitiveType, IR_INLINE void IRRuntimeDrawPrimitives(renderencoder_t enc, primitivetype_t primitiveType, buffer_t indirectBuffer, uint64_t indirectBufferOffset) IR_OVERLOADABLE { + IRRuntimeDrawInfo di = { kIRNonIndexedDraw, (uint8_t)primitiveType, 0, 0, 0 }; #ifdef IR_RUNTIME_METALCPP enc->setVertexBuffer( indirectBuffer, indirectBufferOffset, kIRArgumentBufferDrawArgumentsBindPoint ); + enc->setVertexBytes( &di, sizeof( IRRuntimeDrawInfo ), kIRArgumentBufferUniformsBindPoint ); enc->drawPrimitives( primitiveType, indirectBuffer, indirectBufferOffset ); #else [enc setVertexBuffer:indirectBuffer offset:indirectBufferOffset atIndex:kIRArgumentBufferDrawArgumentsBindPoint]; + [enc setVertexBytes:&di length:sizeof( IRRuntimeDrawInfo ) atIndex:kIRArgumentBufferUniformsBindPoint]; [enc drawPrimitives:primitiveType indirectBuffer:indirectBuffer indirectBufferOffset:indirectBufferOffset]; #endif } @@ -771,23 +787,6 @@ static uint32_t IRRuntimePrimitiveTypeVertexOverlap(IRRuntimePrimitiveType primi return 0; } -IR_INLINE -static uint32_t DXAIRPrimitiveTypeToPrimitiveTopology(IRRuntimePrimitiveType primitiveType) -{ - switch (primitiveType) - { - case IRRuntimePrimitiveTypePoint: return 1; - case IRRuntimePrimitiveTypeLine: return 2; - case IRRuntimePrimitiveTypeLineStrip: return 3; - case IRRuntimePrimitiveTypeTriangle: return 4; - case IRRuntimePrimitiveTypeTriangleStrip: return 5; - case IRRuntimePrimitiveTypeLineWithAdj: return 10; - case IRRuntimePrimitiveTypeTriangleWithAdj: return 12; - default: return 0; - } - return 0; -} - IR_INLINE static IRRuntimeDrawInfo IRRuntimeCalculateDrawInfoForGSEmulation(IRRuntimePrimitiveType primitiveType, indextype_t indexType, uint32_t vertexSizeInBytes, uint32_t maxInputPrimitivesPerMeshThreadgroup, uint32_t instanceCount) { @@ -895,11 +894,11 @@ void IRRuntimeDrawIndexedPrimitivesGeometryEmulation(renderencoder_t enc, IRRuntimeDrawParams drawParams; drawParams.drawIndexed = (IRRuntimeDrawIndexedArgument){ - .startInstanceLocation = baseInstance, + .indexCountPerInstance = indexCountPerInstance, .instanceCount = instanceCount, - .baseVertexLocation = baseVertex, .startIndexLocation = startIndex, - .indexCountPerInstance = indexCountPerInstance + .baseVertexLocation = baseVertex, + .startInstanceLocation = baseInstance }; @@ -1009,11 +1008,11 @@ void IRRuntimeDrawIndexedPatchesTessellationEmulation(renderencoder_t enc, IRRuntimeDrawParams drawParams; drawParams.drawIndexed = (IRRuntimeDrawIndexedArgument){ - .startInstanceLocation = baseInstance, + .indexCountPerInstance = indexCountPerInstance, .instanceCount = instanceCount, - .baseVertexLocation = baseVertex, .startIndexLocation = startIndex, - .indexCountPerInstance = indexCountPerInstance + .baseVertexLocation = baseVertex, + .startInstanceLocation = baseInstance }; uint32_t threadgroupMem = 16; @@ -1521,8 +1520,7 @@ renderpipelinestate_t IRRuntimeNewGeometryTessellationEmulationPipeline(device_t MTLFunctionDescriptor* pFunctionDesc = [[MTLFunctionDescriptor alloc] init]; [pFunctionDesc setConstantValues:pFunctionConstants]; - - NSString* functionName = [NSString stringWithFormat:@"%s.dxil_irconverter_object_shader", descriptor->vertexFunctionName]; + pFunctionDesc.name = [NSString stringWithFormat:@"%s.dxil_irconverter_object_shader", descriptor->vertexFunctionName]; pVertexFn = [descriptor->vertexLibrary newFunctionWithDescriptor:pFunctionDesc error:error]; diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 01e66ed..28623db 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "saxaboom-runtime" -version = "0.1.0+irconverter-1.1" +version = "0.1.0+irconverter-2.0" authors = ["Traverse Research "] edition = "2021" license = "Apache-2.0" diff --git a/runtime/src/bindings.rs b/runtime/src/bindings.rs index 6b4101f..cdfb200 100644 --- a/runtime/src/bindings.rs +++ b/runtime/src/bindings.rs @@ -80,13 +80,46 @@ where } } } -pub type uint = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct MTLDispatchThreadgroupsIndirectArguments { pub threadgroupsPerGrid: [u32; 3usize], } pub type resourceid_t = MTLResourceID; +pub type uint = ::std::os::raw::c_uint; +extern "C" { + pub static kIRArgumentBufferBindPoint: u64; +} +extern "C" { + pub static kIRDescriptorHeapBindPoint: u64; +} +extern "C" { + pub static kIRSamplerHeapBindPoint: u64; +} +extern "C" { + pub static kIRArgumentBufferHullDomainBindPoint: u64; +} +extern "C" { + pub static kIRArgumentBufferDrawArgumentsBindPoint: u64; +} +extern "C" { + pub static kIRArgumentBufferUniformsBindPoint: u64; +} +extern "C" { + pub static kIRVertexBufferBindPoint: u64; +} +extern "C" { + pub static kIRStageInAttributeStartIndex: u64; +} +extern "C" { + pub static mut kIRIndirectTriangleIntersectionFunctionName: *const ::std::os::raw::c_char; +} +extern "C" { + pub static mut kIRIndirectProceduralIntersectionFunctionName: *const ::std::os::raw::c_char; +} +extern "C" { + pub static kIRNonIndexedDraw: u16; +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct IRDescriptorTableEntry { @@ -94,9 +127,15 @@ pub struct IRDescriptorTableEntry { pub textureViewID: u64, pub metadata: u64, } -pub const kIRRuntimeTessellatorTablesBindPoint: u64 = 7; -pub const kIRRuntimeTessellatorTablesCountsAndOffsetLength: u32 = 32768; -pub const kIRRuntimeTessellatorTablesLookupTableLength: u32 = 701114; +extern "C" { + pub static kIRRuntimeTessellatorTablesBindPoint: u64; +} +extern "C" { + pub static kIRRuntimeTessellatorTablesCountsAndOffsetLength: u32; +} +extern "C" { + pub static kIRRuntimeTessellatorTablesLookupTableLength: u32; +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct IRShaderIdentifier { @@ -238,8 +277,12 @@ impl IRRaytracingInstanceDescriptor { __bindgen_bitfield_unit } } -pub const kIRRayDispatchIndirectionKernelName: &[u8; 18] = b"RaygenIndirection\0"; -pub const kIRRayDispatchArgumentsBindPoint: u64 = 3; +extern "C" { + pub static mut kIRRayDispatchIndirectionKernelName: *const ::std::os::raw::c_char; +} +extern "C" { + pub static kIRRayDispatchArgumentsBindPoint: u64; +} #[repr(u32)] #[non_exhaustive] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -463,20 +506,3 @@ pub struct IRRuntimeDrawInfo { pub inputControlPointsPerPatch: u16, pub indexBuffer: u64, } -pub const kIRArgumentBufferBindPoint: u64 = 2; -pub const kIRArgumentBufferHullDomainBindPoint: u64 = 3; -pub const kIRDescriptorHeapBindPoint: u64 = 0; -pub const kIRSamplerHeapBindPoint: u64 = 1; -pub const kIRArgumentBufferDrawArgumentsBindPoint: u64 = 4; -pub const kIRArgumentBufferUniformsBindPoint: u64 = 5; -pub const kIRVertexBufferBindPoint: u64 = 6; -pub const kIRStageInAttributeStartIndex: u64 = 11; -pub const kIRIndirectTriangleIntersectionFunctionName: &[u8; 51] = - b"irconverter.wrapper.intersection.function.triangle\0"; -pub const kIRIndirectProceduralIntersectionFunctionName: &[u8; 53] = - b"irconverter.wrapper.intersection.function.procedural\0"; -pub const kIRBufSizeOffset: u64 = 0; -pub const kIRBufSizeMask: u64 = 4294967295; -pub const kIRTexViewOffset: u64 = 32; -pub const kIRTexViewMask: u64 = 255; -pub const kIRTypedBufferOffset: u64 = 63; diff --git a/src/bindings.rs b/src/bindings.rs index 768aec0..15a8018 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -1,12 +1,12 @@ /* automatically generated by rust-bindgen 0.70.1 */ -pub const IR_VERSION_MAJOR: u32 = 1; -pub const IR_VERSION_MINOR: u32 = 1; +pub const IR_VERSION_MAJOR: u32 = 2; +pub const IR_VERSION_MINOR: u32 = 0; pub const IR_VERSION_PATCH: u32 = 0; pub const IRDescriptorRangeOffsetAppend: u32 = 4294967295; pub const IRIntrinsicMaskClosestHitAll: u32 = 2147483647; pub const IRIntrinsicMaskMissShaderAll: u32 = 32767; -pub const IRIntrinsicMaskCallableShaderAll: u32 = 32767; +pub const IRIntrinsicMaskCallableShaderAll: u32 = 28735; pub const IRRayTracingUnlimitedRecursionDepth: i32 = -1; #[repr(u32)] #[non_exhaustive] @@ -559,7 +559,6 @@ pub struct IRVertexInputTable { pub NumDescriptorRanges: u32, pub pDescriptorRanges: *const IRDescriptorRange, } -pub type IRVertexInput = IRVertexInputTable; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct IRRootConstants { @@ -634,6 +633,9 @@ impl IRCompatibilityFlags { impl IRCompatibilityFlags { pub const SampleNanToZero: IRCompatibilityFlags = IRCompatibilityFlags(32); } +impl IRCompatibilityFlags { + pub const TexWriteRoundingRTZ: IRCompatibilityFlags = IRCompatibilityFlags(64); +} impl ::std::ops::BitOr for IRCompatibilityFlags { type Output = Self; #[inline] @@ -764,8 +766,8 @@ pub struct IRInputElementDescriptor1 { pub format: IRFormat, pub inputSlot: u32, pub alignedByteOffset: u32, - pub inputSlotClass: IRInputClassification, pub instanceDataStepRate: u32, + pub inputSlotClass: IRInputClassification, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -856,7 +858,8 @@ pub enum IRErrorCode { UnableToLinkModule = 13, UnrecognizedDXILHeader = 14, InvalidRaytracingAttribute = 15, - Unknown = 16, + NullHullShaderInputOutputMismatch = 16, + Unknown = 17, } #[repr(u32)] #[non_exhaustive] @@ -1297,6 +1300,8 @@ pub struct metal_irconverter { unsafe extern "C" fn(compiler: *mut IRCompiler, family: IRGPUFamily), pub IRCompilerIgnoreRootSignature: unsafe extern "C" fn(compiler: *mut IRCompiler, ignoreEmbeddedRootSignature: bool), + pub IRCompilerIgnoreDebugInformation: + unsafe extern "C" fn(compiler: *mut IRCompiler, ignoreDebugInformation: bool), pub IRCompilerSetMinimumDeploymentTarget: unsafe extern "C" fn( compiler: *mut IRCompiler, operatingSystem: IROperatingSystem, @@ -1423,6 +1428,16 @@ pub struct metal_irconverter { serialized: *const ::std::os::raw::c_char, rootSignatureDescriptor: *mut IRVersionedRootSignatureDescriptor, ) -> bool, + pub IRInputLayoutDescriptor1AllocStringAndSerialize: + unsafe extern "C" fn( + inputLayoutDescriptor: *mut IRInputLayoutDescriptor1, + ) -> *const ::std::os::raw::c_char, + pub IRInputLayoutDescriptor1FreeString: + unsafe extern "C" fn(serialized: *const ::std::os::raw::c_char), + pub IRInputLayoutDescriptor1Deserialize: unsafe extern "C" fn( + serialized: *const ::std::os::raw::c_char, + inputLayoutDescriptor: *mut IRInputLayoutDescriptor1, + ) -> bool, } impl metal_irconverter { pub unsafe fn new

(path: P) -> Result @@ -1517,6 +1532,9 @@ impl metal_irconverter { let IRCompilerIgnoreRootSignature = __library .get(b"IRCompilerIgnoreRootSignature\0") .map(|sym| *sym)?; + let IRCompilerIgnoreDebugInformation = __library + .get(b"IRCompilerIgnoreDebugInformation\0") + .map(|sym| *sym)?; let IRCompilerSetMinimumDeploymentTarget = __library .get(b"IRCompilerSetMinimumDeploymentTarget\0") .map(|sym| *sym)?; @@ -1634,6 +1652,15 @@ impl metal_irconverter { let IRVersionedRootSignatureDescriptorDeserialize = __library .get(b"IRVersionedRootSignatureDescriptorDeserialize\0") .map(|sym| *sym)?; + let IRInputLayoutDescriptor1AllocStringAndSerialize = __library + .get(b"IRInputLayoutDescriptor1AllocStringAndSerialize\0") + .map(|sym| *sym)?; + let IRInputLayoutDescriptor1FreeString = __library + .get(b"IRInputLayoutDescriptor1FreeString\0") + .map(|sym| *sym)?; + let IRInputLayoutDescriptor1Deserialize = __library + .get(b"IRInputLayoutDescriptor1Deserialize\0") + .map(|sym| *sym)?; Ok(metal_irconverter { __library, IRErrorGetCode, @@ -1670,6 +1697,7 @@ impl metal_irconverter { IRCompilerSetEntryPointName, IRCompilerSetMinimumGPUFamily, IRCompilerIgnoreRootSignature, + IRCompilerIgnoreDebugInformation, IRCompilerSetMinimumDeploymentTarget, IRMetalLibBinaryCreate, IRMetalLibBinaryDestroy, @@ -1711,6 +1739,9 @@ impl metal_irconverter { IRVersionedRootSignatureDescriptorAllocStringAndSerialize, IRVersionedRootSignatureDescriptorFreeString, IRVersionedRootSignatureDescriptorDeserialize, + IRInputLayoutDescriptor1AllocStringAndSerialize, + IRInputLayoutDescriptor1FreeString, + IRInputLayoutDescriptor1Deserialize, }) } #[doc = " Obtain the error code of an error.\n @param error error object to query.\n @return error code."] @@ -1774,7 +1805,7 @@ impl metal_irconverter { pub unsafe fn IRCompilerDestroy(&self, compiler: *mut IRCompiler) { (self.IRCompilerDestroy)(compiler) } - #[doc = " Allocate a new object and populate it with the results of compiling and linking IR bytecode.\n @note Prior calls to `IRCompilerSetHitgroupType`, `IRCompilerSetRayTracingPipelineArguments`, `IRCompilerSetGlobalRootSignature`, `IRCompilerSetLocalRootSignature` influence the bytecode this function produces.\n @note you need to call `IRCompilerSetRayTracingPipelineArguments` before compiling ray tracing shaders.\n @param compiler compiler to use for the translation process.\n @param entryPointName optional entry point name to compile when converting a library with multiple entry points.\n @param input input IR object.\n @param error on return, if the compiler generates any errors, this optional out parameter contains error information. If an error occurs and this parameter is non-NULL, you must free it by calling IRErrorDestroy.\n @return an IR Object containing MetalIR compiled from the input IR, or NULL if an error occurs. You must destroy this object by calling IRObjectDestroy."] + #[doc = " Allocate a new object and populate it with the results of compiling and linking IR bytecode.\n @note Prior calls to `IRCompilerSetHitgroupType`, `IRCompilerSetRayTracingPipelineArguments`, `IRCompilerSetGlobalRootSignature`, `IRCompilerSetLocalRootSignature` influence the bytecode this function produces.\n @note you need to call `IRCompilerSetRayTracingPipelineArguments` before compiling ray tracing shaders.\n @param compiler compiler to use for the translation process.\n @param entryPointName optional entry point name to compile when converting a library with multiple entry points.\n @param input input IR object.\n @param error on return, if the compiler generates any errors, this optional out parameter contains error information. If an error occurs and this parameter is non-NULL, you must free it by calling IRErrorDestroy.\n @return an IR Object containing MetalIR compiled and linked from the input IR, or NULL if an error occurs. You must destroy this object by calling IRObjectDestroy."] pub unsafe fn IRCompilerAllocCompileAndLink( &self, compiler: *mut IRCompiler, @@ -1978,6 +2009,14 @@ impl metal_irconverter { ) { (self.IRCompilerIgnoreRootSignature)(compiler, ignoreEmbeddedRootSignature) } + #[doc = " Set compiler settings to ignore debug information.\n @param compiler compiler for which to set the flags.\n @param ignoreDebugInformation whether dxil debug information should be ignored. Defaults to false."] + pub unsafe fn IRCompilerIgnoreDebugInformation( + &self, + compiler: *mut IRCompiler, + ignoreDebugInformation: bool, + ) { + (self.IRCompilerIgnoreDebugInformation)(compiler, ignoreDebugInformation) + } #[doc = " Set the minimum operating system software version target for Metal IR code generation.\n Targetting a newer software version may enable the compiler to emi MetalIR further optimized for newer macOS and iOS releases, but it may render it incompatible with older operating system versions.\n Setting a minimum deployment target newer than your SDK may produce an `IRErrorCodeUnableToLinkModule` error.\n @param compiler compiler to configure.\n @param operatingSystem operating system name.\n @param version operating system version, such as \"13.0.0\" or \"16.0.0\"."] pub unsafe fn IRCompilerSetMinimumDeploymentTarget( &self, @@ -2007,7 +2046,7 @@ impl metal_irconverter { pub unsafe fn IRMetalLibGetBytecodeSize(&self, lib: *const IRMetalLibBinary) -> usize { (self.IRMetalLibGetBytecodeSize)(lib) } - #[doc = " Serialize an MetalIR object's shader bytecode to disk.\n @param outputPath path into which to write the serialized MetalIR.\n @param obj IRObject containing the bytecode to serialize.\n @param stage shader stage to serialize."] + #[doc = " Serialize a MetalIR object's shader bytecode to disk.\n @param outputPath path into which to write the serialized MetalIR.\n @param obj IRObject containing the bytecode to serialize.\n @param stage shader stage to serialize."] pub unsafe fn IRObjectSerialize( &self, outputPath: *const ::std::os::raw::c_char, @@ -2262,7 +2301,7 @@ impl metal_irconverter { ) { (self.IRVersionedRootSignatureDescriptorFreeString)(serialized) } - #[doc = " Deserialized a string representation of a root signature into a root signature object.\n @param serialized a string representation of a root signature.\n @param rootSignatureDescriptor root signature object into which to deserialize the root signature.\n @return true if deserialization is successful, false otherwise."] + #[doc = " Deserialize a string representation of a root signature into a root signature object.\n @param serialized a string representation of a root signature.\n @param rootSignatureDescriptor root signature object into which to deserialize the root signature.\n @return true if deserialization is successful, false otherwise."] pub unsafe fn IRVersionedRootSignatureDescriptorDeserialize( &self, serialized: *const ::std::os::raw::c_char, @@ -2270,4 +2309,26 @@ impl metal_irconverter { ) -> bool { (self.IRVersionedRootSignatureDescriptorDeserialize)(serialized, rootSignatureDescriptor) } + #[doc = " Serialize an input layout descriptor version 1 into a string.\n @param inputLayoutDescriptor descriptor to serialize.\n @return a string representation of the input layout descriptor. You need to release this string by calling IRInputLayoutDescriptor1FreeString."] + pub unsafe fn IRInputLayoutDescriptor1AllocStringAndSerialize( + &self, + inputLayoutDescriptor: *mut IRInputLayoutDescriptor1, + ) -> *const ::std::os::raw::c_char { + (self.IRInputLayoutDescriptor1AllocStringAndSerialize)(inputLayoutDescriptor) + } + #[doc = " Release a string allocated by IRInputLayoutDescriptor1AllocStringAndSerialize.\n @param serialized string to release."] + pub unsafe fn IRInputLayoutDescriptor1FreeString( + &self, + serialized: *const ::std::os::raw::c_char, + ) { + (self.IRInputLayoutDescriptor1FreeString)(serialized) + } + #[doc = " Deserialize a string representation of an input layout descriptor version 1 into an IRInputLayoutDescriptor1 structure.\n @param serialized a string representation of an input layout descriptor version 1.\n @param inputLayoutDescriptor input layout descriptor version 1 object into which to deserialized the input layout descriptor.\n @return true if deserialization is successful, false otherwise."] + pub unsafe fn IRInputLayoutDescriptor1Deserialize( + &self, + serialized: *const ::std::os::raw::c_char, + inputLayoutDescriptor: *mut IRInputLayoutDescriptor1, + ) -> bool { + (self.IRInputLayoutDescriptor1Deserialize)(serialized, inputLayoutDescriptor) + } }