[D3D8] Sync with Wine 3.0. CORE-14225

This commit is contained in:
Amine Khaldi 2018-01-21 22:13:33 +01:00
parent 928bad849b
commit e6c95b14e3
5 changed files with 51 additions and 46 deletions

View File

@ -53,73 +53,75 @@ IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version)
/***********************************************************************
* ValidateVertexShader (D3D8.@)
*
* I've seen reserved1 and reserved2 always passed as 0's
* bool seems always passed as 0 or 1, but other values work as well...
* toto result?
*/
HRESULT WINAPI ValidateVertexShader(DWORD *vertexshader, DWORD *reserved1, DWORD *reserved2,
BOOL return_error, char **errors)
HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto)
{
const char *message = "";
HRESULT hr = E_FAIL;
HRESULT ret;
static BOOL warned;
TRACE("(%p %p %p %d %p): semi-stub\n", vertexshader, reserved1, reserved2, return_error, errors);
if (TRACE_ON(d3d8) || !warned) {
FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto);
warned = TRUE;
}
if (!vertexshader)
{
message = "(Global Validation Error) Version Token: Code pointer cannot be NULL.\n";
goto done;
}
if (!vertexshader)
return E_FAIL;
switch (*vertexshader)
{
if (reserved1 || reserved2)
return E_FAIL;
switch(*vertexshader) {
case 0xFFFE0101:
case 0xFFFE0100:
hr = S_OK;
ret=S_OK;
break;
default:
WARN("Invalid shader version token %#x.\n", *vertexshader);
message = "(Global Validation Error) Version Token: Unsupported vertex shader version.\n";
}
ret=E_FAIL;
}
done:
if (!return_error) message = "";
if (errors && (*errors = HeapAlloc(GetProcessHeap(), 0, strlen(message) + 1)))
strcpy(*errors, message);
return hr;
return ret;
}
/***********************************************************************
* ValidatePixelShader (D3D8.@)
*
* PARAMS
* toto result?
*/
HRESULT WINAPI ValidatePixelShader(DWORD *pixelshader, DWORD *reserved1, BOOL return_error, char **errors)
HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bool, DWORD* toto)
{
const char *message = "";
HRESULT hr = E_FAIL;
HRESULT ret;
static BOOL warned;
TRACE("(%p %p %d %p): semi-stub\n", pixelshader, reserved1, return_error, errors);
if (TRACE_ON(d3d8) || !warned) {
FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, bool, toto);
warned = TRUE;
}
if (!pixelshader)
return E_FAIL;
if (!pixelshader)
return E_FAIL;
switch (*pixelshader)
{
if (reserved1)
return E_FAIL;
switch(*pixelshader) {
case 0xFFFF0100:
case 0xFFFF0101:
case 0xFFFF0102:
case 0xFFFF0103:
case 0xFFFF0104:
hr = S_OK;
ret=S_OK;
break;
default:
WARN("Invalid shader version token %#x.\n", *pixelshader);
message = "(Global Validation Error) Version Token: Unsupported pixel shader version.\n";
}
if (!return_error) message = "";
if (errors && (*errors = HeapAlloc(GetProcessHeap(), 0, strlen(message) + 1)))
strcpy(*errors, message);
return hr;
ret=E_FAIL;
}
return ret;
}
void d3d8_resource_cleanup(struct d3d8_resource *resource)

View File

@ -734,6 +734,8 @@ static HRESULT WINAPI d3d8_device_Reset(IDirect3DDevice8 *iface,
{
present_parameters->BackBufferCount = swapchain_desc.backbuffer_count;
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_POINTSIZE_MIN, 0);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ZENABLE,
!!swapchain_desc.enable_auto_depth_stencil);
device->device_state = D3D8_DEVICE_STATE_OK;
}
else
@ -3258,8 +3260,7 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine
return D3DERR_INVALIDCALL;
}
hr = wined3d_device_init_3d(device->wined3d_device, &swapchain_desc);
if (FAILED(hr))
if (FAILED(hr = wined3d_device_init_3d(device->wined3d_device, &swapchain_desc)))
{
WARN("Failed to initialize 3D, hr %#x.\n", hr);
wined3d_device_release_focus_window(device->wined3d_device);
@ -3269,6 +3270,8 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine
return hr;
}
wined3d_device_set_render_state(device->wined3d_device,
WINED3D_RS_ZENABLE, !!swapchain_desc.enable_auto_depth_stencil);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_POINTSIZE_MIN, 0);
wined3d_mutex_unlock();

View File

@ -405,7 +405,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_LIMIT_VIEWPORT;
| WINED3D_LEGACY_CUBEMAP_FILTERING;
d3d8->IDirect3D8_iface.lpVtbl = &d3d8_vtbl;
d3d8->refcount = 1;

View File

@ -20,17 +20,17 @@
static inline struct d3d8_texture *impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface)
{
return CONTAINING_RECORD((IDirect3DBaseTexture8 *)iface, struct d3d8_texture, IDirect3DBaseTexture8_iface);
return CONTAINING_RECORD(iface, struct d3d8_texture, IDirect3DBaseTexture8_iface);
}
static inline struct d3d8_texture *impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface)
{
return CONTAINING_RECORD((IDirect3DBaseTexture8 *)iface, struct d3d8_texture, IDirect3DBaseTexture8_iface);
return CONTAINING_RECORD(iface, struct d3d8_texture, IDirect3DBaseTexture8_iface);
}
static inline struct d3d8_texture *impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface)
{
return CONTAINING_RECORD((IDirect3DBaseTexture8 *)iface, struct d3d8_texture, IDirect3DBaseTexture8_iface);
return CONTAINING_RECORD(iface, struct d3d8_texture, IDirect3DBaseTexture8_iface);
}
static HRESULT WINAPI d3d8_texture_2d_QueryInterface(IDirect3DTexture8 *iface, REFIID riid, void **out)

View File

@ -22,7 +22,7 @@ reactos/sdk/tools/wpp # Synced to WineStaging-2.9
The following libraries are shared with Wine.
reactos/dll/directx/wine/amstream # Synced to Wine-3.0
reactos/dll/directx/wine/d3d8 # Synced to WineStaging-2.16
reactos/dll/directx/wine/d3d8 # Synced to Wine-3.0
reactos/dll/directx/wine/d3d9 # Synced to WineStaging-2.16
reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-2.16
reactos/dll/directx/wine/d3drm # Synced to WineStaging-2.16