#Fwog and co.
1 messages · Page 13 of 1
I am using MSVC. I added back the Jaker's version of the repo to recreate the issue.
(Some of these are mine and fixable but there's cgltf and stb_image)
wth
let me remove the header files even tho i dont think that'd fix stuff
this convo is giving me conniptions
isnt that a 25/8 condition 🙂
deccy did you read what tess wants?
no, i asked for a tldr
I'd have to fix cgltf too
^
ah
and i thought thats what add_compile_options does when you ad it for your project
ok tldr:
This version works with cgltf and stb_image: ~~https://github.com/ClementineAccount/Fwog/blob/main/CMakeLists.txt~~ https://github.com/ClementineAccount/Fwog/blob/patch-1/CMakeLists.txt
This version does not work: https://github.com/JuanDiegoMontoya/Fwog/blob/main/CMakeLists.txt
I'm just glad it has nothing to do with me 
why? I don't know all I did was remove /Wx
just add those flags to only your target
thats what i said
target_compile_options then i guess
yep
It's more this:
All my homies use target compile options
sorry for the conchfusion
I don't really understand why the top works but not the bottom
I mean I think I understand it 'dont show the warnings as errors'
but I don't understand if there's more going on
I dunno what the INTERFACE scope means exactly.
"only targets that link me, but not for me (the target that has the INTERFACE)"
Doesn't that mean that fwog is trolling basil then
I linked the wrong https://github.com/ClementineAccount/Fwog/blob/patch-1/CMakeLists.txt file (this is the correct one)
listen buddy, i have no idea what is happening :3
urm screenshot of the diff
If fwog's compile options have the interface scope, then they're polluting yours too
And anyone else who depends on fwog
yeh thats defo fucko
Copy paste gone wrong
Okay. I hope this helps point out that mistake then.
Sorry for making it a bit confusing though. I should have investigated further then just make it a clean Issue ticket instead
See if changing fwog's thing to private helps
we can also move over to #1026467818943807579 if its my template related
Replace INTERFACE with PRIVATE in your pic, but for fwog
its fwog related
Your template was more the 'test case'
then I can even go back and uncomment the Werror yea?
I wouldn't do that
id have made it 2 lines and not cram all the compilerisms into one line, for better readaiblitlilbility
the middle one should be addressed
hiding shit is not nice
or reintroducing members
I wonder why I don't get those 🤔
Perhaps
You're on msvc, so changing those has 0 effect
did you set a c++ language level, mr. weasl?
yea it'd be caused by W3 or W4
oh i haven't for this project
shouldhaps set it to 20
You should
you must
Fwog is ceepeepee 20
I checked and these issues do exist in the public version
ive been messin with this CMake stuff for way too long lol
Idk how tf my msvc isn't telling me about these
Maybe we're on different versions of the tool chain
ill make my own branch in my fork for my car game development for now no worries
also add #define mayhaps_unused maybe_unused
for [[mayhaps_unused]] unusedparameterhere
I changed fwog's compile options to private scope and now I get those errors
honestly kwuite inkredible
I guess this will enable asan globally, which probably isn't desirable
target_compile_options(fwog PUBLIC /fsanitize=address)
🤡 CXX_COMPILER_ID:AppleClang
I guess AppleClang users could theoretically want to cross-compile a fwog app to a useful platform
apple should not be supported at all 🙂
compiler should emit a message "go buy a real pc" or so
hehe
I wonder if they could use one of those layerisms to run GL 4.5 code on their mac
gl-on-vulkan-on-metal or some crap
I guess it wouldn't be unreasonable if they used Zink + MoltenVk
I'm gonna close your PR @fiery sorrel since I fixed the underlying issue
they might aswell use GoldCoatedFwog
yeet
for my racing game gotta move some of the code from the fork over to the own repo version
I guess thats kinda like a mini refactor
github has a button to sync your fork
no I mean I still gotta move code over by hand for the racing game logic
since that shouldn't be apart of a fwog repo anyways
on the plus side since I am putting it into the codebase I made using Deccer's template that means i got spd and tracey for free
someone should make a tray racing game
is that a subtle hint
subtle hint at competitive slide riding
If you are still using DXGI_SWAP_EFFECT_DISCARD or DXGI_SWAP_EFFECT_SEQUENTIAL (a.k.a. the "blt" present model), it's time to stop!
bacon lettuce transgressionsagainstcomputerscience
Btw if it means anything
Fwog was the easiest to Cmake Fetch Content into my project

oh wow surprised no fwog updates. I've been away for a couple days
I pronouce it "jayker" (in my head, lest he appear)
i pronounce slacker as slaycker too 😛
I've heard people call me "jacker" in voice chat
ill boot them off the server next time, just point at them
@golden schooner can we bring back monthly showcase, but in april we all just submit short audio clips of trying to pronounce jaker
heh
we are working on the monfhly showcase to come back
did you get one of the underpaid modlings to do it
just don't call clep & co grannies
i heard they don't like that too much
wasn't froyok gonna do something
I'll have you know I'm still a very young lad
I haven't even begun to peak
they just like me fr 😂
I prounice deccer as 'decker'
you're telling me you don't say it like dessert
deeser
Just wanna gush about how Fwog makes doing this super easy
so thank you for this 
dw i'd refactor that so u can pass in the buffer or some struct containing a buffer and the count
is your project up in #1019722539116802068 ?
yea its in #1093833868336963725
it uses Fwog
and I just posted here as like positive feedback abt fwog somethin
conceptually is calling SubData() twice slower or creating an array container just to insert slower?
Like would four subdata calls actually be better. I don't wanna profile something so bikeshedd-y but was curious in terms of what subdata does
it calls glBufferSubData
yea i know
is calling glBufferSubData twice slower than calling it once but allocating a container
wdym allocating a container
std::array<glm::vec3 2> linePt{ptA, ptB}
.SubData(linePt, sizeof(glm::vec3))
vs
.SubData(ptA, sizeof(glm::vec3))
.SubData(ptB, sizeof(glm::vec3) * 2)
do you know what std::array is
well either way, it should be extremely cheap to make
much cheaper than a subdata call
i think i do but now I dont know
isnt it just 'ok i wanna allocate memory on the stack for this data' like an array in C
but with the C++ container types so u get access to .size() and the range iterators
it's just a C array wrapper
what's this
looks like a bluenoise generator
is it because you know I love noise
that and that 🙂
thought since you experiment with denoising sometimes, i saw dis and added 1 to 1
mayhaps blueNoise32.png from 10 years ago is not enough
are you calling me crazy
i am saying you can always get some blue noise from this "song"
also, also, the crazy frog is exactly how i picture you, jaker
I don't get it 
i also read "frog" not "song"
that video has almost 4 billion views on yt 
3.999.999.999 now with you watching it
one sec I'm watching this vid
https://youtu.be/xOVQPtuKRs4
ah that was a fix for another issue gone wrong
thanks for catching that
failure to call 911 saves 4 firefighters' lives
merg'd

oooh I see
anyways, if you pull it should be fixed
this time I tested both release and debug
lol that super spank
I just learned from Wikipedia that rainbows and fog bows are caused by the same phenomena, except fog bows just have smaller particles to interact with the light (which makes the colors duller)
That should mean I can use mieplot to generate a different phase function lut for rainbow rendering
Then I can reuse my current code to render cool rainbows 🙂
!remindme 9 hours 🏳️🌈
Alright Jaker, I'll remind you about 🏳️🌈 in 9 hours. ID: 56126129
woah I've never seen a fog bow before, they look cool
inshallah the rainbow lut is almost complete
hopefully 500 micrometers is the average size of a raindrop
ah man I accidentally made the medium a vacuum 😩
well, it barely changes the index of refraction at least 🤠
I like how scrolling this much in excel is 3000 rows 
that looks cool
too bad it's a bit 🇫🇴 🇨🇰 🇪 🇩 from the low volume resolution
I think this looks 🇨🇴 🇴🇲 🇪🇷 (there is no :flag_ol: 😔)
the moving clouds make this amazing
I can ruin the illusion by going higher
would be cool to explore atmospherics in greater depth sometime
like proper sky rendering, clouds, rain, etc.
and rainbows formed by the rain ofc
damn
i need to add that thing at some point too when i fly through my asteroid fields 🙂
I think the important things for a rainbow to form are:
a) rain (particles of average size ~500um) for sunlight to interact with
b) the sunlight to have an unobstructed path to the rain (which means patchy cloud coverage usually)
you don't see rainbows on days that are both overcast & rainy because light is essentially coming from all directions at roughly equal intensities
you could do something like this with a 🦐le ray march in screen space
depends on how fancy you want it to be, really
once i have some sort of flying and some asteroids going i will make sure to let you know
the 🦐lest volume effects can be done in like 30 loc of shader code
and it's quite satisfying too
btw, I never noticed that the area inside the inner rainbow is brighter than normal
it's pretty obvious in photos too
hmm, maybe I noticed it, but assumed it wasn't an optical effect related to rainbows
sometimes there is even a third one
hmm, where?
my noisy plot (didn't want it to take forever) suggests that there are only two places where you might see a rainbow
there is a dot in the center of the rainbow (far right spike in the plot) similar to glory
it's hard to see in photos of full circle rainbows though
hmm, perhaps you're referring to these
https://en.wikipedia.org/wiki/File:Supernumerary-rainbows-jb.jpg
i have no idea when you get a third, but on .mu i saw a few at least
third one is very faint
mayhaps different humidities
differently sized particles in the air can cause different rainbows too
the 100 um one seems to have the most obvious "third" rainbow
hmm people burn alot of shnit in their gardens mayhaps that has an influence on the particles in the air
not all the time
could be
but i remember standing on our roof and seeing like 10? little fires around my viewdistance
that sounds neat
ocean is also visible and few mountain peaks
btw, I still want to render one of these bad boys. I can't find any articles about rendering them though
https://en.wikipedia.org/wiki/Sun_dog
I could try to make a 2D lut (zenith and azimuth) based on an hdr photo or something
i think i saw that phenomenon once too, never knew what that is or what it is caused by
seems much easier to just spawn pots of gold where you want the two ends
😄
just render those 3 images on 3 quads
The exact etymology of sun dog largely remains a mystery. The Oxford English Dictionary says it is "of obscure origin".
hehe
I think it's because there are actual dogs up there making the sky prettier for us
deccer's dog army
woah these are pretty neat phenomena that I never knew about
and the outer rainbow is the colours in reverse
What is an alternative to glReadPixels() that I can use in Fwog to implement framebuffer color picking version of mouse picking?
currently, there's no mechanism in fwog to read textures
I have an issue for it already
So my three options are:
- raw ogl
- compute shader hack
- raycast pick
I can probably go with option 3 for my project
What you should do is make a persistently mapped buffer and perform a pixel transfer to it, then issue a fence and read from the buffer when the fence is signaled
(that is, if you need to read from an image)
I can try that. Is there an example in the examples that show how to do it? If not I can figure it out through the header files.
There is not, and you need to use raw GL for part of this (until I add it to fwog)
You can use Fwog texture and buffer types still, you just need to call .Handle() for the bits that require raw GL calls
I can try that yea
You would bind the buffer to GL_PIXEL_PACK_BUFFER, then call glGetTextureImage and it'll be written to the buffer
got it
And reading from the buffer requires mapping it (ideally persistently if you want to avoid stalls) or manually calling glGetBufferSubData with the handle
I can get the texture from a color attachment's Render() then do a pixel transfer to a FBO then glReadPixel or something
I imagine I can afford a tiny stall since its only called for a mouse click
It's actually a huge stall, but yeah it might be bearable
Why can't I blit that texture to a framebuffer directly
I submitted an ldjam game that stalled every frame due to buffer reads and it ran fine
bind it and then glReadPixel that
You can
glReadPixels sucks though
You have to make a framebuffer first, and fwog doesn't expose those
ooh I get what you're saying now
I skip glReadPIxels and a framebuffer
by just getting the pixel data through a different buffer
Ye
yea my bad. I mixed up what you were saying with this PBO guide from way back: http://www.songho.ca/opengl/gl_pbo.html
It's equivalent to this almost
https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImageToBuffer.html
I have legit considered just moving mousepicking till later as a simple inspector window is enough for the scope
Btw reading this makes me remember how ass gl's api is
but I know how to do mousepicking with glReadPIxels without issues so I was looking into it
I am trying to look at Fwog headers to figure out how to do the texture to buffer transfer
It doesn't exist in fwog
I said that already
You have to make these gl calls yourself
Oh
Right you meant
Handle() on the Fwog::Texutre
to get the GL texture ID
and then call that
Ye
ok bye bye
I am thinking my sky color needs to account for gamma correction or something?
I was expecting the bottom but got the top instead
Solved it.
yea that looks intended. A bit too dark for my taste but I choosing this color as part of the skybox I downloaded uses it for its lower half and I am prob gonna do some editing magic to blend it with the fog horizon (so I'd need to move the whole image up or something)
Alright I think I know how to make skyboxes in Fwog esp reading: https://github.com/fendevel/Guide-to-Modern-OpenGL-Functions#uploading-cube-maps
and reading the header files for Texture
After I do it mayhaps I might make an example in the Fwog repo showing it but idk seems straightforward but it did require me to look 👁️ 👁️
I think small samples are good to have in graphics libraries, makes it attractive for newbies
some people look at a lib and if it has a lot of pretty pictures and code examples they are more likely to pick it and then maybe ask a question (how do I do X in Y) on some forum spreading the word about it as a consequence
on that note you can even get more attention if you make tutorials for how to make a game using the lib
the first fwogtorial
the other component is having that "who uses it?" section
you gotta legitimize yourself so your project doesn't look like the ephemeral hobby project it really is
the first fwogmmunity sample
who uses it: <link to some obscure github hobby project> (ends here)
<link to your own repo>
the circle is complete
wasnt there a scissor trick as well, for reading 1pixel off off glReadPioxels
Idk, I'm not versed in the dark arts of glReadPixels
@fiery sorrel do you have some sample code that uses tessellation that I can look at, preferably on github?
Is this one ok? https://github.com/SaschaWillems/Vulkan/blob/master/examples/tessellation/tessellation.cpp
I meant OpenGL code 😄
(The shader inside here: https://github.com/SaschaWillems/Vulkan/tree/master/data/shaders/glsl/tessellation)
ahh for OGL I actually also haven't touched tess in OGL sorry.
I want to see how much (if at all) the APIs diverge here
I know LearnOpenGL has a tutorial but I don't know if that's a good reference
Learn OpenGL . com provides good and clear modern 3.3+ OpenGL tutorials with clear examples. A great resource to learn modern OpenGL aimed at beginners.
yeaa get a good rest
thanks for being active for Fwog stuff
I really enjoy using Fwog
there will be 12345 messages soon
alhamdullah

jebus, you talk a lot
says the guy with 17k messages in his thread 
i think this and deccer thread are the most active ones
speaking of
@oak garden had an iShoe with his vulkan thing,and i suggested to boop you
aye
no idea if he did or not 😄
oh shit
next stop 123456 😛
same code for creating AS
ray query crashes inside driver, but ray pipeline works fine
🤷
true
not while he schlep

heh

it seems like in GL, you can have just a tess eval shader or tess eval and tess control if you want tessellation
but in VK, it seems like you need both to have tessellation
which explains why vulkan doesn't have an equivalent of PATCH_DEFAULT_OUTER_LEVEL and PATCH_DEFAULT_INNER_LEVEL
@fiery sorrel if you pull the latest version, tessellation shaders should be supported
also maybe now would be a good time to start tagging key commits
oh and also seamless cubemap is enabled
mashallah Fwog 0.1.0 has been officially released 🙏

I always wondered whether you ironically or unironically use the muslim phrases
I use them to convey unironic feelings : )
Inshallah void will be conchfused by my language
Deccer enabling different keyboard layouts to type those
Hmm isn't that a conlang
yes
multiple rabbitholes rabbitholed the area of conlangs is
Cause it's silly and goofy and whimsical
I wonder how many people actually learn these conlangs
most likely less than devices running java
It's fun to do to train the brain
I'd rather learn a real lang 
also intermeresting to dig into wikipedia
A circumhorizontal arc is an optical phenomenon that belongs to the family of ice halos formed by the refraction of sunlight or moonlight in plate-shaped ice crystals suspended in the atmosphere, typically in cirrus or cirrostratus clouds. In its full form, the arc has the appearance of a large, brightly spectrum-coloured band (red being the top...
Wow
man you're really digging into obscure optical phenomena
this one seems to be masked onto the clouds
cool thing about tess shader means i can also use it to generate wireframe spheres without CPU memory allocation for it
Cloud iridescence or irisation is a colorful optical phenomenon that occurs in a cloud and appears in the general proximity of the Sun or Moon. The colors resemble those seen in soap bubbles and oil on a water surface. It is a type of photometeor. This fairly common phenomenon is most often observed in altocumulus, cirrocumulus, lenticular, and ...
I'm gonna do a little overhauling of buffer mapping
I'm gonna start by banning non-persistent mapping
then, I wonder if it makes sense to immediately map buffers with the persistent mapping flag on construction, though it's not clear to me if this is advantageous in all situations
I also wonder if there's any point in having non-coherent persistent mapping (as in you must manually flush changes)
all the map flags can be deleted and replaced with a bool in the constructor
buffers have no copy constructor right?
what are you trying to do here
Was prototyping and wanted an object to have a buffer and wanted to ininitalize them without a constructor, originally tried to do push_back to a list
but since these buffers have no copy constructor I had to create the object first and then construct the buffer
The alternatives I can think of is that I need a constructor for this struct which is fine, this is just a prototyping thing
push_back has an overload for move insertable types
this compiles just fine
std::vector<Fwog::Buffer> bufs;
bufs.push_back(Fwog::Buffer(100));
if you want to make a buffer outside the call to push_back, you need to move it in, like so
Fwog::Buffer buf(100);
bufs.push_back(std::move(buf));
you can also use emplace_back to avoid a move and some typing
bufs.emplace_back(100);
I see. Thanks
tried it. It works. I didn't realize that std::move worked on member variables if called on a struct/class.
That is helpful to know
std::move does not discriminate
@golden schooner do you have any thoughts about abstracting buffers (linked thoughts are related)
do you think it's worth making the call to glMap happen in the constructor only, or nah
or should the user be able to call Map and Unmap themselves
I also dunno if explicit flushing is worth anything
hmm that's probably a complicated question
the answer is probably related to memory types
https://asawicki.info/news_1740_vulkan_memory_types_on_pc_and_how_to_use_them
hmmmmm what's that one article with perf of the different memory types
it had the word "disaster" in the title
I need more info about the perf of the different memory types
hmm
there was one presentation by AMD with relative perf for them (fast vs slow for CPU/GPU reads and such)
it had rabbits and turtles to show the speed 😄
im probably the last person you should ask when it comes to that stuff, mayhaps MJP/Jasper might have something to say
that's cheating
otherwise if you ignore all the gl-isms it would technically make sense to map buffers right away
the interface is the same as updating buffers wherever you update them usually
mayhaps it makes sense to play through some examples?
and differentiate between more static buffers vs dynamic ones ... ie vertexbuffers and all the little buffers you update perApp/perFrame/perObject?
well the main thing with mapping is that it gives you more control over perf (particularly when you screw around with the persistent/coherent flags)
for all things in general, frequent/infrequent ubdates??
I'm basically wondering if there's a perf reason to expose the coherent flag or just always include it
I guess it depends
hmm i wonder if you could make it an experiment
if you profile and see that buffer updates are slow, then you need to use persistent mapping and stuff
and have different setups, with different sizes toupdate... 1k, 2k, 4k, 16k, 1024k etc with mapped/unmappd
mayhaps there is even a diffrence between platforms teamgreen/red/bleu and or win/linux
and then you could do some platform detection and let it chose a "strategy" of how its doing its bufferisms (in oop speak)
from what I recall in the random crap I've heard lurking, in vulkan there's no reason not to use the coherent bit
that's good enough for me
there is reason to not use the coherent bit
but PCs don't give you this option
all host visible memory is coherent
so do I need a mac to see it 
nah mobiles
hehe I jk
its unclear what gl implems do with coherent
naturally
it might mean something different
that yes, but i don't know how this interacts with buffer tracking
i guess it just turns it off? idk
yeah it's quite conchfusing
I like to map (no pun intended) concepts to vulkan because they actually have meaning there
fr fr
btw gl also has GL_MAP_UNSYNCHRONIZED_BIT
that's what turns off auto sync
I guess I always want that bit when I map too, if I'm forcing the user to use persistent mapping
my last uncertainty is whether it's a good idea to always map in the constructor if the user adds a map flag
I guess I don't see a use where you'd want to map and unmap the same buffer multiple times
if you do persistent mapping, then the reasons to unmap are 1) 32 bit process, 2) buggy OS (iirc there is/was some boog)
I thought there was a limited amount of persistently mappable memory without sam/rebar
like 256mb on AMD
The BAR has existed for a long time and has been used by the driver for various purposes. Radeon™ drivers for Vulkan® have exposed it as well for application use. However, until recently, only a 256MiB aperture has been visible to the CPU at any time.
https://gpuopen.com/learn/get-the-most-out-of-smart-access-memory/
256MB for everyone
it’s a PCI limitation, not necessarily a GPU one
well, for everyone with >256MB VRAM
that sounds like a compelling reason to not automatically map these buffers
but at the same time, if you make a buffer with persistent+coherent map flags, I expect that you would immediately map them anyways
but thats mappable device memory
are you saying that it (the limited host-visible memory) is consumed whether it's mapped or not?
what i am saying that there is no limit to mapping system memory (except the aforementioned virtual memory space)
if you were thinking about mapping all memory on creation, then ye, thats probably no bueno
it is even unclear to me if nvidia lets you map device memory at all
the only memory I'd hypothetically immediately map would be buffers with the "map" bit set (and have it imply persistent+coherent)
I wasn't clear
or if it would just do shadow copies or some other shenanigans
since it took them 4 years to give this option (w/o rebar) in their vk driver
and ofc the memest api of them all, dx is only offering this now
interesting
also memory in gl is not pinned to a specific location
so the driver can and most likely will move them
maybe I should just pretend that having no guarantees is liberating
time for fwog-vk 
it means I can do whatever I want and get random performance regardless
👀
btw the only time I used vulkan that wasn't in a tutorial context was to write a tiny benchmark, so I need to hurt myself with vulkan some more first
I do look at the vulkan spec a lot for someone who doesn't write vulkan 
perchance
making fwog helped a lot with my understanding of vulkan tbqh, since I copied a lot of its decisions
yeah
btw it's unclear to me what the actual perf implications of GL_MAP_READ_BIT and GL_MAP_WRITE_BIT are, and whether there is any benefit to having just one or the other
theres no distinction in vk
exactly
so probably none
that's what I would imagine, but who knows what drivers are doing under the hood
true
the gl ones
for sanity's sake, I'm just going to make it vulkan-like
you want a mapped buffer? you get GL_MAP_READ_BIT | GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT
it is possible to make read only virtual memory maps, i suppose that is what they are trying to mimic
I don't quite understand
there's probably like 1 game that uses persistent mapping that drivers care about anyways 
do games generally avoid using persistent mappings?
mfw still trying to divine what gl drivers do
it wasn't added until relatively late in GL's lifetime
ah makes sense
gl drivers are handed down directly from the lord
their divine workings are unknown to us mortals
gl 4.4 (which adds persistent mapping) was 2013, so I suppose there was some time for games to use these features
it's a shame how dx became the favored API after the early API wars
makes sense considering windows has always been the main OS for gamers
gl sucked so bad in the early days I guess
compared to early dx
have you seen the longs peak presentation, that shit was unhinged
i havent
gib link
2006 
there was a guy in gpvm who attended that presentation in person and recalled how everyone's reaction to it was 

hmm i wonder if you could make it an experiment
what about
i copied the message link of that message but turned into that thing
ah I didn't realize what you meant the first time you said it
oh
you can click it
but it scrolls to somewhere else for me
oh huh, thats rly weird and not intuitive UI
btw deccer do you mean like a benchmark that people run
hrng effort
it does go here for me but it only flashes the message briefly so its annoying to spot :P
yes that one 😄 when i clicked it a2nd time i arrived there too

template is a placeholder for the gl objects
lol
except khronos was allergic to structs back then
glu 😛
approaching all driver overhead
is that from the 2006 paperino?
they used all the pent up structing for vulkan
and this (image objects) is the same as what became glTexStorage (immutable storage), which is actually a good thing
yeah but who thought splitting it into 10 calls was a good idea
heh
turning this question into an experiment for others to run is perhaps the best thing
before khronos became hinged
i see
different drivers might also behave differently
the best driver is the one that exists in my head and makes sense
longs peak is also where the idea of inflicting VAOs upon us came from
they should've copied vulkan tbh
you meant to say: they should have made a new opengl from the ground up and call it OpenGL 2.0
maybe even call it glNext
it turned out to be glpNext
wowee my old gl abstractions were quite special
https://github.com/JuanDiegoMontoya/EngineBase/blob/master/Source/abo.cpp
apparently this code was written before I realized that buffers were buffers
what's enginebase
but after I knew what MDIC was
whew
an old abstraction I wrote for using in my gl projects
what is ABO short for
a buffer object?
atomic (counter) buffer object
hm
and I had one for parameter buffers (for MultiDrawIndirectCount) too 
there's even some cherno code in there
the awful vao abstraction
famous last words 
'this code will make you go "VAO"'
lol
you implemented it in a shit way then blamed me 
I remember trying to make the binding point a template parameter as well
er wait
yours is doing something different 
the thing about GL is that it invites noobs to abstract it in the most horrendous and random ways possible
turns out GL is already a bad abstraction, so further abstracting it directly is the wrong move
unfortunately yeah
i wonder how much you would roast my c# nonsense
but i need to upload the latest iteration of it first :3
the apiest api of all time
// init
testBuffer = Fwog::TypedBuffer<GlobalUniforms>(Fwog::BufferStorageFlag::MAP_MEMORY);
// each frame
glFinish();
auto ptr = testBuffer->GetMappedPointerTyped();
ptr->proj = proj;
ptr->viewProj = viewProj;
Fwog::CopyBuffer(*testBuffer, globalUniformsBuffer);
this is what happens when I remove the glFinish btw

dw weird behavior was expected
mapped pointers are unsynchronized in fwog, so you have to use fences or glFinish if you're naughty
they're coherent already
oh
just unsynced w.r.t. GPU execution
so you need to implement double buffering yourself
the intent is to provide a smol escape hatch in case the driver autosync is giving you grief
*when
mfw there's no glGetTextureSubImage
so you have to read the entire image when you call it
makes it rather difficult to implement vkCmdCopyImageToBuffer in opengl
oh wait, there's glReadPixels 
man, I get defeated by glPixelStorei every time I try implementing this feature

I swear I googled it the first time
well I actually googled glGetTexSubImage the first time, expecting there to be a non-DSA version of it as usual
dafuq refpages
GL_PACK_IMAGE_HEIGHT
If greater than 0, GL_PACK_IMAGE_HEIGHT defines the number of pixels in an image three-dimensional texture volume, where ``image'' is defined by all pixels sharing the same third dimension index.
the actual spec says this (the definition of PACK_IMAGE_HEIGHT just points to this)
If the value of the integer parameter UNPACK_IMAGE_HEIGHT is not positive, then the number of rows in each two-dimensional image is height; otherwise the number of rows is UNPACK_IMAGE_HEIGHT. Each two-dimensional image comprises an integral number of rows, and is exactly adjacent to its neighbor images.
okay, this is epic
https://github.com/KhronosGroup/Vulkan-Docs/issues/776
can't wait for the secret midnight commit where you substitute the entire impl for vulkan and all the last GL clingers-on using fwog will be vulkan'd
it will happen sooner than you might think
Should attempting to call .subdata on a non-dynamic buffer lead to an assert?
it doesn't right now it silently fails instead
actually why isn't Buffer's default constructor not set to `= delete;'
yeah it probably should assert
I can make the issue
because it's used internally (it's private)
well maybe I'm lying
it was used at one point, which is why it's there
ah, I don't store the flags for the buffer
do you have the debug callback set up
I don't know if I accidentally disabled it but I think I should have.
the gl one
yea
let me recreate the bug though. I had spd log turned off earlier in a macro
it was left off by accident for Release mode
no error despite recreatig the conditions for the bug
ah alright
I can try and invoke an error by using the non mipmap verison
of CreateTexture
ok nvm GenMipmaps() also doesn't check if you have mipmap levels
that's fine imo
trying to think of a way I can cause an assert on purpose easily
go to rendering.cpp and ctrl+f assert
the easiest one is to call a Fwog::Cmd outside of a rendering/compute scope
Oh i got that way before
Yea lemme see if moving up EndRendering works
asserts work fine
trying to think how to get an opengl error here easily
bind a sampled image to slot 100000 or something
or just form an invalid enum somewhere
ok yea its something on my end that isn't outputting my glDebugMessageCallback properly lately
let me rebuild and check if its the macro from before
if you have the gl header, just call glDrawArrays(GL_SOME_RANDOM_ENUM, 0, 0);
ill test it out more later ognna be late for something
ok fix pushed
SO THIS IS WHY YOU WERE LATE

late for what
trying to see how VkImageAspectFlags aspectMask; from VkImageSubresourceLayers (from VkBufferImageCopy) maps to the args in glTextureSubImage2D
I guess it corresponds to format, with the difference being that you must upload all components of a color at once (instead of letting GL truncate or zero-fill components)
and I guess vulkan also does away with format conversions, because there is nothing that maps to the type parameter
I also don't understand why you need to specify the base layer + count when you already specify 3D offset and extent in VkBufferImageCopy
there's no such thing as a 3D array texture
maybe it has to do with cubemap arrays
nope
For cube and cube array image views, the layers of the image view starting at baseArrayLayer correspond to faces in the order +X, -X, +Y, -Y, +Z, -Z. For cube arrays, each set of six sequential layers is a single cube, so the number of cube maps in a cube map array view is layerCount / 6, and image array layer (baseArrayLayer + i) is face index (i mod 6) of cube i / 6.
seems to me that either the array index + length will be useless, or the Z component of the image offset + extent will be
interesting, I always just assumed because of VkExtent3D that you could theoretically have an array of 3D textures, whatever that'd mean
if anything this might now relate to the VkComponentMapping in the imageview, since now you can swizzle your texture access however you like
interestingly, the GL analogue to that function doesn't have any way to specify array layers, so you have to treat arrays, etc. as 3D textures
btw, I wonder where a level parameter should go in this function
void CopyBufferToTexture(const Buffer& source,
const Texture& target,
uint64_t sourceOffset,
Offset3D targetOffset,
Extent3D targetExtent,
UploadFormat format,
UploadType type,
uint32_t bufferRowLength = 0,
uint32_t bufferImageHeight = 0);
yeah I have all the relevant docs open rn
if I copied vulkan, the level param would go right before bufferRowLength
but I think it makes sense to copy GL and put it right after the texture param
in this case, it looks like it's useful for batching copies (since you specify an array of these in vkCmdCopyBufferToImage)
but vulkan loves putting parameter structs everywhere, even in places where they aren't strictly necessary
yeah that as well, it might be useful to copy that
parameter structs are basically the C/C++ hack for named args, so it makes sense for API clarity
hmm yeah I have parameter structs in a few places already
might as well use em here
idk where to draw the line though
here's a conundrum: should this use a parameter struct?
void CopyBuffer(const Buffer& source,
const Buffer& target,
uint64_t sourceOffset = 0,
uint64_t targetOffset = 0,
uint64_t size = WHOLE_BUFFER);
it depends how you batch them internally I guess, I personally have exactly that as my upload API
array of copies for images but direct params for buffers
I don't plan on batching them internally
it's just a straight wrapper over glCopyNamedBufferData
I mean in your future vulkan backend :^)
I don't actually batch them in my uploads though/try to deduplicate pairs of src and dst, since usually that doesn't occur
the main case I can see it arising tho is if you have something like an instance buffer in non-host-visible memory and every frame you generate a bunch of update copies, you might wanna leverage whatever batching vulkan assists you with
I would prefer to upload the whole buffer at once
and I'll impose that preference onto the user by making no mechanism to batch copies/uploads
inshallah
yeah I think generating tons of tiny copy intervals is probably not the way to go
I have doubt that most impls will accelerate it very much
maybe someone who has looked at radv can comment
I think 5 parameters is still doable
also, reference params in these structs are a little annoying
since you have to bind them immediately
stinky
wait thats also not default constructible anyway
I like reference params to specify non-null
yeah
glTexStorage2DMultisample(..., GLboolean fixedsamplelocations);
fixedsamplelocations
Specifies whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not depend on the internal format or size of the image.
glboolean dowhateverthefuckyouwant
lolwut
isnt there a NV extension which can be used to describe shrimple points
it's only supported by NV or AMD on Zink
also, I googled the fixedsamplelocations parameter and apparently fermi GPUs had a thing to jitter sample locations on a per-pixel basis
idk how it would be useful though
As mentioned in the intro, one focus of Fermi is to improve the image quality, and to do this, NVIDIA introduces such techniques as Accelerated Jittered Sampling, which changes the sampling pattern randomly on a per-pixel basis in order to deliver a cleaner result. This is done with a technique called Gather4, which samples four texels with a given offset on a 128×128 grid with a single texture instruction. This technique would help improve image quality with shadow mapping, AO (ambient occlusion), among others.
doesn't really make sense to me, but yeah
verdict: wacky
yep that one
oh, i only remembered it as "set custom shrimple points" never read it properly
I need to make some more samples
One for MSAA and one for async (doing stuff with fences and persistently mapped buffers)
multisampling
and one with acshual pbr
about to add a bunch of const_casts to the code, wish me luck 
whats the reason behind it?
calm the compiler?
a bunch of fwog functions internally call Texture::Handle() to retrieve the OpenGL object ID, and I just recently made it not const
ah
so basically I'm appeasing the compiler
const const uint32_t const Handle() const const
for example, BindSampledImage takes a const ref to a texture since you can at most read from the texture, but the function still needs the object's ID to function properly
that being said, I'm still iffy on how const-correctness should work for this stuff
is it to not have some magic going where one could so texture->Handle() = 943;
does const Texture& mean the memory is immutable, its data, or both?
good question
no, it doesn't return a reference to the handle. that'd be cursed
yeah I've been recently changing the const semantics to be more consistent in that const = immutable data and memory
before, const just meant that the object itself (the struct members) couldn't change, but that seemed almost useless in what it conveyed
you want the data to be immutable, right?
I suppose, yeah
const std::vector means the data is immutable (as well as the memory itself, ofc)
I suppose you could look at Fwog::Texture the same way
yeah, after that it's just reading and writing to its memorydataisms
I called it SubImage because I wasn't creative
ah, right
i remember seeing it recently in basils' stuff value().subImage(...) iirc
another issue I noticed is that SubImage and CopyBufferToTexture are basically the same, except where the source data comes from
yet SubImage is a member of Texture, while CopyBufferToTexture is in an entirely separate file
I couldn't think of a clean way to marry the two concepts, so they are separate for now
hmm i think having them separate makes sense
Context::CopyBufferToTexture(Buffer, Texture)
Context::CopyTextureToTexture(Texture, Texture)
the latter might have params for the area you want to copy, or which slice/mip
and Texture::SubImage stays where it is
although Subimage is an unfortunate name
are you sure you wanna keep subimage
I was the one with calling it Update(TextureUpdateDescriptor, pixels)
since it's not real :^)
I've considered it tbh
and forcing the user to use buffer2image copies
but it's such a massive inconvenience
when do you do buffer2texture/image?
when the driver autosync fails somehow
not really when you have good persistent mapping and buffer creation API
really it begs for the whole suite of transfer assists
i think ive lost you two
the driver has implicit sync and resource shadowing, which are things that fwog doesn't provide in the persistent mapping API schtuff
ah
so SubImage/SubData have a place imo
they're the lazy way of doing things that work probably 90% of the time (totally real statistic there)
what would the alternatives be?
persistent mapping (optional) + CopyBufferToTexture
maybe for homogeneity you could put them with b2t and t2t and call it MemoryToTexture/MemoryToBuffer
so if you ever replace their impls it's still a bit more homogenous
I'm trying (unsuccessfully) to compile this right now
auto pixelBuf = Fwog::Buffer(frame.gAlbedo->Extent().width * frame.gAlbedo->Extent().height * 4,
Fwog::BufferStorageFlag::MAP_MEMORY);
Fwog::CopyTextureToBuffer(*frame.gAlbedo, pixelBuf, 0, {}, 0, frame.gAlbedo->Extent(),
Fwog::UploadFormat::RGBA,
Fwog::UploadType::UBYTE);
Fwog::CopyBufferToTexture(pixelBuf,
*frame.gAlbedo,
0,
0,
{},
frame.gAlbedo->Extent(),
Fwog::UploadFormat::RGBA,
Fwog::UploadType::UBYTE);
those need parameter structs
anyways, that code literally just copies an image to a buffer, then back into the image
thats ok
both things
i think i just miss the actual use case, of those functions in action
because my little brain cant make one up right now
ah
i under stand the things as separate things
like mapped buffer, makes sense to me
and copying an image into another image as well, like for grabbing pixel values for selecting verticles or whatever instead of glReadPixels directly
CopyBufferToTexture is mainly useful for when you need control over synchronization and other stuff that the driver normally does behind your back when you call glTexSubImage
the buffer in question would need to be persistently mapped, and you'd need a fence
then CopyBufferToTexture doesn't read any CPU memory (in theory), everything happens on the GPU timeline
as for a contrived "real" example: let's say you experience an unfortunate situation where you need to update a bit of a texture every frame, but the driver says eff you and calls glFinish to wait for everything on the GPU to finish before the upload can occur
that is where you would want more control over sync
i see
glFinish is also a little unfortunate and fucks with your performance, hence you would want more control perchance
yeah, ideally you want the CPU and GPU running simultaneously
but glFinish or vkDeviceWaitIdle serializes the execution timelines
also sounds like this could come in handy when creatingr resources from other threads perhaps
yeah, you could fill the mapped boofer from another thread
lel
OpenGL Debug message (131154): Pixel-path performance warning: Pixel transfer is synchronized with 3D rendering.
Source: API
Type: Performance
Severity: medium
: D
of what, specifically
SubImage? because I'd agree
I copied vulkan for those, hah
heh
but I think they fit
DX11 calls textures/boofers resources
Fwog::CopyResourceToResource
yeah
BUT
but
fwog has no idea what Resource is, yet
this would need introduction and perchance some inheritancisms
having nothing called xxxResource, but having a function CopyResourceToResource would be odd
j roc know what im sayin
Trailer Park Boys
"No copyright infringement intended.All materials used property of their respective owners."
I kno whatcha saiyan
check it
auto pixelBuf = Fwog::Buffer(frame.gAlbedo->Extent().width * frame.gAlbedo->Extent().height * 4,
Fwog::BufferStorageFlag::MAP_MEMORY);
Fwog::CopyTextureToBuffer(*frame.gAlbedo, pixelBuf, 0, {}, 0, frame.gAlbedo->Extent(),
Fwog::UploadFormat::RGBA,
Fwog::UploadType::UBYTE);
glFinish();
auto pixels = pixelBuf.GetMappedPointer();
memset(pixels, 255, 4 * 1000 * 100);
Fwog::CopyBufferToTexture(pixelBuf,
*frame.gAlbedo,
0,
0,
{},
frame.gAlbedo->Extent(),
Fwog::UploadFormat::RGBA,
Fwog::UploadType::UBYTE);
just the albedo, to be clear
yeah
this is just before the shading pass
and the finish needs to go
without the glFinish, the white albedo never even appears lol
but an incorrect result was to be expected with 0 sync there
it may or may not flicker perhaps
CopyTextureToBuffer happens sometime in the future (it's async), while the memset happens immediately
the CopyBufferToImage happens right after CopyTextureToBuffer on the GPU timeline, so there is actually a very tiny window in which the memset must occur for any result to be visible at all
like most GPU calls, you don't want it to happen immediately
ok so its more like "whenever you have some time, fill the albedobuffer with white, but when you do, do it consistently and in one go"
but the code right now is all running on your main thread right now, and the memset is blocking anyway
if it were immediate, you'd force the execution of everything the call depends on (everything that wrote to the image, directly or not) to finish, which means waiting for maybe multiple frames of GPU work to finish
ok i think i understand that
because autosync
since the gl calls you do are just commands you enqueue, kindof
yeah, and there are implicit dependencies between some of the commands
if you write to an image in one pass, then read from the image in another pass, the driver has to insert a barrier to make sure the write finishes before the next pass starts
i think i understood a bit more of all this just from this little conversation
yeah that makes sense
and thats where barriers/syncs come into play like when you do ordinary multuithreadingisms, with io or whatever for instance
ok that means that fwog should provide those facilities or expose themsomehow as well
the CPU and GPU are basically like two threads that you are trying to keep running (with useful work) at all times, ye
yeah
except the GPU is always behind the CPU since the CPU must feed it with work
if only operating systems would run on gpus and no cpu was involved 😛
which is why GPU readback is spoopy and takes multiple frames if you don't want a big stall
because you have to wait for everything to finish on the gpu unless you are a glitchgiraffics pro gramer
like XFX/o u t b o u n d s
boutounds
hehe
but yeah gl functions that read GPU memory to the CPU are terribad for perf because the driver must wait for (basically) everyyyyyyyyything on the GPU to finish before even starting the transfer
is there a way fwog could expose a fence automatically when you use certain operatins
yeah
mayhap, haven't really thought about it
or some sort of BeginXXX() which returns an IAsyncOperation you have to .End()..... well pretty much a future ye
I think that'd be the next step in making manual sync/async stuff a little less painful
would be neat to have something manual first, in form of an actual example
and then turned that into something more fluid, with another example
speaking of which, lemme make an iShoe for the examples I mentioned earlier
mayhaps you need some manual ones for some cases - mayhaps when threads are involved
dont forget to make an example for actual pbr too 🙂
plus those 2
also also, i am diggin through filament's sources and docs again and i have not been able to get it to compile on my machine yet, but ive seen a few videas and those looks NOTHING like that stupid gltf viewer which support filament, but froyo or was it you? mentioned that it might be some options with unfortunate values perchance
that will be part of 03_gltf_viewer at some point
: )
i have a feeling this is like the rotating gimbal thing with attached lights i want some1 to implement in his vr engine 😛
78 already
re naming things
would you consider having some base for Texture/Buffer like Resource
idk why I would tbqh
hehe i think there is plenty of curses in any api
no matter how you look at them
it makes a lot more sense the more you dig into vulkan too
the driver truly has a sisyphean job here
all that sync ism makes more sense when i deal with IO, but thre i have no real tuoble understanding it, but with vulkan and gpuisms its a different story for some reason
although the gpu is nothing more than a threadpool of sorts
idk maybe it's the terminology
very possible
same when you c++ people talk yourselves into its isms in #bikeshed-😇 all the time, i dont get 0 lol
but i still can write c++ with new and delete like before and that makes sense (extreme example here)
there's also a conchfusion about frames in flight and double buffering
which is made worse by the fact that some tutorials conflate the two
once i have a new gpu, i will definitlitly give vulkan a try
lmao
i am now convinced you ll wait until your gpu breaks
Today imma update my fwog
good luck
is it supposed to work just out of the box? @long robin
because it does for me I 'rebuild all'
and was able to run without issues
yeah that should work
ok sweet 


