diff --git a/src/Device/Stream.hpp b/src/Device/Stream.hpp index 31a80ab6a63ef..54841e3684161 100644 --- a/src/Device/Stream.hpp +++ b/src/Device/Stream.hpp @@ -19,14 +19,9 @@ namespace sw { - class Resource; - enum StreamType ENUM_UNDERLYING_TYPE_UNSIGNED_INT { STREAMTYPE_COLOR, // 4 normalized unsigned bytes, ZYXW order - STREAMTYPE_UDEC3, // 3 unsigned 10-bit fields - STREAMTYPE_DEC3N, // 3 normalized signed 10-bit fields - STREAMTYPE_INDICES, // 4 unsigned bytes, stored unconverted into X component STREAMTYPE_FLOAT, // Normalization ignored STREAMTYPE_BYTE, STREAMTYPE_SBYTE, @@ -34,7 +29,6 @@ namespace sw STREAMTYPE_USHORT, STREAMTYPE_INT, STREAMTYPE_UINT, - STREAMTYPE_FIXED, // Normalization ignored (16.16 format) STREAMTYPE_HALF, // Normalization ignored STREAMTYPE_2_10_10_10_INT, STREAMTYPE_2_10_10_10_UINT, @@ -44,16 +38,14 @@ namespace sw struct StreamResource { - Resource *resource; const void *buffer; unsigned int stride; }; struct Stream : public StreamResource { - Stream(Resource *resource = 0, const void *buffer = 0, unsigned int stride = 0) + Stream(const void *buffer = nullptr, unsigned int stride = 0) { - this->resource = resource; this->buffer = buffer; this->stride = stride; } @@ -81,7 +73,6 @@ namespace sw { static const float4 null = {0, 0, 0, 1}; - resource = 0; buffer = &null; stride = 0; type = STREAMTYPE_FLOAT; diff --git a/src/Pipeline/VertexRoutine.cpp b/src/Pipeline/VertexRoutine.cpp index 803c24d834ace..c4e5db5b1d221 100644 --- a/src/Pipeline/VertexRoutine.cpp +++ b/src/Pipeline/VertexRoutine.cpp @@ -376,115 +376,6 @@ namespace sw transpose4xN(v.x, v.y, v.z, v.w, stream.count); } break; - case STREAMTYPE_UDEC3: - { - // FIXME: Vectorize - { - Int x, y, z; - - x = y = z = *Pointer(source0); - - v.x.x = Float(x & 0x000003FF); - v.x.y = Float(y & 0x000FFC00); - v.x.z = Float(z & 0x3FF00000); - } - - { - Int x, y, z; - - x = y = z = *Pointer(source1); - - v.y.x = Float(x & 0x000003FF); - v.y.y = Float(y & 0x000FFC00); - v.y.z = Float(z & 0x3FF00000); - } - - { - Int x, y, z; - - x = y = z = *Pointer(source2); - - v.z.x = Float(x & 0x000003FF); - v.z.y = Float(y & 0x000FFC00); - v.z.z = Float(z & 0x3FF00000); - } - - { - Int x, y, z; - - x = y = z = *Pointer(source3); - - v.w.x = Float(x & 0x000003FF); - v.w.y = Float(y & 0x000FFC00); - v.w.z = Float(z & 0x3FF00000); - } - - transpose4x3(v.x, v.y, v.z, v.w); - - v.y *= Float4(1.0f / 0x00000400); - v.z *= Float4(1.0f / 0x00100000); - } - break; - case STREAMTYPE_DEC3N: - { - // FIXME: Vectorize - { - Int x, y, z; - - x = y = z = *Pointer(source0); - - v.x.x = Float((x << 22) & 0xFFC00000); - v.x.y = Float((y << 12) & 0xFFC00000); - v.x.z = Float((z << 2) & 0xFFC00000); - } - - { - Int x, y, z; - - x = y = z = *Pointer(source1); - - v.y.x = Float((x << 22) & 0xFFC00000); - v.y.y = Float((y << 12) & 0xFFC00000); - v.y.z = Float((z << 2) & 0xFFC00000); - } - - { - Int x, y, z; - - x = y = z = *Pointer(source2); - - v.z.x = Float((x << 22) & 0xFFC00000); - v.z.y = Float((y << 12) & 0xFFC00000); - v.z.z = Float((z << 2) & 0xFFC00000); - } - - { - Int x, y, z; - - x = y = z = *Pointer(source3); - - v.w.x = Float((x << 22) & 0xFFC00000); - v.w.y = Float((y << 12) & 0xFFC00000); - v.w.z = Float((z << 2) & 0xFFC00000); - } - - transpose4x3(v.x, v.y, v.z, v.w); - - v.x *= Float4(1.0f / 0x00400000 / 511.0f); - v.y *= Float4(1.0f / 0x00400000 / 511.0f); - v.z *= Float4(1.0f / 0x00400000 / 511.0f); - } - break; - case STREAMTYPE_FIXED: - { - v.x = Float4(*Pointer(source0)) * *Pointer(constants + OFFSET(Constants,unscaleFixed)); - v.y = Float4(*Pointer(source1)) * *Pointer(constants + OFFSET(Constants,unscaleFixed)); - v.z = Float4(*Pointer(source2)) * *Pointer(constants + OFFSET(Constants,unscaleFixed)); - v.w = Float4(*Pointer(source3)) * *Pointer(constants + OFFSET(Constants,unscaleFixed)); - - transpose4xN(v.x, v.y, v.z, v.w, stream.count); - } - break; case STREAMTYPE_HALF: { if(stream.count >= 1) @@ -540,14 +431,6 @@ namespace sw } } break; - case STREAMTYPE_INDICES: - { - v.x.x = *Pointer(source0); - v.x.y = *Pointer(source1); - v.x.z = *Pointer(source2); - v.x.w = *Pointer(source3); - } - break; case STREAMTYPE_2_10_10_10_INT: { Int4 src; diff --git a/src/Vulkan/VkPipeline.cpp b/src/Vulkan/VkPipeline.cpp index 556b6a21bbd03..b2eac40af81c7 100644 --- a/src/Vulkan/VkPipeline.cpp +++ b/src/Vulkan/VkPipeline.cpp @@ -70,10 +70,11 @@ sw::StreamType getStreamType(VkFormat format) case VK_FORMAT_R8_UINT: case VK_FORMAT_R8G8_UINT: case VK_FORMAT_R8G8B8A8_UINT: - case VK_FORMAT_B8G8R8A8_UNORM: case VK_FORMAT_A8B8G8R8_UNORM_PACK32: case VK_FORMAT_A8B8G8R8_UINT_PACK32: return sw::STREAMTYPE_BYTE; + case VK_FORMAT_B8G8R8A8_UNORM: + return sw::STREAMTYPE_COLOR; case VK_FORMAT_R8_SNORM: case VK_FORMAT_R8_SINT: case VK_FORMAT_R8G8_SNORM: