MantisBT - Community
View Issue Details
0027606Community[OCCT] OCCT:Visualizationpublic2016-06-15 12:352016-12-09 16:37
Timo 
bugmaster 
lowminor 
closedfixed 
[OCCT] 7.0.0 
[OCCT] 7.1.0[OCCT] 7.1.0 
Not needed
0027606: Visualization - view is blocking when MSAA has been overridden in graphics driver settings
When changing the number of MSAA samples, then rotating or fitting the view and then changing the number of MSAA samples again, the view is blocking and cannot be rotated anymore.

I don't know whether it is a general problem or related to my graphics driver:
OpenGL info:
  GLvendor = 'ATI Technologies Inc.'
  GLdevice = 'ATI FirePro V5800 (FireGL) Graphics Adapter'
  GLversion = '4.5.13399 Compatibility Profile Context FireGL 15.200.1062.1004'
  GLSLversion = '4.40'

I was able to reproduce it with the official OpenCASCADE7.0.0-vc10-64 setup on Windows 10 (64 bit).

NVIDIA
TKOpenGl.OpenGL | Type: Error | ID: 1282 | Severity: High | Message:
  GL_INVALID_OPERATION error generated. The SAMPLES values of the read and draw framebuffers should match.



AMD
TKOpenGl.OpenGL | Type: Error | ID: 3010 | Severity: High | Message:
  glBlitFramebuffer failed because the framebuffer configurations require that the source and destination 
formats and sample counts match (GL_INVALID_OPERATION)
- Set MSAA settings to 4x "Override any application setting" in graphics driver.
- Execute script:
pload MODELING VISUALIZATION
vgldebug 1
box b 10 20 10
vclear
vinit View1
vdisplay b
vfit
vrenderparams -msaa 2

Bug: antialiasing does not change and view is blocking, cannot be rotated
No tags attached.
related to 0026711closed bugmaster Open CASCADE Visualization, TKOpenGl - support creation of multisampling off-screen FBOs 
png blocking view.png (83,342) 2016-06-15 12:38
https://tracker.dev.opencascade.org/
Issue History
2016-06-15 12:35TimoNew Issue
2016-06-15 12:35TimoAssigned To => kgv
2016-06-15 12:38TimoFile Added: blocking view.png
2016-06-15 12:38TimoDescription Updatedbug_revision_view_page.php?rev_id=13934#r13934
2016-06-15 12:39TimoDescription Updatedbug_revision_view_page.php?rev_id=13935#r13935
2016-06-15 13:46kgvNote Added: 0055004
2016-06-15 13:46kgvAssigned Tokgv => Timo
2016-06-15 13:46kgvStatusnew => feedback
2016-06-15 13:46kgvResolutionopen => unable to reproduce
2016-06-15 13:46kgvNote Edited: 0055004bug_revision_view_page.php?bugnote_id=55004#r13937
2016-06-15 14:02abvNote Added: 0055007
2016-06-15 14:16TimoNote Added: 0055013
2016-06-15 14:28TimoNote Added: 0055021
2016-06-15 16:19TimoNote Added: 0055036
2016-06-15 16:20TimoAssigned ToTimo => kgv
2016-06-16 11:30kgvPrioritynormal => low
2016-06-16 11:30kgvStatusfeedback => assigned
2016-06-16 11:30kgvResolutionunable to reproduce => open
2016-06-16 11:30kgvSummaryView is blocking after number of MSAA samples was changed => Visualization - view is blocking when MSAA has been overridden in graphics driver settings
2016-06-16 11:30kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13953#r13953
2016-06-16 11:52kgvRelationship addedrelated to 0026711
2016-06-16 12:00gitNote Added: 0055063
2016-06-16 12:14kgvNote Added: 0055064
2016-06-16 12:16kgvNote Edited: 0055064bug_revision_view_page.php?bugnote_id=55064#r13955
2016-06-16 12:16kgvNote Added: 0055065
2016-06-16 12:16kgvAssigned Tokgv => san
2016-06-16 12:16kgvStatusassigned => resolved
2016-06-16 12:17kgvNote Edited: 0055065bug_revision_view_page.php?bugnote_id=55065#r13957
2016-06-16 12:19kgvNote Edited: 0055064bug_revision_view_page.php?bugnote_id=55064#r13958
2016-06-16 12:58gitNote Added: 0055068
2016-06-16 13:02sanNote Added: 0055071
2016-06-16 13:02sanAssigned Tosan => bugmaster
2016-06-16 13:02sanStatusresolved => reviewed
2016-06-16 14:12mkvTest case number => Not needed
2016-06-16 14:18mkvAssigned Tobugmaster => mkv
2016-06-16 17:06kgvDescription Updatedbug_revision_view_page.php?rev_id=13966#r13966
2016-06-16 17:15kgvDescription Updatedbug_revision_view_page.php?rev_id=13967#r13967
2016-06-16 18:20gitNote Added: 0055102
2016-06-17 15:19mkvNote Added: 0055191
2016-06-17 15:20mkvNote Added: 0055192
2016-06-17 15:20mkvNote Added: 0055193
2016-06-17 15:20mkvAssigned Tomkv => bugmaster
2016-06-17 15:20mkvStatusreviewed => tested
2016-06-24 12:41bugmasterChangeset attached => occt master 7ccf8676
2016-06-24 12:41bugmasterStatustested => verified
2016-06-24 12:41bugmasterResolutionopen => fixed
2016-06-24 12:58gitNote Added: 0055430
2016-12-09 16:31aivStatusverified => closed
2016-12-09 16:37aivFixed in Version => 7.1.0

Notes
(0055004)
kgv   
2016-06-15 13:46   
It is better reporting issue to your graphics driver vendor - there is nothing we can do with driver bugs at application level.
Although your card designed in '2010 is already in legacy list of AMD (not based on GCN architecture) as far as I can see.

MSAA in OCCT works fine on AMD Radeon HD 7700, AMD Radon R9 290, NVIDIA GeForce GTX 650, Intel HD Graphics 2500 and many other GPUs with up-to-date drivers.
OpenGL info:
  GLvendor    = 'ATI Technologies Inc.'
  GLdevice    = 'AMD Radeon HD 7700 Series'
  GLversion   = '4.5.13431 Compatibility Profile Context 16.150.2211.1001'
  GLSLversion = '4.50'


(0055007)
abv   
2016-06-15 14:02   
Hello Timo, please check that you have the newest version of drivers for your card.
(0055013)
Timo   
2016-06-15 14:16   
After updating my graphics driver, the problem is still there.

OpenGL info:
  GLvendor = 'ATI Technologies Inc.'
  GLdevice = 'ATI FirePro V5800 (FireGL) Graphics Adapter'
  GLversion = '4.5.13411 Compatibility Profile Context FireGL 15.201.2401.0'
  GLSLversion = '4.40'
(0055021)
Timo   
2016-06-15 14:28   
If I leave out the vfit, then there is no problem in changing the number of samples.
(0055036)
Timo   
2016-06-15 16:19   
After checking on another computer, we found out that the problem is related to the settings of the graphics card driver.

If the driver overrides the application settings, defining a lower number of samples, e.g. 4, compared to the number of samples defined via OCC then the problem occurs.
If the driver uses the application settings, there is no problem.

This behaviour does not seem to be correct. If the driver settings override the application settings, the view should use the number of samples defined by the driver settings.

Can you reproduce the problem now?
Is there a way to find out, whether the driver ovverrides the application settings?

The other computer had the following graphics card:
OpenGL info:
  GLvendor = 'NVIDIA Corporation'
  GLdevice = 'GeForce GTX 950/PCIe/SSE2'
  GLversion = '4.5.0 NVIDIA 358.91'
  GLSLversion = '4.50 NVIDIA'

So, it does not seem to be a driver bug.
(0055063)
git   
2016-06-16 12:00   
Branch CR27606 has been created by kgv.

SHA-1: ffacecf941c74c1011958948c19ea4ed86d5be5e


Detailed log of new commits:

Author: kgv
Date: Thu Jun 16 12:00:49 2016 +0300

    0027606: Visualization - view is blocking when MSAA has been overridden in graphics driver settings
    
    OpenGl_View::blitBuffers() - try disabling MSAA on glBlitFramebuffer() failure
(0055064)
kgv   
2016-06-16 12:14   
(edited on: 2016-06-16 12:19)
> If the driver settings override the application settings, the view should use the number of samples defined by the driver settings.
Driver options overriding application settings is a terrible hack for applications that are not aware of some features - like MSAA at the moment when it was introduced - graphics vendors wanted to advertise their feature to users on existing applications.

This worked fine for old applications which rendered directly to the window (driver just needs to create MSAA window buffer) but became totally unusable nowadays with using off-screen buffers in rendering algorithms. You can find a lot of articles on the web concluding that overriding MSAA settings in driver settings has no effect on majority of modern games and for some of them causing graphical issues (depending on driver); for example http://www.tomshardware.com/reviews/anti-aliasing-nvidia-geforce-amd-radeon,2868-7.html [^]

OCCT is an example of these applications - it uses offscreen FBOs and driver is unable to override them properly. And since this is _overriding_ on driver level - graphics API does not report to application actual configuration of window format (e.g. WGL_SAMPLES_ARB), driver intentionally _lies_ to application! Therefore application is unable to handle this situation correctly (and technically does not have to - this is a hack in driver, its a driver responsibility to make it working or at least harmless).

So in general, user should not expect that overriding application settings in driver settings should be harmless / should have effect, and therefore should avoid using such settings (use per-application profile instead).

(0055065)
kgv   
2016-06-16 12:16   
(edited on: 2016-06-16 12:17)
Patch is ready for review in branch CR27606.
Test case is not needed (scenario depends on driver settings).

(0055068)
git   
2016-06-16 12:58   
Branch CR27606 has been updated forcibly by kgv.

SHA-1: 451d14c066253ff89133cb1b8c5ca87964c94f8b
(0055071)
san   
2016-06-16 13:02   
Branch CR27606 reviewed without remarks, ready for testing.
(0055102)
git   
2016-06-16 18:20   
Branch CR27606 has been updated forcibly by mkv.

SHA-1: 5d0846282fbdf5e73b70dcaabef8ad7862822742
(0055191)
mkv   
2016-06-17 15:19   
Dear BugMaster,
Branch CR27606 was rebased on IR-2016-06-16 branch of occt git-repository.
SHA-1: 5d0846282fbdf5e73b70dcaabef8ad7862822742
(0055192)
mkv   
2016-06-17 15:20   
Dear BugMaster,
Branch CR27606 from occt git-repository (and IR-2016-06-16 from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 5d0846282fbdf5e73b70dcaabef8ad7862822742

Number of compiler warnings:

occt component :
Linux: 0 (0 on IR-2016-06-16)
Windows: 0 (0 on IR-2016-06-16)
MacOS : 0 (0 on IR-2016-06-16)

products component :
Linux: 68 (68 on IR-2016-06-16)
Windows: 0 (0 on IR-2016-06-16)
MacOS : 1135

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 87937428 / 89141601 [-1.35%]
Total CPU difference: 19430.329999999998 / 19458.52999999997 [-0.14%]
products component :
Total MEMORY difference: 27460618 / 27412842 [+0.17%]
Total CPU difference: 5156.479999999995 / 5165.429999999985 [-0.17%]

Testing on Windows:
occt component :
Total MEMORY difference: 55894770 / 55903796 [-0.02%]
Total CPU difference: 18325.15666819888 / 18535.758018198954 [-1.14%]
products component :
Total MEMORY difference: 18649467 / 18614185 [+0.19%]
Total CPU difference: 4984.840353899948 / 4998.802443399952 [-0.28%]

There are no differences in images found by testdiff.
(0055193)
mkv   
2016-06-17 15:20   
Dear BugMaster,
Branch CR27606 is TESTED.
(0055430)
git   
2016-06-24 12:58   
Branch CR27606 has been deleted by inv.

SHA-1: 5d0846282fbdf5e73b70dcaabef8ad7862822742