wined3d: Check registry for UseGLSL enabled.

This commit is contained in:
Phil Costin 2006-05-18 02:24:08 +01:00 committed by Alexandre Julliard
parent a45b16a460
commit 1b320431b8
3 changed files with 25 additions and 9 deletions

View File

@ -1677,15 +1677,15 @@ HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, WINED3D
*pCaps->MaxStreams = MAX_STREAMS;
*pCaps->MaxStreamStride = 1024;
if (wined3d_settings.vs_mode == VS_HW && GL_SUPPORT(ARB_SHADING_LANGUAGE_100) && DeviceType != WINED3DDEVTYPE_REF) {
/* FIXME: Uncomment the line below and remove the line beneath that to set Vertex Shader 2.0+ capability */
/* *pCaps->VertexShaderVersion = D3DVS_VERSION(3,0); */
*pCaps->VertexShaderVersion = D3DVS_VERSION(1,1);
if (wined3d_settings.vs_mode == VS_HW && GL_SUPPORT(ARB_SHADING_LANGUAGE_100) &&
wined3d_settings.glslRequested && DeviceType != WINED3DDEVTYPE_REF) {
*pCaps->VertexShaderVersion = D3DVS_VERSION(3,0);
TRACE_(d3d_caps)("Hardware Vertex Shaders versions 2.0+ enabled\n");
} else if (wined3d_settings.vs_mode == VS_HW && GL_SUPPORT(ARB_VERTEX_PROGRAM) && DeviceType != WINED3DDEVTYPE_REF) {
*pCaps->VertexShaderVersion = D3DVS_VERSION(1,1);
TRACE_(d3d_caps)("Hardware Vertex Shader version 1.1 enabled\n");
} else if (wined3d_settings.vs_mode == VS_SW || DeviceType == WINED3DDEVTYPE_REF) {
/* FIXME: Change the following line (when needed) to reflect the reported software vertex shader version implemented */
*pCaps->VertexShaderVersion = D3DVS_VERSION(1,1);
TRACE_(d3d_caps)("Software Vertex Shader version 1.1 enabled\n");
} else {
@ -1699,10 +1699,10 @@ HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, WINED3D
*pCaps->MaxVertexShaderConst = WINED3D_VSHADER_MAX_CONSTANTS;
}
if (wined3d_settings.ps_mode == PS_HW && GL_SUPPORT(ARB_SHADING_LANGUAGE_100) && DeviceType != WINED3DDEVTYPE_REF) {
/* FIXME: Uncomment the following line and remove the line beneath that to set Pixel Shader 2.0+ capability */
/* *pCaps->PixelShaderVersion = D3DPS_VERSION(3,0); */
*pCaps->PixelShaderVersion = D3DPS_VERSION(1,4);
if (wined3d_settings.ps_mode == PS_HW && GL_SUPPORT(ARB_SHADING_LANGUAGE_100) &&
wined3d_settings.glslRequested && DeviceType != WINED3DDEVTYPE_REF) {
*pCaps->PixelShaderVersion = D3DPS_VERSION(3,0);
/* FIXME: The following line is card dependant. -1.0 to 1.0 is a safe default clamp range for now */
*pCaps->PixelShader1xMaxValue = 1.0;
TRACE_(d3d_caps)("Hardware Pixel Shaders versions 2.0+ enabled\n");
} else if (wined3d_settings.ps_mode == PS_HW && GL_SUPPORT(ARB_FRAGMENT_PROGRAM) && DeviceType != WINED3DDEVTYPE_REF) {

View File

@ -36,7 +36,8 @@ wined3d_settings_t wined3d_settings =
{
VS_HW, /* Hardware by default */
PS_NONE, /* Disabled by default */
VBO_HW /* Hardware by default */
VBO_HW, /* Hardware by default */
FALSE /* Use of GLSL disabled by default */
};
WineD3DGlobalStatistics *wineD3DGlobalStatistics = NULL;
@ -168,6 +169,18 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
wined3d_settings.vbo_mode = VBO_HW;
}
}
if ( !get_config_key( hkey, appkey, "UseGLSL", buffer, size) )
{
if (!strcmp(buffer,"enabled"))
{
TRACE("Use of GL Shading Language enabled for systems that support it\n");
wined3d_settings.glslRequested = TRUE;
}
else
{
TRACE("Use of GL Shading Language disabled\n");
}
}
if ( !get_config_key( hkey, appkey, "Nonpower2Mode", buffer, size) )
{
if (!strcmp(buffer,"none"))
@ -190,6 +203,8 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
TRACE("Disable pixel shaders\n");
if (wined3d_settings.vbo_mode == VBO_NONE)
TRACE("Disable Vertex Buffer Hardware support\n");
if (wined3d_settings.glslRequested)
TRACE("If supported by your system, GL Shading Language will be used\n");
if (wined3d_settings.nonpower2_mode == NP2_REPACK)
TRACE("Repacking non-power2 textures\n");

View File

@ -137,6 +137,7 @@ typedef struct wined3d_settings_s {
int vs_mode;
int ps_mode;
int vbo_mode;
BOOL glslRequested;
/* nonpower 2 function */
int nonpower2_mode;
} wined3d_settings_t;