Henri Verbeet : wined3d: Introduce WINED3DFMT_FLAG_VERTEX_ATTRIBUTE.

Alexandre Julliard julliard at winehq.org
Fri Sep 14 14:20:59 CDT 2018


Module: wine
Branch: master
Commit: a220669f33411dae74aa05c80201611c93d9a932
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a220669f33411dae74aa05c80201611c93d9a932

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Sep 14 01:55:49 2018 +0430

wined3d: Introduce WINED3DFMT_FLAG_VERTEX_ATTRIBUTE.

To indicate a format can be used for vertex attributes.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 17aa8c0..d463a08 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 89329d4..863366b 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 2673de0..aea874f 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
 {




More information about the wine-cvs mailing list