diff options
| author | degasus <wickmarkus@web.de> | 2014-01-24 15:41:08 +0100 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2014-01-31 07:19:34 +0100 |
| commit | a65162f1cd345b8f206fd01e19ac261d09ac291b (patch) | |
| tree | 4f90d9cb21c73d88715653d16afcc62090257460 /Source/Core/VideoBackends | |
| parent | 6c59b691b0247f4a56ff17d7cf134364b258a6c5 (diff) | |
PortableVertexFormat: use AttributeFormat for posmtx attribute format
Diffstat (limited to 'Source/Core/VideoBackends')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp | 7 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/OGL/NativeVertexFormat.cpp | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp index 24dc6ce575..824778d238 100644 --- a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp +++ b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp @@ -114,11 +114,12 @@ void D3DVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl) } } - if (_vtx_decl.posmtx_offset != -1) + format = &_vtx_decl.posmtx; + if (format->enable) { m_elems[m_num_elems].SemanticName = "BLENDINDICES"; - m_elems[m_num_elems].AlignedByteOffset = _vtx_decl.posmtx_offset; - m_elems[m_num_elems].Format = DXGI_FORMAT_R8G8B8A8_UNORM; + m_elems[m_num_elems].AlignedByteOffset = format->offset; + m_elems[m_num_elems].Format = VarToD3D(format->type, format->components, format->integer); m_elems[m_num_elems].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA; ++m_num_elems; } diff --git a/Source/Core/VideoBackends/OGL/NativeVertexFormat.cpp b/Source/Core/VideoBackends/OGL/NativeVertexFormat.cpp index 97b0b7a7a2..4f3f2ad0d7 100644 --- a/Source/Core/VideoBackends/OGL/NativeVertexFormat.cpp +++ b/Source/Core/VideoBackends/OGL/NativeVertexFormat.cpp @@ -86,10 +86,7 @@ void GLVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl) SetPointer(SHADER_TEXTURE0_ATTRIB+i, vertex_stride, vtx_decl.texcoords[i]); } - if (vtx_decl.posmtx_offset != -1) { - glEnableVertexAttribArray(SHADER_POSMTX_ATTRIB); - glVertexAttribPointer(SHADER_POSMTX_ATTRIB, 4, GL_UNSIGNED_BYTE, GL_FALSE, vtx_decl.stride, (u8*)NULL + vtx_decl.posmtx_offset); - } + SetPointer(SHADER_POSMTX_ATTRIB, vertex_stride, vtx_decl.posmtx); vm->m_last_vao = VAO; } |
