From ed2134784e173e071a124c768eea5dd12be8425c Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 24 Mar 2018 02:01:03 -0400 Subject: gl_rasterizer: Implement AnalyzeVertexArray. --- src/video_core/engines/maxwell_3d.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/video_core/engines') diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 3c49cd27f..869ddde90 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h @@ -229,6 +229,41 @@ public: BitField<21, 6, VertexSize> size; BitField<27, 3, VertexType> type; BitField<31, 1, u32> bgra; + + u32 SizeInBytes() const { + switch (size) { + case VertexSize::Size_32_32_32_32: + return 16; + case VertexSize::Size_32_32_32: + return 12; + case VertexSize::Size_16_16_16_16: + return 8; + case VertexSize::Size_32_32: + return 8; + case VertexSize::Size_16_16_16: + return 6; + case VertexSize::Size_8_8_8_8: + return 4; + case VertexSize::Size_16_16: + return 4; + case VertexSize::Size_32: + return 4; + case VertexSize::Size_8_8_8: + return 3; + case VertexSize::Size_8_8: + return 2; + case VertexSize::Size_16: + return 2; + case VertexSize::Size_8: + return 1; + case VertexSize::Size_10_10_10_2: + return 4; + case VertexSize::Size_11_11_10: + return 4; + default: + UNREACHABLE(); + } + } } vertex_attrib_format[NumVertexAttributes]; INSERT_PADDING_WORDS(0xF); -- cgit v1.2.3