Commit ffb27c61 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

opengl32: Introduce WGL_WINE_query_renderer.

This is a fairly straightforward adaptation of GLX_MESA_query_renderer to WGL. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 644724d3
...@@ -574,6 +574,17 @@ my %ext_functions = ...@@ -574,6 +574,17 @@ my %ext_functions =
"glDeleteObjectBufferATI" => [ "void", [ [ "GLuint", "buffer" ] ], [ "GL_ATI_vertex_array_object" ] ], "glDeleteObjectBufferATI" => [ "void", [ [ "GLuint", "buffer" ] ], [ "GL_ATI_vertex_array_object" ] ],
"wglSetPixelFormatWINE" => [ "BOOL", [ [ "HDC", "hdc" ], "wglSetPixelFormatWINE" => [ "BOOL", [ [ "HDC", "hdc" ],
[ "int", "format" ] ], [ "WGL_WINE_pixel_format_passthrough" ] ], [ "int", "format" ] ], [ "WGL_WINE_pixel_format_passthrough" ] ],
"wglQueryCurrentRendererIntegerWINE" => [ "BOOL", [ [ "GLenum", "attribute" ],
[ "GLuint *", "value" ] ], [ "WGL_WINE_query_renderer" ] ],
"wglQueryCurrentRendererStringWINE" => [ "const GLchar *", [ [ "GLenum", "attribute" ] ],
[ "WGL_WINE_query_renderer" ] ],
"wglQueryRendererIntegerWINE" => [ "BOOL", [ [ "HDC", "dc" ],
[ "GLint", "renderer" ],
[ "GLenum", "attribute" ],
[ "GLuint *", "value" ] ], [ "WGL_WINE_query_renderer" ] ],
"wglQueryRendererStringWINE" => [ "const GLchar *", [ [ "HDC", "dc" ],
[ "GLint", "renderer" ],
[ "GLenum", "attribute" ] ], [ "WGL_WINE_query_renderer" ] ],
); );
...@@ -614,7 +625,21 @@ my %supported_wgl_extensions = ...@@ -614,7 +625,21 @@ my %supported_wgl_extensions =
"WGL_WINE_pixel_format_passthrough" => 1, "WGL_WINE_pixel_format_passthrough" => 1,
); );
my %enums = (); my %enums =
(
"WGL_RENDERER_VENDOR_ID_WINE" => "0x8183",
"WGL_RENDERER_DEVICE_ID_WINE" => "0x8184",
"WGL_RENDERER_VERSION_WINE" => "0x8185",
"WGL_RENDERER_ACCELERATED_WINE" => "0x8186",
"WGL_RENDERER_VIDEO_MEMORY_WINE" => "0x8187",
"WGL_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_WINE" => "0x8188",
"WGL_RENDERER_PREFERRED_PROFILE_WINE" => "0x8189",
"WGL_RENDERER_OPENGL_CORE_PROFILE_VERSION_WINE" => "0x818A",
"WGL_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_WINE" => "0x818B",
"WGL_RENDERER_OPENGL_ES_PROFILE_VERSION_WINE" => "0x818C",
"WGL_RENDERER_OPENGL_ES2_PROFILE_VERSION_WINE" => "0x818D",
"WGL_RENDERER_ID_WINE" => "0x818E",
);
sub parse_variable($) sub parse_variable($)
{ {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(opengl); WINE_DEFAULT_DEBUG_CHANNEL(opengl);
const int extension_registry_size = 2576; const int extension_registry_size = 2580;
static void WINAPI glAccumxOES( GLenum op, GLfixed value ) { static void WINAPI glAccumxOES( GLenum op, GLfixed value ) {
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
...@@ -15342,7 +15342,7 @@ static void WINAPI glWriteMaskEXT( GLuint res, GLuint in, GLenum outX, GLenum ou ...@@ -15342,7 +15342,7 @@ static void WINAPI glWriteMaskEXT( GLuint res, GLuint in, GLenum outX, GLenum ou
funcs->ext.p_glWriteMaskEXT( res, in, outX, outY, outZ, outW ); funcs->ext.p_glWriteMaskEXT( res, in, outX, outY, outZ, outW );
} }
const OpenGL_extension extension_registry[2576] = { const OpenGL_extension extension_registry[2580] = {
{ "glAccumxOES", "GL_OES_fixed_point", glAccumxOES }, { "glAccumxOES", "GL_OES_fixed_point", glAccumxOES },
{ "glActiveProgramEXT", "GL_EXT_separate_shader_objects", glActiveProgramEXT }, { "glActiveProgramEXT", "GL_EXT_separate_shader_objects", glActiveProgramEXT },
{ "glActiveShaderProgram", "GL_ARB_separate_shader_objects GL_VERSION_4_1", glActiveShaderProgram }, { "glActiveShaderProgram", "GL_ARB_separate_shader_objects GL_VERSION_4_1", glActiveShaderProgram },
...@@ -17913,7 +17913,11 @@ const OpenGL_extension extension_registry[2576] = { ...@@ -17913,7 +17913,11 @@ const OpenGL_extension extension_registry[2576] = {
{ "wglGetPixelFormatAttribivARB", "WGL_ARB_pixel_format", wglGetPixelFormatAttribivARB }, { "wglGetPixelFormatAttribivARB", "WGL_ARB_pixel_format", wglGetPixelFormatAttribivARB },
{ "wglGetSwapIntervalEXT", "WGL_EXT_swap_control", wglGetSwapIntervalEXT }, { "wglGetSwapIntervalEXT", "WGL_EXT_swap_control", wglGetSwapIntervalEXT },
{ "wglMakeContextCurrentARB", "WGL_ARB_make_current_read", wglMakeContextCurrentARB }, { "wglMakeContextCurrentARB", "WGL_ARB_make_current_read", wglMakeContextCurrentARB },
{ "wglQueryCurrentRendererIntegerWINE", "WGL_WINE_query_renderer", wglQueryCurrentRendererIntegerWINE },
{ "wglQueryCurrentRendererStringWINE", "WGL_WINE_query_renderer", wglQueryCurrentRendererStringWINE },
{ "wglQueryPbufferARB", "WGL_ARB_pbuffer", wglQueryPbufferARB }, { "wglQueryPbufferARB", "WGL_ARB_pbuffer", wglQueryPbufferARB },
{ "wglQueryRendererIntegerWINE", "WGL_WINE_query_renderer", wglQueryRendererIntegerWINE },
{ "wglQueryRendererStringWINE", "WGL_WINE_query_renderer", wglQueryRendererStringWINE },
{ "wglReleasePbufferDCARB", "WGL_ARB_pbuffer", wglReleasePbufferDCARB }, { "wglReleasePbufferDCARB", "WGL_ARB_pbuffer", wglReleasePbufferDCARB },
{ "wglReleaseTexImageARB", "WGL_ARB_render_texture", wglReleaseTexImageARB }, { "wglReleaseTexImageARB", "WGL_ARB_render_texture", wglReleaseTexImageARB },
{ "wglSetPbufferAttribARB", "WGL_ARB_render_texture", wglSetPbufferAttribARB }, { "wglSetPbufferAttribARB", "WGL_ARB_render_texture", wglSetPbufferAttribARB },
......
...@@ -32,5 +32,10 @@ extern const OpenGL_extension extension_registry[] DECLSPEC_HIDDEN; ...@@ -32,5 +32,10 @@ extern const OpenGL_extension extension_registry[] DECLSPEC_HIDDEN;
extern const int extension_registry_size DECLSPEC_HIDDEN; extern const int extension_registry_size DECLSPEC_HIDDEN;
extern BOOL WINAPI wglSetPixelFormatWINE( HDC hdc, int format ) DECLSPEC_HIDDEN; extern BOOL WINAPI wglSetPixelFormatWINE( HDC hdc, int format ) DECLSPEC_HIDDEN;
extern BOOL WINAPI wglQueryCurrentRendererIntegerWINE( GLenum attribute, GLuint *value ) DECLSPEC_HIDDEN;
extern const GLchar * WINAPI wglQueryCurrentRendererStringWINE( GLenum attribute );
extern BOOL WINAPI wglQueryRendererIntegerWINE( HDC dc, GLint renderer,
GLenum attribute, GLuint *value ) DECLSPEC_HIDDEN;
extern const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum attribute ) DECLSPEC_HIDDEN;
#endif /* __DLLS_OPENGL32_OPENGL_EXT_H */ #endif /* __DLLS_OPENGL32_OPENGL_EXT_H */
...@@ -5932,7 +5932,11 @@ static BOOL null_wglGetPixelFormatAttribfvARB( HDC hdc, int iPixelFormat, int iL ...@@ -5932,7 +5932,11 @@ static BOOL null_wglGetPixelFormatAttribfvARB( HDC hdc, int iPixelFormat, int iL
static BOOL null_wglGetPixelFormatAttribivARB( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int* piValues ) { return 0; } static BOOL null_wglGetPixelFormatAttribivARB( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int* piValues ) { return 0; }
static int null_wglGetSwapIntervalEXT( void ) { return 0; } static int null_wglGetSwapIntervalEXT( void ) { return 0; }
static BOOL null_wglMakeContextCurrentARB( HDC hDrawDC, HDC hReadDC, struct wgl_context * hglrc ) { return 0; } static BOOL null_wglMakeContextCurrentARB( HDC hDrawDC, HDC hReadDC, struct wgl_context * hglrc ) { return 0; }
static BOOL null_wglQueryCurrentRendererIntegerWINE( GLenum attribute, GLuint * value ) { return 0; }
static const GLchar * null_wglQueryCurrentRendererStringWINE( GLenum attribute ) { return 0; }
static BOOL null_wglQueryPbufferARB( struct wgl_pbuffer * hPbuffer, int iAttribute, int* piValue ) { return 0; } static BOOL null_wglQueryPbufferARB( struct wgl_pbuffer * hPbuffer, int iAttribute, int* piValue ) { return 0; }
static BOOL null_wglQueryRendererIntegerWINE( HDC dc, GLint renderer, GLenum attribute, GLuint * value ) { return 0; }
static const GLchar * null_wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum attribute ) { return 0; }
static int null_wglReleasePbufferDCARB( struct wgl_pbuffer * hPbuffer, HDC hDC ) { return 0; } static int null_wglReleasePbufferDCARB( struct wgl_pbuffer * hPbuffer, HDC hDC ) { return 0; }
static BOOL null_wglReleaseTexImageARB( struct wgl_pbuffer * hPbuffer, int iBuffer ) { return 0; } static BOOL null_wglReleaseTexImageARB( struct wgl_pbuffer * hPbuffer, int iBuffer ) { return 0; }
static BOOL null_wglSetPbufferAttribARB( struct wgl_pbuffer * hPbuffer, const int* piAttribList ) { return 0; } static BOOL null_wglSetPbufferAttribARB( struct wgl_pbuffer * hPbuffer, const int* piAttribList ) { return 0; }
...@@ -8862,7 +8866,11 @@ struct opengl_funcs null_opengl_funcs = ...@@ -8862,7 +8866,11 @@ struct opengl_funcs null_opengl_funcs =
null_wglGetPixelFormatAttribivARB, null_wglGetPixelFormatAttribivARB,
null_wglGetSwapIntervalEXT, null_wglGetSwapIntervalEXT,
null_wglMakeContextCurrentARB, null_wglMakeContextCurrentARB,
null_wglQueryCurrentRendererIntegerWINE,
null_wglQueryCurrentRendererStringWINE,
null_wglQueryPbufferARB, null_wglQueryPbufferARB,
null_wglQueryRendererIntegerWINE,
null_wglQueryRendererStringWINE,
null_wglReleasePbufferDCARB, null_wglReleasePbufferDCARB,
null_wglReleaseTexImageARB, null_wglReleaseTexImageARB,
null_wglSetPbufferAttribARB, null_wglSetPbufferAttribARB,
......
...@@ -1213,6 +1213,58 @@ BOOL WINAPI wglSetPixelFormatWINE( HDC hdc, int format ) ...@@ -1213,6 +1213,58 @@ BOOL WINAPI wglSetPixelFormatWINE( HDC hdc, int format )
} }
/*********************************************************************** /***********************************************************************
* wglQueryCurrentRendererIntegerWINE
*
* Provided by the WGL_WINE_query_renderer extension.
*/
BOOL WINAPI wglQueryCurrentRendererIntegerWINE( GLenum attribute, GLuint *value )
{
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
if (!funcs->ext.p_wglQueryCurrentRendererIntegerWINE) return FALSE;
return funcs->ext.p_wglQueryCurrentRendererIntegerWINE( attribute, value );
}
/***********************************************************************
* wglQueryCurrentRendererStringWINE
*
* Provided by the WGL_WINE_query_renderer extension.
*/
const GLchar * WINAPI wglQueryCurrentRendererStringWINE( GLenum attribute )
{
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
if (!funcs->ext.p_wglQueryCurrentRendererStringWINE) return NULL;
return funcs->ext.p_wglQueryCurrentRendererStringWINE( attribute );
}
/***********************************************************************
* wglQueryRendererIntegerWINE
*
* Provided by the WGL_WINE_query_renderer extension.
*/
BOOL WINAPI wglQueryRendererIntegerWINE( HDC dc, GLint renderer, GLenum attribute, GLuint *value )
{
const struct opengl_funcs *funcs = get_dc_funcs( dc );
if (!funcs || !funcs->ext.p_wglQueryRendererIntegerWINE) return FALSE;
return funcs->ext.p_wglQueryRendererIntegerWINE( dc, renderer, attribute, value );
}
/***********************************************************************
* wglQueryRendererStringWINE
*
* Provided by the WGL_WINE_query_renderer extension.
*/
const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum attribute )
{
const struct opengl_funcs *funcs = get_dc_funcs( dc );
if (!funcs || !funcs->ext.p_wglQueryRendererStringWINE) return NULL;
return funcs->ext.p_wglQueryRendererStringWINE( dc, renderer, attribute );
}
/***********************************************************************
* wglUseFontBitmaps_common * wglUseFontBitmaps_common
*/ */
static BOOL wglUseFontBitmaps_common( HDC hdc, DWORD first, DWORD count, DWORD listBase, BOOL unicode ) static BOOL wglUseFontBitmaps_common( HDC hdc, DWORD first, DWORD count, DWORD listBase, BOOL unicode )
......
...@@ -5654,6 +5654,18 @@ typedef void GLvoid; ...@@ -5654,6 +5654,18 @@ typedef void GLvoid;
#define GL_ZOOM_X 0x0D16 #define GL_ZOOM_X 0x0D16
#define GL_ZOOM_Y 0x0D17 #define GL_ZOOM_Y 0x0D17
#define GL_Z_EXT 0x87D7 #define GL_Z_EXT 0x87D7
#define WGL_RENDERER_ACCELERATED_WINE 0x8186
#define WGL_RENDERER_DEVICE_ID_WINE 0x8184
#define WGL_RENDERER_ID_WINE 0x818E
#define WGL_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_WINE 0x818B
#define WGL_RENDERER_OPENGL_CORE_PROFILE_VERSION_WINE 0x818A
#define WGL_RENDERER_OPENGL_ES2_PROFILE_VERSION_WINE 0x818D
#define WGL_RENDERER_OPENGL_ES_PROFILE_VERSION_WINE 0x818C
#define WGL_RENDERER_PREFERRED_PROFILE_WINE 0x8189
#define WGL_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_WINE 0x8188
#define WGL_RENDERER_VENDOR_ID_WINE 0x8183
#define WGL_RENDERER_VERSION_WINE 0x8185
#define WGL_RENDERER_VIDEO_MEMORY_WINE 0x8187
void GLAPIENTRY glAccum(GLenum,GLfloat); void GLAPIENTRY glAccum(GLenum,GLfloat);
void GLAPIENTRY glAlphaFunc(GLenum,GLfloat); void GLAPIENTRY glAlphaFunc(GLenum,GLfloat);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#define WINE_GLAPI #define WINE_GLAPI
#endif #endif
#define WINE_WGL_DRIVER_VERSION 14 #define WINE_WGL_DRIVER_VERSION 15
struct wgl_context; struct wgl_context;
struct wgl_pbuffer; struct wgl_pbuffer;
...@@ -2940,7 +2940,11 @@ struct opengl_funcs ...@@ -2940,7 +2940,11 @@ struct opengl_funcs
BOOL (WINE_GLAPI *p_wglGetPixelFormatAttribivARB)(HDC,int,int,UINT,const int*,int*); BOOL (WINE_GLAPI *p_wglGetPixelFormatAttribivARB)(HDC,int,int,UINT,const int*,int*);
int (WINE_GLAPI *p_wglGetSwapIntervalEXT)(void); int (WINE_GLAPI *p_wglGetSwapIntervalEXT)(void);
BOOL (WINE_GLAPI *p_wglMakeContextCurrentARB)(HDC,HDC,struct wgl_context *); BOOL (WINE_GLAPI *p_wglMakeContextCurrentARB)(HDC,HDC,struct wgl_context *);
BOOL (WINE_GLAPI *p_wglQueryCurrentRendererIntegerWINE)(GLenum,GLuint *);
const GLchar * (WINE_GLAPI *p_wglQueryCurrentRendererStringWINE)(GLenum);
BOOL (WINE_GLAPI *p_wglQueryPbufferARB)(struct wgl_pbuffer *,int,int*); BOOL (WINE_GLAPI *p_wglQueryPbufferARB)(struct wgl_pbuffer *,int,int*);
BOOL (WINE_GLAPI *p_wglQueryRendererIntegerWINE)(HDC,GLint,GLenum,GLuint *);
const GLchar * (WINE_GLAPI *p_wglQueryRendererStringWINE)(HDC,GLint,GLenum);
int (WINE_GLAPI *p_wglReleasePbufferDCARB)(struct wgl_pbuffer *,HDC); int (WINE_GLAPI *p_wglReleasePbufferDCARB)(struct wgl_pbuffer *,HDC);
BOOL (WINE_GLAPI *p_wglReleaseTexImageARB)(struct wgl_pbuffer *,int); BOOL (WINE_GLAPI *p_wglReleaseTexImageARB)(struct wgl_pbuffer *,int);
BOOL (WINE_GLAPI *p_wglSetPbufferAttribARB)(struct wgl_pbuffer *,const int*); BOOL (WINE_GLAPI *p_wglSetPbufferAttribARB)(struct wgl_pbuffer *,const int*);
......
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