bgfx/examples/common/nanovg/vs_nanovg_fill.sc
MooZ d65dac2000
Shaderc OpenGL fixes. (#2317)
* Reworked profile cli argument.

* Added missing GLSL profile.

* Fixed essl shader preambule.

* Fixed uniform "parsing" and hlsl profiles.

* Reworked hlsl profiles.

* Fixed missing extension for gl_FragDepth.

* Cleanup.

* Removed version preamble and reverted shadow samplers translation.

* Fixed HLSL profile tests.
2020-12-28 11:24:49 -08:00

24 lines
530 B
Python

$input a_position, a_texcoord0
$output v_position, v_texcoord0
#include "../common.sh"
#define NEED_HALF_TEXEL (BGFX_SHADER_LANGUAGE_HLSL < 400)
uniform vec4 u_viewSize;
#if NEED_HALF_TEXEL
uniform vec4 u_halfTexel;
#endif // NEED_HALF_TEXEL
void main()
{
#if !NEED_HALF_TEXEL
const vec4 u_halfTexel = vec4_splat(0.0);
#endif // !NEED_HALF_TEXEL
v_position = a_position;
v_texcoord0 = a_texcoord0+u_halfTexel.xy;
gl_Position = vec4(2.0*v_position.x/u_viewSize.x - 1.0, 1.0 - 2.0*v_position.y/u_viewSize.y, 0.0, 1.0);
}