- v2: Specify the maximum allowed feature level when creating the device. - v3: Rebased. - v4: Use a flag to indicate that indirect draws won't be used.
-- v4: wined3d: Use the chunk allocator for GL element array buffers. wined3d: Introduce a new flag to indicate that indirect draws won't be used.
From: Anton Baskanov baskanov@gmail.com
--- dlls/d3d8/directx.c | 2 +- dlls/d3d9/directx.c | 2 +- dlls/ddraw/ddraw_private.h | 2 +- include/wine/wined3d.h | 1 + 4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c index bd375aa58a4..973c7fea779 100644 --- a/dlls/d3d8/directx.c +++ b/dlls/d3d8/directx.c @@ -476,7 +476,7 @@ BOOL d3d8_init(struct d3d8 *d3d8) DWORD flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING | WINED3D_HANDLE_RESTORE | WINED3D_PIXEL_CENTER_INTEGER | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR | WINED3D_NO_PRIMITIVE_RESTART - | WINED3D_LEGACY_CUBEMAP_FILTERING; + | WINED3D_LEGACY_CUBEMAP_FILTERING | WINED3D_NO_DRAW_INDIRECT; unsigned int adapter_idx, output_idx, adapter_count, output_count = 0; struct wined3d_adapter *wined3d_adapter;
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index f9d4d68cdd8..64291c586bb 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -685,7 +685,7 @@ BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended) DWORD flags = WINED3D_PRESENT_CONVERSION | WINED3D_HANDLE_RESTORE | WINED3D_PIXEL_CENTER_INTEGER | WINED3D_SRGB_READ_WRITE_CONTROL | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR | WINED3D_NO_PRIMITIVE_RESTART | WINED3D_LEGACY_CUBEMAP_FILTERING - | WINED3D_NORMALIZED_DEPTH_BIAS; + | WINED3D_NORMALIZED_DEPTH_BIAS | WINED3D_NO_DRAW_INDIRECT; unsigned int adapter_idx, output_idx, adapter_count, output_count = 0; struct wined3d_adapter *wined3d_adapter;
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 159ce987dc3..1edc459ed79 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -66,7 +66,7 @@ struct FvfToDecl #define DDRAW_WINED3D_FLAGS (WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING \ | WINED3D_RESTORE_MODE_ON_ACTIVATE | WINED3D_FOCUS_MESSAGES | WINED3D_PIXEL_CENTER_INTEGER \ | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR | WINED3D_NO_PRIMITIVE_RESTART \ - | WINED3D_LEGACY_CUBEMAP_FILTERING) + | WINED3D_LEGACY_CUBEMAP_FILTERING | WINED3D_NO_DRAW_INDIRECT)
#define DDRAW_MAX_ACTIVE_LIGHTS 32 #define DDRAW_MAX_TEXTURES 8 diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index d1147e03f66..a18dcda45be 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -1322,6 +1322,7 @@ enum wined3d_memory_segment_group #define WINED3D_NO_PRIMITIVE_RESTART 0x00000800 #define WINED3D_LEGACY_CUBEMAP_FILTERING 0x00001000 #define WINED3D_NORMALIZED_DEPTH_BIAS 0x00002000 +#define WINED3D_NO_DRAW_INDIRECT 0x00004000
#define WINED3D_RESZ_CODE 0x7fa05000
From: Anton Baskanov baskanov@gmail.com
--- dlls/wined3d/device.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 913376ee3ee..1f9774767ba 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1084,7 +1084,8 @@ static struct wined3d_allocator_block *wined3d_device_gl_allocate_memory(struct return block; }
-static bool use_buffer_chunk_suballocation(const struct wined3d_gl_info *gl_info, GLenum binding) +static bool use_buffer_chunk_suballocation(struct wined3d_device_gl *device_gl, + const struct wined3d_gl_info *gl_info, GLenum binding) { switch (binding) { @@ -1095,6 +1096,12 @@ static bool use_buffer_chunk_suballocation(const struct wined3d_gl_info *gl_info case GL_UNIFORM_BUFFER: return true;
+ case GL_ELEMENT_ARRAY_BUFFER: + /* There is no way to specify an element array buffer offset for + * indirect draws in OpenGL. */ + return device_gl->d.wined3d->flags & WINED3D_NO_DRAW_INDIRECT + || !gl_info->supported[ARB_DRAW_INDIRECT]; + case GL_TEXTURE_BUFFER: return gl_info->supported[ARB_TEXTURE_BUFFER_RANGE];
@@ -1117,7 +1124,7 @@ bool wined3d_device_gl_create_bo(struct wined3d_device_gl *device_gl, struct win
if (gl_info->supported[ARB_BUFFER_STORAGE]) { - if (use_buffer_chunk_suballocation(gl_info, binding)) + if (use_buffer_chunk_suballocation(device_gl, gl_info, binding)) { if ((memory = wined3d_device_gl_allocate_memory(device_gl, context_gl, memory_type_idx, size, &id))) buffer_offset = memory->offset;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126069
Your paranoid android.
=== debian11 (32 bit report) ===
d3drm: d3drm.c:5561: Test failed: Cannot create IM device, skipping tests.
httpapi: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x7b020c3f).
=== debian11 (build log) ===
0620:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0620:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0620:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0678:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0678:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0678:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this.
This merge request was approved by Zebediah Figura.