dri: Add DRI entrypoints to create a context for a given API
This commit is contained in:
@@ -63,7 +63,7 @@ i830CreateContext(const __GLcontextModes * mesaVis,
|
|||||||
i830InitVtbl(i830);
|
i830InitVtbl(i830);
|
||||||
i830InitDriverFunctions(&functions);
|
i830InitDriverFunctions(&functions);
|
||||||
|
|
||||||
if (!intelInitContext(intel, mesaVis, driContextPriv,
|
if (!intelInitContext(intel, __DRI_API_OPENGL, mesaVis, driContextPriv,
|
||||||
sharedContextPrivate, &functions)) {
|
sharedContextPrivate, &functions)) {
|
||||||
FREE(i830);
|
FREE(i830);
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
@@ -94,7 +94,8 @@ i915InitDriverFunctions(struct dd_function_table *functions)
|
|||||||
extern const struct tnl_pipeline_stage *intel_pipeline[];
|
extern const struct tnl_pipeline_stage *intel_pipeline[];
|
||||||
|
|
||||||
GLboolean
|
GLboolean
|
||||||
i915CreateContext(const __GLcontextModes * mesaVis,
|
i915CreateContext(int api,
|
||||||
|
const __GLcontextModes * mesaVis,
|
||||||
__DRIcontext * driContextPriv,
|
__DRIcontext * driContextPriv,
|
||||||
void *sharedContextPrivate)
|
void *sharedContextPrivate)
|
||||||
{
|
{
|
||||||
@@ -114,7 +115,7 @@ i915CreateContext(const __GLcontextModes * mesaVis,
|
|||||||
|
|
||||||
i915InitDriverFunctions(&functions);
|
i915InitDriverFunctions(&functions);
|
||||||
|
|
||||||
if (!intelInitContext(intel, mesaVis, driContextPriv,
|
if (!intelInitContext(intel, api, mesaVis, driContextPriv,
|
||||||
sharedContextPrivate, &functions)) {
|
sharedContextPrivate, &functions)) {
|
||||||
FREE(i915);
|
FREE(i915);
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
@@ -318,7 +318,8 @@ do { \
|
|||||||
/*======================================================================
|
/*======================================================================
|
||||||
* i915_context.c
|
* i915_context.c
|
||||||
*/
|
*/
|
||||||
extern GLboolean i915CreateContext(const __GLcontextModes * mesaVis,
|
extern GLboolean i915CreateContext(int api,
|
||||||
|
const __GLcontextModes * mesaVis,
|
||||||
__DRIcontext * driContextPriv,
|
__DRIcontext * driContextPriv,
|
||||||
void *sharedContextPrivate);
|
void *sharedContextPrivate);
|
||||||
|
|
||||||
|
@@ -68,7 +68,8 @@ static void brwInitDriverFunctions( struct dd_function_table *functions )
|
|||||||
functions->Viewport = intel_viewport;
|
functions->Viewport = intel_viewport;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
|
GLboolean brwCreateContext( int api,
|
||||||
|
const __GLcontextModes *mesaVis,
|
||||||
__DRIcontext *driContextPriv,
|
__DRIcontext *driContextPriv,
|
||||||
void *sharedContextPrivate)
|
void *sharedContextPrivate)
|
||||||
{
|
{
|
||||||
@@ -85,7 +86,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
|
|||||||
brwInitVtbl( brw );
|
brwInitVtbl( brw );
|
||||||
brwInitDriverFunctions( &functions );
|
brwInitDriverFunctions( &functions );
|
||||||
|
|
||||||
if (!intelInitContext( intel, mesaVis, driContextPriv,
|
if (!intelInitContext( intel, api, mesaVis, driContextPriv,
|
||||||
sharedContextPrivate, &functions )) {
|
sharedContextPrivate, &functions )) {
|
||||||
printf("%s: failed to init intel context\n", __FUNCTION__);
|
printf("%s: failed to init intel context\n", __FUNCTION__);
|
||||||
FREE(brw);
|
FREE(brw);
|
||||||
|
@@ -687,7 +687,8 @@ void brwInitVtbl( struct brw_context *brw );
|
|||||||
/*======================================================================
|
/*======================================================================
|
||||||
* brw_context.c
|
* brw_context.c
|
||||||
*/
|
*/
|
||||||
GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
|
GLboolean brwCreateContext( int api,
|
||||||
|
const __GLcontextModes *mesaVis,
|
||||||
__DRIcontext *driContextPriv,
|
__DRIcontext *driContextPriv,
|
||||||
void *sharedContextPrivate);
|
void *sharedContextPrivate);
|
||||||
|
|
||||||
|
@@ -586,6 +586,7 @@ intelInitDriverFunctions(struct dd_function_table *functions)
|
|||||||
|
|
||||||
GLboolean
|
GLboolean
|
||||||
intelInitContext(struct intel_context *intel,
|
intelInitContext(struct intel_context *intel,
|
||||||
|
int api,
|
||||||
const __GLcontextModes * mesaVis,
|
const __GLcontextModes * mesaVis,
|
||||||
__DRIcontext * driContextPriv,
|
__DRIcontext * driContextPriv,
|
||||||
void *sharedContextPrivate,
|
void *sharedContextPrivate,
|
||||||
@@ -601,8 +602,8 @@ intelInitContext(struct intel_context *intel,
|
|||||||
if (intelScreen->bufmgr == NULL)
|
if (intelScreen->bufmgr == NULL)
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx,
|
if (!_mesa_initialize_context_for_api(&intel->ctx, api, mesaVis, shareCtx,
|
||||||
functions, (void *) intel)) {
|
functions, (void *) intel)) {
|
||||||
printf("%s: failed to init mesa context\n", __FUNCTION__);
|
printf("%s: failed to init mesa context\n", __FUNCTION__);
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -364,6 +364,7 @@ extern int INTEL_DEBUG;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
extern GLboolean intelInitContext(struct intel_context *intel,
|
extern GLboolean intelInitContext(struct intel_context *intel,
|
||||||
|
int api,
|
||||||
const __GLcontextModes * mesaVis,
|
const __GLcontextModes * mesaVis,
|
||||||
__DRIcontext * driContextPriv,
|
__DRIcontext * driContextPriv,
|
||||||
void *sharedContextPrivate,
|
void *sharedContextPrivate,
|
||||||
|
@@ -356,10 +356,12 @@ extern GLboolean i830CreateContext(const __GLcontextModes * mesaVis,
|
|||||||
__DRIcontext * driContextPriv,
|
__DRIcontext * driContextPriv,
|
||||||
void *sharedContextPrivate);
|
void *sharedContextPrivate);
|
||||||
|
|
||||||
extern GLboolean i915CreateContext(const __GLcontextModes * mesaVis,
|
extern GLboolean i915CreateContext(int api,
|
||||||
|
const __GLcontextModes * mesaVis,
|
||||||
__DRIcontext * driContextPriv,
|
__DRIcontext * driContextPriv,
|
||||||
void *sharedContextPrivate);
|
void *sharedContextPrivate);
|
||||||
extern GLboolean brwCreateContext(const __GLcontextModes * mesaVis,
|
extern GLboolean brwCreateContext(int api,
|
||||||
|
const __GLcontextModes * mesaVis,
|
||||||
__DRIcontext * driContextPriv,
|
__DRIcontext * driContextPriv,
|
||||||
void *sharedContextPrivate);
|
void *sharedContextPrivate);
|
||||||
|
|
||||||
@@ -375,7 +377,7 @@ intelCreateContext(gl_api api,
|
|||||||
#ifdef I915
|
#ifdef I915
|
||||||
if (IS_9XX(intelScreen->deviceID)) {
|
if (IS_9XX(intelScreen->deviceID)) {
|
||||||
if (!IS_965(intelScreen->deviceID)) {
|
if (!IS_965(intelScreen->deviceID)) {
|
||||||
return i915CreateContext(mesaVis, driContextPriv,
|
return i915CreateContext(api, mesaVis, driContextPriv,
|
||||||
sharedContextPrivate);
|
sharedContextPrivate);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -384,7 +386,8 @@ intelCreateContext(gl_api api,
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (IS_965(intelScreen->deviceID))
|
if (IS_965(intelScreen->deviceID))
|
||||||
return brwCreateContext(mesaVis, driContextPriv, sharedContextPrivate);
|
return brwCreateContext(api, mesaVis,
|
||||||
|
driContextPriv, sharedContextPrivate);
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr, "Unrecognized deviceID %x\n", intelScreen->deviceID);
|
fprintf(stderr, "Unrecognized deviceID %x\n", intelScreen->deviceID);
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
Reference in New Issue
Block a user