Commit Graph

145 Commits

Author SHA1 Message Date
Olli Wang
4bdaf42ccf Updates NanoVG to the latest commit.
This commit updates NanoVG's bgfx backend to match the original NanoVG's latest commit, which has significant changes about composite operation implementation as mentioned in pull request https://github.com/memononen/nanovg/pull/312.
2017-03-23 00:23:20 +08:00
Branimir Karadžić
a60095c1b6 Updated shaders. 2017-03-11 15:02:37 -08:00
Branimir Karadžić
65f2b998ff Updated shaders. 2017-02-24 19:43:40 -08:00
Branimir Karadžić
d72aff9e5d Rebuilt shaders. 2017-02-11 10:30:16 -08:00
Branimir Karadžić
64922762df Cleanup. 2017-02-06 16:22:08 -08:00
Branimir Karadžić
b9b8a6e871 Cleanup. 2017-01-04 08:34:25 -08:00
Branimir Karadžić
3b83f53ab1 Happy New Year! 2017-01-01 00:18:41 -08:00
Branimir Karadžić
58e46330cd Updated embedded shaders. 2016-12-05 16:55:49 -08:00
Branimir Karadžić
4afd337d5e Cleanup. 2016-12-04 19:52:48 -08:00
Branimir Karadžić
eaa73c9b2e Rebuilt shaders. 2016-10-31 22:13:21 -07:00
Branimir Karadžić
3cc01f4ddb Fixed GCC-6 warnings. 2016-10-20 23:16:18 -07:00
Branimir Karadžić
69c5902453 Rebuilt shaders. 2016-09-30 20:03:41 -07:00
Branimir Karadžić
44de6fb789 Cleanup. 2016-09-08 22:03:42 -07:00
Branimir Karadžić
374fe6f845 Updated NanoVG. 2016-09-08 21:19:47 -07:00
Branimir Karadžić
f9486780c2 Updated NaCl toolchain to v49. 2016-09-02 21:25:01 -07:00
Branimir Karadžić
8809a190ef Fixed calcTextureSize. 2016-08-22 14:17:08 -07:00
Branimir Karadžić
7537b705e5 GL: Added support for texture array. 2016-08-21 14:03:16 -07:00
Branimir Karadžić
c98be90bf5 WIP: Texture array support. 2016-08-19 21:05:37 -07:00
Branimir Karadžić
a488207c81 Cleanup. 2016-08-10 21:51:29 -07:00
Branimir Karadžić
2c861766e8 Switch iffy translation code to lookup table translation. 2016-08-10 20:36:21 -07:00
Olli Wang
1804ba77c1 Updates nanovg to support global composite operation. (#877)
This commit updates bgfx's NanoVG codebase to adapt the latest NanoVG commit since I've implemented blending support for the original NanoVG and there is no need of `nvgState()` anymore.
2016-08-10 20:15:31 -07:00
Branimir Karadžić
9f7386e53a Rebuilt NanoVG embedded shader. 2016-08-10 10:59:07 -07:00
Branimir Karadžić
d7026e8f0c Reverted embedded shader. 2016-08-09 22:54:18 -07:00
Olli Wang
b9810aca70 Updates nanovg backend to adopt premultiplied alpha. (#873)
This commit updates nanovg's bgfx backend to adopt premultiplied alpha as the default blending mode just like the original nanovg. Both the fragment shader and the `glnvg__convertPaint()` function are updated to match the original nanovg counterpart.

However, the binary file of the fragment shader is built on Mac so DirectX support is missing.
2016-08-09 22:44:04 -07:00
Branimir Karadžić
c25a273e29 Cleanup. 2016-08-08 09:23:42 -07:00
Olli Wang
f11d954bc1 Implements nanovg's framebuffer helper functions. (#869)
This commit ports nanovg's helper functions for rendering stuff in framebuffer defined in `nanovg_gl_utils.h`. Also, a new `nvgState()` function is created for bgfx backend so it is possible to blend between framebuffers, which feature is long requested but not yet supported in original nanovg. The `nvgState()` function can be called between `nvgBeginFrame()` and `nvgEndFrame()`.
2016-08-08 08:33:37 -07:00
Olli Wang
fa73aa4b09 Adds iOS device's Retina screen support for nanovg. (#865)
This commit fixes the bug that the bgfx does not respect the `devicePixelRatio` parameter passed to nanovg's `nvgBeginFrame()` function. The problem is caused by the `bgfx::setViewRect()` call defined in the `nvgRenderViewport()` function, as it should take size in consideration of the `devicePixelRatio` value.

However, this commit does not fix nanovg's example app because currently there is no easy way to pass the scale value to the `ExampleNanoVG::update()` method as it calls `nvgBeginFrame()`.
2016-08-05 09:50:02 -07:00
Olli Wang
c960c46564 Moves additional bgfx nanovg functions to a separate header file.
This commit moves the additional nanovg functions for bgfx to a separate header file, so it is possible to compile the original nanovg  source files with bgfx in a custom build environment.
2016-08-05 17:26:06 +08:00
Branimir Karadžić
e46135da8c Added ability to programmatically capture frame with RenderDoc. 2016-06-02 18:46:43 -07:00
Branimir Karadžić
21518f201f texturec: Preserve precision of input texture. 2016-06-02 16:38:26 -07:00
Branimir Karadžić
2b77088a38 Cleanup. 2016-03-05 11:03:52 -08:00
Branimir Karadžić
dc46b1a36b Cleanup. 2016-02-21 13:59:38 -08:00
Branimir Karadžić
608e038b96 Manually merged PR #676. 2016-02-08 12:53:19 -08:00
Branimir Karadžić
728a8ee4e5 NanoVG: Added ability to pass custom allocator. 2016-02-07 18:58:17 -08:00
Branimir Karadžić
a972d1fef0 Tools cleanup. 2016-01-30 16:15:25 -08:00
Branimir Karadžić
6af72ce686 nanovg: Allow texture update after creation. 2016-01-25 09:26:14 -08:00
Branimir Karadžić
ab9a0c12b0 Cleanup. 2016-01-12 13:20:07 -08:00
Branimir Karadžić
4bb2b623d3 Happy New Year! 2016-01-01 00:11:04 -08:00
Branimir Karadžić
fac71e9e35 Fixed issue #569. 2015-12-08 16:09:30 -08:00
Branimir Karadžić
46822b242a Updated NanoVG. 2015-12-05 11:00:11 -08:00
Branimir Karadžić
35f9c78080 Cleanup. 2015-11-28 16:13:26 -08:00
Branimir Karadžić
f5d9c28f03 Fixed clang warning. 2015-11-23 19:05:52 -08:00
Branimir Karadžić
6e7de6f122 NanoVG: Fixed #519 crash. 2015-11-02 18:59:01 -08:00
Branimir Karadžić
69fd07a590 Rebuilt shaders. 2015-10-24 22:47:24 -07:00
Branimir Karadžić
6aa6efda12 Added initial texture read back support. 2015-10-20 16:32:08 -07:00
Branimir Karadžić
0fba3c137e Added checks for redundant uniform sets. 2015-09-25 20:54:40 -07:00
Branimir Karadžić
d1f99896ec Moved public header files into bgfx subdirectory.
grep -rl '<bgfx.h>' . | xargs sed -i 's@<bgfx.h>@<bgfx/bgfx.h>@g'
2015-09-18 20:19:12 -07:00
Branimir Karadžić
6e9ed09d19 Rebuilt shaders. 2015-09-03 20:00:15 -07:00
Branimir Karadžić
4470f7097c Fixed HLSL reflection for samplers. 2015-09-01 16:44:11 -07:00
Kocsis Attila
5d5df77318 Metal backend: initial commit 2015-08-14 15:12:44 +02:00
Branimir Karadžić
1fa85ccf27 Replaced bgfx::setProgram function with bgfx::submit argument. Added bgfx::touch and bgfx::getStats. 2015-07-22 18:05:11 -07:00
Branimir Karadžić
921a315c4d Cleanup. 2015-07-16 20:28:43 -07:00
Branimir Karadžić
ff01992cb7 Refactored uniform types. 2015-05-28 15:27:00 -07:00
Branimir Karadžić
dedf75a89b Rebuilt shaders. 2015-04-12 22:26:40 -07:00
Branimir Karadžić
57cfeffb8d Rebuilt shaders. 2015-04-11 18:18:43 -07:00
Branimir Karadžić
a042d6f7b9 Fixed decoding of unsupported RGBA8/BGRA8 formats on D3D9/GL. 2015-04-11 00:17:49 -07:00
Branimir Karadžić
c7eb016ae0 Rebuilt shaders. 2015-04-10 21:09:46 -07:00
Mike Popoloski
5f4bd7700e Recompiling shaders. Shouldn't have any effect on runtime behavior. 2015-04-10 22:49:39 -04:00
Branimir Karadžić
1824a3f5bd Cleanup. 2015-04-08 14:16:02 -07:00
Branimir Karadžić
2e6ac0ca49 Silence -Wshadow warning in stb_image. 2015-04-04 16:23:50 -07:00
Branimir Karadžić
81d6876067 Cleanup. 2015-03-31 09:44:51 -07:00
Dario Manesku
4360841989 Imgui can be now downscaled to fit small resolution screens. 2015-03-16 13:59:28 +01:00
Dario Manesku
5cca4686e2 NVG now uses same viewId as imgui. 2015-03-12 20:28:07 +01:00
Branimir Karadžić
13ac805085 Cleanup. 2015-02-16 21:58:13 -08:00
Miodrag Milanovic
93ea52c23a Compile fixes for Apple GCC 4.2 2015-02-15 13:55:45 +01:00
Branimir Karadžić
bbeb0a3ffe Updated to latest ocornut imgui. 2015-01-22 21:01:09 -08:00
Branimir Karadžić
649d7f74d2 Updated copyright year. 2015-01-02 14:43:11 -08:00
Branimir Karadžić
c25dd466be Updated copyright year. 2015-01-01 15:04:46 -08:00
Branimir Karadžić
878cbd41bd shaderc: Added shader strip. 2014-12-05 20:28:15 -08:00
Branimir Karadzic
36e02361d1 Fixed bad include path. 2014-11-20 16:51:14 -08:00
Branimir Karadžić
cf7b1542d2 Merge pull request #187 from SmilyOrg/patch-2
Fix for crash with too many lines / vertices
2014-11-20 16:48:32 -08:00
Miha Lunar
e5da24f490 Fix for crash when too many lines / vertices
When a lot of lines are being drawn, this can overflow the vertex buffer, causing a crash in `nvgRenderFlush`. While the underlying code handles this case in an okay manner (truncating the vertex buffer instead of crashing), the `nvgRenderFlush` code is missing a check for this case, causing it to think it has more space than was allocated.

I tried to fix it with multiple buffers as mentioned in #160, however it seems more complex than it appears. This fix just makes it truncate the output according to the actual allocated amount of bytes in the vertex buffer, so it doesn't crash at least.
2014-11-21 00:57:33 +01:00
Miha Lunar
6c6a550fd6 Fix for convexFill crash when path fillCount is 0
In our situation, the crash happened due to the view dimensions being reset to 0x0 after minimizing the window. This translated to fillCount of a path ending up at 0, which makes `fan` crash as it computes number of tris to -2 of fillCount. Since `numTris` is unsigned, this could lead to terrible things, but luckily it crashes soon.

There might be a cleaner fix for this further up the call stack, but this is a good solution in the meanwhile.
2014-11-21 00:39:04 +01:00
Branimir Karadžić
6c7589c0c9 Cleanup. 2014-11-17 21:35:53 -08:00
Branimir Karadzic
d54063bfd5 Fixed GCC/Clang warnings. 2014-11-17 08:33:14 -08:00
Branimir Karadžić
ff44d73480 Updated NanoVG and Blendish. 2014-11-16 18:59:17 -08:00
Branimir Karadžić
4a1a31b538 Updated glsl-optimizer. 2014-10-11 12:32:43 -07:00
Miha Lunar
78746c8972 Merged fixed allocation for paths from nanovg 2014-09-25 13:23:51 +02:00
Branimir Karadžić
c627e55451 Fixed issue #149. 2014-09-13 21:23:23 -07:00
Branimir Karadžić
eec4ae9847 Fixing paths. 2014-09-10 21:48:08 -07:00
Branimir Karadžić
ae9da4b2a6 Fixed alignment. 2014-08-25 19:32:20 -07:00
Branimir Karadžić
612eb2f7ed Fixed uniform leak at shutdown. 2014-08-23 10:37:34 -07:00
Branimir Karadžić
66890595b9 Added serialization for vertex decl attribute enums. Binary format changes. Rebuilt all meshes and shaders. 2014-08-17 17:20:15 -07:00
bkaradzic
c56b7ad261 Fixed GCC warnings. 2014-08-15 19:14:17 -07:00
Branimir Karadžić
e782f2f873 Fixed preprocessor bug that trucnates macro arguments to first character when concatenating them. 2014-07-28 20:15:01 -07:00
Branimir Karadžić
2b147081c4 Changed imguiSlider argument. 2014-06-29 21:53:23 -07:00
Dario Manesku
4cc0d8e777 Added setViewRect inside nanovg. 2014-06-23 07:59:09 +01:00
Dario Manesku
5084649832 Added imguiColorWheel(). 2014-06-23 06:34:42 +01:00
Branimir Karadžić
0728b91bfa Workaround C4127 MSVC level 4 warning. 2014-06-08 20:57:39 -07:00
Branimir Karadžić
bba2ef8031 Added predefined uniforms for inverted view/proj/viewproj matrices.
shaderc: Added raw shader support.
shaderc: Fixed uniform types.
2014-05-10 20:51:54 -07:00
Branimir Karadžić
5dca5791c5 Fixed half texel offset in NanoVG for DX9. 2014-04-29 19:52:42 -07:00
Branimir Karadžić
ed955ed149 Fixed VS2012 compile error. 2014-04-28 19:45:49 -07:00
bkaradzic
0ca66108b4 Fixed GCC errors. 2014-04-27 18:22:07 -07:00
bkaradzic
5b31ef54a2 Fixed compile error. 2014-04-27 08:49:09 -07:00
Branimir Karadžić
1cda6159c7 Added 20-nanovg example. 2014-04-26 23:50:11 -07:00