Standardise on uint32_t for width/height storage, cast to int32_t

This commit is contained in:
baldurk
2016-02-07 18:50:52 +01:00
parent 0bdd186550
commit b86389d3ca
4 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -1032,7 +1032,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
RDCASSERT(vkr == VK_SUCCESS);
{
int width = FONT_TEX_WIDTH, height = FONT_TEX_HEIGHT;
uint32_t width = FONT_TEX_WIDTH, height = FONT_TEX_HEIGHT;
VkImageCreateInfo imInfo = {
VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, NULL, 0,
@@ -1137,7 +1137,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
RDCASSERT(pData != NULL);
for(int32_t row = 0; row < height; row++)
for(uint32_t row = 0; row < height; row++)
{
memcpy(pData, buf, width);
pData += layout.rowPitch;
+3 -3
View File
@@ -35,7 +35,7 @@ struct TextPrintState
VkCommandBuffer cmd;
VkRenderPass rp;
VkFramebuffer fb;
int32_t w, h;
uint32_t w, h;
};
struct MeshDisplayPipelines
@@ -255,8 +255,8 @@ class VulkanDebugManager
void PatchFixedColShader(VkShaderModule &mod, float col[4]);
void RenderTextInternal(const TextPrintState &textstate, float x, float y, const char *text);
static const int FONT_TEX_WIDTH = 256;
static const int FONT_TEX_HEIGHT = 128;
static const uint32_t FONT_TEX_WIDTH = 256;
static const uint32_t FONT_TEX_HEIGHT = 128;
LogState m_State;
+5 -5
View File
@@ -1352,15 +1352,15 @@ void VulkanReplay::RenderHighlightBox(float w, float h, float scale)
{ 1.0f, 1.0f, 1.0f, 1.0f }
};
int32_t sz = int32_t(scale);
uint32_t sz = uint32_t(scale);
VkOffset2D tl = { int32_t(w/2.0f + 0.5f), int32_t(h/2.0f + 0.5f) };
VkClearRect rect[4] = {
{ { { tl.x, tl.y }, { 1, sz }, }, 0, 1 },
{ { { tl.x+sz, tl.y }, { 1, sz+1 }, }, 0, 1 },
{ { { tl.x, tl.y }, { sz, 1 }, }, 0, 1 },
{ { { tl.x, tl.y+sz }, { sz, 1 }, }, 0, 1 },
{ { { tl.x , tl.y }, { 1, sz }, }, 0, 1 },
{ { { tl.x+(int32_t)sz, tl.y }, { 1, sz+1 }, }, 0, 1 },
{ { { tl.x , tl.y }, { sz, 1 }, }, 0, 1 },
{ { { tl.x , tl.y+(int32_t)sz }, { sz, 1 }, }, 0, 1 },
};
// inner
+2 -2
View File
@@ -195,7 +195,7 @@ class VulkanReplay : public IReplayDriver
WINDOW_HANDLE_DECL
int32_t width, height;
uint32_t width, height;
VkSurfaceKHR surface;
VkSwapchainKHR swap;
@@ -227,7 +227,7 @@ class VulkanReplay : public IReplayDriver
uint64_t m_OutputWinID;
uint64_t m_ActiveWinID;
bool m_BindDepth;
int m_DebugWidth, m_DebugHeight;
uint32_t m_DebugWidth, m_DebugHeight;
// simple cache for when we need buffer data for highlighting
// vertices, typical use will be lots of vertices in the same