Logo by blob - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. March 28, 2024, 02:26:17 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: 1 [2] 3   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Frag to GPU asm dump  (Read 6839 times)
Description: a little bit of code to dump GPU asm from fragmentarium
0 Members and 1 Guest are viewing this topic.
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #15 on: June 11, 2015, 12:59:26 AM »

hmm, not surprising that it doesn't work on other cards and a little disappointing that it causes a crash, sorry about that but I have no other cards to test on, I will add a nVidia flag and warning like "Do you really want to continue?" or something, maybe just enable the menu option only if there is nVidia card present.

did it crash on Intel card? did it display anything?

Thanks for the feedback cheesy
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
_revers_
Conqueror
*******
Posts: 138



« Reply #16 on: June 11, 2015, 07:18:42 PM »

Well, Fragmentarium didn't even start. During startup I get message about OpenGL module/profile absence (or something like that).
But there is installed OpenGL driver on this machine (BTW OS used on it is Ubuntu 14.04 x64). It supports OpenGL 3.3 Core Profile.
Maybe Core Profile is the problem? Fragmentarium uses Compatibility Profile?

But from your source I can tell you it will eventually crash since you do not check if "formats" returned from glGetIntegerv() is greater than "0":
Code:
   GLint formats = 0;
    glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &formats);
    GLint binaryFormats[formats];
« Last Edit: June 11, 2015, 10:45:55 PM by _revers_ » Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #17 on: June 11, 2015, 10:01:42 PM »

Fragmentarium (at least my legacy version) uses immediate mode OpenGL calls (glBegin(...)), so it needs compatibility.
The default requested QGLWidget context should be a OpenGL 2.x ccontext.

I have never heard about a graphics driver abandoning compatibility context completely. Are you able to run glxgears?
« Last Edit: June 11, 2015, 10:16:40 PM by Syntopia » Logged
_revers_
Conqueror
*******
Posts: 138



« Reply #18 on: June 11, 2015, 10:23:40 PM »

I will check tomorrow at work.

EDIT:
It seems like in Mesa drivers (which Intel uses) indeed there is no "Compatiblity Profile" in OpenGL 3.x context, but one can instead create OpenGL 1 or 2 context.
So I suppose that glxgears demo will work, and this is not the case with Fragmentarium failure. Maybe it's something with Qt?
« Last Edit: June 11, 2015, 10:44:17 PM by _revers_ » Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #19 on: June 12, 2015, 12:18:04 AM »

I think 3dickulus added the 'glGetProgramBinary to the list of required functions. This is OpenGL 3.0+, so with that function a compatibility mode is required.
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #20 on: June 12, 2015, 01:03:06 AM »

using...
Code:
#include <QOpenGLVersionFunctions>
#include <QOpenGLFunctions_4_1_Compatibility>
...means ThirdPartyCode/glextensions.h is no longer required as everything is made available in QGLWidget by
Code:
class DisplayWidget : public QGLWidget, protected QOpenGLFunctions_4_1_Compatibility {
    Q_OBJECT
public:
...etc...

I only added 4 #defines that didn't resolve.
Code:
#define GL_RGBA32F 0x8814
#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
#define GL_PROGRAM_BINARY_FORMATS 0x87FF
#define GL_PROGRAM_BINARY_LENGTH 0x8741
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
_revers_
Conqueror
*******
Posts: 138



« Reply #21 on: June 12, 2015, 06:32:39 PM »

I am able to run glxgears demo on the Intel machine.
The exact error during Fragmentarium startup is:
"OpenGL features are missing.

Failed to resolve OpenGL functions required to run this application.
The program will now exit."

Driver details:
Code:
Platform: Linux Ubuntu 14.04 x64
GL Vendor     : Intel Open Source Technology Center
GL Renderer   : Mesa DRI Intel(R) Haswell Desktop
GL Version    : 3.3 (Core Profile) Mesa 10.3.0
GL Version    : 3.3
GLSL Version  : 3.30
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #22 on: June 12, 2015, 08:07:04 PM »

That is as expected.

3dickulus, using  QOpenGLFunctions_4_1_Compatibility will not help. Revers' GPU only offers legacy modes (OpenGL 1.x, OpenGL 2.x) and modern OpenGL 3/4 Core contexts. But Fragmentarium cannot run in a core context - it needs compatibility - and the glGetBInaryProgram requires OpenGL 3 or later.

This is the same situation as on Mac, where there are two completely different implementations, legacy OpenGL 2.1 and moderne OpenGL 3.3/4.1 core contexts:
https://developer.apple.com/opengl/capabilities/index.html

The best solution would be to get rid of the glBegin/glEnd stuff (and the matrix stack), and instead use VBO's. After all we are only drawing a single quad.
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #23 on: June 13, 2015, 01:20:19 AM »

my reply above is only for reference as to what I used in DisplayWidget source, not meant as a fix suggestion, I tried 3_0 to 4_0 but 4_1 is the one that compiles with no errors
glGetBInaryProgram doesn't seem to be in the QOpenGLFunctions until you get to 4_1 but should be available back to 3_0

I think the solution in this case is simply no AsmBrowser if GL Vers < 4.1 , this is ok (with me) as it only works with one brand anyways so will try to set it up to warn but not exit.

edit: it does compile an run with QOpenGLFunctions_1_0 up to and inculding QOpenGLFunctions_4_1_Core and Compat (not thoroughly tested) without the AsmBrowser stuff
« Last Edit: June 13, 2015, 01:57:25 AM by 3dickulus, Reason: upd » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #24 on: June 13, 2015, 05:07:12 AM »

for now I have added...
Code:
/// comment this out to compile with AsmBrowser enabled requires GL => 4.1
#define ASMBROWSER
as line 3 and 4 of DisplayWidget.h and ifdefed a few things like...
Code:
#ifdef ASMBROWSER
class DisplayWidget : public QGLWidget, protected QOpenGLFunctions_4_1_Compatibility {
#else
class DisplayWidget : public QGLWidget, protected QOpenGLFunctions {
#endif
I think this should make a legacy or modern GL version at compile time (haven't seen black screen for a while I think I fixed that too)

the changes are now in the sources on my website (might be slow it's been recruited for rendering duties)

@_revers_ you compile from source?
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
_revers_
Conqueror
*******
Posts: 138



« Reply #25 on: June 13, 2015, 08:55:07 AM »

Yes, I've compiled from the source. I'll check on Monday if your fix works (now I don't have access to this computer). Also I will check if original Syntopia's Fragmentarium works.
Logged
_revers_
Conqueror
*******
Posts: 138



« Reply #26 on: June 14, 2015, 11:05:22 AM »

@3dickulus

Can I use your technique for extracting assembly code in the Synthclipse? I would like to implement similar assembly preview. I think the preview might be useful for example to see how much ASM instructions shader uses (One of my experimental shaders uses 11 000 asm instructions, though it is designed to be maximally configurable, not optimal smiley ).
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #27 on: June 14, 2015, 11:25:56 AM »

yes of course, thanks for asking smiley
the AsmBrowser class just extracts text from nV binary, very unsophisticated, I had planned to parse the variable names and put them into the code where they belong for better readability.

I recently found out (Qt Docs) that Compatibility doesn't work on Mac, needs Core profile above GLv3.0, I have changed this and it compiles and runs fine on linux and win but I don't have access to a Mac for testing. (latest source tweek uploaded minutes ago)

edit: 2 exe files on the website one for nVidia GL v4.1 and up (nV suffix) and one for legacy GL, the difference is the nVidia version has the Shader Asm Browser and uses GL 4.1 Core profile.
« Last Edit: June 14, 2015, 01:47:03 PM by 3dickulus, Reason: 2exe » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
_revers_
Conqueror
*******
Posts: 138



« Reply #28 on: June 14, 2015, 02:11:39 PM »

Thanks smiley
Logged
_revers_
Conqueror
*******
Posts: 138



« Reply #29 on: June 15, 2015, 07:30:19 PM »

Fragmentarium 1.0.7 works (on the Intel machine) with removed flag "ASMBROWSER". Fragmentarium 1.0.0 works without any modification.
Logged
Pages: 1 [2] 3   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Small error in Complex.frag Fragmentarium JosLeys 2 1417 Last post June 08, 2013, 09:01:45 AM
by Roquen
Orbit Trap in GI frag Fragmentarium « 1 2 3 » vinz 38 7119 Last post June 20, 2013, 07:48:01 PM
by vinz
Photomanip + Fractal :: Image Dump Images Showcase (Rate My Fractal) Ryche 6 1071 Last post July 21, 2015, 11:20:59 AM
by Ryche
Frag / GLSL newbie questions Fragmentarium Patryk Kizny 5 1200 Last post July 25, 2015, 05:02:47 AM
by 3dickulus
Abox minR2 tweaking frag Amazing Box, Amazing Surf and variations mclarekin 0 2372 Last post July 26, 2017, 03:18:00 PM
by mclarekin

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 2.575 seconds with 25 queries. (Pretty URLs adds 0.149s, 2q)