Commit 6dc3ac2b authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Make the core extensions enabling table-based.

parent 25247c5a
......@@ -3342,6 +3342,19 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
/* Context activation is done by the caller. */
static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
{
static const struct
{
enum wined3d_gl_extension extension;
DWORD min_gl_version;
}
core_extensions[] =
{
{EXT_TEXTURE3D, MAKEDWORD_VERSION(1, 2)},
{EXT_BLEND_MINMAX, MAKEDWORD_VERSION(1, 4)},
{EXT_BLEND_SUBTRACT, MAKEDWORD_VERSION(1, 4)},
{NV_POINT_SPRITE, MAKEDWORD_VERSION(1, 4)},
{ARB_TEXTURE_NON_POWER_OF_TWO, MAKEDWORD_VERSION(2, 0)},
};
struct wined3d_driver_info *driver_info = &adapter->driver_info;
const char *gl_vendor_str, *gl_renderer_str, *gl_version_str;
struct wined3d_gl_info *gl_info = &adapter->gl_info;
......@@ -3354,7 +3367,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
enum wined3d_pci_device device;
DWORD gl_version;
HDC hdc;
unsigned int i;
unsigned int i, j;
GLint context_profile = 0;
TRACE("adapter %p.\n", adapter);
......@@ -3429,30 +3442,25 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
parse_extension_string(gl_info, WGL_Extensions, wgl_extension_map,
sizeof(wgl_extension_map) / sizeof(*wgl_extension_map));
if (!gl_info->supported[EXT_TEXTURE3D] && gl_version >= MAKEDWORD_VERSION(1, 2))
{
TRACE("GL CORE: GL_EXT_texture3D support.\n");
gl_info->supported[EXT_TEXTURE3D] = TRUE;
}
if (!gl_info->supported[NV_POINT_SPRITE] && gl_version >= MAKEDWORD_VERSION(1, 4))
{
TRACE("GL CORE: GL_NV_point_sprite support.\n");
gl_info->supported[NV_POINT_SPRITE] = TRUE;
}
if ((!gl_info->supported[EXT_BLEND_MINMAX] || !gl_info->supported[EXT_BLEND_SUBTRACT])
&& gl_version >= MAKEDWORD_VERSION(1, 4))
for (i = 0; i < ARRAY_SIZE(core_extensions); ++i)
{
TRACE("GL CORE: GL_EXT_blend_minmax / GL_EXT_blend_subtract support.\n");
gl_info->supported[EXT_BLEND_MINMAX] = TRUE;
gl_info->supported[EXT_BLEND_SUBTRACT] = TRUE;
}
if (!gl_info->supported[core_extensions[i].extension]
&& gl_version >= core_extensions[i].min_gl_version)
{
for (j = 0; j < ARRAY_SIZE(gl_extension_map); ++j)
if (gl_extension_map[j].extension == core_extensions[i].extension)
break;
if (!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] && gl_version >= MAKEDWORD_VERSION(2, 0))
{
TRACE("GL CORE: GL_ARB_texture_non_power_of_two support.\n");
gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] = TRUE;
if (j < ARRAY_SIZE(gl_extension_map))
{
TRACE("GL CORE: %s support.\n", gl_extension_map[j].extension_string);
gl_info->supported[core_extensions[i].extension] = TRUE;
}
else
{
FIXME("GL extension %u not in the GL extensions map.\n", core_extensions[i].extension);
}
}
}
if (gl_info->supported[EXT_BLEND_MINMAX] || gl_info->supported[EXT_BLEND_SUBTRACT])
......
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