Commit 72468834 by Jamie Madill

Move getData from the D3D to the Impl.

We will need this functionality for index validation, so we likely can assume an implemenation will need to support such a call. We might redesign this requirement, but for now we can't call though to BufferD3D on OSX. BUG=angle:773 Change-Id: I16187c78ff62471fdf7221a11b9956560e617a14 Reviewed-on: https://chromium-review.googlesource.com/238450Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent c34d53e4
...@@ -28,6 +28,10 @@ class BufferImpl ...@@ -28,6 +28,10 @@ class BufferImpl
virtual gl::Error map(size_t offset, size_t length, GLbitfield access, GLvoid **mapPtr) = 0; virtual gl::Error map(size_t offset, size_t length, GLbitfield access, GLvoid **mapPtr) = 0;
virtual gl::Error unmap() = 0; virtual gl::Error unmap() = 0;
virtual void markTransformFeedbackUsage() = 0; virtual void markTransformFeedbackUsage() = 0;
// This method may not have a corresponding GL-backed function. It is necessary
// for validation, for certain indexed draw calls.
virtual gl::Error getData(const uint8_t **outData) = 0;
}; };
} }
......
...@@ -31,7 +31,6 @@ class BufferD3D : public BufferImpl ...@@ -31,7 +31,6 @@ class BufferD3D : public BufferImpl
unsigned int getSerial() const { return mSerial; } unsigned int getSerial() const { return mSerial; }
virtual gl::Error getData(const uint8_t **outData) = 0;
virtual size_t getSize() const = 0; virtual size_t getSize() const = 0;
virtual bool supportsDirectBinding() const = 0; virtual bool supportsDirectBinding() const = 0;
virtual RendererD3D *getRenderer() = 0; virtual RendererD3D *getRenderer() = 0;
......
...@@ -24,9 +24,6 @@ ...@@ -24,9 +24,6 @@
#include "common/mathutil.h" #include "common/mathutil.h"
#include "common/utilities.h" #include "common/utilities.h"
// FIXME(jmadill): remove this when we support buffer data caching
#include "libANGLE/renderer/d3d/BufferD3D.h"
namespace gl namespace gl
{ {
...@@ -1653,10 +1650,9 @@ bool ValidateDrawElements(Context *context, GLenum mode, GLsizei count, GLenum t ...@@ -1653,10 +1650,9 @@ bool ValidateDrawElements(Context *context, GLenum mode, GLsizei count, GLenum t
uintptr_t offset = reinterpret_cast<uintptr_t>(indices); uintptr_t offset = reinterpret_cast<uintptr_t>(indices);
if (!elementArrayBuffer->getIndexRangeCache()->findRange(type, offset, count, indexRangeOut, NULL)) if (!elementArrayBuffer->getIndexRangeCache()->findRange(type, offset, count, indexRangeOut, NULL))
{ {
// FIXME(jmadill): Use buffer data caching instead of the D3D back-end rx::BufferImpl *bufferImpl = elementArrayBuffer->getImplementation();
rx::BufferD3D *bufferD3D = rx::BufferD3D::makeBufferD3D(elementArrayBuffer->getImplementation());
const uint8_t *dataPointer = NULL; const uint8_t *dataPointer = NULL;
Error error = bufferD3D->getData(&dataPointer); Error error = bufferImpl->getData(&dataPointer);
if (error.isError()) if (error.isError())
{ {
context->recordError(error); context->recordError(error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment