virtual void bindTexImage(Surface *surface) = 0;
virtual EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel) = 0;
virtual Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel) = 0;
- virtual int getClientVersion() const = 0;
+ virtual EGLint getClientVersion() const = 0;
+ virtual EGLint getConfigID() const = 0;
virtual void finish() = 0;
protected:
{
if(libGLES_CM)
{
- context = libGLES_CM->es1CreateContext(this, shareContext);
+ context = libGLES_CM->es1CreateContext(this, shareContext, config);
}
}
else if((clientVersion == 2 && config->mRenderableType & EGL_OPENGL_ES2_BIT) ||
{
if(libGLESv2)
{
- context = libGLESv2->es2CreateContext(this, shareContext, clientVersion);
+ context = libGLESv2->es2CreateContext(this, shareContext, clientVersion, config);
}
}
else
return EGL_FALSE;
}
- UNIMPLEMENTED(); // FIXME
+ switch(attribute)
+ {
+ case EGL_CONFIG_ID:\r
+ *value = context->getConfigID();\r
+ break;\r
+ case EGL_CONTEXT_CLIENT_TYPE:\r
+ *value = egl::getCurrentAPI();\r
+ break;\r
+ case EGL_CONTEXT_CLIENT_VERSION:
+ *value = context->getClientVersion();
+ break;
+ case EGL_RENDER_BUFFER:
+ *value = EGL_BACK_BUFFER;\r
+ break;
+ default:
+ return error(EGL_BAD_ATTRIBUTE, EGL_FALSE);
+ }
- return success(0);
+ return success(EGL_TRUE);
}
EGLBoolean WaitGL(void)
namespace es1
{
-Context::Context(egl::Display *const display, const Context *shareContext)
- : egl::Context(display),
+Context::Context(egl::Display *const display, const Context *shareContext, const egl::Config *config)
+ : egl::Context(display), config(config),
modelViewStack(MAX_MODELVIEW_STACK_DEPTH),
projectionStack(MAX_PROJECTION_STACK_DEPTH),
textureStack0(MAX_TEXTURE_STACK_DEPTH),
markAllStateDirty();
}
-int Context::getClientVersion() const
+EGLint Context::getClientVersion() const
{
return 1;
}
+EGLint Context::getConfigID() const
+{
+ return config->mConfigID;
+}
+
// This function will set all of the state-related dirty flags, so that all state is set during next pre-draw.
void Context::markAllStateDirty()
{
}
-egl::Context *es1CreateContext(egl::Display *display, const egl::Context *shareContext)
+egl::Context *es1CreateContext(egl::Display *display, const egl::Context *shareContext, const egl::Config *config)
{
ASSERT(!shareContext || shareContext->getClientVersion() == 1); // Should be checked by eglCreateContext
- return new es1::Context(display, static_cast<const es1::Context*>(shareContext));
+ return new es1::Context(display, static_cast<const es1::Context*>(shareContext), config);
}
TextureUnit textureUnit[MAX_TEXTURE_UNITS];
};
-class Context : public egl::Context
+class [[clang::lto_visibility_public]] Context : public egl::Context
{
public:
- Context(egl::Display *display, const Context *shareContext);
+ Context(egl::Display *display, const Context *shareContext, const egl::Config *config);
- virtual void makeCurrent(egl::Surface *surface);
- virtual int getClientVersion() const;
- virtual void finish();
+ void makeCurrent(egl::Surface *surface) override;
+ EGLint getClientVersion() const override;
+ EGLint getConfigID() const override;
+
+ void finish() override;
void markAllStateDirty();
bool cullSkipsDraw(GLenum drawMode);
bool isTriangleMode(GLenum drawMode);
+ const egl::Config *const config;
+
State mState;
gl::BindingPointer<Texture2D> mTexture2DZero;
void (*glDrawTexfOES)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
void (*glDrawTexfvOES)(const GLfloat *coords);
- egl::Context *(*es1CreateContext)(egl::Display *display, const egl::Context *shareContext);
+ egl::Context *(*es1CreateContext)(egl::Display *display, const egl::Context *shareContext, const egl::Config *config);
__eglMustCastToProperFunctionPointerType (*es1GetProcAddress)(const char *procname);
egl::Image *(*createBackBuffer)(int width, int height, const egl::Config *config);
egl::Image *(*createDepthStencil)(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
void DrawTexfvOES(const GLfloat *coords);
}
-egl::Context *es1CreateContext(egl::Display *display, const egl::Context *shareContext);
+egl::Context *es1CreateContext(egl::Display *display, const egl::Context *shareContext, const egl::Config *config);
extern "C" __eglMustCastToProperFunctionPointerType es1GetProcAddress(const char *procname);
egl::Image *createBackBuffer(int width, int height, const egl::Config *config);
egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
namespace es2
{
-Context::Context(egl::Display *display, const Context *shareContext, EGLint clientVersion)
- : egl::Context(display), clientVersion(clientVersion)
+Context::Context(egl::Display *display, const Context *shareContext, EGLint clientVersion, const egl::Config *config)
+ : egl::Context(display), clientVersion(clientVersion), config(config)
{
sw::Context *context = new sw::Context();
device = new es2::Device(context);
return clientVersion;
}
+EGLint Context::getConfigID() const
+{
+ return config->mConfigID;
+}
+
// This function will set all of the state-related dirty flags, so that all state is set during next pre-draw.
void Context::markAllStateDirty()
{
}
-egl::Context *es2CreateContext(egl::Display *display, const egl::Context *shareContext, int clientVersion)
+egl::Context *es2CreateContext(egl::Display *display, const egl::Context *shareContext, int clientVersion, const egl::Config *config)
{
ASSERT(!shareContext || shareContext->getClientVersion() == clientVersion); // Should be checked by eglCreateContext
- return new es2::Context(display, static_cast<const es2::Context*>(shareContext), clientVersion);
+ return new es2::Context(display, static_cast<const es2::Context*>(shareContext), clientVersion, config);
}
class [[clang::lto_visibility_public]] Context : public egl::Context
{
public:
- Context(egl::Display *display, const Context *shareContext, EGLint clientVersion);
+ Context(egl::Display *display, const Context *shareContext, EGLint clientVersion, const egl::Config *config);
void makeCurrent(egl::Surface *surface) override;
- virtual EGLint getClientVersion() const;
+ EGLint getClientVersion() const override;
+ EGLint getConfigID() const override;
void markAllStateDirty();
Query *createQuery(GLuint handle, GLenum type);
const EGLint clientVersion;
+ const egl::Config *const config;
State mState;
void (*glGenerateMipmapOES)(GLenum target);
void (*glDrawBuffersEXT)(GLsizei n, const GLenum *bufs);
- egl::Context *(*es2CreateContext)(egl::Display *display, const egl::Context *shareContext, int clientVersion);
+ egl::Context *(*es2CreateContext)(egl::Display *display, const egl::Context *shareContext, int clientVersion, const egl::Config *config);
__eglMustCastToProperFunctionPointerType (*es2GetProcAddress)(const char *procname);
egl::Image *(*createBackBuffer)(int width, int height, const egl::Config *config);
egl::Image *(*createDepthStencil)(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
}
}
-egl::Context *es2CreateContext(egl::Display *display, const egl::Context *shareContext, int clientVersion);
+egl::Context *es2CreateContext(egl::Display *display, const egl::Context *shareContext, int clientVersion, const egl::Config *config);
extern "C" __eglMustCastToProperFunctionPointerType es2GetProcAddress(const char *procname);
egl::Image *createBackBuffer(int width, int height, const egl::Config *config);
egl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);