Commit 2e7cdd8a by Nicolas Capens Committed by Nicolas Capens

Implement B10G11R11_UFLOAT_PACK32 uniform texel buffer support

VK_FORMAT_B10G11R11_UFLOAT_PACK32 is a mandatory uniform texel buffer format, which we claimed support for, but the implementation was missing. Bug: b/159561781 Change-Id: I47a1aa3d4f371603e4d97e85526e10677753b9ca Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/46008 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent 3121585a
...@@ -872,6 +872,12 @@ SpirvShader::EmitResult SpirvShader::EmitImageRead(InsnIterator insn, EmitState ...@@ -872,6 +872,12 @@ SpirvShader::EmitResult SpirvShader::EmitImageRead(InsnIterator insn, EmitState
dst.move(2, SIMD::Float((packed[0]) & SIMD::Int(0x1F)) * SIMD::Float(1.0f / 0x1F)); dst.move(2, SIMD::Float((packed[0]) & SIMD::Int(0x1F)) * SIMD::Float(1.0f / 0x1F));
dst.move(3, SIMD::Float((packed[0] >> 15) & SIMD::Int(0x1))); dst.move(3, SIMD::Float((packed[0] >> 15) & SIMD::Int(0x1)));
break; break;
case VK_FORMAT_B10G11R11_UFLOAT_PACK32:
dst.move(0, halfToFloatBits((packed[0] << 4) & SIMD::Int(0x7FF0)));
dst.move(1, halfToFloatBits((packed[0] >> 7) & SIMD::Int(0x7FF0)));
dst.move(2, halfToFloatBits((packed[0] >> 17) & SIMD::Int(0x7FE0)));
dst.move(3, SIMD::Float(1));
break;
default: default:
UNSUPPORTED("VkFormat %d", int(vkFormat)); UNSUPPORTED("VkFormat %d", int(vkFormat));
break; break;
......
...@@ -791,6 +791,7 @@ void PhysicalDevice::getFormatProperties(Format format, VkFormatProperties *pFor ...@@ -791,6 +791,7 @@ void PhysicalDevice::getFormatProperties(Format format, VkFormatProperties *pFor
switch(format) switch(format)
{ {
// Vulkan 1.1 mandatory
case VK_FORMAT_R8_UNORM: case VK_FORMAT_R8_UNORM:
case VK_FORMAT_R8_SNORM: case VK_FORMAT_R8_SNORM:
case VK_FORMAT_R8_UINT: case VK_FORMAT_R8_UINT:
...@@ -810,8 +811,6 @@ void PhysicalDevice::getFormatProperties(Format format, VkFormatProperties *pFor ...@@ -810,8 +811,6 @@ void PhysicalDevice::getFormatProperties(Format format, VkFormatProperties *pFor
case VK_FORMAT_A8B8G8R8_SINT_PACK32: case VK_FORMAT_A8B8G8R8_SINT_PACK32:
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_A2R10G10B10_UNORM_PACK32:
case VK_FORMAT_A2R10G10B10_UINT_PACK32:
case VK_FORMAT_R16_UINT: case VK_FORMAT_R16_UINT:
case VK_FORMAT_R16_SINT: case VK_FORMAT_R16_SINT:
case VK_FORMAT_R16_SFLOAT: case VK_FORMAT_R16_SFLOAT:
...@@ -831,6 +830,9 @@ void PhysicalDevice::getFormatProperties(Format format, VkFormatProperties *pFor ...@@ -831,6 +830,9 @@ void PhysicalDevice::getFormatProperties(Format format, VkFormatProperties *pFor
case VK_FORMAT_R32G32B32A32_SINT: case VK_FORMAT_R32G32B32A32_SINT:
case VK_FORMAT_R32G32B32A32_SFLOAT: case VK_FORMAT_R32G32B32A32_SFLOAT:
case VK_FORMAT_B10G11R11_UFLOAT_PACK32: case VK_FORMAT_B10G11R11_UFLOAT_PACK32:
// Optional
case VK_FORMAT_A2R10G10B10_UNORM_PACK32:
case VK_FORMAT_A2R10G10B10_UINT_PACK32:
pFormatProperties->bufferFeatures |= pFormatProperties->bufferFeatures |=
VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT; VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT;
break; break;
......
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