Commit 7d091431 by Chris Forbes

Add support for sampling VK_FORMAT_D32_SFLOAT (without depth compare)

Bug: b/131246807 Test: dEQP-VK.*d32_sfloat* Change-Id: I1ec0d8eefa7d46422e9b6dd85766f55ae3f21179 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30488Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 1c462b34
...@@ -257,6 +257,7 @@ namespace sw ...@@ -257,6 +257,7 @@ namespace sw
break; break;
case VK_FORMAT_R32_SFLOAT: case VK_FORMAT_R32_SFLOAT:
case VK_FORMAT_R16_SFLOAT: case VK_FORMAT_R16_SFLOAT:
case VK_FORMAT_D32_SFLOAT:
c.y = Float4(0.0f); c.y = Float4(0.0f);
case VK_FORMAT_R32G32_SFLOAT: case VK_FORMAT_R32G32_SFLOAT:
case VK_FORMAT_R16G16_SFLOAT: case VK_FORMAT_R16G16_SFLOAT:
...@@ -1887,6 +1888,7 @@ namespace sw ...@@ -1887,6 +1888,7 @@ namespace sw
case VK_FORMAT_R32_SFLOAT: case VK_FORMAT_R32_SFLOAT:
case VK_FORMAT_R32_SINT: case VK_FORMAT_R32_SINT:
case VK_FORMAT_R32_UINT: case VK_FORMAT_R32_UINT:
case VK_FORMAT_D32_SFLOAT:
// FIXME: Optimal shuffling? // FIXME: Optimal shuffling?
c.x.x = *Pointer<Float>(buffer[f0] + index[0] * 4); c.x.x = *Pointer<Float>(buffer[f0] + index[0] * 4);
c.x.y = *Pointer<Float>(buffer[f1] + index[1] * 4); c.x.y = *Pointer<Float>(buffer[f1] + index[1] * 4);
......
...@@ -1923,6 +1923,7 @@ bool Format::hasYuvFormat() const ...@@ -1923,6 +1923,7 @@ bool Format::hasYuvFormat() const
case VK_FORMAT_A2B10G10R10_UNORM_PACK32: case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
case VK_FORMAT_A2B10G10R10_UINT_PACK32: case VK_FORMAT_A2B10G10R10_UINT_PACK32:
case VK_FORMAT_E5B9G9R9_UFLOAT_PACK32: case VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:
case VK_FORMAT_D32_SFLOAT:
return false; return false;
default: default:
UNIMPLEMENTED("Format: %d", int(format)); UNIMPLEMENTED("Format: %d", int(format));
...@@ -1977,6 +1978,8 @@ bool Format::isRGBComponent(int component) const ...@@ -1977,6 +1978,8 @@ bool Format::isRGBComponent(int component) const
case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM: case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
case VK_FORMAT_E5B9G9R9_UFLOAT_PACK32: case VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:
return component < 3; return component < 3;
case VK_FORMAT_D32_SFLOAT:
return false;
default: default:
UNIMPLEMENTED("Format: %d", int(format)); UNIMPLEMENTED("Format: %d", int(format));
} }
...@@ -1984,4 +1987,4 @@ bool Format::isRGBComponent(int component) const ...@@ -1984,4 +1987,4 @@ bool Format::isRGBComponent(int component) const
return false; return false;
} }
} // namespace vk } // namespace vk
\ 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