Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernelbase: HACK: Force swiftshader + in-process-gpu for Rockstar Soc… #140

Open
wants to merge 83 commits into
base: experimental_7.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
04fd8e9
amd_ags_x64: Implement agsDriverExtensionsDX11_CreateDevice().
Feb 2, 2022
50a9b4f
amd_ags_x64: Add stub for agsDriverExtensionsDX11_SetDepthBounds().
Feb 2, 2022
7a99665
amd_ags_x64: Implement agsDriverExtensionsDX11_DestroyDevice().
Feb 2, 2022
56d7e0b
wine.inf: Use built-in atiadlxx for STAR WARS Squadrons.
Feb 2, 2022
69afcb1
esync: Type-check HANDLE in esync_set_event.
Guy1524 Feb 2, 2022
a87274a
ntdll: Use .seh handler instead of __TRY in RtlUserThreadStart() on x64.
Feb 1, 2022
1771325
userenv: Set ProgramData in CreateEnvironmentBlock.
Guy1524 Feb 3, 2022
5934e8b
winhttp/tests: Avoid "misleading indentation" warnings.
DarkShadow44 Jan 28, 2022
97ac1bf
winhttp: Fix memory leak on error path in WinHttpCrackUrl (Coverity).
alexhenrie Feb 2, 2022
7cbc5bf
hnetcfg: Use CRT allocation functions.
Feb 1, 2022
3f16573
hnetcfg/tests: Add tests for static port mapping collection.
Feb 1, 2022
a4caa6b
hnetcfg: Return stub interface from upnpnat_get_StaticPortMappingColl…
Feb 1, 2022
de1d451
hnetcfg: Get gateway description location in init_gateway_connection().
Feb 1, 2022
f6b2602
hnetcfg: Open connection to gateway in init_gateway_connection().
Feb 1, 2022
1a49f69
hnetcfg: Get control URL for WANIPConnection service in init_gateway_…
Feb 1, 2022
47a84b5
hnetcfg: Fix realloc handling in fw_app_put_ProcessImageFileName().
Feb 2, 2022
7d56255
hnetcfg: Get port mapping list in init_gateway_connection().
Feb 2, 2022
fdc6c53
hnetcfg: Implement static_ports_get_Item().
Feb 2, 2022
fafdc40
hnetcfg: Implement static_ports_get_Count().
Feb 2, 2022
a81ab80
hnetcfg: Implement static_ports__NewEnum().
Feb 2, 2022
7f59920
hnetcfg: Implement static_ports_Remove().
Feb 2, 2022
f152937
hnetcfg: Implement static_ports_Add().
Feb 2, 2022
b51ecfc
hnetcfg: Don't use _GetValue() if text element is missing in get_xml_…
Feb 3, 2022
170addb
hnetcfg: Handle NULL strings in update_mapping_list().
Feb 3, 2022
8a9d383
hnetcfg/tests: Don't leak IEnumVARIANT reference in test_static_port_…
Feb 3, 2022
ef84561
hnetcfg/tests: Don't test removing the same mapping twice.
Feb 3, 2022
f4ddb18
winmm: Don't process audio data during waveOutWrite while playing.
aeikum Jan 27, 2022
778452d
fshack: Blit the contents of current framebuffer to the fshack's fram…
Feb 4, 2022
a8d3240
fshack: HACK: Use specific names for textures for SWJKJA.
Feb 4, 2022
c1d58f4
battleye: Add launcher process instead of redirecting CreateProcess c…
Guy1524 Jan 21, 2022
36b0e9d
winegstreamer: Add custom allocator for MFMediaBuffer-backed memory
aeikum Jan 19, 2022
a71e8ba
winegstreamer: Return MFMediaBuffer-backed memory directly to media_s…
aeikum Jan 19, 2022
f8c2c88
winegstreamer: Return MFMediaBuffer-backed memory directly to color c…
aeikum Jan 21, 2022
4e4a7ee
winegstreamer: Avoid input buffer copy in colorconvert
aeikum Jan 21, 2022
704b643
winegstreamer: Return MFMediaBuffer-backed memory directly to audio c…
aeikum Jan 21, 2022
fbea0b3
winegstreamer: Avoid input buffer copy in audio converter
aeikum Jan 21, 2022
29f3d24
winegstreamer: Add MFVideoFormat_RGB32 output for the source.
aeikum Jan 25, 2022
b11d236
HACK: mf: Always allow enumerating source types in topology
aeikum Jan 25, 2022
dc6d87a
winegstreamer: Don't flip RGB for Media Foundation clients
aeikum Jan 27, 2022
699e4c9
mshtml: Implement layerX/layerY properties for mouse event.
nsivov Feb 6, 2022
f273bea
winegstreamer: Reset internal format on BEGIN_STREAMING message.
rbernon Feb 8, 2022
6bc8c9b
server: Seal shared memory mappings against future writes.
rbernon Feb 8, 2022
a5ad4a5
mfreadwrite: Introduce an internal source reader refcount.
rbernon Feb 9, 2022
6c21f02
ntdll: Guard against syscall stack overrun.
Feb 10, 2022
aec9c01
fixup! ntdll: Implement CPU topology override.
Feb 8, 2022
c7d9891
mf: Handle MESourceSeeked and MEStreamSeeked state change events.
rbernon Feb 11, 2022
b28ab9a
evr/presenter: Initial implementation of GetCurrentImage().
nsivov Feb 1, 2022
4682d66
HACK: winex11.drv/opengl: Do not trigger a libX11 bug.
giomasce Feb 3, 2022
465de7e
fixup! winebus.sys: Only call SDL_HapticRumbleInit if supported, as a…
rbernon Feb 14, 2022
a5216de
amend! mfreadwrite/reader: Use separate refcount for events callbacks.
rbernon Feb 11, 2022
7a3fb11
mfreadwrite/reader: Stop media source when shutdown is not allowed.
nsivov Feb 11, 2022
58eccf4
winebus.sys: Flag the Deck touchsceen, mouse and keyboard as Steam co…
rbernon Feb 14, 2022
f072cf6
fsync: Type-check HANDLE in esync_set_event.
Guy1524 Feb 14, 2022
6f2c985
fixup! esync, fsync: Yield execution before alertable wait for AC Ody…
Feb 14, 2022
17bdb16
make_requests
Feb 14, 2022
9c934b8
wined3d: Use StretchBlt() in swapchain_blit_gdi().
Feb 11, 2022
af5da6c
wined3d: Clear GL backbuffer in wined3d_context_gl_init().
Feb 11, 2022
62f1813
fixup! winegstreamer: After failing to create decodebin parser, try p…
rbernon Feb 15, 2022
0de1a4c
fixup! battleye: Add launcher process instead of redirecting CreatePr…
rbernon Feb 15, 2022
d6a2371
fsync: Add WINE_FSYNC_SIMULATE_SCHED_QUANTUM config option.
Feb 15, 2022
b3fb8a5
fixup! fsync: Add WINE_FSYNC_SIMULATE_SCHED_QUANTUM config option.
Feb 15, 2022
deb036d
Revert "winevulkan: Allow call of unexposed function vkCmdWriteBuffer…
ivyl Feb 16, 2022
ed28962
Revert "mshtml: Always report available data before stop_binding."
rbernon Feb 16, 2022
3350eca
winex11.drv: Fix focus delay issues with desktop clipping.
rbernon Jan 28, 2021
1f3291a
msvcrt: Check for ERMS support and use rep stosb for large memset calls.
rbernon Sep 14, 2021
243f46b
msvcrt: Add an SSE2 memset_aligned_32 implementation.
rbernon Sep 14, 2021
dc0e276
wineboot: Compute and write the TSC frequency to registry ~Mhz.
rbernon Jun 4, 2021
73b6bfa
tools: Add gdbinit helper with LoadSymbolFiles command.
rbernon Jun 21, 2021
3caf5bf
ntdll: Use clock_gettime64 if supported.
zfigura Jan 20, 2021
012b378
winegstreamer: Use unlimited buffering for DirectShow as well.
Feb 11, 2022
20b1841
user32: Prevent a recursive loop with the activation messages.
rbernon Jan 27, 2022
39d4cab
user32: Use PostMessageW in set_foreground_window.
rbernon Jan 27, 2022
082c975
user32: Do not deactivate if thread is foreground.
rbernon Jan 27, 2022
c42b365
user32: Send WM_NCACTIVATE on SetForegroundWindow call.
rbernon Jan 27, 2022
513022b
user32: Send WM_*FOCUS messages even if already focused.
rbernon Jan 27, 2022
b3213cb
server: Drop pending internal messages in set_active_window.
rbernon Jan 27, 2022
443b7ac
Revert "winegstreamer: Avoid input buffer copy in audio converter"
rbernon Feb 16, 2022
a9559c1
Revert "winegstreamer: Return MFMediaBuffer-backed memory directly to…
rbernon Feb 16, 2022
098076a
Revert "winegstreamer: Avoid input buffer copy in colorconvert"
rbernon Feb 16, 2022
0db2a8c
Revert "winegstreamer: Return MFMediaBuffer-backed memory directly to…
rbernon Feb 16, 2022
b1e9a55
Revert "winegstreamer: Return MFMediaBuffer-backed memory directly to…
rbernon Feb 16, 2022
9417252
Revert "winegstreamer: Add custom allocator for MFMediaBuffer-backed …
rbernon Feb 16, 2022
eaad88a
kernelbase: HACK: Force swiftshader + in-process-gpu for Rockstar Soc…
misyltoad Feb 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1994,6 +1994,7 @@ AC_CHECK_FUNCS(\
getrandom \
kqueue \
mach_continuous_time \
memfd_create \
pipe2 \
port_create \
posix_fadvise \
Expand Down Expand Up @@ -3579,6 +3580,7 @@ WINE_CONFIG_MAKEFILE(po)
WINE_CONFIG_MAKEFILE(programs/arp)
WINE_CONFIG_MAKEFILE(programs/aspnet_regiis)
WINE_CONFIG_MAKEFILE(programs/attrib)
WINE_CONFIG_MAKEFILE(programs/belauncher)
WINE_CONFIG_MAKEFILE(programs/cabarc)
WINE_CONFIG_MAKEFILE(programs/cacls)
WINE_CONFIG_MAKEFILE(programs/chcp.com)
Expand Down
6 changes: 4 additions & 2 deletions dlls/amd_ags_x64/amd_ags.h
Original file line number Diff line number Diff line change
Expand Up @@ -1506,8 +1506,10 @@ AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_EndUAVOverlap( AGSContext* con
/// \param [in] minDepth The near depth range to clip against.
/// \param [in] maxDepth The far depth range to clip against.
///
AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds_520( AGSContext* context, bool enabled, float minDepth, float maxDepth );
AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* context, ID3D11DeviceContext* dxContext, bool enabled, float minDepth, float maxDepth );
AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* context, bool enabled, float minDepth, float maxDepth );

/* Since 5.3.0 */
AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds_530( AGSContext* context, ID3D11DeviceContext* dxContext, bool enabled, float minDepth, float maxDepth );

/// @}

Expand Down
6 changes: 3 additions & 3 deletions dlls/amd_ags_x64/amd_ags_x64.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
@ stdcall agsCheckDriverVersion(ptr long)
@ stub agsDriverExtensionsDX11_BeginUAVOverlap
@ stub agsDriverExtensionsDX11_CreateBuffer
@ stub agsDriverExtensionsDX11_CreateDevice
@ stdcall agsDriverExtensionsDX11_CreateDevice(ptr ptr ptr ptr)
@ stub agsDriverExtensionsDX11_CreateFromDevice
@ stub agsDriverExtensionsDX11_CreateTexture1D
@ stub agsDriverExtensionsDX11_CreateTexture2D
@ stub agsDriverExtensionsDX11_CreateTexture3D
@ stub agsDriverExtensionsDX11_DeInit
@ stub agsDriverExtensionsDX11_Destroy
@ stub agsDriverExtensionsDX11_DestroyDevice
@ stdcall -norelay -arch=win64 agsDriverExtensionsDX11_DestroyDevice()
@ stub agsDriverExtensionsDX11_EndUAVOverlap
@ stub agsDriverExtensionsDX11_GetMaxClipRects
@ stub agsDriverExtensionsDX11_IASetPrimitiveTopology
Expand All @@ -24,7 +24,7 @@
@ stub agsDriverExtensionsDX11_NotifyResourceEndWrites
@ stub agsDriverExtensionsDX11_NumPendingAsyncCompileJobs
@ stub agsDriverExtensionsDX11_SetClipRects
@ stub agsDriverExtensionsDX11_SetDepthBounds
@ stdcall -norelay -arch=win64 agsDriverExtensionsDX11_SetDepthBounds() DX11_SetDepthBounds_impl
@ stub agsDriverExtensionsDX11_SetDiskShaderCacheEnabled
@ stub agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount
@ stub agsDriverExtensionsDX11_SetViewBroadcastMasks
Expand Down
175 changes: 165 additions & 10 deletions dlls/amd_ags_x64/amd_ags_x64_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "wine/heap.h"

#include "wine/vulkan.h"
#include "wine/asm.h"

#define COBJMACROS
#include "d3d11.h"
Expand Down Expand Up @@ -38,18 +39,19 @@ static const struct
int minor;
int patch;
unsigned int device_size;
unsigned int dx11_returned_params_size;
}
amd_ags_info[AMD_AGS_VERSION_COUNT] =
{
{5, 1, 1, sizeof(AGSDeviceInfo_511)},
{5, 2, 0, sizeof(AGSDeviceInfo_520)},
{5, 2, 1, sizeof(AGSDeviceInfo_520)},
{5, 3, 0, sizeof(AGSDeviceInfo_520)},
{5, 4, 0, sizeof(AGSDeviceInfo_540)},
{5, 4, 1, sizeof(AGSDeviceInfo_541)},
{5, 4, 2, sizeof(AGSDeviceInfo_542)},
{6, 0, 0, sizeof(AGSDeviceInfo_600)},
{6, 0, 1, sizeof(AGSDeviceInfo_600)},
{5, 1, 1, sizeof(AGSDeviceInfo_511), sizeof(AGSDX11ReturnedParams_511)},
{5, 2, 0, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520)},
{5, 2, 1, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520)},
{5, 3, 0, sizeof(AGSDeviceInfo_520), sizeof(AGSDX11ReturnedParams_520)},
{5, 4, 0, sizeof(AGSDeviceInfo_540), sizeof(AGSDX11ReturnedParams_520)},
{5, 4, 1, sizeof(AGSDeviceInfo_541), sizeof(AGSDX11ReturnedParams_520)},
{5, 4, 2, sizeof(AGSDeviceInfo_542), sizeof(AGSDX11ReturnedParams_520)},
{6, 0, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)},
{6, 0, 1, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)},
};

#define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \
Expand Down Expand Up @@ -117,8 +119,10 @@ struct AGSContext
VkPhysicalDeviceMemoryProperties *memory_properties;
};

static HMODULE hd3d12;
static HMODULE hd3d11, hd3d12;
static typeof(D3D12CreateDevice) *pD3D12CreateDevice;
static typeof(D3D11CreateDevice) *pD3D11CreateDevice;
static typeof(D3D11CreateDeviceAndSwapChain) *pD3D11CreateDeviceAndSwapChain;

static BOOL load_d3d12_functions(void)
{
Expand All @@ -132,6 +136,19 @@ static BOOL load_d3d12_functions(void)
return TRUE;
}

static BOOL load_d3d11_functions(void)
{
if (hd3d11)
return TRUE;

if (!(hd3d11 = LoadLibraryA("d3d11.dll")))
return FALSE;

pD3D11CreateDevice = (void *)GetProcAddress(hd3d11, "D3D11CreateDevice");
pD3D11CreateDeviceAndSwapChain = (void *)GetProcAddress(hd3d11, "D3D11CreateDeviceAndSwapChain");
return TRUE;
}

static AGSReturnCode vk_get_physical_device_properties(unsigned int *out_count,
VkPhysicalDeviceProperties **out, VkPhysicalDeviceMemoryProperties **out_memory)
{
Expand Down Expand Up @@ -605,6 +622,76 @@ AGSReturnCode WINAPI agsGetCrossfireGPUCount(AGSContext *context, int *gpu_count
return AGS_SUCCESS;
}

AGSReturnCode WINAPI agsDriverExtensionsDX11_CreateDevice( AGSContext* context,
const AGSDX11DeviceCreationParams* creation_params, const AGSDX11ExtensionParams* extension_params,
AGSDX11ReturnedParams* returned_params )
{
ID3D11DeviceContext *device_context;
IDXGISwapChain *swapchain = NULL;
D3D_FEATURE_LEVEL feature_level;
ID3D11Device *device;
HRESULT hr;

TRACE("feature levels %u, pSwapChainDesc %p, app %s, engine %s %#x %#x.\n", creation_params->FeatureLevels,
creation_params->pSwapChainDesc,
debugstr_w(extension_params->agsDX11ExtensionParams511.pAppName),
debugstr_w(extension_params->agsDX11ExtensionParams511.pEngineName),
extension_params->agsDX11ExtensionParams511.appVersion,
extension_params->agsDX11ExtensionParams511.engineVersion);

if (!load_d3d11_functions())
{
ERR("Could not load d3d11.dll.\n");
return AGS_MISSING_D3D_DLL;
}
memset( returned_params, 0, amd_ags_info[context->version].dx11_returned_params_size );
if (creation_params->pSwapChainDesc)
{
hr = pD3D11CreateDeviceAndSwapChain(creation_params->pAdapter, creation_params->DriverType,
creation_params->Software, creation_params->Flags, creation_params->pFeatureLevels,
creation_params->FeatureLevels, creation_params->SDKVersion, creation_params->pSwapChainDesc,
&swapchain, &device, &feature_level, &device_context);
}
else
{
hr = pD3D11CreateDevice(creation_params->pAdapter, creation_params->DriverType,
creation_params->Software, creation_params->Flags, creation_params->pFeatureLevels,
creation_params->FeatureLevels, creation_params->SDKVersion,
&device, &feature_level, &device_context);
}
if (FAILED(hr))
{
ERR("Device creation failed, hr %#x.\n", hr);
return AGS_DX_FAILURE;
}
if (context->version < AMD_AGS_VERSION_5_2_0)
{
AGSDX11ReturnedParams_511 *r = &returned_params->agsDX11ReturnedParams511;
r->pDevice = device;
r->pImmediateContext = device_context;
r->pSwapChain = swapchain;
r->FeatureLevel = feature_level;
}
else if (context->version < AMD_AGS_VERSION_6_0_0)
{
AGSDX11ReturnedParams_520 *r = &returned_params->agsDX11ReturnedParams520;
r->pDevice = device;
r->pImmediateContext = device_context;
r->pSwapChain = swapchain;
r->FeatureLevel = feature_level;
}
else
{
AGSDX11ReturnedParams_600 *r = &returned_params->agsDX11ReturnedParams600;
r->pDevice = device;
r->pImmediateContext = device_context;
r->pSwapChain = swapchain;
r->featureLevel = feature_level;
}

return AGS_SUCCESS;
}

AGSReturnCode WINAPI agsDriverExtensionsDX12_CreateDevice(AGSContext *context,
const AGSDX12DeviceCreationParams *creation_params, const AGSDX12ExtensionParams *extension_params,
AGSDX12ReturnedParams *returned_params)
Expand Down Expand Up @@ -684,3 +771,71 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)

return TRUE;
}

#ifdef __x86_64__
AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDepthBounds(AGSContext* context, bool enabled,
float minDepth, float maxDepth )
{
static int once;

if (!once++)
FIXME("context %p, enabled %#x, minDepth %f, maxDepth %f stub.\n", context, enabled, minDepth, maxDepth);
return AGS_EXTENSION_NOT_SUPPORTED;
}

AGSReturnCode WINAPI agsDriverExtensionsDX11_SetDepthBounds_530(AGSContext* context,
ID3D11DeviceContext* dxContext, bool enabled, float minDepth, float maxDepth )
{
static int once;

if (!once++)
FIXME("context %p, enabled %#x, minDepth %f, maxDepth %f stub.\n", context, enabled, minDepth, maxDepth);
return AGS_EXTENSION_NOT_SUPPORTED;
}

__ASM_GLOBAL_FUNC( DX11_SetDepthBounds_impl,
"mov (%rcx),%eax\n\t" /* version */
"cmp $3,%eax\n\t"
"jge 1f\n\t"
"jmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds") "\n\t"
"1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_SetDepthBounds_530") )

AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_520(AGSContext *context, ID3D11Device* device,
unsigned int *device_ref, ID3D11DeviceContext *device_context,
unsigned int *context_ref)
{
ULONG ref;

TRACE("context %p, device %p, device_ref %p, device_context %p, context_ref %p.\n",
context, device, device_ref, device_context, context_ref);

if (!device)
return AGS_SUCCESS;

ref = ID3D11Device_Release(device);
if (device_ref)
*device_ref = ref;

if (!device_context)
return AGS_SUCCESS;

ref = ID3D11DeviceContext_Release(device_context);
if (context_ref)
*context_ref = ref;
return AGS_SUCCESS;
}

AGSReturnCode WINAPI agsDriverExtensionsDX11_DestroyDevice_511(AGSContext *context, ID3D11Device *device,
unsigned int *references )
{
TRACE("context %p, device %p, references %p.\n", context, device, references);

return agsDriverExtensionsDX11_DestroyDevice_520(context, device, references, NULL, NULL);
}
__ASM_GLOBAL_FUNC( agsDriverExtensionsDX11_DestroyDevice,
"mov (%rcx),%eax\n\t" /* version */
"cmp $1,%eax\n\t"
"jge 1f\n\t"
"jmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_511") "\n\t"
"1:\tjmp " __ASM_NAME("agsDriverExtensionsDX11_DestroyDevice_520") )
#endif
Loading