From 289afdc7626499080c65bd06f94d5d9fd35182f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 10 Aug 2019 08:00:06 -0700 Subject: [PATCH] Removed todos. --- src/bgfx.cpp | 4 +++- src/glcontext_html5.cpp | 12 ++++++++---- src/renderer_vk.cpp | 7 +++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 2f0183928..9691bf2f8 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -763,7 +763,9 @@ namespace bgfx uint32_t ch = line->character; uint8_t attr = line->attribute; if (ch > 0xff) - ch = 0; // todo: render unicode code point , ch > 255) + { + ch = 0; + } if (0 != (ch|attr) && (' ' != ch || 0 != (attr&0xf0) ) ) diff --git a/src/glcontext_html5.cpp b/src/glcontext_html5.cpp index 07fd35adb..c9f15922e 100644 --- a/src/glcontext_html5.cpp +++ b/src/glcontext_html5.cpp @@ -85,19 +85,24 @@ namespace bgfx { namespace gl if (m_primary) { if (m_current == m_primary) + { m_current = NULL; + } + BX_DELETE(g_allocator, m_primary); m_primary = NULL; } } void GlContext::resize(uint32_t _width, uint32_t _height, uint32_t /* _flags */) - { + { if (m_primary == NULL) + { return; + } emscripten_set_canvas_element_size(m_primary->m_canvas, (int) _width, (int) _height); - } + } SwapChainGL* GlContext::createSwapChain(void* _nwh) { @@ -108,8 +113,7 @@ namespace bgfx { namespace gl s_attrs.stencil = true; s_attrs.enableExtensionsByDefault = true; - // let emscripten figure out the best WebGL context to create - // TODO this isn't necessarily the right thing, I don't think the code actually does the fallback like it should + // let emscripten figure out the best WebGL context to create s_attrs.majorVersion = 0; s_attrs.majorVersion = 0; diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index ae7cb6234..3ea4767d3 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -379,7 +379,7 @@ VK_IMPORT_DEVICE for (uint32_t inst = 0; inst < _numInstanceData; ++inst) { - inputAttrib->location = numAttribs; // TODO: is this usable for all case? what if the order of i_dataN is swizzled? + inputAttrib->location = numAttribs; inputAttrib->binding = numBindings; inputAttrib->format = VK_FORMAT_R32G32B32A32_SFLOAT; inputAttrib->offset = inst * 16; @@ -3198,7 +3198,6 @@ VK_IMPORT_DEVICE uint32_t borderColor = ((_samplerFlags & BGFX_SAMPLER_BORDER_COLOR_MASK) >> BGFX_SAMPLER_BORDER_COLOR_SHIFT); if (borderColor > 0) { - // TODO: set borderColor properly sci.borderColor = VK_BORDER_COLOR_INT_OPAQUE_WHITE; } @@ -5987,7 +5986,7 @@ BX_UNUSED(currentSamplerStateIdx); VkDeviceSize offset = 0; vkCmdBindVertexBuffers(m_commandBuffer - , 0 // TODO: multiple vertex stream + , 0 , 1 , &vb.m_buffer , &offset @@ -5998,7 +5997,7 @@ BX_UNUSED(currentSamplerStateIdx); VkDeviceSize instanceOffset = draw.m_instanceDataOffset; VertexBufferVK& instanceBuffer = m_vertexBuffers[draw.m_instanceDataBuffer.idx]; vkCmdBindVertexBuffers(m_commandBuffer - , 1 // TODO: multiple vertex stream + , 1 , 1 , &instanceBuffer.m_buffer , &instanceOffset