Commit b24e69dc authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

d3d8: Move the capability detection code over to WineD3D.

Let the few existing parts which need the capabiliteis use the WineD3D capability structure (gl_info). This info structure contains next to 'flags' inidicating certain features also all GL/GLX functions pointers. Because D3D8 moves over to the wined3d gl_info structure all the gl prototypes in d3dcore_gl.h were unneeded and removed.
parent 0014e504
...@@ -748,8 +748,7 @@ inline static VOID IDirect3DVertexShaderImpl_GenerateProgramArbHW(IDirect3DVerte ...@@ -748,8 +748,7 @@ inline static VOID IDirect3DVertexShaderImpl_GenerateProgramArbHW(IDirect3DVerte
/* Due to the dynamic constants binding mechanism, we need to declare /* Due to the dynamic constants binding mechanism, we need to declare
* all the constants for relative addressing. */ * all the constants for relative addressing. */
/* Mesa supports nly 95 constants for VS1.X although we should have at least 96. */ /* Mesa supports nly 95 constants for VS1.X although we should have at least 96. */
if (This->direct3d8->gl_info.gl_vendor == VENDOR_MESA || if (GL_VENDOR_NAME(This) == VENDOR_MESA || GL_VENDOR_NAME(This) == VENDOR_WINE) {
This->direct3d8->gl_info.gl_vendor == VENDOR_WINE) {
numConstants = 95; numConstants = 95;
} }
sprintf(tmpLine, "PARAM C[%d] = { program.env[0..%d] };\n", numConstants, numConstants-1); sprintf(tmpLine, "PARAM C[%d] = { program.env[0..%d] };\n", numConstants, numConstants-1);
......
...@@ -696,13 +696,6 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid ...@@ -696,13 +696,6 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid
} }
} }
/* D3D8 doesn't use the opengl capability code from WineD3D and because of this the maximum texture size isn't set. */
if (((IWineD3DImpl *)This->wineD3D)->dxVersion == 8 && GL_LIMITS(texture_size) == 0) {
int gl_max;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max);
GL_LIMITS(texture_size) = gl_max;
}
/** Check against the maximum texture sizes supported by the video card **/ /** Check against the maximum texture sizes supported by the video card **/
if (pow2Width > GL_LIMITS(texture_size) || pow2Height > GL_LIMITS(texture_size)) { if (pow2Width > GL_LIMITS(texture_size) || pow2Height > GL_LIMITS(texture_size)) {
/* one of three options /* one of three options
......
...@@ -1782,6 +1782,16 @@ HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter, D3DDEV ...@@ -1782,6 +1782,16 @@ HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter, D3DDEV
object->adapterNo = Adapter; object->adapterNo = Adapter;
object->devType = DeviceType; object->devType = DeviceType;
/* Let D3D8 use WineD3D's capability detection code. We can't use the block of code after this call yet
/ as D3D8 doesn't use WineD3D stateblocks / swapchains.
*/
if(This->dxVersion == 8) {
/* Setup some defaults for creating the implicit swapchain */
ENTER_GL();
IWineD3DImpl_FillGLCaps(&This->gl_info, IWineD3DImpl_GetAdapterDisplay(iface, Adapter));
LEAVE_GL();
}
/* FIXME: Use for dx8 code eventually too! */ /* FIXME: Use for dx8 code eventually too! */
/* Deliberately no indentation here, as this if will be removed when dx8 support merged in */ /* Deliberately no indentation here, as this if will be removed when dx8 support merged in */
if (This->dxVersion > 8) { if (This->dxVersion > 8) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment