From 4b7dbb610ba95b21e2cb122f9ddfd3663d68acdb Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 16 Apr 2016 21:15:16 +0200 Subject: [PATCH] Added patch with stubs for QUERY_TYPE_SO_STATISTICS and QUERY_TYPE_SO_OVERFLOW. --- patches/patchinstall.sh | 19 +++ ...s-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch | 118 ++++++++++++++++++ patches/wined3d-QUERY_Stubs/definition | 1 + 3 files changed, 138 insertions(+) create mode 100644 patches/wined3d-QUERY_Stubs/0001-wined3d-Add-stubs-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch create mode 100644 patches/wined3d-QUERY_Stubs/definition diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index ca662e9d..07413ef5 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -361,6 +361,7 @@ patch_enable_all () enable_wined3d_DXTn="$1" enable_wined3d_Fix_Typos="$1" enable_wined3d_Limit_Vram="$1" + enable_wined3d_QUERY_Stubs="$1" enable_wined3d_Revert_PixelFormat="$1" enable_wined3d_Silence_FIXMEs="$1" enable_winedevice_Fix_Relocation="$1" @@ -1256,6 +1257,9 @@ patch_enable () wined3d-Limit_Vram) enable_wined3d_Limit_Vram="$2" ;; + wined3d-QUERY_Stubs) + enable_wined3d_QUERY_Stubs="$2" + ;; wined3d-Revert_PixelFormat) enable_wined3d_Revert_PixelFormat="$2" ;; @@ -7211,6 +7215,21 @@ if test "$enable_wined3d_Limit_Vram" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-QUERY_Stubs +# | +# | This patchset fixes the following Wine bugs: +# | * [#20776] Add stubs for QUERY_TYPE_SO_STATISTICS and QUERY_TYPE_SO_OVERFLOW +# | +# | Modified files: +# | * dlls/wined3d/query.c, include/wine/wined3d.h +# | +if test "$enable_wined3d_QUERY_Stubs" -eq 1; then + patch_apply wined3d-QUERY_Stubs/0001-wined3d-Add-stubs-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch + ( + echo '+ { "Michael Müller", "wined3d: Add stubs for QUERY_TYPE_SO_STATISTICS and QUERY_TYPE_SO_OVERFLOW.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-Revert_PixelFormat # | # | Modified files: diff --git a/patches/wined3d-QUERY_Stubs/0001-wined3d-Add-stubs-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch b/patches/wined3d-QUERY_Stubs/0001-wined3d-Add-stubs-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch new file mode 100644 index 00000000..05205929 --- /dev/null +++ b/patches/wined3d-QUERY_Stubs/0001-wined3d-Add-stubs-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch @@ -0,0 +1,118 @@ +From 4eb44bc7f251082d2e0c37ac6487fa702f7de013 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 16 Apr 2016 18:18:54 +0200 +Subject: wined3d: Add stubs for QUERY_TYPE_SO_STATISTICS and + QUERY_TYPE_SO_OVERFLOW. + +--- + dlls/wined3d/query.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ + include/wine/wined3d.h | 6 +++++ + 2 files changed, 68 insertions(+) + +diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +index 410ce6c..0c56b23 100644 +--- a/dlls/wined3d/query.c ++++ b/dlls/wined3d/query.c +@@ -681,6 +681,42 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query * + return WINED3D_OK; + } + ++static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query, ++ void *data, DWORD size, DWORD flags) ++{ ++ static const struct wined3d_query_data_so_statistics statistics = { 1, 1 }; ++ ++ FIXME("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); ++ ++ if (!data || !size) return S_OK; ++ fill_query_data(data, size, &statistics, sizeof(statistics)); ++ return S_OK; ++} ++ ++static HRESULT wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags) ++{ ++ FIXME("query %p, flags %#x.\n", query, flags); ++ return WINED3D_OK; ++} ++ ++static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, ++ void *data, DWORD size, DWORD flags) ++{ ++ static const BOOL overflow = FALSE; ++ ++ FIXME("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); ++ ++ if (!data || !size) return S_OK; ++ fill_query_data(data, size, &overflow, sizeof(overflow)); ++ return S_OK; ++} ++ ++static HRESULT wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags) ++{ ++ FIXME("query %p, flags %#x.\n", query, flags); ++ return WINED3D_OK; ++} ++ + static const struct wined3d_query_ops event_query_ops = + { + wined3d_event_query_ops_get_data, +@@ -705,6 +741,18 @@ static const struct wined3d_query_ops timestamp_disjoint_query_ops = + wined3d_timestamp_disjoint_query_ops_issue, + }; + ++static const struct wined3d_query_ops statistics_query_ops = ++{ ++ wined3d_statistics_query_ops_get_data, ++ wined3d_statistics_query_ops_issue, ++}; ++ ++static const struct wined3d_query_ops overflow_query_ops = ++{ ++ wined3d_overflow_query_ops_get_data, ++ wined3d_overflow_query_ops_issue ++}; ++ + static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *device, + enum wined3d_query_type type, void *parent) + { +@@ -752,6 +800,20 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de + } + break; + ++ case WINED3D_QUERY_TYPE_SO_STATISTICS: ++ FIXME("Statistics query.\n"); ++ query->query_ops = &statistics_query_ops; ++ query->data_size = sizeof(struct wined3d_query_data_so_statistics); ++ query->extendedData = NULL; ++ break; ++ ++ case WINED3D_QUERY_TYPE_SO_OVERFLOW: ++ FIXME("Overflow query.\n"); ++ query->query_ops = &overflow_query_ops; ++ query->data_size = sizeof(BOOL); ++ query->extendedData = NULL; ++ break; ++ + case WINED3D_QUERY_TYPE_TIMESTAMP: + TRACE("Timestamp query.\n"); + if (!gl_info->supported[ARB_TIMER_QUERY]) +diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h +index cf2715c..c61bf17 100644 +--- a/include/wine/wined3d.h ++++ b/include/wine/wined3d.h +@@ -702,6 +702,12 @@ struct wined3d_query_data_timestamp_disjoint + BOOL disjoint; + }; + ++struct wined3d_query_data_so_statistics ++{ ++ UINT64 written; ++ UINT64 needed; ++}; ++ + #define WINED3DISSUE_BEGIN (1u << 1) + #define WINED3DISSUE_END (1u << 0) + #define WINED3DGETDATA_FLUSH (1u << 0) +-- +2.7.1 + diff --git a/patches/wined3d-QUERY_Stubs/definition b/patches/wined3d-QUERY_Stubs/definition new file mode 100644 index 00000000..2ee018d3 --- /dev/null +++ b/patches/wined3d-QUERY_Stubs/definition @@ -0,0 +1 @@ +Fixes: [20776] Add stubs for QUERY_TYPE_SO_STATISTICS and QUERY_TYPE_SO_OVERFLOW