Documentation ¶
Overview ¶
package alignsl performs 16-byte alignment checking of struct fields and total size modulus checking of struct types to ensure HLSL (and GSL) compatibility.
Checks that struct sizes are an even multiple of 16 bytes (4 float32's), fields are 32 bit types: [U]Int32, Float32, and that fields that are other struct types are aligned at even 16 byte multiples.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPackage ¶
CheckPackage is main entry point for checking a package returns error string if any errors found.
func CheckStack ¶
func CheckStruct ¶
CheckStruct is the primary checker -- returns hasErr = true if there are any mis-aligned fields or total size of struct is not an even multiple of 16 bytes -- adds details to Errs
Types ¶
type Context ¶
type Context struct { Sizes types.Sizes // from package Structs map[*types.Struct]string // structs that have been processed already -- value is name Stack map[*types.Struct]string // structs to process in a second pass -- structs encountered during processing of other structs Errs []string // accumulating list of error strings -- empty if all good }
Context for given package run