Struct spirv_cross2::compile::hlsl::CompileOptions
source · #[non_exhaustive]pub struct CompileOptions {
pub common: CommonOptions,
pub shader_model: HlslShaderModel,
pub point_size_compat: bool,
pub point_coord_compat: bool,
pub support_nonzero_base_vertex_base_instance: bool,
pub force_storage_buffer_as_uav: bool,
pub nonwritable_uav_texture_as_srv: bool,
pub flatten_matrix_vertex_input_semantics: bool,
pub enable_16bit_types: bool,
pub use_entry_point_name: bool,
pub preserve_structured_buffers: bool,
}Expand description
HLSL compiler options
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.common: CommonOptionsCompile options common to GLSL, HLSL, and MSL.
shader_model: HlslShaderModelThe HLSL shader model version to output. The default is SM 3.0
point_size_compat: boolAllows the PointSize builtin in SM 4.0+, and ignores it, as PointSize is not supported in SM 4+.
point_coord_compat: boolAllows the PointCoord builtin, returns float2(0.5, 0.5), as PointCoord is not supported in HLSL.
support_nonzero_base_vertex_base_instance: boolIf true, the backend will assume that VertexIndex and InstanceIndex will need to apply a base offset, and you will need to fill in a cbuffer with offsets.
Set to false if you know you will never use base instance or base vertex functionality as it might remove an internal cbuffer.
force_storage_buffer_as_uav: boolForces a storage buffer to always be declared as UAV, even if the readonly decoration is used. By default, a readonly storage buffer will be declared as ByteAddressBuffer (SRV) instead.
nonwritable_uav_texture_as_srv: boolForces any storage image type marked as NonWritable to be considered an SRV instead. For this to work with function call parameters, NonWritable must be considered to be part of the type system so that NonWritable image arguments are also translated to Texture rather than RWTexture.
flatten_matrix_vertex_input_semantics: boolIf matrices are used as IO variables, flatten the attribute declaration to use
TEXCOORD{N,N+1,N+2,...} rather than TEXCOORDN_{0,1,2,3}.
If add_vertex_attribute_remap is used and this feature is used,
the semantic name will be queried once per active location.
enable_16bit_types: boolEnables native 16-bit types. Needs SM 6.2. Uses half/int16_t/uint16_t instead of min16* types. Also adds support for 16-bit load-store from (RW)ByteAddressBuffer.
use_entry_point_name: boolRather than emitting main() for the entry point, use the name in SPIR-V.
preserve_structured_buffers: boolPreserve (RW)StructuredBuffer types if the input source was HLSL.
This relies on UserTypeGOOGLE to encode the buffer type either as structuredbuffer or rwstructuredbuffer
whereas the type can be extended with an optional subtype, e.g. structuredbuffer:int.