Commit a21eea36 by Jamie Madill

Add pixel unpack buffer stubs to the Renderer classes.

TRAC #23841 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
parent 89a0bf50
......@@ -259,6 +259,10 @@ class Renderer
void setCurrentClientVersion(int clientVersion) { mCurrentClientVersion = clientVersion; }
int getCurrentClientVersion() const { return mCurrentClientVersion; }
// Buffer-to-texture and Texture-to-buffer copies
virtual bool fastCopyBufferToTexture(const gl::PixelUnpackState &unpack, unsigned int offset, RenderTarget *destRenderTarget,
GLenum destinationFormat, GLenum sourcePixelsType, const gl::Box &destArea) = 0;
virtual bool getLUID(LUID *adapterLuid) const = 0;
protected:
......
......@@ -30,6 +30,7 @@
#include "libGLESv2/renderer/Fence11.h"
#include "libGLESv2/renderer/Blit11.h"
#include "libGLESv2/renderer/Clear11.h"
#include "libGLESv2/renderer/PixelTransfer11.h"
#include "libEGL/Display.h"
......@@ -68,6 +69,7 @@ Renderer11::Renderer11(egl::Display *display, HDC hDc) : Renderer(display), mDc(
mTriangleFanIB = NULL;
mBlit = NULL;
mPixelTransfer = NULL;
mClear = NULL;
......@@ -391,6 +393,9 @@ void Renderer11::initializeDevice()
ASSERT(!mClear);
mClear = new Clear11(this);
ASSERT(!mPixelTransfer);
mPixelTransfer = new PixelTransfer11(this);
markAllStateDirty();
}
......@@ -1615,6 +1620,7 @@ void Renderer11::releaseDeviceResources()
SafeDelete(mTriangleFanIB);
SafeDelete(mBlit);
SafeDelete(mClear);
SafeDelete(mPixelTransfer);
SafeRelease(mDriverConstantBufferVS);
SafeRelease(mDriverConstantBufferPS);
......@@ -2768,6 +2774,13 @@ FenceImpl *Renderer11::createFence()
return new Fence11(this);
}
bool Renderer11::fastCopyBufferToTexture(const gl::PixelUnpackState &unpack, unsigned int offset, RenderTarget *destRenderTarget,
GLenum destinationFormat, GLenum sourcePixelsType, const gl::Box &destArea)
{
ASSERT(gl::IsFastCopyBufferToTextureSupported(destinationFormat, getCurrentClientVersion()));
return mPixelTransfer->copyBufferToTexture(unpack, offset, destRenderTarget, destinationFormat, sourcePixelsType, destArea);
}
bool Renderer11::getRenderTargetResource(gl::Renderbuffer *colorbuffer, unsigned int *subresourceIndex, ID3D11Texture2D **resource)
{
ASSERT(colorbuffer != NULL);
......
......@@ -31,6 +31,7 @@ class IndexDataManager;
class StreamingIndexBufferInterface;
class Blit11;
class Clear11;
class PixelTransfer11;
enum
{
......@@ -206,6 +207,10 @@ class Renderer11 : public Renderer
Blit11 *getBlitter() { return mBlit; }
// Buffer-to-texture and Texture-to-buffer copies
virtual bool fastCopyBufferToTexture(const gl::PixelUnpackState &unpack, unsigned int offset, RenderTarget *destRenderTarget,
GLenum destinationFormat, GLenum sourcePixelsType, const gl::Box &destArea);
bool getRenderTargetResource(gl::Renderbuffer *colorbuffer, unsigned int *subresourceIndex, ID3D11Texture2D **resource);
void unapplyRenderTargets();
void setOneTimeRenderTarget(ID3D11RenderTargetView *renderTargetView);
......@@ -352,6 +357,7 @@ class Renderer11 : public Renderer
// Texture copy resources
Blit11 *mBlit;
PixelTransfer11 *mPixelTransfer;
// Masked clear resources
Clear11 *mClear;
......
......@@ -693,6 +693,14 @@ FenceImpl *Renderer9::createFence()
return new Fence9(this);
}
bool Renderer9::fastCopyBufferToTexture(const gl::PixelUnpackState &unpack, unsigned int offset, RenderTarget *destRenderTarget,
GLenum destinationFormat, GLenum sourcePixelsType, const gl::Box &destArea)
{
// Pixel buffer objects are not supported in D3D9, since D3D9 is ES2-only and PBOs are ES3.
UNREACHABLE();
return false;
}
void Renderer9::setSamplerState(gl::SamplerType type, int index, const gl::SamplerState &samplerState)
{
bool *forceSetSamplers = (type == gl::SAMPLER_PIXEL) ? mForceSetPixelSamplerStates : mForceSetVertexSamplerStates;
......
......@@ -216,6 +216,10 @@ class Renderer9 : public Renderer
virtual QueryImpl *createQuery(GLenum type);
virtual FenceImpl *createFence();
// Buffer-to-texture and Texture-to-buffer copies
virtual bool fastCopyBufferToTexture(const gl::PixelUnpackState &unpack, unsigned int offset, RenderTarget *destRenderTarget,
GLenum destinationFormat, GLenum sourcePixelsType, const gl::Box &destArea);
// D3D9-renderer specific methods
bool boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest);
......
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