Skip to content

Instantly share code, notes, and snippets.

@elect86
Created February 23, 2016 17:01
Show Gist options
  • Select an option

  • Save elect86/1e8ab579235ef7b65812 to your computer and use it in GitHub Desktop.

Select an option

Save elect86/1e8ab579235ef7b65812 to your computer and use it in GitHub Desktop.
<elect> I have a really hot loop, it's a modified version of the bindlessApp sample from Nvidia
* AlphaAtom (~textual@cpc3-bath5-2-0-cust183.aztw.cable.virginm.net) has joined
* GarrettShields (~GarrettSh@2607:fea8:a120:2b:658b:ef40:c2c0:714c) has joined
<elect> 40k objects and I am updating an uniform buffer per object
<elect> the buffer is persistently mapped
* AlphaAtom has quit (Max SendQ exceeded)
<elect> gl4.glBufferStorage(GL_UNIFORM_BUFFER, uniformBlockSize, null, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT);
<elect> but when i render, I get artifacts
* langkid1 (~langkid1@bnc.langkid1.me) has joined
* AlphaAtom (~textual@cpc3-bath5-2-0-cust183.aztw.cable.virginm.net) has joined
<elect> if I switch back to the old glBufferData/glBufferSubData everything fine again
<elect> shall I use a 3-ring buffer?
<Guest81406> Anyone here who could help me? I wrote a pretty simple vertext (+fragment) shader. All works until I multiply gl_Position by a identity matrix .... if anyone could have a look I would be very happy: http://pastebin.com/4k99qUb5
<elect> or is there a quick way to barrier that
* centrinia (~centrinia@2602:306:bd0d:a690:bdf1:8e42:7d9a:7dec) has joined
* stefkos (~stefkos@82.177.144.226) has joined
<ratchetfreak> elect: maybe use memory barriers?
* Codex_ has quit (Ping timeout: 248 seconds)
<ratchetfreak> or don't use coherent but instead flush explicitly
<elect> you mean glMemoryBarrier?
<elect> what's best?
* seangrov` has quit (Remote host closed the connection)
<ratchetfreak> try with barrier first I guess
<elect> ok
* linuxuz3r (~linuxuz3r@2602:306:bd2a:a160:84b2:726f:59c8:d61d) has joined
<noizex> elect: https://ferransole.wordpress.com/2014/06/08/persistent-mapped-buffers/
<Guest81406> Any help for a beginner?
<ratchetfreak> Guest81406: matrix is not an attribute
<ratchetfreak> so you shouldn't be using attributeLocation to get the location
<noizex> and you're not even multiplying that matrix
<noizex> and multiplying int by float vec will probably result in type mismatch afair
<elect> gl4.glMemoryBarrier(0xffffffff); doesn't help
<elect> that's arg stays for gl_all_barrier_bits
<ratchetfreak> do you wait until the buffer is no longer in use before updating it (using sync objects)
<elect> no
<elect> :/
<noizex> elect: you're modifying buffer that's in use by gpu, hence the artifacts
<elect> ok, I'll try the sample code you linked
<Guest81406> noizex: Thank You! You saved my day ... I missed the attribute mistake
<noizex> read a bit on this
<noizex> Guest81406: it was ratchetfreak ;)
<danhedron> elect: you can do it the lazy way and orphan the buffer once you've reached the end
<elect> that is?
<danhedron> discard the buffer by invalidating the storage
<Guest81406> ratchetfreak: ooops, of course thank you!! :)
* karab44 has quit (Read error: Connection reset by peer)
* napcode has quit (Quit: WeeChat 1.4)
* verm1n has quit (Ping timeout: 276 seconds)
<localuser-> There's definitely something weird going on. If I manually apply *2.0 to the interpolated scale vector (before I combine a transform matrix for each bone) the movement seems to work fine, although the spider turns all 70's fro-spider (magnified legs and buttsack)
* idanbeck has quit (Remote host closed the connection)
* Leates (~Leates@unaffiliated/rbxdev) has joined
<jokoon> mmmh how do I specify texture coordinates in indexed mode?
<ratchetfreak> maybe the null bone matrix gets too much weight
* dmatos91 (599a0905@gateway/web/freenode/ip.89.154.9.5) has joined
<ratchetfreak> jokoon: same way you specify the position
<ratchetfreak> all attributes use the same index
<localuser-> ratchetfreak I have no such bone
* dine9091 (~Adium@95.150.177.10) has left
<jokoon> so I also need to index the textures coordinates?
<ratchetfreak> I meant the matrix for the binding pose
* c64zottel (~orko@host-37-191-199-1.lynet.no) has joined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment