Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: GLSL: The return to fixed functinoality

  1. #11
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    None of what you're talking about is how anything in OpenGL works. Please don't confuse people who are struggling to understand how these things actually work with ideas about how you want them to work.

  2. #12
    Junior Member Regular Contributor
    Join Date
    Nov 2012
    Location
    Bremen, Germany
    Posts
    167
    Yes and no (meaning I deserve that scolding posting after drinking some beers).
    But: If creating a context and not giving any information about the version wanted - how is it decided what context to create? If something similar happens in the degree of development from 4.X to version Y as in the development from 1.0 to 3.2 one cannot expect a Version-Y-core context to provide the functionality that was core today. Or were those flags really designed for a one-time purpose without the intention to give them some semantics that will stay in place?
    And: How is that related to the small incident of CreateContext returning a context for which neither core- nor compat-bits is set? Seems hard to decide that apps built against earlier gl-version using CreateContext should not work anymore because the Default-flag is CORE. Returning 0 for profile-mask would mean it's neither a core- nor a compat context. Would result in 0-entry-poits if you ask me.

  3. #13
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    how is it decided what context to create?
    Have you ever hear about default values and/or default behavior?

    For instance:

    Quote Originally Posted by GLX_ARB_create_context
    The default values for GLX_CONTEXT_MAJOR_VERSION_ARB and GLX_CONTEXT_MINOR_VERSION_ARB are 1 and 0 respectively. In this case, implementations will typically return the most recent version of OpenGL they support which is backwards compatible with OpenGL 1.0 (e.g. 3.0, 3.1 + GL_ARB_compatibility, or 3.2 compatibility profile)
    How is that related to the small incident of CreateContext returning a context for which neither core- nor compat-bits is set?
    First of all, neither glxCreateContext nor wglCreateContext take an attrib list. If it doesn't take an attrib list, it cannot take a bit setting the compat or core profile. [wgl|glx]CreateContextAttribsARB is the appropriate API. Second, setting neither is an error - however, that means you provide the CONTEXT_PROFILE_MASK name with a value that is neither CONTEXT_CORE_PROFILE_BIT nor CONTEXT_COMPATIBILITY_PROFILE_BIT. If you don't specify a <name, value> pair specifying the CONTEXT_PROFILE_MASK at all, the default value, i.e. CONTEXT_CORE_PROFILE_BIT, is used.

    Just read the corresponding extension specs ...

  4. #14
    Junior Member Regular Contributor
    Join Date
    Nov 2012
    Location
    Bremen, Germany
    Posts
    167
    I guess that's cause I only used to read it partially or this is really a contradiction:
    Default value is 1.0 for Version which requires compatibility.
    Default for profile is core.
    wglCreateContext = wglCreateContextAttribs(..., 0, 0).
    The sentence
    The default value for WGL_CONTEXT_PROFILE_MASK_ARB is WGL_CONTEXT_CORE_PROFILE_BIT_ARB.
    could have been extended by "if not required otherwise by the version number requested" or something like that. Of course this makes no sense...

  5. #15
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    Default value is 1.0 for Version which requires compatibility.
    Default for profile is core.
    That's where you've confused yourself.

    There is no such thing as "compatibility 1.0". The core/compatibility distinction did not exist until 3.2 or later. That's why setting the CONTEXT_COMPATIBILITY_PROFILE_BIT on any version request before 3.2 is an error.

    The core and compatibility profiles refer to OpenGL specification documents. There is a 3.2 core specification and a 3.2 compatibility specification. There is a 1.1 core specification, but there is no 1.1 compatibility specification.

    You keep trying to think of "compatibility" as "fixed-function" or whatever. It's not.

  6. #16
    Junior Member Regular Contributor
    Join Date
    Nov 2012
    Location
    Bremen, Germany
    Posts
    167
    May that be the actual reason wglCreateContext returns a context with neither profile bit set (which nonetheless is a compatibility-context)?

    EDIT: My stupid - the GLenum for the query likely is unknown to the context returned and hence it gives 0...

    EDIT2: However glGetError() returns 0. Just checked this.
    Last edited by hlewin; 07-26-2013 at 12:42 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •