wined3d: Trace the minimum buffer map alignment in wined3d_adapter_init_gl_caps().

There's not much else we need to do for ARB_map_buffer_alignment. There's
still a pretty decent chance that we'll get lucky with alignment even on
drivers that don't support the extension, since mmap is going to return page
aligned memory. Tiny buffers might get packed together in a page though.
This commit is contained in:
Henri Verbeet 2011-11-23 21:14:55 +01:00 committed by Alexandre Julliard
parent bca0ec8182
commit 0acd48d89f
2 changed files with 17 additions and 0 deletions

View file

@ -101,6 +101,7 @@ EXTENSION_MAP[] =
{"GL_ARB_geometry_shader4", ARB_GEOMETRY_SHADER4, 0 },
{"GL_ARB_half_float_pixel", ARB_HALF_FLOAT_PIXEL, 0 },
{"GL_ARB_half_float_vertex", ARB_HALF_FLOAT_VERTEX, 0 },
{"GL_ARB_map_buffer_alignment", ARB_MAP_BUFFER_ALIGNMENT, 0 },
{"GL_ARB_map_buffer_range", ARB_MAP_BUFFER_RANGE, 0 },
{"GL_ARB_multisample", ARB_MULTISAMPLE, 0 }, /* needs GLX_ARB_MULTISAMPLE as well */
{"GL_ARB_multitexture", ARB_MULTITEXTURE, 0 },
@ -2474,6 +2475,15 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
}
}
if (gl_info->supported[ARB_MAP_BUFFER_ALIGNMENT])
{
glGetIntegerv(GL_MIN_MAP_BUFFER_ALIGNMENT, &gl_max);
TRACE_(d3d_caps)("Minimum buffer map alignment: %d.\n", gl_max);
}
else
{
WARN_(d3d_caps)("Driver doesn't guarantee a minimum buffer map alignment.\n");
}
if (gl_info->supported[NV_REGISTER_COMBINERS])
{
glGetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &gl_max);

View file

@ -1745,6 +1745,7 @@ enum wined3d_gl_extension
ARB_GEOMETRY_SHADER4,
ARB_HALF_FLOAT_PIXEL,
ARB_HALF_FLOAT_VERTEX,
ARB_MAP_BUFFER_ALIGNMENT,
ARB_MAP_BUFFER_RANGE,
ARB_MULTISAMPLE,
ARB_MULTITEXTURE,
@ -2161,6 +2162,12 @@ typedef void (WINE_GLAPI *PGLFNFRAMEBUFFERTEXTUREFACEARBPROC)(GLenum target, GLe
#define GL_HALF_FLOAT 0x140b
#endif
/* GL_ARB_map_buffer_alignment */
#ifndef GL_ARB_map_buffer_alignment
#define GL_ARB_map_buffer_alignment 1
#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90bc
#endif
/* GL_ARB_map_buffer_range */
#ifndef GL_ARB_map_buffer_range
#define GL_ARB_map_buffer_range 1