Module spirv_reflect::ffi

source ·

Re-exports

pub use self::SpvSourceLanguage_ as SpvSourceLanguage;
pub use self::SpvExecutionModel_ as SpvExecutionModel;
pub use self::SpvAddressingModel_ as SpvAddressingModel;
pub use self::SpvMemoryModel_ as SpvMemoryModel;
pub use self::SpvExecutionMode_ as SpvExecutionMode;
pub use self::SpvStorageClass_ as SpvStorageClass;
pub use self::SpvDim_ as SpvDim;
pub use self::SpvSamplerAddressingMode_ as SpvSamplerAddressingMode;
pub use self::SpvSamplerFilterMode_ as SpvSamplerFilterMode;
pub use self::SpvImageFormat_ as SpvImageFormat;
pub use self::SpvImageChannelOrder_ as SpvImageChannelOrder;
pub use self::SpvImageChannelDataType_ as SpvImageChannelDataType;
pub use self::SpvImageOperandsShift_ as SpvImageOperandsShift;
pub use self::SpvImageOperandsMask_ as SpvImageOperandsMask;
pub use self::SpvFPFastMathModeShift_ as SpvFPFastMathModeShift;
pub use self::SpvFPFastMathModeMask_ as SpvFPFastMathModeMask;
pub use self::SpvFPRoundingMode_ as SpvFPRoundingMode;
pub use self::SpvLinkageType_ as SpvLinkageType;
pub use self::SpvAccessQualifier_ as SpvAccessQualifier;
pub use self::SpvFunctionParameterAttribute_ as SpvFunctionParameterAttribute;
pub use self::SpvDecoration_ as SpvDecoration;
pub use self::SpvBuiltIn_ as SpvBuiltIn;
pub use self::SpvSelectionControlShift_ as SpvSelectionControlShift;
pub use self::SpvSelectionControlMask_ as SpvSelectionControlMask;
pub use self::SpvLoopControlShift_ as SpvLoopControlShift;
pub use self::SpvLoopControlMask_ as SpvLoopControlMask;
pub use self::SpvFunctionControlShift_ as SpvFunctionControlShift;
pub use self::SpvFunctionControlMask_ as SpvFunctionControlMask;
pub use self::SpvMemorySemanticsShift_ as SpvMemorySemanticsShift;
pub use self::SpvMemorySemanticsMask_ as SpvMemorySemanticsMask;
pub use self::SpvMemoryAccessShift_ as SpvMemoryAccessShift;
pub use self::SpvMemoryAccessMask_ as SpvMemoryAccessMask;
pub use self::SpvScope_ as SpvScope;
pub use self::SpvGroupOperation_ as SpvGroupOperation;
pub use self::SpvKernelEnqueueFlags_ as SpvKernelEnqueueFlags;
pub use self::SpvKernelProfilingInfoShift_ as SpvKernelProfilingInfoShift;
pub use self::SpvKernelProfilingInfoMask_ as SpvKernelProfilingInfoMask;
pub use self::SpvCapability_ as SpvCapability;
pub use self::SpvOp_ as SpvOp;

Structs

Constants

Statics

Functions

@fn spvReflectChangeDescriptorBindingNumbers @brief Assign new set and/or binding numbers to a descriptor binding. In addition to updating the reflection data, this function modifies the underlying SPIR-V bytecode. The updated code can be retrieved with spvReflectGetCode(). If the binding is used in multiple entry points within the module, it will be changed in all of them. @param p_module Pointer to an instance of SpvReflectShaderModule. @param p_binding Pointer to the descriptor binding to modify. @param new_binding_number The new binding number to assign to the provided descriptor binding. To leave the binding number unchanged, pass SPV_REFLECT_BINDING_NUMBER_DONT_CHANGE. @param new_set_number The new set number to assign to the provided descriptor binding. Successfully changing a descriptor binding’s set number invalidates all existing SpvReflectDescriptorBinding and SpvReflectDescriptorSet pointers from this module. To leave the set number unchanged, pass SPV_REFLECT_SET_NUMBER_DONT_CHANGE. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectChangeDescriptorSetNumber @brief Assign a new set number to an entire descriptor set (including all descriptor bindings in that set). In addition to updating the reflection data, this function modifies the underlying SPIR-V bytecode. The updated code can be retrieved with spvReflectGetCode(). If the descriptor set is used in multiple entry points within the module, it will be modified in all of them. @param p_module Pointer to an instance of SpvReflectShaderModule. @param p_set Pointer to the descriptor binding to modify. @param new_set_number The new set number to assign to the provided descriptor set, and all its descriptor bindings. Successfully changing a descriptor binding’s set number invalidates all existing SpvReflectDescriptorBinding and SpvReflectDescriptorSet pointers from this module. To leave the set number unchanged, pass SPV_REFLECT_SET_NUMBER_DONT_CHANGE. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectChangeInputVariableLocation @brief Assign a new location to an input interface variable. In addition to updating the reflection data, this function modifies the underlying SPIR-V bytecode. The updated code can be retrieved with spvReflectGetCode(). It is the caller’s responsibility to avoid assigning the same location to multiple input variables. If the input variable is used by multiple entry points in the module, it will be changed in all of them. @param p_module Pointer to an instance of SpvReflectShaderModule. @param p_input_variable Pointer to the input variable to update. @param new_location The new location to assign to p_input_variable. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectChangeOutputVariableLocation @brief Assign a new location to an output interface variable. In addition to updating the reflection data, this function modifies the underlying SPIR-V bytecode. The updated code can be retrieved with spvReflectGetCode(). It is the caller’s responsibility to avoid assigning the same location to multiple output variables. If the output variable is used by multiple entry points in the module, it will be changed in all of them. @param p_module Pointer to an instance of SpvReflectShaderModule. @param p_output_variable Pointer to the output variable to update. @param new_location The new location to assign to p_output_variable. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectCreateShaderModule
@fn spvReflectDestroyShaderModule
@fn spvReflectEnumerateDescriptorBindings
@fn spvReflectEnumerateDescriptorSets
@fn spvReflectEnumerateEntryPointDescriptorBindings @brief Creates a listing of all descriptor bindings that are used in the static call tree of the given entry point. @param p_module Pointer to an instance of SpvReflectShaderModule. @param entry_point The name of the entry point to get the descriptor bindings for. @param p_count If pp_bindings is NULL, the entry point’s descriptor binding count (across all descriptor sets) will be stored here. If pp_bindings is not NULL, *p_count must contain the entry points’s descriptor binding count. @param pp_bindings If NULL, the entry point’s total descriptor binding count will be written to *p_count. If non-NULL, pp_bindings must point to an array with p_count entries, where pointers to the entry point’s descriptor bindings will be written. The caller must not free the binding pointers written to this array. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectEnumerateEntryPointDescriptorSets @brief Creates a listing of all descriptor sets and their bindings that are used in the static call tree of a given entry point. @param p_module Pointer to an instance of SpvReflectShaderModule. @param entry_point The name of the entry point to get the descriptor bindings for. @param p_count If pp_sets is NULL, the module’s descriptor set count will be stored here. If pp_sets is not NULL, *p_count must contain the module’s descriptor set count. @param pp_sets If NULL, the module’s total descriptor set count will be written to *p_count. If non-NULL, pp_sets must point to an array with p_count entries, where pointers to the module’s descriptor sets will be written. The caller must not free the descriptor set pointers written to this array. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectEnumerateEntryPointInputVariables @brief Enumerate the input variables for a given entry point. @param entry_point The name of the entry point to get the input variables for. @param p_module Pointer to an instance of SpvReflectShaderModule. @param p_count If pp_variables is NULL, the entry point’s input variable count will be stored here. If pp_variables is not NULL, *p_count must contain the entry point’s input variable count. @param pp_variables If NULL, the entry point’s input variable count will be written to *p_count. If non-NULL, pp_variables must point to an array with p_count entries, where pointers to the entry point’s input variables will be written. The caller must not free the interface variables written to this array. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectEnumerateEntryPointOutputVariables @brief Enumerate the output variables for a given entry point. @param p_module Pointer to an instance of SpvReflectShaderModule. @param entry_point The name of the entry point to get the output variables for. @param p_count If pp_variables is NULL, the entry point’s output variable count will be stored here. If pp_variables is not NULL, *p_count must contain the entry point’s output variable count. @param pp_variables If NULL, the entry point’s output variable count will be written to *p_count. If non-NULL, pp_variables must point to an array with p_count entries, where pointers to the entry point’s output variables will be written. The caller must not free the interface variables written to this array. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectEnumerateEntryPointPushConstantBlocks @brief Enumerate the push constant blocks used in the static call tree of a given entry point. @param p_module Pointer to an instance of SpvReflectShaderModule. @param p_count If pp_blocks is NULL, the entry point’s push constant block count will be stored here. If pp_blocks is not NULL, *p_count must contain the entry point’s push constant block count. @param pp_blocks If NULL, the entry point’s push constant block count will be written to *p_count. If non-NULL, pp_blocks must point to an array with *p_count entries, where pointers to the entry point’s push constant blocks will be written. The caller must not free the block variables written to this array. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectEnumerateInputVariables @brief If the module contains multiple entry points, this will only get the input variables for the first one. @param p_module Pointer to an instance of SpvReflectShaderModule. @param p_count If pp_variables is NULL, the module’s input variable count will be stored here. If pp_variables is not NULL, *p_count must contain the module’s input variable count. @param pp_variables If NULL, the module’s input variable count will be written to *p_count. If non-NULL, pp_variables must point to an array with p_count entries, where pointers to the module’s input variables will be written. The caller must not free the interface variables written to this array. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectEnumerateOutputVariables @brief Note: If the module contains multiple entry points, this will only get the output variables for the first one. @param p_module Pointer to an instance of SpvReflectShaderModule. @param p_count If pp_variables is NULL, the module’s output variable count will be stored here. If pp_variables is not NULL, *p_count must contain the module’s output variable count. @param pp_variables If NULL, the module’s output variable count will be written to *p_count. If non-NULL, pp_variables must point to an array with p_count entries, where pointers to the module’s output variables will be written. The caller must not free the interface variables written to this array. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectEnumeratePushConstantBlocks @brief Note: If the module contains multiple entry points, this will only get the push constant blocks for the first one. @param p_module Pointer to an instance of SpvReflectShaderModule. @param p_count If pp_blocks is NULL, the module’s push constant block count will be stored here. If pp_blocks is not NULL, *p_count must contain the module’s push constant block count. @param pp_blocks If NULL, the module’s push constant block count will be written to *p_count. If non-NULL, pp_blocks must point to an array with *p_count entries, where pointers to the module’s push constant blocks will be written. The caller must not free the block variables written to this array. @return If successful, returns SPV_REFLECT_RESULT_SUCCESS. Otherwise, the error code indicates the cause of the failure.
@fn spvReflectGetCode
@fn spvReflectGetCodeSize
@fn spvReflectGetDescriptorBinding
@fn spvReflectGetDescriptorSet
@fn spvReflectGetEntryPoint
@fn spvReflectGetEntryPointDescriptorBinding @brief Get the descriptor binding with the given binding number and set number that is used in the static call tree of a certain entry point. @param p_module Pointer to an instance of SpvReflectShaderModule. @param entry_point The entry point to get the binding from. @param binding_number The “binding” value of the requested descriptor binding. @param set_number The “set” value of the requested descriptor binding. @param p_result If successful, SPV_REFLECT_RESULT_SUCCESS will be written to *p_result. Otherwise, a error code indicating the cause of the failure will be stored here. @return If the entry point contains a descriptor binding that matches the provided [binding_number, set_number] values, a pointer to that binding is returned. The caller must not free this pointer. If no match can be found, or if an unrelated error occurs, the return value will be NULL. Detailed error results are written to *pResult. @note If the entry point contains multiple desriptor bindings with the same set and binding numbers, there are no guarantees about which binding will be returned.
@fn spvReflectGetEntryPointDescriptorSet
@fn spvReflectGetEntryPointPushConstantBlock @brief Get the push constant block corresponding to the given entry point. As by the Vulkan specification there can be no more than one push constant block used by a given entry point, so if there is one it will be returned, otherwise NULL will be returned. @param p_module Pointer to an instance of SpvReflectShaderModule. @param entry_point The entry point to get the push constant block from. @param p_result If successful, SPV_REFLECT_RESULT_SUCCESS will be written to *p_result. Otherwise, a error code indicating the cause of the failure will be stored here. @return If the provided index is within range, a pointer to the corresponding push constant block is returned. The caller must not free this pointer. If no match can be found, or if an unrelated error occurs, the return value will be NULL. Detailed error results are written to *pResult.
@fn spvReflectGetPushConstantBlock
@fn spvReflectSourceLanguage

Type Definitions

@enum SpvReflectDecorationBits
@enum SpvReflectDescriptorType
@enum SpvReflectFormat
@enum SpvReflectGenerator
@enum SpvReflectResourceType
@enum SpvReflectResult
@enum SpvReflectShaderStageFlagBits
@enum SpvReflectTypeFlagBits