Attached is a patch file of the changes I have made to wined3d and it's config options.
Summary of the changes :
* Cleaned up graphics tab on winecfg to make room for more DirectX related options. In an ideal world, options would be automagically detected but due to the amount of differences between setups and such, this isn't feasable at the moment.
* User-selectable pixel shader version. Default is 1.4. 2.0 is selectable and if your card has GLSL support it should return the PS version to apps as 2.0. 98% of the PS 2.0 functions right now however are stubs or not implemented so this is why 1.4 is default. Setting the version to 2.0 will return a warning stating that it will most likely break any applications that try to use 2.0.
* User-selectable texture memory reporting. The current CVS version is hardcoded to report 64 megabytes of graphics card texture memory. I changed the hardcoded variable to be set by a registry setting allowing the user to set how much graphics card memory this wish to report to D3D apps. This should help games and applications that use a lot of big or highly-detailed textures. In the future, default should autodetect however right now default is 64 megabytes.
I'd appreciate if people could test this patch and see if it breaks any games. It compiles and runs fine on my system but I'd like to know regardless. Sometimes I have a tendency to make silly mistakes in coding :P
As for the text that was removed, most of it described what things like the virtual desktop function did and it took up over half of the tabs pane. This text should probably be placed in either the user manual/documentation or through some future help function in winecfg. Someone suggested I add a seperate DirectX tab however as it is right now, I do not think it is a good idea to add many more tabs. Too many tabs can lead to useability issues as people are unable to find where different settings are located.
I will seperate the patches out later by the specific changes they do but right now it's just one big patch file.
Thanks
Saturday, February 4, 2006, 3:33:50 PM, Brian Hill wrote:
Attached is a patch file of the changes I have made to wined3d and it's config options.
Summary of the changes :
- User-selectable pixel shader version. Default is 1.4. 2.0 is
selectable and if your card has GLSL support it should return the PS version to apps as 2.0. 98% of the PS 2.0 functions right now however are stubs or not implemented so this is why 1.4 is default. Setting the version to 2.0 will return a warning stating that it will most likely break any applications that try to use 2.0.
Did we really had so much changes that we can change default from none to 1.4?
- User-selectable texture memory reporting. The current CVS version is
hardcoded to report 64 megabytes of graphics card texture memory. I
We still need to make an attempt to detect it. Overriding it this way doesn't really make it more universal. From what I see it will be another way to users to select as much as there is and brake textures totally.
[skip]
Now the patch itself:
if (Adapter >= IWineD3D_GetAdapterCount(iface)) {
return D3DERR_INVALIDCALL;
}return D3DERR_INVALIDCALL;
This and lots of other places: Please don't change formatting in the function that you haven't otherwise changed. Especially when you change from accepted format (4 spaces indent) to something different.
if(GL_SUPPORT(ARB_SHADING_LANGUAGE_100)) {
WARN("PS 2.0 support is mostly incomplete,turning it
on will break most applications that attempt to use it.\n");
Use FIXME instead. WARN by default is not shown.
} else {
WARN("Your OpenGL driver lacks the needed extensions to support Pixel Shader 2.0\n");
WARN("Defaulting back to Pixel Shader version 1.4");
*pCaps->PixelShaderVersion = D3DPS_VERSION(1,4);
*pCaps->PixelShader1xMaxValue = 1.0;
}
If GPU / driver doesn't support PS2.0 then users shouldn't be able to select this option in the first place.
default :
WARN("Invalid Pixel Shader version %d",wined3d_settings.ps_mode);
break;
Default should be NONE.
if (!strcmp(buffer,"default"))
{
TRACE("Allow pixel shaders version 1.4\n");
wined3d_settings.ps_mode = PS_14;
}
I would drop default and make it "auto-detect" and make it default instead.
from dlls/wined3d/wined3d_main.c:
wined3d_settings_t wined3d_settings = { VS_HW, /* Hardware by default */ PS_NONE, /* Disabled by default */ VBO_HW /* Hardware by default */ };
As you see default is default is PS_NONE. So please make winecfg match that. Or change it here as well. (This is when no options are present in the registry)
if (!strcmp(buffer,"16 Mb")) {
TRACE("Setting available texture memory to 16 Mb + AGP");
wined3d_settings.texture_memory = 16 * 1024 * 1024;
}
Don't use "16 Mb" format. Use number in bytes. That should prevent lots of problems with parsing "user edited" entries.
--- programs/winecfg/x11drvdlg.c 2 Feb 2006 13:13:48 -0000 1.31 +++ programs/winecfg/x11drvdlg.c 4 Feb 2006 22:21:04 -0000 @@ -1,26 +1,3 @@ -/*
- Graphics configuration code
- Copyright 2003 Mark Westcott
- Copyright 2003-2004 Mike Hearn
- Copyright 2005 Raphael Junqueira
Why are you deleting copyrights?
Regards, Vitaliy Margolen
Vitaliy Margolen wrote:
- User-selectable texture memory reporting. The current CVS version is
hardcoded to report 64 megabytes of graphics card texture memory. I
We still need to make an attempt to detect it. Overriding it this way doesn't really make it more universal. From what I see it will be another way to users to select as much as there is and brake textures totally.
When this was discussed before, extensions that allow for it to be detected on nvidia and ati cards were brought up. Seeing as these are the only 2 brands of cards anyone realistically is going to be able to play DirectX games on, why not go ahead and use those extensions, even though it's not an elegant solution for all cards? Just have it check for them and then fall back on 64MB if they're not available. That should take care of 99% of people using WineD3D I'd think.
Vitaliy Margolen wrote:
Saturday, February 4, 2006, 3:33:50 PM, Brian Hill wrote:
- User-selectable texture memory reporting. The current CVS version is
hardcoded to report 64 megabytes of graphics card texture memory. I
We still need to make an attempt to detect it. Overriding it this way doesn't really make it more universal. From what I see it will be another way to users to select as much as there is and brake textures totally.
I have an idea, although it probably won't work for the majority of the cases: Get the vram size from the X config file. If it is set, the X will work as if that is the absolute amount of memory, and if we use that when it's set, well, nothing more can truly break, cause all breakage resulting from that would be X or PEBKAC (user) error in the config.
Of course this means we would have to code in a parser for the X11 config, and hard-code in X config paths, but it wouldn't be too hard, as most users have similar X config/enviroments/installs, and those that have the different ones are probably using something other than Linux (so we can expect them to know what's going on).
Good, structured comments on this are good, but please send the flames to /dev/null.
* The copyrights are still in my copy of the altered file. I have no idea why CVS removed them. I'll look into why it did that. Same goes with the formatting.
* Will change from WARN to FIXME.
* Detecting the amount of texture memory is implementation specific and so we'd have to do different code for different drivers. If we were talking about Mac OS X, there OpenGL implementation does have this built-in but I do not believe this to be the case for WGL or Linux OpenGL. OpenGL, unlike Direct3D, is not designed for only 3D accelerated setups, and as such does not make any assumptions about hardware. Direct3D on the other hand is always run natively on Wintel boxes and there is a more consistant hardware setup.
* Winecfg cannot easily detect what PS version is supported because it is not linked with wined3d. I would have to link the GL code into winecfg in order to detect if the OpenGL driver supports x version of Pixel Shaders which would then require additional defs to still allow for the --without-opengl option in the configure script.
* Selecting too much texture memory may or may not break a game. It is entirely dependent on the game itself. Some games will automatically scale back texture useage when memory runs out, even if it runs out earlier than it should. Others will throw an exception and stop.
* Will fix the defaults and terminology.
Vitaliy Margolen wrote:
Saturday, February 4, 2006, 3:33:50 PM, Brian Hill wrote:
Attached is a patch file of the changes I have made to wined3d and it's config options.
Summary of the changes :
- User-selectable pixel shader version. Default is 1.4. 2.0 is
selectable and if your card has GLSL support it should return the PS version to apps as 2.0. 98% of the PS 2.0 functions right now however are stubs or not implemented so this is why 1.4 is default. Setting the version to 2.0 will return a warning stating that it will most likely break any applications that try to use 2.0.
Did we really had so much changes that we can change default from none to 1.4?
- User-selectable texture memory reporting. The current CVS version is
hardcoded to report 64 megabytes of graphics card texture memory. I
We still need to make an attempt to detect it. Overriding it this way doesn't really make it more universal. From what I see it will be another way to users to select as much as there is and brake textures totally.
[skip]
Now the patch itself:
if (Adapter >= IWineD3D_GetAdapterCount(iface)) {
return D3DERR_INVALIDCALL;
}return D3DERR_INVALIDCALL;
This and lots of other places: Please don't change formatting in the function that you haven't otherwise changed. Especially when you change from accepted format (4 spaces indent) to something different.
if(GL_SUPPORT(ARB_SHADING_LANGUAGE_100)) {
WARN("PS 2.0 support is mostly incomplete,turning it
on will break most applications that attempt to use it.\n");
Use FIXME instead. WARN by default is not shown.
} else {
WARN("Your OpenGL driver lacks the needed extensions to support Pixel Shader 2.0\n");
WARN("Defaulting back to Pixel Shader version 1.4");
*pCaps->PixelShaderVersion = D3DPS_VERSION(1,4);
*pCaps->PixelShader1xMaxValue = 1.0;
}
If GPU / driver doesn't support PS2.0 then users shouldn't be able to select this option in the first place.
default :
WARN("Invalid Pixel Shader version %d",wined3d_settings.ps_mode);
break;
Default should be NONE.
if (!strcmp(buffer,"default"))
{
TRACE("Allow pixel shaders version 1.4\n");
wined3d_settings.ps_mode = PS_14;
}
I would drop default and make it "auto-detect" and make it default instead.
from dlls/wined3d/wined3d_main.c:
wined3d_settings_t wined3d_settings = { VS_HW, /* Hardware by default */ PS_NONE, /* Disabled by default */ VBO_HW /* Hardware by default */ };
As you see default is default is PS_NONE. So please make winecfg match that. Or change it here as well. (This is when no options are present in the registry)
if (!strcmp(buffer,"16 Mb")) {
TRACE("Setting available texture memory to 16 Mb + AGP");
wined3d_settings.texture_memory = 16 * 1024 * 1024;
}
Don't use "16 Mb" format. Use number in bytes. That should prevent lots of problems with parsing "user edited" entries.
--- programs/winecfg/x11drvdlg.c 2 Feb 2006 13:13:48 -0000 1.31 +++ programs/winecfg/x11drvdlg.c 4 Feb 2006 22:21:04 -0000 @@ -1,26 +1,3 @@ -/*
- Graphics configuration code
- Copyright 2003 Mark Westcott
- Copyright 2003-2004 Mike Hearn
- Copyright 2005 Raphael Junqueira
Why are you deleting copyrights?
Regards, Vitaliy Margolen
On 04/02/06, Vitaliy Margolen wine-devel@kievinfo.com wrote:
default :
WARN("Invalid Pixel Shader version %d",wined3d_settings.ps_mode);
break;
Default should be NONE.
if (!strcmp(buffer,"default"))
{
TRACE("Allow pixel shaders version 1.4\n");
wined3d_settings.ps_mode = PS_14;
}
I would drop default and make it "auto-detect" and make it default instead.
Although that would be nice, I don't think we can autodetect the supported PS version yet.
It's possible to do a rough auto-detect.
General rule of thumb :
ARB_FRAGMENT_PROGRAM = ~1.4 ARB_SHADER_LANGUAGE_100/GLSL = >= 2.0
This does not, however, take into account vendor specific shader extensions.
H. Verbeet wrote:
On 04/02/06, Vitaliy Margolen wine-devel@kievinfo.com wrote:
default :
WARN("Invalid Pixel Shader version %d",wined3d_settings.ps_mode);
break;
Default should be NONE.
if (!strcmp(buffer,"default"))
{
TRACE("Allow pixel shaders version 1.4\n");
wined3d_settings.ps_mode = PS_14;
}
I would drop default and make it "auto-detect" and make it default instead.
Although that would be nice, I don't think we can autodetect the supported PS version yet.
On 04/02/06, Brian Hill dcatz@nc.rr.com wrote:
I'd appreciate if people could test this patch and see if it breaks any games. It compiles and runs fine on my system but I'd like to know regardless. Sometimes I have a tendency to make silly mistakes in coding :P
I had a quick look at the diff, haven't compiled it against my tree yet.
On the subject of autodetecting graphics card memory, I seem to remember that someone was working on that a while ago. However, I'm not sure who, or what happened to it. I should probably have a look at the wine-devel archives. Regardless of whether the amount of memory gets autodetected or not, I think it's still usefull to be able to override the autodetected amount. Perhaps it should be possible to enter any amount, instead of just the ones in the list, but then, perhaps that's overkill. Technically, the units should be in MiB, but at least use MB instead of Mb.
I'm not sure if a big switch statement with different PS_ values is the way to go. It would seem more logical to just store the major and minor version numbers, and then use D3DPS_VERSION on that.
You define some stuff for GL_EXT_blend_func_separate, but never use it. Was that even supposed to go in the patch?
You use tabs in some places, spaces in others. Although I don't care all too much about the whole tabs vs spaces flamewar, the indent should match the rest of the code as much as possible. In general wined3d seems to use 4 spaces as indent.
As for the text that was removed, most of it described what things like the virtual desktop function did and it took up over half of the tabs pane. This text should probably be placed in either the user manual/documentation or through some future help function in winecfg.
A help function would probably be the more usefull option. I don't think you can rely on people actually reading the manual, or for that matter, finding it in the first place.
GL_ext_blend_func_separate was something else I was working on for EVE Online. I branched off two CVS directories on my hard drive and that accidentally got copied over.
H. Verbeet wrote:
On 04/02/06, Brian Hill dcatz@nc.rr.com wrote:
I'd appreciate if people could test this patch and see if it breaks any games. It compiles and runs fine on my system but I'd like to know regardless. Sometimes I have a tendency to make silly mistakes in coding :P
I had a quick look at the diff, haven't compiled it against my tree yet.
On the subject of autodetecting graphics card memory, I seem to remember that someone was working on that a while ago. However, I'm not sure who, or what happened to it. I should probably have a look at the wine-devel archives. Regardless of whether the amount of memory gets autodetected or not, I think it's still usefull to be able to override the autodetected amount. Perhaps it should be possible to enter any amount, instead of just the ones in the list, but then, perhaps that's overkill. Technically, the units should be in MiB, but at least use MB instead of Mb.
I'm not sure if a big switch statement with different PS_ values is the way to go. It would seem more logical to just store the major and minor version numbers, and then use D3DPS_VERSION on that.
You define some stuff for GL_EXT_blend_func_separate, but never use it. Was that even supposed to go in the patch?
You use tabs in some places, spaces in others. Although I don't care all too much about the whole tabs vs spaces flamewar, the indent should match the rest of the code as much as possible. In general wined3d seems to use 4 spaces as indent.
As for the text that was removed, most of it described what things like the virtual desktop function did and it took up over half of the tabs pane. This text should probably be placed in either the user manual/documentation or through some future help function in winecfg.
A help function would probably be the more usefull option. I don't think you can rely on people actually reading the manual, or for that matter, finding it in the first place.
Brian Hill wrote:
- User-selectable texture memory reporting. The current CVS version
is hardcoded to report 64 megabytes of graphics card texture memory. I changed the hardcoded variable to be set by a registry setting...
Woo hoo! I like this one!
-J