=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Avoid accessing gl_info in vertexdeclaration_init().
Alexandre Julliard
julliard at winehq.org
Mon Aug 27 16:18:16 CDT 2018
Module: wine
Branch: master
Commit: 25d55c42095e967ea5683664dd454cc6f67415f3
URL: https://source.winehq.org/git/wine.git/?a=commit;h=25d55c42095e967ea5683664dd454cc6f67415f3
Author: Józef Kucia <jkucia at codeweavers.com>
Date: Fri Aug 24 15:44:05 2018 +0200
wined3d: Avoid accessing gl_info in vertexdeclaration_init().
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/context.c | 2 +-
dlls/wined3d/vertexdeclaration.c | 6 +++---
dlls/wined3d/wined3d_private.h | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index a4cfd66..83e3563 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -3683,7 +3683,7 @@ static void context_update_stream_info(struct wined3d_context *context, const st
if (use_vs(state))
{
- if (state->vertex_declaration->half_float_conv_needed)
+ if (state->vertex_declaration->have_half_floats && !gl_info->supported[ARB_HALF_FLOAT_VERTEX])
{
TRACE("Using immediate mode draw with vertex shaders for FLOAT16 conversion.\n");
context->use_immediate_mode_draw = TRUE;
diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c
index 9098b32..c050a6d 100644
--- a/dlls/wined3d/vertexdeclaration.c
+++ b/dlls/wined3d/vertexdeclaration.c
@@ -174,7 +174,6 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara
void *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_adapter *adapter = device->adapter;
- const struct wined3d_gl_info *gl_info = &adapter->gl_info;
unsigned int i;
if (TRACE_ON(d3d_decl))
@@ -218,7 +217,8 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara
/* Find the streams used in the declaration. The vertex buffers have
* to be loaded when drawing, but filter tesselation pseudo streams. */
- if (e->input_slot >= MAX_STREAMS) continue;
+ if (e->input_slot >= MAX_STREAMS)
+ continue;
if (!e->format->gl_vtx_format)
{
@@ -254,7 +254,7 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara
if (elements[i].format == WINED3DFMT_R16G16_FLOAT || elements[i].format == WINED3DFMT_R16G16B16A16_FLOAT)
{
- if (!gl_info->supported[ARB_HALF_FLOAT_VERTEX]) declaration->half_float_conv_needed = TRUE;
+ declaration->have_half_floats = TRUE;
}
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8da12d7..da3cd46 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3463,10 +3463,10 @@ struct wined3d_vertex_declaration
struct wined3d_device *device;
struct wined3d_vertex_declaration_element *elements;
- UINT element_count;
+ unsigned int element_count;
BOOL position_transformed;
- BOOL half_float_conv_needed;
+ BOOL have_half_floats;
};
struct wined3d_saved_states
More information about the wine-cvs
mailing list