120 Replies
veldrid-cursed
in this specific use case im only going to be mapping vertex and index buffers, so its just a sanity check
@techpizza veldrid-cursed
cursed-veldrid
i can assume the buffer i allocate is continuous right?
like i dont have to worry about pitch and other stuff? https://i.beyleyisnot.moe/JfnxIzw.png
vertex and index buffers are onedimensional yes
cool thx
easiest class of my life
okay so once the mapper is full, should i copy the mapper buffer to a new buffer or just create a new buffer and tell the mapper to point to this new buffer
is there a perf hit to the buffer being dynamic?
if so, i should probably create new non-dynamic buffers and copy to them
depends on backend and driver 🤡
just use dynamic
alright
so ill just create a new buffer when it gets full and stash the old buffer for rendering
yes please
cool
this should do the trick https://i.beyleyisnot.moe/J7V8yzA.png
pass you the old buffer and create a new one
should i do the same single texture system in veldrid too?
hmm?
since veldrid also covers GL i guess i should only bind a single texture at a time
i think we deduced that the shader branching was not a problem or what now
oh
so i should readd all that multitexture code :^)
thats hopefully simple
well if it worked in instancing i dont see why it wouldnt work here
a
Kai would need to test on amd
but amd only bitched about the attribute locations right
seemingly yea
okay multitexture is back lemme run the same benchmark
hovering around 5-6k fps
2k higher than single texture
at least we now know that branching is likely ok
im sure its Fine
i also am in a perfect position to do bindless opengl once i get veldrid and DX11 up and running
ive heard complete DSA OpenGL is actually a p decent upgrade from standard opengl
i wanna give it a shot sometime
sounds like writing more backends for naught but oh well
idk it just seems like fun sometime :^)
something for a rainy day
okay got the basic veldrid buffer system down, time to create the pipeline
https://i.beyleyisnot.moe/grJuLA.png
now i just gotta write the shaders
time for it to shit itself immediately
so im missing a quad and 2 tris on the pentagon
probably the indices are wrong https://i.beyleyisnot.moe/VrQtwzc.png
somehow
i think i found a bug in veldrid
unmapping resources just doesnt work in GL
nevermind i was changing buffers and not unmapping/mapping
somehow vulkan was fine with it
idk how
what does this mean and why does it only happen on GL https://i.beyleyisnot.moe/5u9YREY.png
not sure
also which veldrid version are you using
normal
i don't see a
normal
version on nuget 🙃ugh
i think that's the latest one yes
back to trying to debug veldrid gl
thisi s pain
veldrid vulkan works literally perfectly which is whats so confusing to me https://i.beyleyisnot.moe/H6jz2gw.png
some quads are just missing for no reasonhttps://i.beyleyisnot.moe/ow2N4n8.png
time to enable the vulkan debug layers?
i can also test it if it's in github
actually wait looking into renderdoc there should not be that many draw calls https://i.beyleyisnot.moe/Na1dRUc.png
i think my buffer size logic is fucked
gimme a min
https://i.beyleyisnot.moe/19dSq6E.png 36/6 is only 6 quads???
why is it only batching 6 quads
tf
¯\_(ツ)_/¯
ah i was creating the buffers too small cus i was forgetting to multiply by the size of the structures
i just pushed to gh
if you want to try
you should probably assert the buffer size after mapping to see if things fit :)
https://i.beyleyisnot.moe/SPIvqfM.png
the things are there in renderdoc, weird that they arent drawing
or use Spans actually
probably ye
that's a new one
uh oh
that doesnt look healthy
ok so cursed thing
renderdoc says that the shader you are using is the internal imgui shader from veldrid
the fuck
that should not be possible in the slightest
it may be renderdoc getting confused
it likes to do that
do you want me to send you my renderdoc capture
nah
ok so vulkan works fine
can you try dx
it might give better debugging results
i can in fact not try dx11
this is a true
Direct X Elevent
Moment
also veldrid is bugged and mellinoe still has not fixed it
true
i had to modify my arch install a bit to even get it to work at all for me
ok so after looking for 30min
the only thing i saw was that RendererVeldrid has different vertex element names than the glsl
but correcting them changed nothing
pain
nightmare.
i have discovered that the first draw call is the only one who has issues on opengl
oh
huh
oh?
i think it's because the buffer is mapped
opengl cannot draw from mapped buffers
oh
but i unmap them
i'm happy that it took me 40min to figure this out 😑
so do i have to copy the data out into unmappable buffers?
nah you just have to unmap them
i do
at least i should be
hmm yeah looks correct
idfk
nope
they are still mapped
i can see it through the debugger
phew
i thought i'm going insane
wait
i think this is giga cursed
hmm maybe not
you think
i'm 100% unmapping
there's no way for me to not unmap
debuggar aint lyin
me rn
maybe a bug in veldrid?
doubt
going through my logic, every map is matched with an unmap also why is only the first one still mapped what?
i'm double mapping
on the first one
yeah that is it
boom works
aaaa
i should add that to my fork
throw if vertex or index buffer is mapped
can i switch to your fork how much trouble would that be
don't bother yet
i will make it a nuget sooon
cool
god this took forever
i'll just blame mellinoe to cope in advance
i have been pouring over the code for 4 hours
i was in the bank earlier STILL thinking about why tf it's not working
i also get stuck up with annoyances for days
at least it's solved now?
it did render everything, i count that as a win
lol
i'm gonna cry myself to sleep now even though it's 5pm
i hate opengl
oh? difficult day?
no just opengl
💯
great
i restart VS and now all symbols have to reload
bruhhh
from the symbol servers
what is this shit
even worse
who killed my cache
opengl
alright i'll go to bed, and leave you with the cursed opengl stuff
aight cya
pog
cant wait to be able to move over to the fork
why tf is it flashing white randomly
in renderdoc the draw claims to not be white anywhere, but for SOME reason its white
just randomly flashing white
had to take 20 captures just to get a rednerdoc capture of it and it aint even helping pain
hehe
lmao