[PATCH 3/8] wined3d: Store multisample draw location in struct wined3d_d3d_info.
Józef Kucia
jkucia at codeweavers.com
Sun Mar 3 12:55:22 CST 2019
We may want to introduce a separate structure for backend options if we
have more of those.
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
dlls/wined3d/adapter_gl.c | 5 +++++
dlls/wined3d/resource.c | 8 +++-----
dlls/wined3d/wined3d_private.h | 2 ++
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index 086d0469551f..492d7f952305 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -3738,6 +3738,11 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
d3d_info->draw_base_vertex_offset = !!gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX];
+ if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE])
+ d3d_info->multisample_draw_location = WINED3D_LOCATION_TEXTURE_RGB;
+ else
+ d3d_info->multisample_draw_location = WINED3D_LOCATION_RB_MULTISAMPLE;
+
TRACE("Max texture stages: %u.\n", d3d_info->limits.ffp_blend_stages);
if (!d3d_info->shader_color_key)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 90025e9648b2..ba71df1e323d 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -481,17 +481,15 @@ BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
{
+ const struct wined3d_d3d_info *d3d_info = &resource->device->adapter->d3d_info;
+
if (!wined3d_resource_is_offscreen(resource) || wined3d_settings.offscreen_rendering_mode != ORM_FBO)
{
resource->draw_binding = WINED3D_LOCATION_DRAWABLE;
}
else if (resource->multisample_type)
{
- const struct wined3d_gl_info *gl_info = &resource->device->adapter->gl_info;
- if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE])
- resource->draw_binding = WINED3D_LOCATION_TEXTURE_RGB;
- else
- resource->draw_binding = WINED3D_LOCATION_RB_MULTISAMPLE;
+ resource->draw_binding = d3d_info->multisample_draw_location;
}
else if (resource->gl_type == WINED3D_GL_RES_TYPE_RB)
{
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 25a74dce0018..cc5902a8e75c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -207,6 +207,8 @@ struct wined3d_d3d_info
unsigned int texture_npot_conditional : 1;
unsigned int draw_base_vertex_offset : 1;
enum wined3d_feature_level feature_level;
+
+ DWORD multisample_draw_location;
};
static const struct color_fixup_desc COLOR_FIXUP_IDENTITY =
--
2.19.2
More information about the wine-devel
mailing list