wined3d: Add support for ARB_vertex_array_bgra.

This commit is contained in:
Henri Verbeet 2010-01-25 19:51:31 +01:00 committed by Alexandre Julliard
parent 96b150929b
commit 98568f0ba1
7 changed files with 14 additions and 7 deletions

View File

@ -483,7 +483,7 @@ static BOOL buffer_find_decl(struct wined3d_buffer *This)
* FLOAT16s if not supported. Also, we can't iterate over the array, so use macros to generate code for all
* the attributes that our current fixed function pipeline implementation cares for.
*/
BOOL support_d3dcolor = gl_info->supported[EXT_VERTEX_ARRAY_BGRA];
BOOL support_d3dcolor = gl_info->supported[ARB_VERTEX_ARRAY_BGRA];
ret = buffer_check_attribute(This, si, WINED3D_FFP_POSITION,
TRUE, TRUE, FALSE, &stride_this_run, &float16_used) || ret;
ret = buffer_check_attribute(This, si, WINED3D_FFP_NORMAL,

View File

@ -298,7 +298,7 @@ void device_stream_info_from_declaration(IWineD3DDeviceImpl *This,
stream_info->elements[idx].stream_idx = element->input_slot;
stream_info->elements[idx].buffer_object = buffer_object;
if (!This->adapter->gl_info.supported[EXT_VERTEX_ARRAY_BGRA]
if (!This->adapter->gl_info.supported[ARB_VERTEX_ARRAY_BGRA]
&& element->format_desc->format == WINED3DFMT_B8G8R8A8_UNORM)
{
stream_info->swizzle_map |= 1 << idx;
@ -361,7 +361,7 @@ void device_stream_info_from_strided(const struct wined3d_gl_info *gl_info,
{
if (!stream_info->elements[i].format_desc) continue;
if (!gl_info->supported[EXT_VERTEX_ARRAY_BGRA]
if (!gl_info->supported[ARB_VERTEX_ARRAY_BGRA]
&& stream_info->elements[i].format_desc->format == WINED3DFMT_B8G8R8A8_UNORM)
{
stream_info->swizzle_map |= 1 << i;

View File

@ -82,6 +82,7 @@ static const struct {
{"GL_ARB_texture_non_power_of_two", ARB_TEXTURE_NON_POWER_OF_TWO, MAKEDWORD_VERSION(2, 0) },
{"GL_ARB_texture_rectangle", ARB_TEXTURE_RECTANGLE, 0 },
{"GL_ARB_texture_rg", ARB_TEXTURE_RG, 0 },
{"GL_ARB_vertex_array_bgra", ARB_VERTEX_ARRAY_BGRA, 0 },
{"GL_ARB_vertex_blend", ARB_VERTEX_BLEND, 0 },
{"GL_ARB_vertex_buffer_object", ARB_VERTEX_BUFFER_OBJECT, 0 },
{"GL_ARB_vertex_program", ARB_VERTEX_PROGRAM, 0 },
@ -1842,6 +1843,11 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_driver_info *driver_info, str
TRACE_(d3d_caps)(" IMPLIED: ARB_depth_clamp support (by NV_depth_clamp).\n");
gl_info->supported[ARB_DEPTH_CLAMP] = TRUE;
}
if (!gl_info->supported[ARB_VERTEX_ARRAY_BGRA] && gl_info->supported[EXT_VERTEX_ARRAY_BGRA])
{
TRACE_(d3d_caps)(" IMPLIED: ARB_vertex_array_bgra support (by EXT_vertex_array_bgra).\n");
gl_info->supported[ARB_VERTEX_ARRAY_BGRA] = TRUE;
}
if (gl_info->supported[NV_TEXTURE_SHADER2])
{
if (gl_info->supported[NV_REGISTER_COMBINERS])

View File

@ -334,7 +334,7 @@ static inline void send_attribute(IWineD3DDeviceImpl *This, WINED3DFORMAT format
GL_EXTCALL(glVertexAttrib4ubvARB(index, ptr));
break;
case WINED3DFMT_B8G8R8A8_UNORM:
if (gl_info->supported[EXT_VERTEX_ARRAY_BGRA])
if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA])
{
const DWORD *src = ptr;
DWORD c = *src & 0xff00ff00;

View File

@ -4167,7 +4167,7 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
GL_EXTCALL(glVertexAttrib4NubvARB(i, ptr));
break;
case WINED3DFMT_B8G8R8A8_UNORM:
if (gl_info->supported[EXT_VERTEX_ARRAY_BGRA])
if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA])
{
const DWORD *src = (const DWORD *)ptr;
DWORD c = *src & 0xff00ff00;
@ -4544,7 +4544,7 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wi
else
{
WORD slow_mask = (1 << WINED3D_FFP_PSIZE);
slow_mask |= -!gl_info->supported[EXT_VERTEX_ARRAY_BGRA]
slow_mask |= -!gl_info->supported[ARB_VERTEX_ARRAY_BGRA]
& ((1 << WINED3D_FFP_DIFFUSE) | (1 << WINED3D_FFP_SPECULAR));
if (fixup || (!dataLocations->position_transformed

View File

@ -1098,7 +1098,7 @@ static void apply_format_fixups(struct wined3d_gl_info *gl_info)
gl_info->gl_formats[idx].heightscale = 1.5f;
gl_info->gl_formats[idx].color_fixup = create_yuv_fixup_desc(YUV_FIXUP_YV12);
if (gl_info->supported[EXT_VERTEX_ARRAY_BGRA])
if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA])
{
idx = getFmtIdx(WINED3DFMT_B8G8R8A8_UNORM);
gl_info->gl_formats[idx].gl_vtx_format = GL_BGRA;

View File

@ -1764,6 +1764,7 @@ typedef enum wined3d_gl_extension
ARB_TEXTURE_NON_POWER_OF_TWO,
ARB_TEXTURE_RECTANGLE,
ARB_TEXTURE_RG,
ARB_VERTEX_ARRAY_BGRA,
ARB_VERTEX_BLEND,
ARB_VERTEX_BUFFER_OBJECT,
ARB_VERTEX_PROGRAM,