mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-30 02:32:46 +01:00
gl_rasterizer: Normalize vertex array data as appropriate.
This commit is contained in:
parent
d4fb8a887c
commit
a6cab532f8
2 changed files with 5 additions and 1 deletions
|
@ -222,6 +222,10 @@ public:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsNormalized() const {
|
||||||
|
return (type == Type::SignedNorm) || (type == Type::UnsignedNorm);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class PrimitiveTopology : u32 {
|
enum class PrimitiveTopology : u32 {
|
||||||
|
|
|
@ -178,7 +178,7 @@ void RasterizerOpenGL::SetupVertexArray(u8* array_ptr, GLintptr buffer_offset) {
|
||||||
for (unsigned index = 0; index < 16; ++index) {
|
for (unsigned index = 0; index < 16; ++index) {
|
||||||
auto& attrib = regs.vertex_attrib_format[index];
|
auto& attrib = regs.vertex_attrib_format[index];
|
||||||
glVertexAttribPointer(index, attrib.ComponentCount(), MaxwellToGL::VertexType(attrib),
|
glVertexAttribPointer(index, attrib.ComponentCount(), MaxwellToGL::VertexType(attrib),
|
||||||
GL_FALSE, vertex_array.stride,
|
attrib.IsNormalized() ? GL_TRUE : GL_FALSE, vertex_array.stride,
|
||||||
reinterpret_cast<GLvoid*>(buffer_offset + attrib.offset));
|
reinterpret_cast<GLvoid*>(buffer_offset + attrib.offset));
|
||||||
glEnableVertexAttribArray(index);
|
glEnableVertexAttribArray(index);
|
||||||
hw_vao_enabled_attributes[index] = true;
|
hw_vao_enabled_attributes[index] = true;
|
||||||
|
|
Loading…
Reference in a new issue