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 6 of 8 FirstFirst ... 45678 LastLast
Results 51 to 60 of 74

Thread: Official Bindless Graphics feedback thread

  1. #51
    Member Regular Contributor
    Join Date
    Mar 2005
    Posts
    301

    Re: Official Bindless Graphics feedback thread

    jeff,

    I don't get these:

    - "A GLsizeiptr is signed". Uh, yeah, that's why I suggested -1 instead of ~0 (a negative size makes no sense, why I thought -1 would fit perfectly).

    - "This is a GPU address, not a CPU address". While true, the driver would still have to verify it on every use by the application (else it'd open a whole factory of worms and system crashes). Right? Would it then be a too large overhead to not only verify, but also internally perform the "32-bit user address space -> 64-bit PCI address space" translation (on 32-bit processes/operating systems)? Also, as you can't (normally) address anything outside "your" address space, how would a 64-bit space help a 32-bit app?

  2. #52
    Member Regular Contributor
    Join Date
    Mar 2005
    Posts
    301

    Re: Official Bindless Graphics feedback thread

    Quote Originally Posted by skynet
    There are useful scenarios where you can mix interleaved and non-interleaved atributes in one VBO
    Point taken. Format objects would likely be a better long-term solution for what I had in mind.

  3. #53
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    Re: Official Bindless Graphics feedback thread

    " "This is a GPU address, not a CPU address". While true, the driver would still have to verify it on every use by the application (else it'd open a whole factory of worms and system crashes)."

    As far as i can see, this extension DOES open up a huge can of worms. I think crashing you favorite OS will become easy again.

    Jan.
    GLIM - Immediate Mode Emulation for GL3

  4. #54
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,270

    Re: Official Bindless Graphics feedback thread

    Worst ever that can happen is a GPU reset, imho. A gpu reset is as 'damaging' and slow as changing the screen resolution.

  5. #55
    Junior Member Newbie
    Join Date
    Jun 2009
    Location
    Cambridge, MA
    Posts
    3

    Re: Official Bindless Graphics feedback thread

    I've started to implement bindless graphics for my app, but I cannot find the appropriate header files or other support for the new function calls. I'm using the latest OpenGL SDK (10.52), and the latest drivers (185.85).

    Do I need to go back to a beta driver (that presumably includes headers, etc)?

    Thanks!
    -mike

  6. #56
    Senior Member OpenGL Pro
    Join Date
    Sep 2004
    Location
    Prombaatu
    Posts
    1,386

    Re: Official Bindless Graphics feedback thread

    You'll need to code up and grab your own extension procs for the time being.

    Quick and dirty loader for tinkering...
    Code :
    //
    // Declare stuff (just paste and comma delimit from spec)
    //
     
    #define GLDECL(ret, name, ...) \
    	typedef ret (APIENTRYP PFN##name##PROC)(__VA_ARGS__); \
    	PFN##name##PROC name = NULL;
     
    // ------------------------------------------------------------------------------------------------
    // NV_shader_buffer_load
    // -----------------------------------------------------------------------------------------------
     
    // Buffer operations
    GLDECL(void, glMakeBufferResidentNV, GLenum target, GLenum access);
    GLDECL(void, glNamedMakeBufferResidentNV, GLuint buffer, GLenum access); // Not in beta
    GLDECL(void, glMakeBufferNonResidentNV, GLenum target);
    GLDECL(void, glNamedMakeBufferNonResidentNV, GLuint buffer); // Not in beta
    GLDECL(GLboolean, glIsBufferResidentNV, GLenum target);
    GLDECL(GLboolean, glIsNamedBufferResidentNV, GLuint buffer);
    GLDECL(void, glGetBufferParameterui64vNV, GLenum target, GLenum pname, GLuint64EXT *params);
    GLDECL(void, glGetNamedBufferParameterui64vNV, GLuint buffer, GLenum pname, GLuint64EXT *params);
    // New Get flavor
    GLDECL(void, glGetIntegerui64vNV, GLenum value, GLuint64EXT *result);
    // (Named) program uniform get/set
    GLDECL(void, glUniformui64NV, GLint location, GLuint64EXT value);
    GLDECL(void, glUniformui64vNV, GLint location, GLsizei count, GLuint64EXT *value);
    GLDECL(void, glGetUniformui64vNV, GLuint program, GLint location, GLuint64EXT *params);
    GLDECL(void, glProgramUniformui64NV, GLuint program, GLint location, GLuint64EXT value);
    GLDECL(void, glProgramUniformui64vNV, GLuint program, GLint location, GLsizei count, GLuint64EXT *value);
     
    enum NV_shader_buffer_load
    {
    	// Accepted by the <pname> parameter of GetBufferParameterui64vNV, GetNamedBufferParameterui64vNV:
        GL_BUFFER_GPU_ADDRESS_NV	= 0x8F1D,
     
    	// Returned by the <type> parameter of GetActiveUniform:
        GL_GPU_ADDRESS_NV		= 0x8F34,
     
    	// Accepted by the <value> parameter of GetIntegerui64vNV: 
        GL_MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35,
    };
     
    // ------------------------------------------------------------------------------------------------
    // NV_vertex_buffer_unified_memory
    // ------------------------------------------------------------------------------------------------
     
    GLDECL(void, glBufferAddressRangeNV, GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
    GLDECL(void, glVertexFormatNV, GLint size, GLenum type, GLsizei stride);
    GLDECL(void, glNormalFormatNV, GLenum type, GLsizei stride);
    GLDECL(void, glColorFormatNV, GLint size, GLenum type, GLsizei stride);
    GLDECL(void, glIndexFormatNV, GLenum type, GLsizei stride);
    GLDECL(void, glTexCoordFormatNV, GLint size, GLenum type, GLsizei stride);
    GLDECL(void, glEdgeFlagFormatNV, GLsizei stride);
    GLDECL(void, glSecondaryColorFormatNV, GLint size, GLenum type, GLsizei stride);
    GLDECL(void, glFogCoordFormatNV, GLenum type, GLsizei stride);
    GLDECL(void, glVertexAttribFormatNV, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
    GLDECL(void, glVertexAttribIFormatNV, GLuint index, GLint size, GLenum type, GLsizei stride);
    GLDECL(void, glGetIntegerui64i_vNV, GLenum value, GLuint index, GLuint64EXT result[]);
     
    enum NV_vertex_buffer_unified_memory
    {
    	// Accepted by the <cap> parameter of DisableClientState, 
    	// EnableClientState, IsEnabled:
    	GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV		= 0x8F1E,
    	GL_ELEMENT_ARRAY_UNIFIED_NV				= 0x8F1F,
    	// Accepted by the <pname> parameter of BufferAddressRangeNV 
    	// and the <value> parameter of GetIntegerui64i_vNV: 
    	GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV		= 0x8F20,
    	GL_TEXTURE_COORD_ARRAY_ADDRESS_NV		= 0x8F25,
    	// Accepted by the <pname> parameter of BufferAddressRangeNV 
    	// and the <value> parameter of GetIntegerui64vNV: 
    	GL_VERTEX_ARRAY_ADDRESS_NV				= 0x8F21,
    	GL_NORMAL_ARRAY_ADDRESS_NV				= 0x8F22,
    	GL_COLOR_ARRAY_ADDRESS_NV				= 0x8F23,
    	GL_INDEX_ARRAY_ADDRESS_NV				= 0x8F24,
    	GL_EDGE_FLAG_ARRAY_ADDRESS_NV			= 0x8F26,
    	GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV		= 0x8F27,
    	GL_FOG_COORD_ARRAY_ADDRESS_NV			= 0x8F28,
    	GL_ELEMENT_ARRAY_ADDRESS_NV				= 0x8F29,
    	// Accepted by the <target> parameter of GetIntegeri_vNV:    
    	GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV		= 0x8F2A,
    	GL_TEXTURE_COORD_ARRAY_LENGTH_NV		= 0x8F2F,
           // Accepted by the <value> parameter of GetIntegerv:
    	GL_VERTEX_ARRAY_LENGTH_NV				= 0x8F2B,
    	GL_NORMAL_ARRAY_LENGTH_NV				= 0x8F2C,
    	GL_COLOR_ARRAY_LENGTH_NV				= 0x8F2D,
    	GL_INDEX_ARRAY_LENGTH_NV				= 0x8F2E,
    	GL_EDGE_FLAG_ARRAY_LENGTH_NV			= 0x8F30,
    	GL_SECONDARY_COLOR_ARRAY_LENGTH_NV		= 0x8F31,
    	GL_FOG_COORD_ARRAY_LENGTH_NV			= 0x8F32,
    	GL_ELEMENT_ARRAY_LENGTH_NV				= 0x8F33,
    };
     
    //
    // Grab procs...
    //
     
    #undef GLDECL
    #define GLDECL(ret, name, ...) \
    	name = (PFN##name##PROC)wglGetProcAddress(#name); \
    	if (name == 0) cerr << "Missing extension: " << #name << endl;
     
     
     
    // Add these to your init function
    GLDECL(void, glMakeBufferResidentNV, GLenum target, GLenum access);
    GLDECL(void, glMakeBufferNonResidentNV, GLenum target);
    GLDECL(GLboolean, glIsBufferResidentNV, GLenum target);
    GLDECL(void, glNamedMakeBufferResidentNV, GLuint buffer, GLenum access);
    GLDECL(void, glNamedMakeBufferNonResidentNV, GLuint buffer);
    GLDECL(GLboolean, glIsNamedBufferResidentNV, GLuint buffer);
    GLDECL(void, glGetBufferParameterui64vNV, GLenum target, GLenum pname, GLuint64EXT *params);
    GLDECL(void, glGetNamedBufferParameterui64vNV, GLuint buffer, GLenum pname, GLuint64EXT *params);
    GLDECL(void, glGetIntegerui64vNV, GLenum value, GLuint64EXT *result);
    GLDECL(void, glUniformui64NV, GLint location, GLuint64EXT value);
    GLDECL(void, glUniformui64vNV, GLint location, GLsizei count, GLuint64EXT *value);
    GLDECL(void, glGetUniformui64vNV, GLuint program, GLint location, GLuint64EXT *params);
    GLDECL(void, glProgramUniformui64NV, GLuint program, GLint location, GLuint64EXT value);
    GLDECL(void, glProgramUniformui64vNV, GLuint program, GLint location, GLsizei count, GLuint64EXT *value);
    GLDECL(void, glBufferAddressRangeNV, GLenum pname, GLuint index, GLuint64EXT address,  GLsizeiptr length);
    GLDECL(void, glVertexFormatNV, GLint size, GLenum type, GLsizei stride);
    GLDECL(void, glNormalFormatNV, GLenum type, GLsizei stride);
    GLDECL(void, glColorFormatNV, GLint size, GLenum type, GLsizei stride);
    GLDECL(void, glIndexFormatNV, GLenum type, GLsizei stride);
    GLDECL(void, glTexCoordFormatNV, GLint size, GLenum type, GLsizei stride);
    GLDECL(void, glEdgeFlagFormatNV, GLsizei stride);
    GLDECL(void, glSecondaryColorFormatNV, GLint size, GLenum type, GLsizei stride);
    GLDECL(void, glFogCoordFormatNV, GLenum type, GLsizei stride);
    GLDECL(void, glVertexAttribFormatNV, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
    GLDECL(void, glVertexAttribIFormatNV, GLuint index, GLint size, GLenum type, GLsizei stride);
    GLDECL(void, glGetIntegerui64i_vNV, GLenum value, GLuint index, GLuint64EXT result[]);

  7. #57
    Junior Member Newbie
    Join Date
    Jun 2009
    Location
    Cambridge, MA
    Posts
    3

    Re: Official Bindless Graphics feedback thread

    Thanks a lot! I'm having some compile issues with it right now, but I need to put more time into it.

    -mike

  8. #58
    Junior Member Newbie
    Join Date
    Jun 2009
    Location
    Cambridge, MA
    Posts
    3

    Re: Official Bindless Graphics feedback thread

    Thanks again for the code snips, Brolingstanz.

    I have it working now. Yes, you can crash your card pretty easily (when you're doing things wrong, of course), and yes, the card resets pretty much instantly (at least my GTX 280 does).

    I thought that I had gotten a 50% speed increase, but when I updated my old VBO code to match the test case's simplifications, I got the same performance in the end. My bottlenecks may be elsewhere.

    Thanks!
    -Mike

  9. #59
    Member Regular Contributor Jackis's Avatar
    Join Date
    Sep 2005
    Location
    Saint-Petersburg, Russia
    Posts
    275

    Re: Official Bindless Graphics feedback thread

    Just a question.
    Does making buffer resident mean it's now sort of GPU-located? I mean, doesn't it result, that we can't exceed VRAM with resident VBOs?
    And second reason why I'm asking that - is there any possibility now to make VBO, which is totally in VRAM? Yes, up to mine responsibility, and so on and so on... But can we avoid having driver-side copy of VBO content?

  10. #60
    Junior Member Newbie
    Join Date
    Jun 2009
    Posts
    6

    Re: Official Bindless Graphics feedback thread

    Congratulations to the NVIDIA team. Bindless rendering really improved our rendering speed, especially on systems with a slow CPU and a fast 3d graphics card. However so far we only use the glBufferAddressRangeNV functionality to speed up the VBO submission to the graphics card.

    What we do not understand yet is the new way of submitting uniform variables to a shader program. Can bindless rendering be used in the following scenario:

    We have one shader program and we submit transform matrices and other float or vec uniform's to this shader each time we render a triangle strip. Will bindless rendering be able to speed up this case, e.g. can we replace glUniform calls with bindless calls?

    The bindless tutorial from NVIDIA is confusing in this respect. I am aware of the sample code using

    loc = GetAttribLocation(pgm, “mat”);
    VertexAttribI2iEXT(loc, buf1Addr, buf1Addr>>32);

    but I have no clue on how to use this in our case.

    Can somebody help us with this issue?

Posting Permissions

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