Commit 393e2f94 by Nicolas Capens Committed by Nicolas Capens

Create a renderer device per GL context.

Bug 18572955 Change-Id: I5c05ab7e0bae3581600ab4fcaba7c499fb5987a7 Reviewed-on: https://swiftshader-review.googlesource.com/1521Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent f4fea7f5
......@@ -35,15 +35,14 @@
namespace es1
{
Device *Context::device = 0;
Context::Context(const egl::Config *config, const Context *shareContext)
: modelViewStack(MAX_MODELVIEW_STACK_DEPTH),
projectionStack(MAX_PROJECTION_STACK_DEPTH),
textureStack0(MAX_TEXTURE_STACK_DEPTH),
textureStack1(MAX_TEXTURE_STACK_DEPTH)
{
device = getDevice();
sw::Context *context = new sw::Context();
device = new es1::Device(context);
mVertexDataManager = new VertexDataManager(this);
mIndexDataManager = new IndexDataManager();
......@@ -210,6 +209,7 @@ Context::~Context()
delete mIndexDataManager;
mResourceManager->release();
delete device;
}
void Context::makeCurrent(egl::Surface *surface)
......@@ -2464,12 +2464,6 @@ egl::Image *Context::createSharedImage(EGLenum target, GLuint name, GLuint textu
Device *Context::getDevice()
{
if(!device)
{
sw::Context *context = new sw::Context();
device = new es1::Device(context);
}
return device;
}
......
......@@ -502,9 +502,8 @@ private:
bool texture2D;
GLenum clientTexture;
Device *device;
ResourceManager *mResourceManager;
static Device *device;
};
}
......
......@@ -39,11 +39,10 @@
namespace es2
{
Device *Context::device = 0;
Context::Context(const egl::Config *config, const Context *shareContext) : mConfig(config)
{
device = getDevice();
sw::Context *context = new sw::Context();
device = new es2::Device(context);
mFenceHandleAllocator.setBaseHandle(0);
......@@ -220,6 +219,7 @@ Context::~Context()
delete mIndexDataManager;
mResourceManager->release();
delete device;
}
void Context::makeCurrent(egl::Surface *surface)
......@@ -3133,12 +3133,6 @@ egl::Image *Context::createSharedImage(EGLenum target, GLuint name, GLuint textu
Device *Context::getDevice()
{
if(!device)
{
sw::Context *context = new sw::Context();
device = new es2::Device(context);
}
return device;
}
......
......@@ -491,9 +491,8 @@ private:
bool mFrontFaceDirty;
bool mDitherStateDirty;
Device *device;
ResourceManager *mResourceManager;
static Device *device;
};
}
......
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