Commit 9219c641 by Chris Forbes

Groundwork for quadlayout support in blit & copy ops

- Correctly claim that VK_FORMAT_S8_UINT has quadlayout. This is the only layout the ROP code understands for stencil. This by itself will cause blitter ops to take it into account. - Clean up the unused but misleading 'useStencil' flag in Blitter::Options - Mark the cases we don't yet support in Image<->Image and Image<->Buffer copies as UNIMPLEMENTED. These will be corrected in followup patches. Bug: b/132156862 Test: dEQP-VK.api.* Test: dEQP-VK.image.* Test: dEQP-VK.renderpass.* Change-Id: I26ccc82a17fb44043ea9624988473e3835069c71 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30770Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 52a3bba8
...@@ -1591,7 +1591,7 @@ namespace sw ...@@ -1591,7 +1591,7 @@ namespace sw
bool doFilter = (filter != VK_FILTER_NEAREST); bool doFilter = (filter != VK_FILTER_NEAREST);
State state(src->getFormat(srcAspect), dst->getFormat(dstAspect), src->getSampleCountFlagBits(), dst->getSampleCountFlagBits(), State state(src->getFormat(srcAspect), dst->getFormat(dstAspect), src->getSampleCountFlagBits(), dst->getSampleCountFlagBits(),
{ doFilter, srcAspect == VK_IMAGE_ASPECT_STENCIL_BIT, doFilter }); { doFilter, doFilter });
state.clampToEdge = (region.srcOffsets[0].x < 0) || state.clampToEdge = (region.srcOffsets[0].x < 0) ||
(region.srcOffsets[0].y < 0) || (region.srcOffsets[0].y < 0) ||
(static_cast<uint32_t>(region.srcOffsets[1].x) > srcExtent.width) || (static_cast<uint32_t>(region.srcOffsets[1].x) > srcExtent.width) ||
......
...@@ -34,10 +34,10 @@ namespace sw ...@@ -34,10 +34,10 @@ namespace sw
struct Options struct Options
{ {
Options() = default; Options() = default;
Options(bool filter, bool useStencil, bool convertSRGB) Options(bool filter, bool convertSRGB)
: writeMask(0xF), clearOperation(false), filter(filter), useStencil(useStencil), convertSRGB(convertSRGB), clampToEdge(false) {} : writeMask(0xF), clearOperation(false), filter(filter), convertSRGB(convertSRGB), clampToEdge(false) {}
Options(unsigned int writeMask) Options(unsigned int writeMask)
: writeMask(writeMask), clearOperation(true), filter(false), useStencil(false), convertSRGB(true), clampToEdge(false) {} : writeMask(writeMask), clearOperation(true), filter(false), convertSRGB(true), clampToEdge(false) {}
union union
{ {
...@@ -54,7 +54,6 @@ namespace sw ...@@ -54,7 +54,6 @@ namespace sw
bool clearOperation : 1; bool clearOperation : 1;
bool filter : 1; bool filter : 1;
bool useStencil : 1;
bool convertSRGB : 1; bool convertSRGB : 1;
bool clampToEdge : 1; bool clampToEdge : 1;
}; };
......
...@@ -122,7 +122,13 @@ bool Format::isDepth() const ...@@ -122,7 +122,13 @@ bool Format::isDepth() const
bool Format::hasQuadLayout() const bool Format::hasQuadLayout() const
{ {
switch(format)
{
case VK_FORMAT_S8_UINT:
return true;
default:
return false; return false;
}
} }
bool Format::isSRGBformat() const bool Format::isSRGBformat() const
......
...@@ -190,6 +190,11 @@ void Image::copyTo(VkImage dstImage, const VkImageCopy& pRegion) ...@@ -190,6 +190,11 @@ void Image::copyTo(VkImage dstImage, const VkImageCopy& pRegion)
int srcBytesPerBlock = srcFormat.bytesPerBlock(); int srcBytesPerBlock = srcFormat.bytesPerBlock();
ASSERT(srcBytesPerBlock == dstFormat.bytesPerBlock()); ASSERT(srcBytesPerBlock == dstFormat.bytesPerBlock());
if (srcFormat.hasQuadLayout() || dstFormat.hasQuadLayout())
{
UNIMPLEMENTED("Quad layout copies");
}
const uint8_t* srcMem = static_cast<const uint8_t*>(getTexelPointer(pRegion.srcOffset, pRegion.srcSubresource)); const uint8_t* srcMem = static_cast<const uint8_t*>(getTexelPointer(pRegion.srcOffset, pRegion.srcSubresource));
uint8_t* dstMem = static_cast<uint8_t*>(dst->getTexelPointer(pRegion.dstOffset, pRegion.dstSubresource)); uint8_t* dstMem = static_cast<uint8_t*>(dst->getTexelPointer(pRegion.dstOffset, pRegion.dstSubresource));
...@@ -286,6 +291,12 @@ void Image::copy(VkBuffer buf, const VkBufferImageCopy& region, bool bufferIsSou ...@@ -286,6 +291,12 @@ void Image::copy(VkBuffer buf, const VkBufferImageCopy& region, bool bufferIsSou
VkImageAspectFlagBits aspect = static_cast<VkImageAspectFlagBits>(region.imageSubresource.aspectMask); VkImageAspectFlagBits aspect = static_cast<VkImageAspectFlagBits>(region.imageSubresource.aspectMask);
Format copyFormat = getFormat(aspect); Format copyFormat = getFormat(aspect);
if (copyFormat.hasQuadLayout())
{
UNIMPLEMENTED("Quad layout copies");
}
VkExtent3D mipLevelExtent = getMipLevelExtent(region.imageSubresource.mipLevel); VkExtent3D mipLevelExtent = getMipLevelExtent(region.imageSubresource.mipLevel);
VkExtent3D imageExtent = imageExtentInBlocks(region.imageExtent, aspect); VkExtent3D imageExtent = imageExtentInBlocks(region.imageExtent, aspect);
VkExtent2D bufferExtent = bufferExtentInBlocks({ imageExtent.width, imageExtent.height }, region); VkExtent2D bufferExtent = bufferExtentInBlocks({ imageExtent.width, imageExtent.height }, region);
...@@ -654,7 +665,7 @@ VkDeviceSize Image::getLayerOffset(VkImageAspectFlagBits aspect, uint32_t mipLev ...@@ -654,7 +665,7 @@ VkDeviceSize Image::getLayerOffset(VkImageAspectFlagBits aspect, uint32_t mipLev
if(is3DSlice()) if(is3DSlice())
{ {
// When the VkImageSubresourceRange structure is used to select a subset of the slices of a 3D // When the VkImageSubresourceRange structure is used to select a subset of the slices of a 3D
// images mip level in order to create a 2D or 2D array image view of a 3D image created with // image's mip level in order to create a 2D or 2D array image view of a 3D image created with
// VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, baseArrayLayer and layerCount specify the first // VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, baseArrayLayer and layerCount specify the first
// slice index and the number of slices to include in the created image view. // slice index and the number of slices to include in the created image view.
ASSERT(samples == VK_SAMPLE_COUNT_1_BIT); ASSERT(samples == VK_SAMPLE_COUNT_1_BIT);
......
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