Commit 33e05bab by Luc Ferron Committed by Commit Bot

Vulkan: Bugfix in TextureVk::setSubImage and DynamicBuffer

Bug 1) The offset wasn't plumbed through for setSubImage. Bug 2) The DynamicBuffer allocation sometime allocates a bit more than requested, but we were using the size requested as the next offset instead of the actual allocated size. This could get us in a situation in certain corner cases where the next allocation would be done on the said buffer instead of using a new allocation as it should. Also enables a bunch of new texture_specification_* tests that were unable to run successfully without these 2 bug fixes. Found a weird issue on WIN AMD only and suppressed these tests for now. Will investigate part of the same bug number as a separate change. Bug: angleproject:2495 Bug: angleproject:2492 Change-Id: I490b1bf2d1795b7a1033365e29eac12a8bc50bff Reviewed-on: https://chromium-review.googlesource.com/1024380Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
parent 66410530
...@@ -74,6 +74,7 @@ void PixelBuffer::release(RendererVk *renderer) ...@@ -74,6 +74,7 @@ void PixelBuffer::release(RendererVk *renderer)
gl::Error PixelBuffer::stageSubresourceUpdate(ContextVk *contextVk, gl::Error PixelBuffer::stageSubresourceUpdate(ContextVk *contextVk,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Extents &extents, const gl::Extents &extents,
const gl::Offset &offset,
const gl::InternalFormat &formatInfo, const gl::InternalFormat &formatInfo,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
GLenum type, GLenum type,
...@@ -131,7 +132,7 @@ gl::Error PixelBuffer::stageSubresourceUpdate(ContextVk *contextVk, ...@@ -131,7 +132,7 @@ gl::Error PixelBuffer::stageSubresourceUpdate(ContextVk *contextVk,
copy.imageSubresource.baseArrayLayer = index.hasLayer() ? index.getLayerIndex() : 0; copy.imageSubresource.baseArrayLayer = index.hasLayer() ? index.getLayerIndex() : 0;
copy.imageSubresource.layerCount = index.getLayerCount(); copy.imageSubresource.layerCount = index.getLayerCount();
gl_vk::GetOffset(gl::Offset(), &copy.imageOffset); gl_vk::GetOffset(offset, &copy.imageOffset);
gl_vk::GetExtent(extents, &copy.imageExtent); gl_vk::GetExtent(extents, &copy.imageExtent);
mSubresourceUpdates.emplace_back(bufferHandle, copy); mSubresourceUpdates.emplace_back(bufferHandle, copy);
...@@ -241,8 +242,8 @@ gl::Error TextureVk::setImage(const gl::Context *context, ...@@ -241,8 +242,8 @@ gl::Error TextureVk::setImage(const gl::Context *context,
// Handle initial data. // Handle initial data.
if (pixels) if (pixels)
{ {
ANGLE_TRY(mPixelBuffer.stageSubresourceUpdate(contextVk, index, size, formatInfo, unpack, ANGLE_TRY(mPixelBuffer.stageSubresourceUpdate(contextVk, index, size, gl::Offset(),
type, pixels)); formatInfo, unpack, type, pixels));
} }
return gl::NoError(); return gl::NoError();
...@@ -258,9 +259,9 @@ gl::Error TextureVk::setSubImage(const gl::Context *context, ...@@ -258,9 +259,9 @@ gl::Error TextureVk::setSubImage(const gl::Context *context,
{ {
ContextVk *contextVk = vk::GetImpl(context); ContextVk *contextVk = vk::GetImpl(context);
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(format, type); const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(format, type);
ANGLE_TRY(mPixelBuffer.stageSubresourceUpdate(contextVk, index, ANGLE_TRY(mPixelBuffer.stageSubresourceUpdate(
gl::Extents(area.width, area.height, area.depth), contextVk, index, gl::Extents(area.width, area.height, area.depth),
formatInfo, unpack, type, pixels)); gl::Offset(area.x, area.y, area.z), formatInfo, unpack, type, pixels));
return gl::NoError(); return gl::NoError();
} }
......
...@@ -29,6 +29,7 @@ class PixelBuffer final : angle::NonCopyable ...@@ -29,6 +29,7 @@ class PixelBuffer final : angle::NonCopyable
gl::Error stageSubresourceUpdate(ContextVk *contextVk, gl::Error stageSubresourceUpdate(ContextVk *contextVk,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Extents &extents, const gl::Extents &extents,
const gl::Offset &offset,
const gl::InternalFormat &formatInfo, const gl::InternalFormat &formatInfo,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
GLenum type, GLenum type,
......
...@@ -161,7 +161,9 @@ Error DynamicBuffer::allocate(RendererVk *renderer, ...@@ -161,7 +161,9 @@ Error DynamicBuffer::allocate(RendererVk *renderer,
ANGLE_TRY(mBuffer.init(device, createInfo)); ANGLE_TRY(mBuffer.init(device, createInfo));
ANGLE_TRY(AllocateBufferMemory(renderer, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, &mBuffer, ANGLE_TRY(AllocateBufferMemory(renderer, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, &mBuffer,
&mMemory, &mSize)); &mMemory, &sizeToAllocate));
mSize = sizeToAllocate;
ANGLE_TRY(mMemory.map(device, 0, mSize, 0, &mMappedMemory)); ANGLE_TRY(mMemory.map(device, 0, mSize, 0, &mMappedMemory));
mNextWriteOffset = 0; mNextWriteOffset = 0;
mLastFlushOffset = 0; mLastFlushOffset = 0;
......
...@@ -201,8 +201,6 @@ ...@@ -201,8 +201,6 @@
2161 VULKAN : dEQP-GLES2.functional.texture.filtering.nearest_mipmap_* = SKIP 2161 VULKAN : dEQP-GLES2.functional.texture.filtering.nearest_mipmap_* = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.filtering.linear_mipmap_* = SKIP 2161 VULKAN : dEQP-GLES2.functional.texture.filtering.linear_mipmap_* = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.mipmap.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.texture.mipmap.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.specification.basic_texsubimage2d.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.specification.texsubimage2d_* = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.specification.basic_copytex* = SKIP 2161 VULKAN : dEQP-GLES2.functional.texture.specification.basic_copytex* = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.completeness.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.texture.completeness.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.texture.vertex.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.texture.vertex.* = SKIP
...@@ -315,3 +313,4 @@ ...@@ -315,3 +313,4 @@
2161 VULKAN : dEQP-GLES2.functional.default_vertex_attrib.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.default_vertex_attrib.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.lifetime.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.lifetime.* = SKIP
2161 VULKAN : dEQP-GLES2.functional.debug_marker.* = SKIP 2161 VULKAN : dEQP-GLES2.functional.debug_marker.* = SKIP
2492 VULKAN WIN AMD : dEQP-GLES2.functional.texture.specification.texsubimage2d_align.2d_* = SKIP
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment