Hi Robert,
On Dec 16, 2008, at 1:58 AM, Robert Osfield wrote:
> This change is still not appropriate. This *is* a driver bug, a
> driver bug that might get fixed, and a bug that might affect other
> hardware and OS's. If you want to place such driver/hardware/specific
> hacks into your application then that's your choice, but it's not one
> that is appropriate for the core OSG.
Thanks for your answer. I understand the base concept, but I got confused with
your answer since the same file contains
some workarounds that violates your policy:
if (rendererString.find("Radeon")!=std::string::npos ||
rendererString.find("RADEON")!=std::string::npos)
{
_isNonPowerOfTwoTextureMipMappedSupported = false;
osg::notify(osg::INFO)<<"Disabling
_isNonPowerOfTwoTextureMipMappedSupported for ATI hardware."<<std::endl;
}
if (rendererString.find("GeForce FX")!=std::string::npos)
{
_isNonPowerOfTwoTextureMipMappedSupported = false;
osg::notify(osg::INFO)<<"Disabling
_isNonPowerOfTwoTextureMipMappedSupported for GeForce FX hardware."<<std::endl;
}
These are the similar kinds of workarounds for specific driver bugs, I believe.
Moreover, the Radeon workaround is not necessary on my MacBook Pro (Radeon
1600X).
I added the workaround for GeForce 7x00 on Mac since the files already has such
"hacks."
If my workaround is not appropriate, then so are these.
> The proper solution for this type of problem is to disable the option
> based on the GL extension disable string, with it's value being drawn
> from the OSG_GL_EXTENSION_DISABLE string or from a your application -
> for instance you could have a file on disk that contains this gl
> extension disable string as a configuration that provides a default
> value, and can be tweaked by end users.
>
> In this case the proper solution using the GL extension disable scheme
> doesn't work right now as the check for the extension support checks
> for OpenGL version number and if this passes then feature is enable no
> matter whether one tries to disable it via the env var.
Yes, I know it doesn't work.
> To enable
> this to work I think the right thing to do is tweak the extension
> query scheme so that the calling code passing in the GL version number
> as well as the extension strings this way we can handle the extension
> disable checking at the same time. I've investigate this at my end.
I don't get this part, how exactly can I do this?
Could you elaborate this a bit more?
Tat
>
>
> Robert.
>
> On Mon, Dec 15, 2008 at 4:37 PM, Tatsuhiro Nishioka
> <[email protected]> wrote:
>> Hi Robert,
>>
>> Okay, I'll resubmit Texture.cpp with a workaround for a possible bug in
>> Mac's GeForce driver.
>> The problem is that hardware mipmapping in multi-threaded environment
>> crashes FlightGear on a Mac with GeForce 7x00 GT cards.
>> I've reported that it happens with 7300 GT and 7600 GT, but it may happen on
>> some other 7x00 series.
>>
>> For doing so, I make Texture::isHardwareMipmapGenerationEnabled() return
>> false when such cards are detected.
>>
>> Best,
>>
>> Tat
>>
>> On Nov 21, 2008, at 7:34 PM, Robert Osfield wrote:
>>
>>> Hi Tatsuhiro,
>>>
>>> You changes are only going to break lots of systems out there so there
>>> is no way I'm going to apply it. It's also the wrong way to go about
>>> managing this feature disablement. The GLExtensionDisable is the
>>> correct way to go about it. It might be that we want to extend this
>>> infrastructure to handle configuration files for different
>>> hardware/drivers rather than just env vars.
>>>
>>> Robert.
>>>
>>> On Thu, Nov 13, 2008 at 5:26 PM, Tatsuhiro Nishioka
>>> <[email protected]> wrote:
>>>> Hi Robert,
>>>>
>>>> Here's Texture.cpp that gives us what I explained in my last post to
>>>> osg-users on this.
>>>> I also added GeForce 7300GT driver bug fix (inside #ifdef __APPLE__ #endif
>>>> closure).
>>>> I tested this file on iMac/GeForce 7300GT and it worked fine.
>>>>
>>>> If this works on Window and Linux, then I'll change other files for the
>>>> same purpose.
>>>>
>>>> Best,
>>>>
>>>> Tat
>>>>
>>>> Tat wrote on osg-users on Wed, Nov 12, 2008 at 1:23 PM:
>>>>> Sure, no problem at all.
>>>>>
>>>>> However, I'm now doing further investigation for simpler code to do
>>>>> the same thing. I'm wondering if version check is actually needed for
>>>>> each extension availability check. Since OpenGL must be upward
>>>>> compatible, you can call only isGLExtensionEnabled for that purpose.
>>>>> The extensions can be accessible as extensions even these were
>>>>> promoted to be OpenGL core functionalities in a certain version.
>>>>>
>>>>> So, I'll try cutting all the version comparisons in checking extension
>>>>> availability from entire osg classes for doing what I mentioned in the
>>>>> last post. Plus, I'll also add a workaround to avoid crash on
>>>>> Macs/GeForce 7300GT.
>>>>>
>>>>> Only one thing I'm worried is that I don't know if there are some
>>>>> exceptional OpenGL drivers that don't have the compatibility written
>>>>> in OpenGL specification. In that case, we need to think about another
>>>>> way to achieve this issue.
>>>>>
>>>>> Anyway, I'll post the files to the submission list when it's done.
>>>>>
>>>>> Tat
>>>>>
>>>>> p.s.
>>>>> If you want me to post the workaround for GeForce separately from the
>>>>> ones with extension disable/enable thing, I'll do so (since these are
>>>>> for different purposes).
>>>>>
>>>>>> From: "Robert Osfield" <[email protected]>
>>>>>>
>>>>>> HI Tat,
>>>>>>
>>>>>> Could you post the whole modified file to osg-submissions I can then
>>>>>> review it their alongside the rest of the code submissions.
>>>>>>
>>>>>> Thanks,
>>>>>> Robert.
>>>>>>
>>>>>> On Sun, Nov 9, 2008 at 5:38 PM, Tatsuhiro Nishioka
>>>>>> <[email protected]> wrote:
>>>>>>> Hi there,
>>>>>>>
>>>>>>> I received some crash reports on FlightGear/OSG from a user who uses
>>>>>>> nVidia 7300GT on Macs.
>>>>>>> Debugging on an iMac gave me that hardware mipmapping on its driver
>>>>>>> caused the crash.
>>>>>>> so I once made a "fix-it-only-for-this-issue" kinda patch that simply
>>>>>>> disable hardware mipmapping when
>>>>>>> the renderer is "NVIDIA GeForce 7300GT OpenGL Engine, " and that
>>>>>>> actually fixed the problem.
>>>>>>> (see
>>>>>>> http://www.mail-archive.com/[email protected]/msg18674.html
>>>>>>> for more detail on this problem and the patch.)
>>>>>>>
>>>>>>> However, I'm wondering if users can disable hardware extensions to
>>>>>>> avoid such problems.
>>>>>>> I tried
>>>>>>> OSG_GL_EXTENSION_DISABLE="GL_SGIS_generate_mipmap;GL_EXT_framebuffer_object"
>>>>>>> but nothing happened.
>>>>>>> Taking a look at Texture.cpp tells me you can never disable hardware
>>>>>>> extensions if your OpenGL driver version >= 1.4 (or 2.0)
>>>>>>> It calls isGLExtensionSupported to check if an extension is supported
>>>>>>> but these will never called.
>>>>>>> For example, the following code is for checking hardware mipmapping
>>>>>>> extension:
>>>>>>>
>>>>>>> _isGenerateMipMapSupported = (strncmp((const
>>>>>>> char*)glGetString(GL_VERSION),"1.4",3)>=0) ||
>>>>>>>
>>>>>>> isGLExtensionSupported(contextID,"GL_SGIS_generate_mipmap");
>>>>>>>
>>>>>>> This means that isGLExtensionSupported will never be called when
>>>>>>> GL_VERSION >= 1.4, resulting that you cannot disable it
>>>>>>> since environment variable is evaluated in isGLExtensionSupported.
>>>>>>>
>>>>>>> Attached is the patch to make hardware extensions disabled using the
>>>>>>> environment variable.
>>>>>>> I'm not so sure on the real purpose of the OR logic in the if statement
>>>>>>> above, but it is good to give users a choice.
>>>>>>> Can anyone test this and check if this is a right solution?
>>>>
>>
>>
>>
>>
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>
>>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org