mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-10-31 16:09:03 -05:00 
			
		
		
		
	maxwell_to_gl: Properly handle UnsignedInt/SignedInt sizes.
This commit is contained in:
		| @@ -24,16 +24,25 @@ using Maxwell = Tegra::Engines::Maxwell3D::Regs; | |||||||
|  |  | ||||||
| inline GLenum VertexType(Maxwell::VertexAttribute attrib) { | inline GLenum VertexType(Maxwell::VertexAttribute attrib) { | ||||||
|     switch (attrib.type) { |     switch (attrib.type) { | ||||||
|  |     case Maxwell::VertexAttribute::Type::UnsignedInt: | ||||||
|     case Maxwell::VertexAttribute::Type::UnsignedNorm: { |     case Maxwell::VertexAttribute::Type::UnsignedNorm: { | ||||||
|  |  | ||||||
|         switch (attrib.size) { |         switch (attrib.size) { | ||||||
|         case Maxwell::VertexAttribute::Size::Size_8: |         case Maxwell::VertexAttribute::Size::Size_8: | ||||||
|         case Maxwell::VertexAttribute::Size::Size_8_8: |         case Maxwell::VertexAttribute::Size::Size_8_8: | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_8_8_8: | ||||||
|         case Maxwell::VertexAttribute::Size::Size_8_8_8_8: |         case Maxwell::VertexAttribute::Size::Size_8_8_8_8: | ||||||
|             return GL_UNSIGNED_BYTE; |             return GL_UNSIGNED_BYTE; | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_16: | ||||||
|         case Maxwell::VertexAttribute::Size::Size_16_16: |         case Maxwell::VertexAttribute::Size::Size_16_16: | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_16_16_16: | ||||||
|         case Maxwell::VertexAttribute::Size::Size_16_16_16_16: |         case Maxwell::VertexAttribute::Size::Size_16_16_16_16: | ||||||
|             return GL_UNSIGNED_SHORT; |             return GL_UNSIGNED_SHORT; | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_32: | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_32_32: | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_32_32_32: | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_32_32_32_32: | ||||||
|  |             return GL_UNSIGNED_INT; | ||||||
|         case Maxwell::VertexAttribute::Size::Size_10_10_10_2: |         case Maxwell::VertexAttribute::Size::Size_10_10_10_2: | ||||||
|             return GL_UNSIGNED_INT_2_10_10_10_REV; |             return GL_UNSIGNED_INT_2_10_10_10_REV; | ||||||
|         } |         } | ||||||
| @@ -43,16 +52,25 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) { | |||||||
|         return {}; |         return {}; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     case Maxwell::VertexAttribute::Type::SignedInt: | ||||||
|     case Maxwell::VertexAttribute::Type::SignedNorm: { |     case Maxwell::VertexAttribute::Type::SignedNorm: { | ||||||
|  |  | ||||||
|         switch (attrib.size) { |         switch (attrib.size) { | ||||||
|         case Maxwell::VertexAttribute::Size::Size_32_32_32: |         case Maxwell::VertexAttribute::Size::Size_8: | ||||||
|             return GL_INT; |  | ||||||
|         case Maxwell::VertexAttribute::Size::Size_8_8: |         case Maxwell::VertexAttribute::Size::Size_8_8: | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_8_8_8: | ||||||
|         case Maxwell::VertexAttribute::Size::Size_8_8_8_8: |         case Maxwell::VertexAttribute::Size::Size_8_8_8_8: | ||||||
|             return GL_BYTE; |             return GL_BYTE; | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_16: | ||||||
|         case Maxwell::VertexAttribute::Size::Size_16_16: |         case Maxwell::VertexAttribute::Size::Size_16_16: | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_16_16_16: | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_16_16_16_16: | ||||||
|             return GL_SHORT; |             return GL_SHORT; | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_32: | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_32_32: | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_32_32_32: | ||||||
|  |         case Maxwell::VertexAttribute::Size::Size_32_32_32_32: | ||||||
|  |             return GL_INT; | ||||||
|         case Maxwell::VertexAttribute::Size::Size_10_10_10_2: |         case Maxwell::VertexAttribute::Size::Size_10_10_10_2: | ||||||
|             return GL_INT_2_10_10_10_REV; |             return GL_INT_2_10_10_10_REV; | ||||||
|         } |         } | ||||||
| @@ -62,9 +80,6 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) { | |||||||
|         return {}; |         return {}; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     case Maxwell::VertexAttribute::Type::UnsignedInt: |  | ||||||
|         return GL_UNSIGNED_INT; |  | ||||||
|  |  | ||||||
|     case Maxwell::VertexAttribute::Type::Float: |     case Maxwell::VertexAttribute::Type::Float: | ||||||
|         return GL_FLOAT; |         return GL_FLOAT; | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 bunnei
					bunnei