
Bindless graphics
Posted Sunday, 17 October, 2010 - 02:35 by sgsrules inI'm trying to play around with nvidias bindless graphics but can't find any of the tokens or functions in openk. here's a sample taken from nvidia's presentation:
for (i = 0; i < N; ++i) { BindBuffer(ARRAY_BUFFER, vboNames[i]); BufferData(ARRAY_BUFFER, size, ptr, STATIC_DRAW); GetBufferParameterui64vNV(ARRAY_BUFFER, BUFFER_GPU_ADDRESS_NV, &vboAddrs[i]); //where's this function? MakeBufferResidentNV(ARRAY_BUFFER, READ_ONLY); //where's this function? } EnableClientState(COLOR_ARRAY); EnableClientState(VERTEX_ARRAY); ColorFormatNV(4, UNSIGNED_BYTE, 20); VertexFormatNV(4, FLOAT, 20); EnableClientState(VERTEX_ATTRIB_ARRAY_UNIFIED_NV); //where's this token? for (i = 0; i < N; ++i) { // point at buffer i BufferAddressRangeNV(COLOR_ARRAY_ADDRESS_NV, 0, vboAddrs[i], size); //where's this function? BufferAddressRangeNV(VERTEX_ARRAY_ADDRESS_NV, 0, vboAddrs[i]+4, size-4); //where's this function? DrawArrays(POINTS, 0, size/20); }


Comments
Re: Bindless graphics
EnableClientState(VERTEX_ATTRIB_ARRAY_UNIFIED_NV); //where's this token?OpenTK doesn't add extension tokens to core enums for various reasons. You will need to cast from the "All" enum.
BufferAddressRangeNV(COLOR_ARRAY_ADDRESS_NV, 0, vboAddrs[i], size)Nvidia-specific extensions are available under
GL.NV.*.Re: Bindless graphics
Maybe i'm missing something but i triple checked GL.NV.* and didn't see BufferAddressRangeNV or MakeBufferResidentNV. I also checked the all enums and didn't see them. I even did a search through the opentk source (svn 1.6.11.20210) and came up empty so i'm pretty sure they're not in there.
Re: Bindless graphics
Thanks. OpenTK is not yet synced to the latest OpenGL specs so it is missing some functions. You can use the following commands to fetch, update and build the gl4 branch:
(Install TortoiseSVN and open a Visual Studio command prompt)
If all goes well, the new OpenTK.dll will contain those functions.
Re: Bindless graphics
Thanks for all the help. But It failed to build the second time. I received 110 errors here's the last few:
Re: Bindless graphics
Ah, yes, these types are new to GL4 and I haven't committed the relevant code yet. Sorry about that.
Try adding the following lines to Source/Bind/Specifications/csharp.tm as a workaround:
Afterwards, rerun Bind.exe and try to recompile.
Re: Bindless graphics
ok i got it working but honestly i'm not to sure if what i'm doing is correct, here's what i did:
added to csharp.tm
added the following enums to GLEnums.cs:
For DrawElements and DrawElementsInstanced i changed the type from version11 and version31 to DrawElementsType
added the following to PixelInternalFormat Enum:
I still havent tested the bindless stuff yet, hopefully i'll get the 7x performance boost nvidia claims ( i really doubt it) Anyhow once again Fiddler thanks for all the help!
-Stephen
Re: Bindless graphics
I'm having problems with some of the parameters inf these functions:
This is a simplified test case and crashes really badly, i suspect it's because of how i'm storing and using the gpu address. I don't receive any opengl errors until i call GL.DrawArrays then it flickers and dies :(
Re: Bindless graphics
Try compiling and using a debug OpenTK.dll, which will inform you about any gl-related errors automatically.
About your questions:
longas address (that's what the '64' suffix means).I've never used bindless graphics myself, so I can't tell if you are using them correctly. Maybe someone can help here?
Re: Bindless graphics
Hi Fidder,
I’m trying to do the same procedure to implement bindless graphics, as suggested by NVIDIA.
The reason is that using OpenGL 2.x drawing method without shader programming and extensive use of buffer object for vertex, normals and texturing, my application has dramatic lack of performance with adapter based on Fermi architecture (from GT8600M to GT555M the paint time increases 4 times). The BindBuffer operation is suspected to be the bottleneck.
Then I downloaded g4 branch and tried to follow the procedure you suggested. Running Convert.exe with just downloaded enum.spec (from OpenGL.org), it throws an exception on row 130: Convert seems not able to parse the syntax of enum.spec.
Do you have any suggestion to solve that problem ?
Many Thanks
This is the stack trace of COnvert error:
in CHeaderToXML.GLParser.d__0.MoveNext() in I:\paolo\test\OpenTK\g4\Source\Converter\GLParser.cs:riga 94
in System.Linq.Enumerable.d__14`2.MoveNext()
in System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
in CHeaderToXML.EntryPoint.MergeDuplicates(IEnumerable`1 sigs) in I:\paolo\test\OpenTK\g4\Source\Converter\Main.cs:riga 182
in CHeaderToXML.EntryPoint.Main(String[] args) in I:\paolo\test\OpenTK\g4\Source\Converter\Main.cs:riga 121
in System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ThreadHelper.ThreadStart()
Re: Bindless graphics
The gl4 branch is obsolete. It has been folded into trunk, so just checkout that and you are good to go (bindless graphics are available out of the box, no need to run the generator).