Documentation
¶
Index ¶
- Constants
- func Compile(p *shaderir.Program) (vertexShader, pixelShader, vertexPrelude, pixelPrelude string)
- func Fragment(p *shaderir.Program, name string, cbuffer, texture int) string
- func UniformLanes(p *shaderir.Program) (lanes []int, size int)
- func UniformVariableOffsetsInDwords(program *shaderir.Program) []int
Constants ¶
const UniformVariableBoundaryInDwords = 4
Variables ¶
This section is empty.
Functions ¶
func Fragment ¶
Fragment returns p's fragment entry point as an HLSL (shader model 5) function named name, for a renderer's pixel shader to call, after the helpers, the uniforms (a cbuffer in register b<cbuffer>, laid out as UniformVariableOffsetsInDwords says), the textures (Texture2D T0, T1, ... in registers t<texture> on) and the functions it reaches:
float4 name(float4 position, ...varyings)
func UniformLanes ¶
UniformLanes returns, for each lane of p's uniforms (in order, columns of matrices, elements of arrays: Type.DwordCount of each), its offset in bytes in the cbuffer of Fragment, and the cbuffer's size, a multiple of 16: an array's elements and a matrix's rows start at a register each, and the backend keeps matrices transposed (rows of HLSL are columns of GLSL).
func UniformVariableOffsetsInDwords ¶
UniformVariableOffsetsInDwords returns the offsets of the uniform variables in DWORD units in the HLSL layout.
Types ¶
This section is empty.