• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# About
2
3Because ANGLE can only generate full HLSL programs after we known the signatures
4between the vertex and pixel stages, we can not immediately call the D3D
5compiler at GL shader compile time. Moreover, we can insert additional
6optimization code right at draw-time.
7
8ESSL 1.00 shaders treat all vertex inputs as floating point. We insert a
9conversion routine to transform un-normalized integer vertex attributes in the
10shader preamble to floating point, saving CPU conversion time.
11
12At draw-time, we also optimize out any unused render target outputs. This
13improved draw call performance significantly on lower spec and integrated
14devices. Changing render target setups may trigger a shader recompile at draw
15time.
16
17# Addendum
18
19ANGLE is not the only program to do this kind of draw-time optimization. A
20common complaint from application developers is that draw calls sometimes
21perform very slowly due to dynamic shader re-compilation. A future design
22direction for ANGLE, when targeting a more modern API, is to perform the vertex
23conversion in a separate shader pass, which would then be linked with another
24compiled shader.
25