Re: [osg-users] EXTERNAL: Re: EXTERNAL: Re: EXTERNAL: Re: Where is CreateContextAttribs() being used?

2019-04-11 Thread Chris Hanson
On Thu, Apr 11, 2019 at 5:46 PM Rowley, Marlin R 
wrote:

> Sebastian,
>
> I have written the shaders for GL 3.3 so that’s done.  When RenderDoc
> runs, I’m assuming it’s only checking that window context.  I am NOT
> assuming that it can comb through my code and determine that I’ve used a
> fixed-function GL call somewhere and therefore spits out the message.
>

  Well, it's not just the GLSL version, you need to create a context that
either can or can not handle non-core  FFP functions. So, outside of your
shaders, even other pieces of OSG code could be requiring non-core
features. You'd need to build OSG and osgEarth with the proper build
options to completely remove their utilization of any non-core abilities,
and then make sure you (or OSG) create a core-only Context.


> In general, I’d like to have a working GPU debugger.  Right now, we are
> struggling to find out values of local variables in the shaders that aren’t
> uniform.  We would also love to be able to pinpoint bottlenecks in the code
> from the GPU side to optimize performance.
>

Debugging shader local variables in-situ is a pretty weak point of GLSL.

My recommendation is to try to create a toy program that replicates the
critical part of your code, as debugging there will be a lot easier, and
then you can apply the fix to your larger environment. Working within OSG
and osgEarth can be very daunting when things aren't working the way you
expect.



>
>
> 
>
> Marlin Rowley
>
> Software Engineer, Staff
>
> [image: cid:image002.jpg@01D39374.DEC5A2E0]
>
> *Missiles and Fire Control*
>
> 972-603-1931 (office)
>
> 214-926-0622 (mobile)
>
> marlin.r.row...@lmco.com
>
>
>
-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS •
osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android
@alphapixel  facebook.com/alphapixel (775)
623-PIXL [7495]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] EXTERNAL: Re: EXTERNAL: Re: EXTERNAL: Re: Where is CreateContextAttribs() being used?

2019-04-11 Thread Rowley, Marlin R
Sebastian,

I have written the shaders for GL 3.3 so that’s done.  When RenderDoc runs, I’m 
assuming it’s only checking that window context.  I am NOT assuming that it can 
comb through my code and determine that I’ve used a fixed-function GL call 
somewhere and therefore spits out the message.

In general, I’d like to have a working GPU debugger.  Right now, we are 
struggling to find out values of local variables in the shaders that aren’t 
uniform.  We would also love to be able to pinpoint bottlenecks in the code 
from the GPU side to optimize performance.


Marlin Rowley
Software Engineer, Staff
[cid:image002.jpg@01D39374.DEC5A2E0]
Missiles and Fire Control
972-603-1931 (office)
214-926-0622 (mobile)
marlin.r.row...@lmco.com<mailto:marlin.r.row...@lmco.com>

From: osg-users  On Behalf Of 
Sebastian Messerschmidt
Sent: Thursday, April 11, 2019 9:49 AM
To: 'OpenSceneGraph Users' 
Subject: EXTERNAL: Re: [osg-users] EXTERNAL: Re: EXTERNAL: Re: Where is 
CreateContextAttribs() being used?

Merlin,

As Chris already mentioned the complete application needs to run on 
core-profile. That means there is no fixed function pipeline and no 
backward-compatibility features.
In order to get your application running in core-profile you need to write 
shaders for everything and IIRC compile OSG with GL3 enabled. I haven’t used 
OSG in a while now, but I think there is mechanism to decorate the scene graph 
with shaders automatically.

I started to refactor my project some years ago to fully support core-only 
scenarios, but I gave up due to a lot features no longer working out-of-the-box.
Can you maybe try to explain what you’re trying to debug? There might be some 
more options for you.


Cheers
Sebastian

From: osg-users 
mailto:osg-users-boun...@lists.openscenegraph.org>>
 On Behalf Of Rowley, Marlin R
Sent: Donnerstag, 11. April 2019 16:24
To: OpenSceneGraph Users 
mailto:osg-users@lists.openscenegraph.org>>
Subject: Re: [osg-users] EXTERNAL: Re: EXTERNAL: Re: Where is 
CreateContextAttribs() being used?

Sebastian,

What does “core OpenGL profile” mean with regards to the graphics context?  I’m 
still not getting it to work.

Here is my code structure:

…
osg::ref_ptr traits = new 
osg::GraphicsContext::Traits;
traits->x = aXPosition;
traits->y = aYPosition;
traits->width  = aWidth;
traits->height = aHeight;
traits->stencil = 8;
traits->doubleBuffer = true;
traits->windowDecoration = false;
#if defined(WIN32)
traits->inheritedWindowData = new 
osgViewer::GraphicsWindowWin32::WindowData( aWindow );
#elif defined(__linux__)
   traits->inheritedWindowData = new 
osgViewer::GraphicsWindowX11::WindowData( aWindow );
#endif
// gl graphics context version and profile mask
traits->glContextVersion = "3.3";
traits->glContextProfileMask = 0x1;

// create the graphics window from the context
osgViewer::GraphicsWindow* gw = 
dynamic_cast(osg::GraphicsContext::createGraphicsContext(traits.get()));

…

// set the main camera to use the window
mainCamera->setGraphicsContext( gw );

…

I assume here that setting the traits variable with the major/minor version of 
OpenGL and setting the profile mask to 1 (‘core’??) would be all I need.  But 
that’s obviously not the case.

-M


Marlin Rowley
Software Engineer, Staff
[cid:image002.jpg@01D39374.DEC5A2E0]
Missiles and Fire Control
972-603-1931 (office)
214-926-0622 (mobile)
marlin.r.row...@lmco.com<mailto:marlin.r.row...@lmco.com>

From: osg-users 
mailto:osg-users-boun...@lists.openscenegraph.org>>
 On Behalf Of 
sebastian.messerschm...@gmx.de<mailto:sebastian.messerschm...@gmx.de>
Sent: Thursday, April 11, 2019 9:01 AM
To: 'OpenSceneGraph Users' 
mailto:osg-users@lists.openscenegraph.org>>
Subject: EXTERNAL: Re: [osg-users] EXTERNAL: Re: Where is 
CreateContextAttribs() being used?

Hi Marlin,

In order for RenderDoc (and most tools I’m aware of) you’re application needs 
to run on core OpenGL profile.
You might want to look here for some debugging options: 
https://www.khronos.org/opengl/wiki/Debugging_Tools
I personally used Nvidia Nsight for quite a while, as it at least helps with 
framebuffer debugging etc.

Cheers
Sebastian


From: osg-users 
mailto:osg-users-boun...@lists.openscenegraph.org>>
 On Behalf Of Rowley, Marlin R
Sent: Donnerstag, 11. April 2019 14:52
To: OpenSceneGraph Users 
mailto:osg-users@lists.openscenegraph.org>>
Subject: Re: [osg-users] EXTERNAL: Re: Where is CreateContextAttribs() being 
used?

We are using Win10-x64.

We are trying to get RenderDoc to be able to see our application so we can do 
some graphics debugging.  It’s shouting back that the current device context 
wasn’t created using CreateContextAttrib, so