Cleanup.
This commit is contained in:
parent
08a31297d5
commit
ab9a0c12b0
@ -293,7 +293,7 @@ namespace Forsyth
|
||||
|
||||
assert(vertexData.activeFaceListSize > 0);
|
||||
uint* begin = &activeFaceList[vertexData.activeFaceListStart];
|
||||
uint* end = &(activeFaceList[vertexData.activeFaceListStart + vertexData.activeFaceListSize - 1]) + 1;
|
||||
uint* end = &(activeFaceList[vertexData.activeFaceListStart + vertexData.activeFaceListSize - 1]) + 1;
|
||||
uint* it = std::find(begin, end, bestFace);
|
||||
assert(it != end);
|
||||
std::swap(*it, *(end-1));
|
||||
|
2
3rdparty/nvtt/nvcore/defsgnucdarwin.h
vendored
2
3rdparty/nvtt/nvcore/defsgnucdarwin.h
vendored
@ -29,7 +29,7 @@
|
||||
#endif
|
||||
|
||||
#define NV_FASTCALL __attribute__((fastcall))
|
||||
#define NV_FORCEINLINE __attribute__((always_inline)) inline
|
||||
#define NV_FORCEINLINE inline
|
||||
#define NV_DEPRECATED __attribute__((deprecated))
|
||||
#define NV_THREAD_LOCAL //ACS: there's no "__thread" or equivalent on iOS/OSX
|
||||
|
||||
|
2
3rdparty/nvtt/nvcore/defsgnuclinux.h
vendored
2
3rdparty/nvtt/nvcore/defsgnuclinux.h
vendored
@ -31,7 +31,7 @@
|
||||
#define NV_FASTCALL __attribute__((fastcall))
|
||||
//#if __GNUC__ > 3
|
||||
// It seems that GCC does not assume always_inline implies inline. I think this depends on the GCC version :(
|
||||
#define NV_FORCEINLINE inline __attribute__((always_inline))
|
||||
#define NV_FORCEINLINE inline
|
||||
//#else
|
||||
// Some compilers complain that inline and always_inline are redundant.
|
||||
//#define NV_FORCEINLINE __attribute__((always_inline))
|
||||
|
2
3rdparty/nvtt/nvcore/defsgnucwin32.h
vendored
2
3rdparty/nvtt/nvcore/defsgnucwin32.h
vendored
@ -19,7 +19,7 @@
|
||||
#endif
|
||||
|
||||
#define NV_FASTCALL __attribute__((fastcall))
|
||||
#define NV_FORCEINLINE __attribute__((always_inline))
|
||||
#define NV_FORCEINLINE inline
|
||||
#define NV_DEPRECATED __attribute__((deprecated))
|
||||
|
||||
#if __GNUC__ > 2
|
||||
|
2
3rdparty/nvtt/nvcore/defsvcwin32.h
vendored
2
3rdparty/nvtt/nvcore/defsvcwin32.h
vendored
@ -48,7 +48,7 @@
|
||||
#endif
|
||||
|
||||
#define NV_NOINLINE __declspec(noinline)
|
||||
#define NV_FORCEINLINE __forceinline
|
||||
#define NV_FORCEINLINE inline
|
||||
|
||||
#define NV_THREAD_LOCAL __declspec(thread)
|
||||
|
||||
|
1
3rdparty/nvtt/nvmath/nvmath.h
vendored
1
3rdparty/nvtt/nvmath/nvmath.h
vendored
@ -36,6 +36,7 @@ namespace nv
|
||||
inline bool isFinite(const float f)
|
||||
{
|
||||
#if defined(_MSC_VER) && _MSC_VER <= 1800
|
||||
(void)f;
|
||||
return true;
|
||||
#else
|
||||
return std::isfinite(f);
|
||||
|
@ -128,6 +128,7 @@ namespace
|
||||
|
||||
uint64_t state;
|
||||
bgfx::TextureHandle th;
|
||||
bgfx::TextureHandle texMissing;
|
||||
|
||||
bgfx::TransientVertexBuffer tvb;
|
||||
uint8_t viewid;
|
||||
@ -263,6 +264,11 @@ namespace
|
||||
, true
|
||||
);
|
||||
|
||||
const bgfx::Memory* mem = bgfx::alloc(4*4*4);
|
||||
uint32_t* bgra8 = (uint32_t*)mem->data;
|
||||
memset(bgra8, 0, 4*4*4);
|
||||
gl->texMissing = bgfx::createTexture2D(4, 4, 0, bgfx::TextureFormat::BGRA8, 0, mem);
|
||||
|
||||
gl->u_scissorMat = bgfx::createUniform("u_scissorMat", bgfx::UniformType::Mat3);
|
||||
gl->u_paintMat = bgfx::createUniform("u_paintMat", bgfx::UniformType::Mat3);
|
||||
gl->u_innerCol = bgfx::createUniform("u_innerCol", bgfx::UniformType::Vec4);
|
||||
@ -444,8 +450,7 @@ namespace
|
||||
memcpy(frag->extent, paint->extent, sizeof(frag->extent) );
|
||||
frag->strokeMult = (width*0.5f + fringe*0.5f) / fringe;
|
||||
|
||||
bgfx::TextureHandle invalid = BGFX_INVALID_HANDLE;
|
||||
gl->th = invalid;
|
||||
gl->th = gl->texMissing;
|
||||
if (paint->image != 0)
|
||||
{
|
||||
tex = glnvg__findTexture(gl, paint->image);
|
||||
@ -460,7 +465,7 @@ namespace
|
||||
else
|
||||
{
|
||||
frag->type = NSVG_SHADER_FILLGRAD;
|
||||
frag->radius = paint->radius;
|
||||
frag->radius = paint->radius;
|
||||
frag->feather = paint->feather;
|
||||
}
|
||||
|
||||
@ -502,7 +507,7 @@ namespace
|
||||
bgfx::setUniform(gl->u_extentRadius, &frag->extent[0]);
|
||||
bgfx::setUniform(gl->u_params, &frag->feather);
|
||||
|
||||
bgfx::TextureHandle handle = BGFX_INVALID_HANDLE;
|
||||
bgfx::TextureHandle handle = gl->texMissing;
|
||||
|
||||
if (image != 0)
|
||||
{
|
||||
@ -976,6 +981,7 @@ namespace
|
||||
}
|
||||
|
||||
bgfx::destroyProgram(gl->prog);
|
||||
bgfx::destroyTexture(gl->texMissing);
|
||||
|
||||
bgfx::destroyUniform(gl->u_scissorMat);
|
||||
bgfx::destroyUniform(gl->u_paintMat);
|
||||
|
Loading…
Reference in New Issue
Block a user