diff options
author | Peter Harris <pharris@opentext.com> | 2014-03-10 13:03:51 -0400 |
---|---|---|
committer | Peter Harris <pharris@opentext.com> | 2014-03-10 13:03:51 -0400 |
commit | a8d6bbf19a3e6c57c8b902cbd994bafe63591078 (patch) | |
tree | 6547c2fa2e10ca840e6df30348e4a8077cfc336f /core_glyphs.hlvs | |
parent | c404049a52f7999d716bc0e2cf6c7af30c62f50f (diff) |
So they can be studied without needing to run the generator.
Diffstat (limited to 'core_glyphs.hlvs')
-rw-r--r-- | core_glyphs.hlvs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/core_glyphs.hlvs b/core_glyphs.hlvs new file mode 100644 index 0000000..64ce291 --- /dev/null +++ b/core_glyphs.hlvs @@ -0,0 +1,46 @@ +/* Automatically generated file; do not edit */ + +// This vertex shader takes inputs in integer pixels, as well as +// a glyph position in integer texels, and outputs +// in floating point coordinates understood by the DX drawing system. + +struct VS_INPUT { + uint2 pos :POSITION; + uint2 glyph_pos :TEXCOORD0; +}; + +struct VS_OUTPUT { + float2 tile_pos :TEXCOORD0; + float2 glyph_pos :TEXCOORD1; + float2 out_pos :TEXCOORD2; + float4 pos :SV_POSITION; +}; + +cbuffer info :register(b0) { + float2 wh; // Half width, half height of target drawable + uint2 tile_offset; + uint2 stipple_size; + uint2 clip_offset; // unused (glyph pos is taken from input.glyph_pos) + uint2 clip_size; // size of the entire glyph atlas +} + +cbuffer output_info :register(b1) { + uint2 out_offset; +} + +VS_OUTPUT main(VS_INPUT input) +{ + VS_OUTPUT output; + output.pos.x = input.pos.x / wh.x - 1.0f; + output.pos.y = -(input.pos.y / wh.y - 1.0f); + output.pos.z = 0; + output.pos.w = 1; + + output.tile_pos = input.pos - tile_offset; + output.tile_pos /= (float2)stipple_size; + + output.glyph_pos = input.glyph_pos / (float2)clip_size; + output.out_pos = input.pos - out_offset; + + return output; +} |