#Fwog and co.

1 messages · Page 13 of 1

golden schooner
#

ANYWAY

#

add_compile_options(-Wall -Wextra -Werror)

#

to the 2nd window

fiery sorrel
#

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)

heavy cipher
#

wth

fiery sorrel
#

let me remove the header files even tho i dont think that'd fix stuff

heavy cipher
#

this convo is giving me conniptions

golden schooner
#

isnt that a 25/8 condition 🙂

heavy cipher
#

deccy did you read what tess wants?

fiery sorrel
#

I don't get it

#

Even if I fix my own unused variable stuff

golden schooner
#

no, i asked for a tldr

fiery sorrel
#

I'd have to fix cgltf too

heavy cipher
#

^

golden schooner
#

ah

#

and i thought thats what add_compile_options does when you ad it for your project

fiery sorrel
#
GitHub

Froggy OpenGL Engoodener. Contribute to ClementineAccount/Fwog development by creating an account on GitHub.

GitHub

Froggy OpenGL Engoodener. Contribute to JuanDiegoMontoya/Fwog development by creating an account on GitHub.

long robin
fiery sorrel
#

why? I don't know all I did was remove /Wx

heavy cipher
#

just add those flags to only your target

golden schooner
#

thats what i said

heavy cipher
#

not the entire project

#

no

#

you are adding to the project

#

to ALL targets

golden schooner
#

target_compile_options then i guess

heavy cipher
#

yep

long robin
#

All my homies use target compile options

golden schooner
#

sorry for the conchfusion

fiery sorrel
#

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

long robin
#

I dunno what the INTERFACE scope means exactly.

heavy cipher
long robin
#

Doesn't that mean that fwog is trolling basil then

fiery sorrel
heavy cipher
fiery sorrel
#

urm screenshot of the diff

long robin
#

If fwog's compile options have the interface scope, then they're polluting yours too

#

And anyone else who depends on fwog

heavy cipher
#

yeh thats defo fucko

long robin
#

Copy paste gone wrong

fiery sorrel
#

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

long robin
#

See if changing fwog's thing to private helps

fiery sorrel
#

where do I do that?

#

oh

golden schooner
#

we can also move over to #1026467818943807579 if its my template related

long robin
#

Replace INTERFACE with PRIVATE in your pic, but for fwog

fiery sorrel
#

target_include not target_link

#

oh u meant inside Fwog not

#

yea I'll do that

fiery sorrel
#

Your template was more the 'test case'

long robin
#

yeah just do it in your fwog fork

#

I can test it locally tomorrow

fiery sorrel
#

then I can even go back and uncomment the Werror yea?

long robin
#

I wouldn't do that

golden schooner
#

id have made it 2 lines and not cram all the compilerisms into one line, for better readaiblitlilbility

long robin
#

Generator expressions suck btw

#

Unreadable trash

#

I will raise an issue on fwog

fiery sorrel
#

yea I will do it later

#

oh now I know why u commented out some of those lol

golden schooner
#

the middle one should be addressed

#

hiding shit is not nice

#

or reintroducing members

fiery sorrel
#

Those two are from Fwog

#

I can file an issue for them too yea

long robin
#

I wonder why I don't get those 🤔

fiery sorrel
#

Perhaps

long robin
#

You're on msvc, so changing those has 0 effect

golden schooner
#

did you set a c++ language level, mr. weasl?

fiery sorrel
#

yea it'd be caused by W3 or W4

fiery sorrel
#

shouldhaps set it to 20

long robin
#

You should

golden schooner
#

you must

long robin
#

Fwog is ceepeepee 20

fiery sorrel
#

no wait I did set it

#

I guess it needs to be in both cmake files

golden schooner
#

it was worf a try to check

long robin
fiery sorrel
#

ive been messin with this CMake stuff for way too long lol

long robin
#

Idk how tf my msvc isn't telling me about these

#

Maybe we're on different versions of the tool chain

fiery sorrel
#

ill make my own branch in my fork for my car game development for now no worries

golden schooner
#

also add #define mayhaps_unused maybe_unused

#

for [[mayhaps_unused]] unusedparameterhere

golden schooner
#

2 more intermeresting items for our vexilloisms

#

🇦🇨 🇨🇰

long robin
#

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

golden schooner
#

apple should not be supported at all 🙂

#

compiler should emit a message "go buy a real pc" or so

long robin
#

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

golden schooner
#

they might aswell use GoldCoatedFwog

fiery sorrel
#

yo i just realized I contributed to a Fwog bug fix

#

thats neat

long robin
#

yeet

fiery sorrel
#

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

long robin
#

github has a button to sync your fork

fiery sorrel
#

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

shell inlet
#

someone should make a tray racing game

long robin
#

is that a subtle hint

shell inlet
#

subtle hint at competitive slide riding

long robin
#

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!

heavy cipher
#

bacon lettuce transgressionsagainstcomputerscience

fiery sorrel
#

Btw if it means anything

#

Fwog was the easiest to Cmake Fetch Content into my project

wind trout
#

oh wow surprised no fwog updates. I've been away for a couple days

golden schooner
#

jaker is a slacker

#

even rhymes

rugged notch
#

I pronouce it "jayker" (in my head, lest he appear)

golden schooner
#

i pronounce slacker as slaycker too 😛

long robin
#

I've heard people call me "jacker" in voice chat

golden schooner
#

ill boot them off the server next time, just point at them

heavy cipher
#

@golden schooner can we bring back monthly showcase, but in april we all just submit short audio clips of trying to pronounce jaker

golden schooner
#

heh

golden schooner
#

we are working on the monfhly showcase to come back

long robin
#

did you get one of the underpaid modlings to do it

golden schooner
#

nope

#

they are all p useless

heavy cipher
#

just don't call clep & co grannies

heavy cipher
#

i heard they don't like that too much

long robin
rugged notch
#

I haven't even begun to peak

rugged notch
fiery sorrel
#

I prounice deccer as 'decker'

rugged notch
#

you're telling me you don't say it like dessert

long robin
#

deeser

fiery sorrel
#

Just wanna gush about how Fwog makes doing this super easy

#

so thank you for this blobpensivepray

#

dw i'd refactor that so u can pass in the buffer or some struct containing a buffer and the count

shell inlet
#

is your project up in #1019722539116802068 ?

fiery sorrel
#

yea its in #1093833868336963725

#

it uses Fwog

#

and I just posted here as like positive feedback abt fwog somethin

fiery sorrel
#

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

long robin
#

it calls glBufferSubData

fiery sorrel
#

yea i know

#

is calling glBufferSubData twice slower than calling it once but allocating a container

long robin
#

wdym allocating a container

fiery sorrel
#
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)
long robin
#

do you know what std::array is

#

well either way, it should be extremely cheap to make

#

much cheaper than a subdata call

fiery sorrel
#

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

long robin
#

it's just a C array wrapper

fiery sorrel
#

ok

#

ok so thats what i thought too

golden schooner
long robin
golden schooner
#

looks like a bluenoise generator

long robin
#

is it because you know I love noise

golden schooner
#

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

long robin
#

hehe

#

I starred the repo in case I need to generate more blue noise

heavy cipher
long robin
#

are you calling me crazy

heavy cipher
#

i am saying you can always get some blue noise from this "song"

golden schooner
#

also, also, the crazy frog is exactly how i picture you, jaker

long robin
#

I don't get it frog_dum

golden schooner
#

i also read "frog" not "song"

long robin
#

that video has almost 4 billion views on yt mindblown

golden schooner
#

3.999.999.999 now with you watching it

fiery sorrel
long robin
long robin
#

thanks for catching that

golden schooner
#

failure to call 911 saves 4 firefighters' lives

fiery sorrel
long robin
#

I put #if instead of #ifdef

fiery sorrel
#

oooh I see

long robin
#

anyways, if you pull it should be fixed

#

this time I tested both release and debug

#

lol that super spank

fiery sorrel
#

I'll test both too lol

#

both work for me too

long robin
#

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 🏳️‍🌈

maiden peakBOT
#

Alright Jaker, I'll remind you about 🏳️‍🌈 in 9 hours. ID: 56126129

final cove
#

woah I've never seen a fog bow before, they look cool

long robin
#

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 bleakekw

long robin
golden schooner
#

that looks cool

long robin
#

too bad it's a bit 🇫🇴 🇨🇰 🇪 🇩 from the low volume resolution

golden schooner
#

the moving clouds make this amazing

long robin
#

would be cool to explore atmospherics in greater depth sometime

#

like proper sky rendering, clouds, rain, etc.

#

and rainbows formed by the rain ofc

golden schooner
#

damn

#

i need to add that thing at some point too when i fly through my asteroid fields 🙂

long robin
#

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

long robin
#

depends on how fancy you want it to be, really

golden schooner
#

once i have some sort of flying and some asteroids going i will make sure to let you know

long robin
#

the 🦐lest volume effects can be done in like 30 loc of shader code

#

and it's quite satisfying too

long robin
# long robin welp

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

golden schooner
#

sometimes there is even a third one

long robin
#

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

golden schooner
#

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

long robin
#

differently sized particles in the air can cause different rainbows too

#

the 100 um one seems to have the most obvious "third" rainbow

golden schooner
#

hmm people burn alot of shnit in their gardens mayhaps that has an influence on the particles in the air

#

not all the time

long robin
#

could be

golden schooner
#

but i remember standing on our roof and seeing like 10? little fires around my viewdistance

long robin
#

that sounds neat

golden schooner
#

ocean is also visible and few mountain peaks

long robin
golden schooner
#

oh those are neat

#

you get them in freezing areas

#

ah it says there heh

long robin
#

I could try to make a 2D lut (zenith and azimuth) based on an hdr photo or something

golden schooner
#

i think i saw that phenomenon once too, never knew what that is or what it is caused by

heavy cipher
golden schooner
#

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

long robin
#

I think it's because there are actual dogs up there making the sky prettier for us

#

deccer's dog army

golden schooner
#

: )

#

dogs are cool people

#

like frogs

final cove
#

woah these are pretty neat phenomena that I never knew about

robust bough
fiery sorrel
#

What is an alternative to glReadPixels() that I can use in Fwog to implement framebuffer color picking version of mouse picking?

long robin
#

currently, there's no mechanism in fwog to read textures

#

I have an issue for it already

fiery sorrel
#

So my three options are:

  1. raw ogl
  2. compute shader hack
  3. raycast pick
#

I can probably go with option 3 for my project

long robin
#

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)

fiery sorrel
#

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.

long robin
#

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

fiery sorrel
#

I can try that yea

long robin
#

You would bind the buffer to GL_PIXEL_PACK_BUFFER, then call glGetTextureImage and it'll be written to the buffer

fiery sorrel
#

got it

long robin
#

And reading from the buffer requires mapping it (ideally persistently if you want to avoid stalls) or manually calling glGetBufferSubData with the handle

fiery sorrel
#

I can get the texture from a color attachment's Render() then do a pixel transfer to a FBO then glReadPixel or something

fiery sorrel
long robin
#

It's actually a huge stall, but yeah it might be bearable

fiery sorrel
#

Why can't I blit that texture to a framebuffer directly

long robin
#

I submitted an ldjam game that stalled every frame due to buffer reads and it ran fine

fiery sorrel
#

bind it and then glReadPixel that

long robin
#

You can

#

glReadPixels sucks though

#

You have to make a framebuffer first, and fwog doesn't expose those

fiery sorrel
#

I skip glReadPIxels and a framebuffer

#

by just getting the pixel data through a different buffer

long robin
#

Ye

fiery sorrel
long robin
heavy cipher
#

render the object id as text and ask the user to type it in

#

there is no easier way

fiery sorrel
#

I have legit considered just moving mousepicking till later as a simple inspector window is enough for the scope

long robin
fiery sorrel
#

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

long robin
#

It doesn't exist in fwog

#

I said that already

#

You have to make these gl calls yourself

fiery sorrel
#

Right you meant

#

Handle() on the Fwog::Texutre

#

to get the GL texture ID

#

and then call that

long robin
#

Ye

fiery sorrel
#

yea ok

#

Considering I only have AABBs planned I could also try a raycast solution

long robin
#

Async readback mayhaps be a good thing to make an example of

#

Ok I schleep

fiery sorrel
#

ok bye bye

fiery sorrel
#

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)

fiery sorrel
#

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 👁️ 👁️

shell inlet
#

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

fiery sorrel
#

the first fwogtorial

final cove
#

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

fiery sorrel
#

the first fwogmmunity sample

shell inlet
#

who uses it: <link to some obscure github hobby project> (ends here)

final cove
#

<link to your own repo>

fiery sorrel
#

the circle is complete

golden schooner
#

wasnt there a scissor trick as well, for reading 1pixel off off glReadPioxels

long robin
#

Idk, I'm not versed in the dark arts of glReadPixels

long robin
#

@fiery sorrel do you have some sample code that uses tessellation that I can look at, preferably on github?

fiery sorrel
long robin
#

I meant OpenGL code 😄

fiery sorrel
#

ahh for OGL I actually also haven't touched tess in OGL sorry.

long robin
#

I want to see how much (if at all) the APIs diverge here

fiery sorrel
#

I know LearnOpenGL has a tutorial but I don't know if that's a good reference

long robin
#

alright, I'll look tomorrow

#

I'm tired af right now so I'm gonna schleep

fiery sorrel
#

yeaa get a good rest

#

thanks for being active for Fwog stuff

#

I really enjoy using Fwog

long robin
#

there will be 12345 messages soon

rugged notch
#

alhamdullah

oak garden
golden schooner
#

jebus, you talk a lot

valid oriole
#

says the guy with 17k messages in his thread listenyoupieceofshit

oak garden
#

i think this and deccer thread are the most active ones

golden schooner
#

heh

#

those are the more interesting ones where i participate 😛

valid oriole
#

aaand

#

everyone stop now

#

no more messages, at least for a bit

golden schooner
#

speaking of

#

@oak garden had an iShoe with his vulkan thing,and i suggested to boop you

oak garden
#

aye

golden schooner
#

no idea if he did or not 😄

valid oriole
golden schooner
#

oh shit

golden schooner
#

next stop 123456 😛

oak garden
#

same code for creating AS

#

ray query crashes inside driver, but ray pipeline works fine

#

🤷

golden schooner
#

lets skootch over to your crib

#

otherwise jaker will kick us out

oak garden
#

true

heavy cipher
#

not while he schlep

oak garden
golden schooner
#

heh

long robin
golden schooner
#

😄

#

is the tool biased somehow?

long robin
#

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

long robin
#

@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 🙏

oak garden
shell inlet
long robin
#

I use them to convey unironic feelings : )

#

Inshallah void will be conchfused by my language

golden schooner
#

إِنْ شَاءَ ٱللَّٰهُ

#

иншаллахь

#

ojalá

#

Дай Бог!

long robin
#

Deccer enabling different keyboard layouts to type those

golden schooner
#

frogs use it all over the place

#

even in esparanto

long robin
#

Hmm isn't that a conlang

golden schooner
#

yes

rugged notch
#

Esperanto is p fun

#

I prefer toki pona tho

golden schooner
#

multiple rabbitholes rabbitholed the area of conlangs is

rugged notch
#

Cause it's silly and goofy and whimsical

long robin
#

I wonder how many people actually learn these conlangs

golden schooner
#

when i read the word esperanto i always see a person like castro

shell inlet
rugged notch
#

It's fun to do to train the brain

long robin
#

I'd rather learn a real lang bleakekw

golden schooner
#

also intermeresting to dig into wikipedia

long robin
#

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...

rugged notch
#

Wow

final cove
#

man you're really digging into obscure optical phenomena

#

this one seems to be masked onto the clouds

fiery sorrel
#

cool thing about tess shader means i can also use it to generate wireframe spheres without CPU memory allocation for it

long robin
#

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

fiery sorrel
#

buffers have no copy constructor right?

long robin
#

correct

#

I also need to add a function to copy buffer regions

fiery sorrel
#

what is an alternative I can consider for

long robin
#

what are you trying to do here

fiery sorrel
#

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

long robin
#

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);
fiery sorrel
#

I see. Thanks

fiery sorrel
#

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

long robin
#

std::move does not discriminate

long robin
#

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

long robin
#

I also dunno if explicit flushing is worth anything

#

hmm that's probably a complicated question

#

hmmmmm what's that one article with perf of the different memory types

#

it had the word "disaster" in the title

long robin
#

I need more info about the perf of the different memory types

golden schooner
#

hmm

long robin
#

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 😄

golden schooner
#

im probably the last person you should ask when it comes to that stuff, mayhaps MJP/Jasper might have something to say

long robin
#

that's cheating

golden schooner
#

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?

long robin
#

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)

golden schooner
#

for all things in general, frequent/infrequent ubdates??

long robin
#

I'm basically wondering if there's a perf reason to expose the coherent flag or just always include it

long robin
golden schooner
#

hmm i wonder if you could make it an experiment

long robin
#

if you profile and see that buffer updates are slow, then you need to use persistent mapping and stuff

golden schooner
#

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)

final cove
#

from what I recall in the random crap I've heard lurking, in vulkan there's no reason not to use the coherent bit

long robin
#

that's good enough for me

heavy cipher
#

there is reason to not use the coherent bit

#

but PCs don't give you this option

#

all host visible memory is coherent

long robin
#

so do I need a mac to see it bleakekw

heavy cipher
#

nah mobiles

long robin
#

hehe I jk

heavy cipher
#

its unclear what gl implems do with coherent

long robin
#

naturally

heavy cipher
#

it might mean something different

long robin
#

it means the same thing as in vulkan

#

as in you must manually flush mapped ranges

heavy cipher
#

that yes, but i don't know how this interacts with buffer tracking

#

i guess it just turns it off? idk

long robin
#

yeah it's quite conchfusing

#

I like to map (no pun intended) concepts to vulkan because they actually have meaning there

heavy cipher
#

fr fr

long robin
#

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

heavy cipher
#

if you do persistent mapping, then the reasons to unmap are 1) 32 bit process, 2) buggy OS (iirc there is/was some boog)

long robin
#

I thought there was a limited amount of persistently mappable memory without sam/rebar

#

like 256mb on AMD

valid oriole
#

it’s a PCI limitation, not necessarily a GPU one

#

well, for everyone with >256MB VRAM

long robin
#

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

heavy cipher
#

but thats mappable device memory

long robin
#

are you saying that it (the limited host-visible memory) is consumed whether it's mapped or not?

heavy cipher
#

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

long robin
#

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

heavy cipher
#

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

long robin
#

interesting

heavy cipher
#

also memory in gl is not pinned to a specific location

#

so the driver can and most likely will move them

long robin
#

gl is cursed, man

#

all I want are some fackin guarantees bleakekw

heavy cipher
long robin
#

maybe I should just pretend that having no guarantees is liberating

oak garden
#

time for fwog-vk hap

long robin
#

it means I can do whatever I want and get random performance regardless

oak garden
#

👀

long robin
#

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 bleakekw

oak garden
#

youre probably knowledgeable enough to pick it up with not a lot of issues tbh

long robin
#

perchance

#

making fwog helped a lot with my understanding of vulkan tbqh, since I copied a lot of its decisions

oak garden
#

yeah

long robin
#

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

oak garden
#

theres no distinction in vk

long robin
#

exactly

oak garden
#

so probably none

long robin
#

that's what I would imagine, but who knows what drivers are doing under the hood

oak garden
#

true

long robin
#

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

heavy cipher
#

it is possible to make read only virtual memory maps, i suppose that is what they are trying to mimic

long robin
#

I don't quite understand

oak garden
#

ig the question is if drivers actually do that

#

or if they just dont care

long robin
#

there's probably like 1 game that uses persistent mapping that drivers care about anyways bleakekw

oak garden
#

do games generally avoid using persistent mappings?

heavy cipher
#

mfw still trying to divine what gl drivers do

long robin
oak garden
#

ah makes sense

#

gl drivers are handed down directly from the lord

#

their divine workings are unknown to us mortals

long robin
#

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

oak garden
#

makes sense considering windows has always been the main OS for gamers

long robin
#

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

oak garden
#

i havent

heavy cipher
#

gib link

oak garden
#

2006 bleakekw

long robin
#

there was a guy in gpvm who attended that presentation in person and recalled how everyone's reaction to it was watbulb

golden schooner
#

what about #1019779751600205955 message

#

the fak

oak garden
golden schooner
#

hmm i wonder if you could make it an experiment
what about this

golden schooner
long robin
#

ah I didn't realize what you meant the first time you said it

golden schooner
#

oh

golden schooner
#

but it scrolls to somewhere else for me

oak garden
long robin
#

btw deccer do you mean like a benchmark that people run

golden schooner
#

yes

#

on different hardware/combinations

long robin
#

hrng effort

oak garden
#

it does go here for me but it only flashes the message briefly so its annoying to spot :P

golden schooner
#

yes that one 😄 when i clicked it a2nd time i arrived there too

oak garden
golden schooner
#

template is a placeholder for the gl objects

long robin
#

that's the biggest watbulb in the whole thing

#

it's just a createinfo struct

oak garden
long robin
#

except khronos was allergic to structs back then

golden schooner
#

glu 😛

oak garden
#

approaching all driver overhead

golden schooner
#

is that from the 2006 paperino?

heavy cipher
long robin
# oak garden lol

and this (image objects) is the same as what became glTexStorage (immutable storage), which is actually a good thing

oak garden
#

yeah but who thought splitting it into 10 calls was a good idea

golden schooner
#

heh

#

turning this question into an experiment for others to run is perhaps the best thing

long robin
#

before khronos became hinged

oak garden
#

i see

golden schooner
#

different drivers might also behave differently

long robin
#

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

golden schooner
#

you meant to say: they should have made a new opengl from the ground up and call it OpenGL 2.0

oak garden
#

maybe even call it glNext

long robin
#

it turned out to be glpNext

#

apparently this code was written before I realized that buffers were buffers

shell inlet
#

what's enginebase

long robin
#

but after I knew what MDIC was

oak garden
long robin
oak garden
#

what is ABO short for

shell inlet
#

a buffer object?

long robin
#

atomic (counter) buffer object

oak garden
#

hm

long robin
#

and I had one for parameter buffers (for MultiDrawIndirectCount) too KEKW

#

there's even some cherno code in there

#

the awful vao abstraction

oak garden
#

famous last words kekw

heavy cipher
#

'this code will make you go "VAO"'

oak garden
#

I remember trying to scope glBind calls

#

It was a hot mess

oak garden
#

lol

heavy cipher
oak garden
#

yeah it was not good lmao

long robin
#

er wait

#

yours is doing something different frogstare

oak garden
#

as I said

#

it was a hot mess

#

i dont think it even worked

long robin
#

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

oak garden
#

unfortunately yeah

golden schooner
#

i wonder how much you would roast my c# nonsense

#

but i need to upload the latest iteration of it first :3

golden schooner
#

i missed it by 20 secs

#

3:14:35

long robin
#

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);
oak garden
long robin
#

dw weird behavior was expected

#

mapped pointers are unsynchronized in fwog, so you have to use fences or glFinish if you're naughty

oak garden
#

aye

#

cant you testBuffer->Flush() or something

long robin
#

they're coherent already

oak garden
#

oh

long robin
#

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

heavy cipher
#

*when

long robin
#

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 bleakekw

long robin
#

man, I get defeated by glPixelStorei every time I try implementing this feature

oak garden
long robin
#

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

long robin
#

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.

final cove
#

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

long robin
#

it will happen sooner than you might think

fiery sorrel
#

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;'

long robin
#

yeah it probably should assert

fiery sorrel
#

I can make the issue

long robin
#

well maybe I'm lying

#

it was used at one point, which is why it's there

fiery sorrel
#

here u go

long robin
#

ah, I don't store the flags for the buffer

long robin
fiery sorrel
#

I don't know if I accidentally disabled it but I think I should have.

fiery sorrel
#

you mean opengl debug callback error message

#

or is there a Fwog one?

long robin
#

the gl one

fiery sorrel
#

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

long robin
#

ah alright

fiery sorrel
#

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

long robin
#

that's fine imo

fiery sorrel
#

trying to think of a way I can cause an assert on purpose easily

long robin
#

go to rendering.cpp and ctrl+f assert

long robin
fiery sorrel
#

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

long robin
#

bind a sampled image to slot 100000 or something

#

or just form an invalid enum somewhere

fiery sorrel
#

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

long robin
#

if you have the gl header, just call glDrawArrays(GL_SOME_RANDOM_ENUM, 0, 0);

fiery sorrel
#

ill test it out more later ognna be late for something

long robin
#

ok fix pushed

robust bough
fiery sorrel
#

LMFAO

#

kinda yea

#

I was debugging that bug

#

then i had to take a quick shower

shell inlet
#

late for what

fiery sorrel
#

was meeting with caio for a soccer pick up game

#

me and him are irl friends

long robin
#

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

final cove
#

interesting, I always just assumed because of VkExtent3D that you could theoretically have an array of 3D textures, whatever that'd mean

final cove
long robin
#

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);
final cove
#

I think this is exactly why vulkan uses helper structs

#

FwogBufferImageCopy

long robin
#

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

long robin
#

but vulkan loves putting parameter structs everywhere, even in places where they aren't strictly necessary

final cove
#

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

long robin
#

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);
final cove
#

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

long robin
#

I don't plan on batching them internally

#

it's just a straight wrapper over glCopyNamedBufferData

final cove
#

I mean in your future vulkan backend :^)

final cove
#

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

long robin
#

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

final cove
#

yeah I think generating tons of tiny copy intervals is probably not the way to go

long robin
#

I have doubt that most impls will accelerate it very much

#

maybe someone who has looked at radv can comment

oak garden
long robin
#

also, reference params in these structs are a little annoying

#

since you have to bind them immediately

oak garden
#

yeah

#

there is std::reference_wrapper i guess

long robin
#

stinky

oak garden
#

wait thats also not default constructible anyway

final cove
#

I like reference params to specify non-null

oak garden
#

yeah

long robin
#

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.

heavy cipher
#

glboolean dowhateverthefuckyouwant

golden schooner
#

isnt there a NV extension which can be used to describe shrimple points

long robin
#

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

final cove
#

verdict: wacky

golden schooner
#

oh, i only remembered it as "set custom shrimple points" never read it properly

long robin
#

I need to make some more samples

#

One for MSAA and one for async (doing stuff with fences and persistently mapped buffers)

heavy cipher
golden schooner
#

and one with acshual pbr

long robin
#

about to add a bunch of const_casts to the code, wish me luck bleakekw

long robin
#

a bunch of fwog functions internally call Texture::Handle() to retrieve the OpenGL object ID, and I just recently made it not const

golden schooner
#

ah

long robin
#

so basically I'm appeasing the compiler

golden schooner
#

const const uint32_t const Handle() const const

long robin
#

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

golden schooner
#

is it to not have some magic going where one could so texture->Handle() = 943;

long robin
#

does const Texture& mean the memory is immutable, its data, or both?

golden schooner
#

good question

long robin
golden schooner
#

exactly

#

const to me in a c++ context always implied some sort of immutability

long robin
#

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

golden schooner
#

you want the data to be immutable, right?

long robin
#

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

golden schooner
#

that makes sense

#

the only time you mutate Texture is at its creation

long robin
#

yeah, after that it's just reading and writing to its memorydataisms

golden schooner
#

yep

#

safeguarded via Update()

#

i think you called it Update(TextureUpdateInfo)

long robin
#

I called it SubImage because I wasn't creative

golden schooner
#

ah, right

#

i remember seeing it recently in basils' stuff value().subImage(...) iirc

long robin
#

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

golden schooner
#

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

long robin
#

hehe

#

what would be better?

final cove
#

are you sure you wanna keep subimage

golden schooner
#

I was the one with calling it Update(TextureUpdateDescriptor, pixels)

final cove
#

since it's not real :^)

long robin
#

I've considered it tbh

#

and forcing the user to use buffer2image copies

#

but it's such a massive inconvenience

golden schooner
#

when do you do buffer2texture/image?

long robin
#

when the driver autosync fails somehow

final cove
#

not really when you have good persistent mapping and buffer creation API

#

really it begs for the whole suite of transfer assists

golden schooner
#

i think ive lost you two

long robin
#

the driver has implicit sync and resource shadowing, which are things that fwog doesn't provide in the persistent mapping API schtuff

golden schooner
#

ah

long robin
#

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)

golden schooner
#

what would the alternatives be?

long robin
#

persistent mapping (optional) + CopyBufferToTexture

final cove
#

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

golden schooner
#

hmm

#

i think you should write an example.cpp of it in action

long robin
#

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

golden schooner
#

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

long robin
#

ah

golden schooner
#

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

long robin
#

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

golden schooner
#

ah

#

now the plot fickens

long robin
#

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

golden schooner
#

i see

#

glFinish is also a little unfortunate and fucks with your performance, hence you would want more control perchance

long robin
#

yeah, ideally you want the CPU and GPU running simultaneously

golden schooner
#

ok

#

makes sense

long robin
#

but glFinish or vkDeviceWaitIdle serializes the execution timelines

golden schooner
#

also sounds like this could come in handy when creatingr resources from other threads perhaps

long robin
#

yeah, you could fill the mapped boofer from another thread

long robin
#

lel

OpenGL Debug message (131154): Pixel-path performance warning: Pixel transfer is synchronized with 3D rendering.
Source: API
Type: Performance
Severity: medium
golden schooner
#

: D

long robin
#

SubImage? because I'd agree

golden schooner
#

CopyXToY

#

SubImage is definitliltiy a shit name, but thats also not your fault

long robin
golden schooner
#

heh

long robin
#

but I think they fit

golden schooner
#

DX11 calls textures/boofers resources

long robin
#

Fwog::CopyResourceToResource

golden schooner
#

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

long robin
#

I kno whatcha saiyan

golden schooner
#

hand tight

#

lol

long robin
#

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);
golden schooner
#

hmm

#

you make the texture white

long robin
#

just the albedo, to be clear

golden schooner
#

yeah

long robin
#

this is just before the shading pass

golden schooner
#

and the finish needs to go

long robin
#

that's just for PoC 😄

#

no one in their right mind would do what I'm doing here

golden schooner
#

im not so sure about that 😛

#

loads of doofuses out there

#

including us 😛

long robin
#

without the glFinish, the white albedo never even appears lol

#

but an incorrect result was to be expected with 0 sync there

golden schooner
#

it may or may not flicker perhaps

long robin
#

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

golden schooner
#

is that an operation you want to happen right away

#

in a synchronous fashion

long robin
#

like most GPU calls, you don't want it to happen immediately

golden schooner
#

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

long robin
#

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

golden schooner
#

ok i think i understand that

long robin
#

because autosync

golden schooner
#

since the gl calls you do are just commands you enqueue, kindof

long robin
#

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

golden schooner
#

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

long robin
#

the CPU and GPU are basically like two threads that you are trying to keep running (with useful work) at all times, ye

golden schooner
#

yeah

long robin
#

except the GPU is always behind the CPU since the CPU must feed it with work

golden schooner
#

if only operating systems would run on gpus and no cpu was involved 😛

long robin
#

which is why GPU readback is spoopy and takes multiple frames if you don't want a big stall

golden schooner
#

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

long robin
#

boutounds

golden schooner
#

hehe

long robin
#

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

golden schooner
#

is there a way fwog could expose a fence automatically when you use certain operatins

long robin
#

hrm

#

like give you a future<T>?

golden schooner
#

yeah

long robin
#

mayhap, haven't really thought about it

golden schooner
#

or some sort of BeginXXX() which returns an IAsyncOperation you have to .End()..... well pretty much a future ye

long robin
#

I think that'd be the next step in making manual sync/async stuff a little less painful

golden schooner
#

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

long robin
#

speaking of which, lemme make an iShoe for the examples I mentioned earlier

golden schooner
#

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

long robin
golden schooner
#

: )

#

i have a feeling this is like the rotating gimbal thing with attached lights i want some1 to implement in his vr engine 😛

long robin
golden schooner
#

78 already

#

re naming things

#

would you consider having some base for Texture/Buffer like Resource

long robin
#

idk why I would tbqh

golden schooner
#

ok

#

if you keep naming the copyisms like Buffer2Texture etc then no need to

long robin
#

heh

#

the DX way of calling everything a resource is a bit cursed imo

golden schooner
#

hehe i think there is plenty of curses in any api

#

no matter how you look at them

long robin
#

the driver truly has a sisyphean job here

golden schooner
#

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

long robin
#

idk maybe it's the terminology

golden schooner
#

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)

long robin
#

there's also a conchfusion about frames in flight and double buffering

golden schooner
#

heh

#

swapchainerino

long robin
#

which is made worse by the fact that some tutorials conflate the two

golden schooner
#

once i have a new gpu, i will definitlitly give vulkan a try

golden schooner
snow sun
snow sun
fiery sorrel
#

Today imma update my fwog

long robin
#

good luck

fiery sorrel
#

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

long robin
#

yeah that should work

fiery sorrel
#

ok sweet blobthumbsup

long robin
#

how old is this nervous

glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo[1-curPBO]); //bind pbo
glTexSubImage3D(GL_TEXTURE_3D,0,0,0,0,xdim,ydim,zdim,GL_LUMINANCE,GL_UNSIGNED_BYTE,0);