From d3cfb7f158cb03f3734b7f9f24c5b3f97e18939d Mon Sep 17 00:00:00 2001 From: Pyry Haulos Date: Mon, 4 Jan 2016 13:54:03 -0800 Subject: [PATCH] Fix implicit VkDeviceSize -> size_t conversion warnings Change-Id: Ibb4b63cf0651ddec66a62e39cc1ab1b155cedd13 --- .../vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp | 2 +- external/vulkancts/modules/vulkan/draw/vktDrawBaseClass.cpp | 2 +- external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp | 4 ++-- external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.cpp | 4 ++-- external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp | 8 ++++---- .../modules/vulkan/dynamic_state/vktDynamicStateBaseClass.cpp | 2 +- .../vulkan/dynamic_state/vktDynamicStateImageObjectUtil.cpp | 4 ++-- .../modules/vulkan/dynamic_state/vktDynamicStateRSTests.cpp | 2 +- .../vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp | 4 ++-- .../modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp | 4 ++-- .../modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp | 4 ++-- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp index 24a5477..6cf6bfb 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp @@ -988,7 +988,7 @@ void CopyBufferToBuffer::copyRegionToTextureLevel (tcu::ConstPixelBufferAccess s { deMemcpy((deUint8*) dst.getDataPtr() + region.bufferCopy.dstOffset, (deUint8*) src.getDataPtr() + region.bufferCopy.srcOffset, - region.bufferCopy.size); + (size_t)region.bufferCopy.size); } class BufferToBufferTestCase : public vkt::TestCase diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawBaseClass.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawBaseClass.cpp index 7f19341..815ab2c 100644 --- a/external/vulkancts/modules/vulkan/draw/vktDrawBaseClass.cpp +++ b/external/vulkancts/modules/vulkan/draw/vktDrawBaseClass.cpp @@ -137,7 +137,7 @@ void DrawTestsBaseClass::initialize (void) vk::VK_BUFFER_USAGE_VERTEX_BUFFER_BIT), m_context.getDefaultAllocator(), vk::MemoryRequirement::HostVisible); deUint8* ptr = reinterpret_cast(m_vertexBuffer->getBoundMemory().getHostPtr()); - deMemcpy(ptr, &m_data[0], dataSize); + deMemcpy(ptr, &m_data[0], static_cast(dataSize)); vk::flushMappedMemoryRange(m_vk, device, diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp index 90dd44d..a879dc8 100644 --- a/external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp +++ b/external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp @@ -387,7 +387,7 @@ void Image::readUsingBuffer (vk::VkQueue queue, } deUint8* destPtr = reinterpret_cast(stagingResource->getBoundMemory().getHostPtr()); - deMemcpy(data, destPtr, bufferSize); + deMemcpy(data, destPtr, static_cast(bufferSize)); } tcu::ConstPixelBufferAccess Image::readSurfaceLinear (vk::VkOffset3D offset, @@ -714,7 +714,7 @@ void Image::uploadUsingBuffer (vk::VkQueue queue, BufferCreateInfo stagingBufferResourceCreateInfo(bufferSize, vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT | vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT); stagingResource = Buffer::createAndAlloc(m_vk, m_device, stagingBufferResourceCreateInfo, allocator, vk::MemoryRequirement::HostVisible); deUint8* destPtr = reinterpret_cast(stagingResource->getBoundMemory().getHostPtr()); - deMemcpy(destPtr, data, bufferSize); + deMemcpy(destPtr, data, static_cast(bufferSize)); vk::flushMappedMemoryRange(m_vk, m_device, stagingResource->getBoundMemory().getMemory(), stagingResource->getBoundMemory().getOffset(), bufferSize); { //todo [scygan] get proper queueFamilyIndex diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.cpp index f285250..1b8da19 100644 --- a/external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.cpp +++ b/external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.cpp @@ -141,7 +141,7 @@ tcu::TestStatus DrawIndexed::iterate (void) deUint8* ptr = reinterpret_cast(m_indexBuffer->getBoundMemory().getHostPtr()); - deMemcpy(ptr, &m_indexes[0], dataSize); + deMemcpy(ptr, &m_indexes[0], static_cast(dataSize)); vk::flushMappedMemoryRange(m_vk, m_context.getDevice(), m_vertexBuffer->getBoundMemory().getMemory(), @@ -241,7 +241,7 @@ tcu::TestStatus DrawInstancedIndexed::iterate (void) deUint8* ptr = reinterpret_cast(m_indexBuffer->getBoundMemory().getHostPtr()); - deMemcpy(ptr, &m_indexes[0], dataSize); + deMemcpy(ptr, &m_indexes[0], static_cast(dataSize)); vk::flushMappedMemoryRange(m_vk, m_context.getDevice(), m_vertexBuffer->getBoundMemory().getMemory(), m_vertexBuffer->getBoundMemory().getOffset(), diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp index 56afe4f..2e5b378 100644 --- a/external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp +++ b/external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp @@ -235,8 +235,8 @@ tcu::TestStatus IndirectDraw::iterate (void) deUint8* ptr = reinterpret_cast(m_indirectBuffer->getBoundMemory().getHostPtr()); - deMemcpy(ptr, &m_junkData, m_offsetInBuffer); - deMemcpy((ptr+m_offsetInBuffer), &m_indirectDrawCmd[0], dataSize); + deMemcpy(ptr, &m_junkData, static_cast(m_offsetInBuffer)); + deMemcpy((ptr+m_offsetInBuffer), &m_indirectDrawCmd[0], static_cast(dataSize)); vk::flushMappedMemoryRange(m_vk, m_context.getDevice(), @@ -404,8 +404,8 @@ tcu::TestStatus IndirectDrawInstanced::iterate (void) deUint8* ptr = reinterpret_cast(m_indirectBuffer->getBoundMemory().getHostPtr()); - deMemcpy(ptr, &m_junkData, m_offsetInBuffer); - deMemcpy((ptr + m_offsetInBuffer), &m_indirectDrawCmd[0], dataSize); + deMemcpy(ptr, &m_junkData, static_cast(m_offsetInBuffer)); + deMemcpy((ptr + m_offsetInBuffer), &m_indirectDrawCmd[0], static_cast(dataSize)); vk::flushMappedMemoryRange(m_vk, m_context.getDevice(), diff --git a/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateBaseClass.cpp b/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateBaseClass.cpp index 07beb72..5f968e7 100644 --- a/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateBaseClass.cpp +++ b/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateBaseClass.cpp @@ -142,7 +142,7 @@ void DynamicStateBaseClass::initialize (void) m_context.getDefaultAllocator(), vk::MemoryRequirement::HostVisible); deUint8* ptr = reinterpret_cast(m_vertexBuffer->getBoundMemory().getHostPtr()); - deMemcpy(ptr, &m_data[0], dataSize); + deMemcpy(ptr, &m_data[0], (size_t)dataSize); vk::flushMappedMemoryRange(m_vk, device, m_vertexBuffer->getBoundMemory().getMemory(), diff --git a/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateImageObjectUtil.cpp b/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateImageObjectUtil.cpp index f3d8bdc..504ef88 100644 --- a/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateImageObjectUtil.cpp +++ b/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateImageObjectUtil.cpp @@ -387,7 +387,7 @@ void Image::readUsingBuffer (vk::VkQueue queue, } char* destPtr = reinterpret_cast(stagingResource->getBoundMemory().getHostPtr()); - deMemcpy(data, destPtr, bufferSize); + deMemcpy(data, destPtr, static_cast(bufferSize)); } tcu::ConstPixelBufferAccess Image::readSurfaceLinear (vk::VkOffset3D offset, @@ -714,7 +714,7 @@ void Image::uploadUsingBuffer (vk::VkQueue queue, BufferCreateInfo stagingBufferResourceCreateInfo(bufferSize, vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT | vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT); stagingResource = Buffer::createAndAlloc(m_vk, m_device, stagingBufferResourceCreateInfo, allocator, vk::MemoryRequirement::HostVisible); char* destPtr = reinterpret_cast(stagingResource->getBoundMemory().getHostPtr()); - deMemcpy(destPtr, data, bufferSize); + deMemcpy(destPtr, data, static_cast(bufferSize)); vk::flushMappedMemoryRange(m_vk, m_device, stagingResource->getBoundMemory().getMemory(), stagingResource->getBoundMemory().getOffset(), bufferSize); { //todo [scygan] get proper queueFamilyIndex diff --git a/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateRSTests.cpp b/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateRSTests.cpp index 2447b56..12865c0 100644 --- a/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateRSTests.cpp +++ b/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateRSTests.cpp @@ -237,7 +237,7 @@ protected: m_context.getDefaultAllocator(), vk::MemoryRequirement::HostVisible); deUint8* ptr = reinterpret_cast(m_vertexBuffer->getBoundMemory().getHostPtr()); - deMemcpy(ptr, &m_data[0], dataSize); + deMemcpy(ptr, &m_data[0], static_cast(dataSize)); vk::flushMappedMemoryRange(m_vk, device, m_vertexBuffer->getBoundMemory().getMemory(), diff --git a/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp b/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp index aff0ec6..2914a4f 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp @@ -698,7 +698,7 @@ ImageStoreTestInstance::ImageStoreTestInstance (Context& context, const Allocation& alloc = m_constantsBuffer->getAllocation(); deUint8* const basePtr = static_cast(alloc.getHostPtr()); - memset(alloc.getHostPtr(), 0, constantsBufferSizeBytes); + deMemset(alloc.getHostPtr(), 0, static_cast(constantsBufferSizeBytes)); for (int layerNdx = 0; layerNdx < numLayers; ++layerNdx) { @@ -994,7 +994,7 @@ LoadStoreTestInstance::LoadStoreTestInstance (Context& context, // Copy reference data to buffer for subsequent upload to image. const Allocation& alloc = m_imageBuffer->getAllocation(); - memcpy(alloc.getHostPtr(), m_referenceImage.getAccess().getDataPtr(), m_imageSizeBytes); + deMemcpy(alloc.getHostPtr(), m_referenceImage.getAccess().getDataPtr(), static_cast(m_imageSizeBytes)); flushMappedMemoryRange(vk, device, alloc.getMemory(), alloc.getOffset(), m_imageSizeBytes); } diff --git a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp index 68b0448..5e49143 100644 --- a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp +++ b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp @@ -388,7 +388,7 @@ void Image::readUsingBuffer (vk::VkQueue queue, } char* destPtr = reinterpret_cast(stagingResource->getBoundMemory().getHostPtr()); - deMemcpy(data, destPtr, bufferSize); + deMemcpy(data, destPtr, static_cast(bufferSize)); } tcu::ConstPixelBufferAccess Image::readSurfaceLinear (vk::VkOffset3D offset, @@ -715,7 +715,7 @@ void Image::uploadUsingBuffer (vk::VkQueue queue, BufferCreateInfo stagingBufferResourceCreateInfo(bufferSize, vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT | vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT); stagingResource = Buffer::createAndAlloc(m_vk, m_device, stagingBufferResourceCreateInfo, allocator, vk::MemoryRequirement::HostVisible); char* destPtr = reinterpret_cast(stagingResource->getBoundMemory().getHostPtr()); - deMemcpy(destPtr, data, bufferSize); + deMemcpy(destPtr, data, static_cast(bufferSize)); vk::flushMappedMemoryRange(m_vk, m_device, stagingResource->getBoundMemory().getMemory(), stagingResource->getBoundMemory().getOffset(), bufferSize); { //todo [scygan] get proper queueFamilyIndex diff --git a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp index 6d11449..4f99c20 100644 --- a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp +++ b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp @@ -820,7 +820,7 @@ void OcclusionQueryTestInstance::captureResults (deUint64* retResults, deUint64* const vk::VkDevice device = m_context.getDevice(); const vk::DeviceInterface& vk = m_context.getDeviceInterface(); - std::vector resultsBuffer (m_testVector.queryResultsStride * NUM_QUERIES_IN_POOL); + std::vector resultsBuffer (static_cast(m_testVector.queryResultsStride) * NUM_QUERIES_IN_POOL); if (m_testVector.queryResultsMode == RESULTS_MODE_GET) { @@ -846,7 +846,7 @@ void OcclusionQueryTestInstance::captureResults (deUint64* retResults, deUint64* for (int queryNdx = 0; queryNdx < NUM_QUERIES_IN_POOL; queryNdx++) { - const void* srcPtr = &resultsBuffer[queryNdx * m_testVector.queryResultsStride]; + const void* srcPtr = &resultsBuffer[queryNdx * static_cast(m_testVector.queryResultsStride)]; if (m_testVector.queryResultSize == RESULT_SIZE_32_BIT) { const deUint32* srcPtrTyped = static_cast(srcPtr); -- 2.7.4