From a220669f33411dae74aa05c80201611c93d9a932 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Fri, 14 Sep 2018 01:37:49 +0430 Subject: [PATCH] wined3d: Introduce WINED3DFMT_FLAG_VERTEX_ATTRIBUTE. To indicate a format can be used for vertex attributes. Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/utils.c | 1 + dlls/wined3d/vertexdeclaration.c | 2 +- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 17aa8c07732..d463a086803 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3692,6 +3692,7 @@ static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter, format->emit_idx = format_vertex_info[i].emit_idx; format->gl_vtx_type = format_vertex_info[i].gl_vtx_type; format->gl_vtx_format = format->component_count; + format->flags[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE; } if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA]) diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c index 89329d42034..863366b9243 100644 --- a/dlls/wined3d/vertexdeclaration.c +++ b/dlls/wined3d/vertexdeclaration.c @@ -220,7 +220,7 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara if (e->input_slot >= MAX_STREAMS) continue; - if (!e->format->gl_vtx_format) + if (!(e->format->flags[WINED3D_GL_RES_TYPE_BUFFER] & WINED3DFMT_FLAG_VERTEX_ATTRIBUTE)) { FIXME("The application tries to use an unsupported format (%s), returning E_FAIL.\n", debug_d3dformat(elements[i].format)); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 2673de0c4eb..aea874f84ea 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4293,6 +4293,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_INTEGER 0x00200000 #define WINED3DFMT_FLAG_GEN_MIPMAP 0x00400000 #define WINED3DFMT_FLAG_NORMALISED 0x00800000 +#define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000 struct wined3d_rational {