Changed Vulkan test code in KRCamera::renderPost, preparing for testing the debug font shader.

Fixed bug causing KRMeshManager::KRVBOData::bind to crash when there is no index data.
This commit is contained in:
2022-07-29 01:12:23 -07:00
parent fb6e197f2b
commit f52ddc007f
2 changed files with 4 additions and 5 deletions

View File

@@ -592,10 +592,6 @@ void KRCamera::renderPost(VkCommandBuffer& commandBuffer, KRSurface& surface)
// m_pContext->getTextureManager()->_setActiveTexture(0); // m_pContext->getTextureManager()->_setActiveTexture(0);
// GLDEBUG(glBindTexture(GL_TEXTURE_2D, 0)); // GLDEBUG(glBindTexture(GL_TEXTURE_2D, 0));
// } // }
// TODO - Test code for Vulkan conversion, remove once texture streaming working
// m_pContext->getTextureManager()->selectTexture(0, m_pContext->getTextureManager()->getTexture("font"), 0.0f, KRTexture::TEXTURE_USAGE_UI);
const char *szText = settings.m_debug_text.c_str(); const char *szText = settings.m_debug_text.c_str();
std::string debug_text; std::string debug_text;
@@ -606,6 +602,9 @@ void KRCamera::renderPost(VkCommandBuffer& commandBuffer, KRSurface& surface)
} }
} }
// TODO - Test code for Vulkan conversion, remove once texture streaming working
szText = "Hello, earthlings!";
if(*szText) { if(*szText) {
int row_count = 1; int row_count = 1;
const int MAX_TABS = 5; const int MAX_TABS = 5;

View File

@@ -644,7 +644,7 @@ void KRMeshManager::KRVBOData::bind(VkCommandBuffer& commandBuffer)
VkDeviceSize offsets[] = { 0 }; VkDeviceSize offsets[] = { 0 };
vkCmdBindVertexBuffers(commandBuffer, 0, 1, vertexBuffers, offsets); vkCmdBindVertexBuffers(commandBuffer, 0, 1, vertexBuffers, offsets);
if (m_index_data->getSize() > 0) { if (m_index_data && m_index_data->getSize() > 0) {
// TODO - Support 32-bit index buffers // TODO - Support 32-bit index buffers
vkCmdBindIndexBuffer(commandBuffer, getIndexBuffer(), 0, VK_INDEX_TYPE_UINT16); vkCmdBindIndexBuffer(commandBuffer, getIndexBuffer(), 0, VK_INDEX_TYPE_UINT16);
} }