summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexDataManager.cpp
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@theqtcompany.com>2014-11-14 10:52:01 +0200
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2014-11-14 19:01:38 +0100
commitc6df5fe3ed0f2a722931be098914978cf17a666f (patch)
tree23abe340dbc427a3afd255c79316f79fef937059 /src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexDataManager.cpp
parent32db2f425a0b85bc03d7de42d7b44337d0aa16f4 (diff)
ANGLE: Upgrade to version 1.2.30d6c255d238
The following patches have been changed: 0001-Fix-compilation-for-MSVC-2008-and-std-tuple.patch Removed because it is no longer possible to build ANGLE with MSVC2008 0002-Fix-compilation-of-ANGLE-with-mingw-tdm64-gcc-4.8.1.patch Removed because the minimum version of MinGW moved to 4.8.2 0005-Fix-build-when-SSE2-is-not-available.patch Removed because it was fixed upstream 0006-Fix-compilation-of-libGLESv2-with-older-MinGW-w64-he.patch Removed because older versions of MinGW are not supported 0007-Fix-ANGLE-build-with-Microsoft-Visual-Studio-14-CTP.patch Removed because it was fixed upstream Task-number: QTBUG-41903 Change-Id: I976d30802f7f6fee725cf9a9f1325d5e82609835 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexDataManager.cpp')
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexDataManager.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexDataManager.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexDataManager.cpp
index 7034b78eab..8d3df31c8b 100644
--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexDataManager.cpp
+++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexDataManager.cpp
@@ -14,6 +14,7 @@
#include "libGLESv2/Buffer.h"
#include "libGLESv2/ProgramBinary.h"
#include "libGLESv2/VertexAttribute.h"
+#include "libGLESv2/State.h"
namespace
{
@@ -51,7 +52,7 @@ static int StreamingBufferElementCount(const gl::VertexAttribute &attrib, int ve
return vertexDrawCount;
}
-VertexDataManager::VertexDataManager(Renderer *renderer) : mRenderer(renderer)
+VertexDataManager::VertexDataManager(RendererD3D *renderer) : mRenderer(renderer)
{
for (int i = 0; i < gl::MAX_VERTEX_ATTRIBS; i++)
{
@@ -82,8 +83,8 @@ VertexDataManager::~VertexDataManager()
}
}
-gl::Error VertexDataManager::prepareVertexData(const gl::VertexAttribute attribs[], const gl::VertexAttribCurrentValueData currentValues[],
- gl::ProgramBinary *programBinary, GLint start, GLsizei count, TranslatedAttribute *translated, GLsizei instances)
+gl::Error VertexDataManager::prepareVertexData(const gl::State &state, GLint start, GLsizei count,
+ TranslatedAttribute *translated, GLsizei instances)
{
if (!mStreamingBuffer)
{
@@ -93,20 +94,22 @@ gl::Error VertexDataManager::prepareVertexData(const gl::VertexAttribute attribs
// Invalidate static buffers that don't contain matching attributes
for (int attributeIndex = 0; attributeIndex < gl::MAX_VERTEX_ATTRIBS; attributeIndex++)
{
- translated[attributeIndex].active = (programBinary->getSemanticIndex(attributeIndex) != -1);
+ translated[attributeIndex].active = (state.getCurrentProgramBinary()->getSemanticIndex(attributeIndex) != -1);
+ const gl::VertexAttribute &curAttrib = state.getVertexAttribState(attributeIndex);
- if (translated[attributeIndex].active && attribs[attributeIndex].enabled)
+ if (translated[attributeIndex].active && curAttrib.enabled)
{
- invalidateMatchingStaticData(attribs[attributeIndex], currentValues[attributeIndex]);
+ invalidateMatchingStaticData(curAttrib, state.getVertexAttribCurrentValue(attributeIndex));
}
}
// Reserve the required space in the buffers
for (int i = 0; i < gl::MAX_VERTEX_ATTRIBS; i++)
{
- if (translated[i].active && attribs[i].enabled)
+ const gl::VertexAttribute &curAttrib = state.getVertexAttribState(i);
+ if (translated[i].active && curAttrib.enabled)
{
- gl::Error error = reserveSpaceForAttrib(attribs[i], currentValues[i], count, instances);
+ gl::Error error = reserveSpaceForAttrib(curAttrib, state.getVertexAttribCurrentValue(i), count, instances);
if (error.isError())
{
return error;
@@ -117,12 +120,14 @@ gl::Error VertexDataManager::prepareVertexData(const gl::VertexAttribute attribs
// Perform the vertex data translations
for (int i = 0; i < gl::MAX_VERTEX_ATTRIBS; i++)
{
+ const gl::VertexAttribute &curAttrib = state.getVertexAttribState(i);
if (translated[i].active)
{
- if (attribs[i].enabled)
+ if (curAttrib.enabled)
{
- gl::Error error = storeAttribute(attribs[i], currentValues[i], &translated[i],
- start, count, instances);
+ gl::Error error = storeAttribute(curAttrib, state.getVertexAttribCurrentValue(i),
+ &translated[i], start, count, instances);
+
if (error.isError())
{
return error;
@@ -135,7 +140,7 @@ gl::Error VertexDataManager::prepareVertexData(const gl::VertexAttribute attribs
mCurrentValueBuffer[i] = new StreamingVertexBufferInterface(mRenderer, CONSTANT_VERTEX_BUFFER_SIZE);
}
- gl::Error error = storeCurrentValue(attribs[i], currentValues[i], &translated[i],
+ gl::Error error = storeCurrentValue(curAttrib, state.getVertexAttribCurrentValue(i), &translated[i],
&mCurrentValue[i], &mCurrentValueOffsets[i],
mCurrentValueBuffer[i]);
if (error.isError())
@@ -148,14 +153,15 @@ gl::Error VertexDataManager::prepareVertexData(const gl::VertexAttribute attribs
for (int i = 0; i < gl::MAX_VERTEX_ATTRIBS; i++)
{
- if (translated[i].active && attribs[i].enabled)
+ const gl::VertexAttribute &curAttrib = state.getVertexAttribState(i);
+ if (translated[i].active && curAttrib.enabled)
{
- gl::Buffer *buffer = attribs[i].buffer.get();
+ gl::Buffer *buffer = curAttrib.buffer.get();
if (buffer)
{
BufferD3D *bufferImpl = BufferD3D::makeBufferD3D(buffer->getImplementation());
- bufferImpl->promoteStaticUsage(count * ComputeVertexAttributeTypeSize(attribs[i]));
+ bufferImpl->promoteStaticUsage(count * ComputeVertexAttributeTypeSize(curAttrib));
}
}
}