Isn't it a bug?

Luis Busquets luis.busquets at ilidium.com
Sun Dec 20 02:20:04 CST 2009


 From some time when I run Civilization4 I get a myriad of these 
messages and others with other formats:

err:d3d:getColorBits Unsupported format: WINED3DFMT_R16G16_FLOAT
err:d3d:IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt Unable to 
check compatibility for Format=WINED3DFMT_R16G16_FLOAT


After looking in the wine code I have found out that what happens is 
that Civ calls the function IDirect3D9Impl_CheckDepthStencilMatch

The implementation of wine then calls IWineD3D_CheckDepthStencilMatch 
which then calls

IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt 
<http://source.winehq.org/ident?i=IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt>

for each format that the adapter supports until it finds a supported format:

Problem:

IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt 
<http://source.winehq.org/ident?i=IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt> 
tries to match the supported pixel format of the adapter with the 
requested format.
If the supported pixel format of the adapter is of type 
WGL_TYPE_RGBA_ARB, it tries to getColorBits of the format even if the 
format to try is a  floating format, getColorBits responds with an error 
and same does IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt 
<http://source.winehq.org/ident?i=IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt>. 
Certainly, the answer is correct (FALSE) but the problem is that it 
fills the screen with ERR that are due to wine checking things for which 
there is no need as they are directly false.

So my question is if it is possible to do 
IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt 
<http://source.winehq.org/ident?i=IWineD3DImpl_IsPixelFormatCompatibleWithRenderFmt> 
right away check if:

cfg->iPixelType ==WGL_TYPE_RGBA_ARB  <http://source.winehq.org/ident?i=WGL_TYPE_RGBA_ARB>  and format_desc is a floating format

then return FALSE right away no need to fill ERR

same if

cfg->iPixelType ==WGL_TYPE_RGBA_FLOAT_AR  <http://source.winehq.org/ident?i=WGL_TYPE_RGBA_FLOAT_ARB>B  <http://source.winehq.org/ident?i=WGL_TYPE_RGBA_ARB>  and format_desc is not a floating format

then return FALSE right away no need to fill ERR

If you do not like this solution, getColorBits could be modified so that 
it does not file an error for floating point formats but just responds 
with 0 for all bit sizes when the format is a floating point without 
filling an error.

What do you prefer?

Can somebody propose a patch with this kind of behaviour or something 
better so that my Civ4 does not respond with this myriad of errors?





  <http://source.winehq.org/ident?i=WGL_TYPE_RGBA_ARB>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20091220/9929214f/attachment.htm>


More information about the wine-devel mailing list