#Rosy
1 messages Β· Page 14 of 1
How to make a CPU from scratch (any% speedrun glitchless):
- Get a rock.
- Smash the rock.
- Now you have 98% concentrated silicon dioxide. Purify it to 99.9% pure silicon dioxide.
- Purify it further to 99.9999999% polysilicon metal.
- Put the polysilicon ingots into a crucible.
- Heat the silicon ingots to 1698 Β°K.
- Take a...

I was thinking more like
might not get a very high frame time though
which jake
captain jake
I don't want to make an OS 
fair
I just want to look at a thing and say I made that, and not feel like I need to apply an asterisk to it
i think you can be proud you "made" something even if u didn't do 100%
part of what makes frogs great is that we build up on each others works across generations
there's a braod spectrum of where people feel like that is fair to say
I think most people on this server would not accept AI, many would not accept using an engine, very few in handmade would accept even using SDL or glfw
it's just a spectrum and it's up to the dev to figure out where they're on it
I might get bored and have a second side project where I just use zig and SDL, including SDL GPU to make a silly game and switch between that and this project
anyway back to UI
true
that would be cool also
maybe even a 2d game so you don't have to learn all of 3d art stuff
I think a small snake sized game in zig and pure SDL I could do in a weekend
I already think I am pretty good with 3D art stuff though
basic PBR I think I can get working pretty quickly
my limits are GI and screen space stuff, which I haven't ever done yet
nicee
the 0 should be round too π
or at least 2 opposite corners, then it could go with the sharp 2 and 5
beautiful
the tringle looks somehow 3d with that background
I fucking love update modals suddenly sprining up in the middle of me trying to concentrate on something
and I also love installation wizards that need 5 confirmations to just install the update
oh and then reboot the machine

my focusrite works on linux btw π
what's focusrite?
audio hardware
i see
sorry about the negativity
something I'm doing on my cpu rasterizer is really slow
π ±οΈrofile?
huh
I think so
I am creating my own font right now lol
it's actually not super hard
nice
there's a win32 function you can call to capture the stack pointer of any thread
and another function you can call to get the stack trace
you can do a lot with just those
found the slow thing
// p_mix2 - input should be a value from 0 to 1
float4 p_mix2(float4 colors[2], float input) {
float4 linear = srgb_to_linear(colors[0]) * input + srgb_to_linear(colors[1]) * (1 - input);
return linear_to_srgb(linear);
}
internal f32 to_linear(f32 r) {
if (r <= 0.0405f)
return r / 12.92f;
return powf((r + 0.055f) / 1.055f, 2.4f);
}
internal f32 to_srgb(f32 r) {
if (r <= 0.0031308f)
return r * 12.92f;
return (1.055f) * powf(r, inv_gamma) - 0.055f;
}
this p_mix2 function
I guess I shouldn't be doing this conversion for each operation XD
I'll fix it later
it's really slow
everything should just be linear
I blit everything to a swapchain image that's srgb
so I don't even need to do this
and just use linear color space
I wrote this code before I was blitting to the swapchain
I guess I'm cheating a little on my cpu software rasterizer by doing that, idk
it's just a one off function for testing right now, I don't want to keep it
wasn't sure how I was going to use it when I wrote it
and I don't like it
I mean it does the job
I think I maybe wanted to make it be able to mix n number of colors? idk
i was just curious, perhaps it was a muratoriism
mixing n numbers will most likely turn into various overloads with n parameters, where n is most likely not going bigger than 2 or 3
there's no overloading in C
then its mix2, mix3, mix4 etc
yeah
what I can do
is pass an arg with a size
and use *pointer
and then I wouldn't need the mixN
well write it when you need it, otherwise keep the code readable π
have you slept already?
I'm a short sleeper also, but on the weekend I usually manage to get in 8
I think maybe I'm putting myself at risk in my old age by getting so little sleep
I sleep like 4-5 hours :/
you can pass VLAs as parameters but the syntax is weird
converted my colors from srgb to linear at definition time and removed all the conversion at op time and fixed my perf
how? by initializing everything as static? or has c constexpr now?
c does not have constexpr
c11 does i thought
I think it's only for variables though
oh, I don't want to use any of that
then you should also use c89 and declare all variables at the top of the function/scope please π
I want to write C in such a way I could write my own C compiler for it
I use block scope
hrm
I wonder if there's a measurable difference in perf for using srgb draw images that get blitted to an srgb swapchain image vs using linear draw images, I'm using a linear drawimage
the draw back is that it looks like shit in renderdoc as it draws, and it doesn't look correct until the swapchain blit
your bro filer should be able to tell
yeah
since maybe it has to convert a huge image to linear and back to srgb any time you do anything with it? idk
maybe it's not a big deal
probably hardware support for it or something
since its all magic number constants i could imagine its all trivial and the compiler gets rid of them somehow
but i dont know
it was really slow on the cpu, but I was doing it in a dumb way
multiple levels of dumb
there are also various optimization levels a compiler can do/use?
oh yeah also I am building with debug output
bro on his way to compete for pq's spot
no

heh dw just having fun
bs is just jealous
you're explicitly doing this for learning
not like
delusions of actually shipping a thing 
imagine having time to bikeshed 
your thread came back alive was really nice to see
just quit your job
your intel sponza is amazing
or do what I did and get laid off
how do you live jaker, it's not my business, but if there's some secret to it lemme know oks
also we're hiring
it's not gfx
but it's good pay :/
ima try to find the time to make at least slow progress on platinum, i finally found motivation again after a while
so that's nice
well the first trick is to have zero expenses
the second is to have a tech job for a few years
I don't think you're in a situation where you could have zero expenses
probably not
maybe I can win the lotto
can't win if you don't play! can't win if you do play, but definitely can't win if you don't play
cant play if you dont pay
I don't play
it's a rip off
like numerically impossible by 1000x
might as well set your money on fire
actually it's possible to win, my neighbor won ~4 million PLN (~1 mil USD) a couple of years ago 
wow
now they sit around their house and drive their car around the neighborhood all day long, doing nothing
I would not do that
I would be writing even more code than I do now
since I don't write code at work I make the ai do it
ok
it's not the full thing
it's good enough for now
I am now a font designer 
germans are raging π
I know I need all the other characters
but this took a long time lol
and I won't use them yet
i am just teasing
I want these
Box-drawing characters, also known as line-drawing characters, are a form of semigraphics widely used in text user interfaces to draw various geometric frames and boxes. These characters are characterized by being designed to be connected horizontally and/or vertically with adjacent characters, which requires proper alignment. Box-drawing charac...
βββ¬β βββ¦β βββ₯β βββ€β
β ββ β ββ β ββ β ββ
βββΌβ€ β ββ¬β£ βββ«β’ βββͺβ‘
βββ΄β βββ©β βββ¨β βββ§β
βββββββββββββββββββββ
β βββββ Some Text ββ
β βββ¦ββ in the box ββ
βββ€βββ©βββ€ββββββββββββ‘β
β ββββ¬βββ€ ββ
β ββββ΄βββ ββ
ββββββββββββββββββββββ
βββββββββββββββββββββ
it didnt send the message
oh
right click -> "try again"
yeah that, sorry
lol it's a random option in the middle
I have never seen that before
i get that once or twice a year
that looks better
ok
I think I need to create something like an IR for my UI
I wonder if the AI will give me shit over this font
idk I don't care, I like it
it could have easily generated this, I did it manually, because I want to write my own code
I'm gonna look at that movie Jaker recommended
tomorrow start on the real UI
which one? the hunt for the right font?
The Lighthouse
ah
I haven't watched a movie in forever
I mostly just watch scary/horror movies and really old movies
oh yeah
Sinners!
that was the last movie I saw
that movie was fucking amazing
classics and scary movies and a couple of things julia and I watch together
nice
honestly looks great
uppercase k maybe a little top heavy, uppercase p loop could extend one pixel lower
other than that it's looking great
yeah the k was hard, the ampersand too
I tried a bunch of things, idk it's not enough dimensions to make it look any good
I fixed the lower case b,d, f, t, k, i and l
there's still something going on that's slow
it's not as slow as it was but it's still too slow
who needs tracy when you can just comment out the code until it stops being slow 
I should do proper profiling though sometime soon
this ain't no way to build a software rasterizer
idk
scaling, window position, and bg & fg color
let me get rid of those lines
hrm
something is not quite right
characters are getting stomped a bit on the left
ok I can't do anything else until I have proper representation of window contents
i was better on the previous version, it's meant to sit on the x height line
actually hol up
why does your x height increase one pixel for ijkmno
and i think the lower row ones as well
you should either increase it for abcdefg or decrease it for those
but your x height should match
make the stem on the t a pixel shorter as well, it's not a full ascender
/rename Rosy Fontshed
oh
I gotta fix e, g and h thx
and d
and b
hrmmm
I think mn and o are wrong
nah
I think those are the correct ones
let me set one of them up to be a ful line
yeah a through are wrong
good eye, thanks!
that was actually an albatross π€ (but I thought it was a seagull at first too)
an albatross also makes more sense thematically
because it's a strong maritime tradition that they're bad luck to kill
"lighthouse jobs near me" 0 results 
I don't think they're manned anymore

gps stole all the jobs
and reliable electric lighting
apparently most active lighthouses are serviced by the coast guard
you can probably get in if you score top of the class on their entrance test/training thing
I bet you can get a waiver since you have prior service if you really wanted it badly
not like the coast guard is the most physically demanding branch unless you're a rescue diver or something
rip, there are probably 50 year olds in the coast guard though, although they got in from the bottom
I've heard some hilarious things about the physical condition of older navy guys from one of my friends who was in sealift
a lot of similar duties for states don't have such an age limit
like the State of California might have similar jobs for example, I don't know why the federal government has age limits
I should actually talk to a professional career councelor to find out what's next for me
I don't think I want to keep doing this shit with AI
I wish I had a business idea
you could always go for the merchant marines, I don't think they have an age limit so long as you can pass a USCG physical, which is easy as hell
I think there's huge gaps in the game dev tools industry, but I don't know what someone would actually pay for
maybe MJP knows
merchant marines is a really hard life
also, not very good internet
torrent what you wanna watch for the next 6 months, leave your family
that about covers it
I will just download the vk/spirv spec and latest clang compiler bring my laptop, some ebooks and come back with a full single player game
not having had to bikeshed anything on this server, maybe 2 games
also wait did you formally get fired
sounds stressful
do they understand the concept of the swiss cheese model of failure
yes, it was specifically brought up
yes and they took a power drill to the cheese
honestly I actually feel very supported right now
but I still personally feel bad about it
I have definitely been one hole away from getting cheesed before
almost lost a month of production data the day before audits started
luckily it was a quick backup to restore, but it was a few layers down in the "where tf do we restore this data from" search
I can feel that level of in the moment panic in my bones reading this
try not to overthink it
I'm going to make a tagged union for my UI window contents
it's what I should also do for my render graph
typedef struct UIWindowComponentText {
const char *text;
u32 size;
} UIWindowComponentText;
typedef enum UIWindowComponentType {
ui_window_component_type_text,
} UIWindowComponentType;
typedef union UIWindowComponent {
UIWindowComponentText text;
} UIWindowComponent;
typedef struct UIWindowContent {
UIWindowComponentType content_type;
UIWindowComponent content;
} UIWindowContent;
struct UIWindow {
// ...
UIWindowContent *contents;
u32 num_contents;
};
lemme see if this works
with a tagged union is the size of the thing the size of the largest type in the union and it does type punning or the size of all of the types? I will investigate, just because I am curious
oh, it's not the size of all the union members combined, but greater than the largest member
interesting
much smaller though than the size of all the individual member types combined though
so this better than a fat struct
Tagged unions and similar constructs are one of my favorite things
yeah they're nice
in zig they are really well supported in zig and I used them then all the time
I was a little spoiled by that and avoided using them in C++ since there's std::variant
but now that I am writing C I shall use them
I went on the obligatory functional programming bender some years back and I think the main takeaway I got was "wow ocaml sure got it right with these things"
I never wrote ocaml but I wrote some haskell once
yeah I really got into functional programming also for like a few years
reactive programming etc
I'm sorry for that time of my life was lost to that, but I am glad I made it out, many don't
I would recommend everybody makes the mistake because there are some good ideas in that sphere, but getting lost in the sauce is dangerous
I was watching jon blow give his talk about jai at some functional programming convention, which in itself is crazy since jai isn't anything of the sort, and all the other talks were just talking about code, and how the code looked better and how beautiful the code looked, and then jon gets on stage and demos an actual game, like an actual thing, not the code, he briefly shows screenshots of jai which looks a lot like C spam and not even remotely functional, and it just struck me how this focus on how code looks and how programming feels vs look at what I made and how it performs was just really funny
it's a bad signal when someone talks about a language, and shows what the code looks like and how it feels to program in it, and not demoing some awesome thing someone actually made with it, I'm just going to tune out . I dont' write code to write code. I write code to make things
and I think this is mostly true from my experience with functional programming
totally anecdotal evidence though
I wish I had started programming with C
and not a higher level language
I'd be a totally different, and better engineer
I know I was definitely into the β¨ aesthetics β¨
yeah me too
all I care about anymore is what the pixels looks like and the perf
the code can be whatever
I do want my code to be readable and maintainable
All I know is that I really wish I had not had to unlearn java-isms when I started programming. I do think MIT back in the day was on to something when they taught scheme for their introductory courses. No syntactic fluff, all about problem solving with a simple tool.
My programming education was rooted in common sense from a period that I view as full of mistakes
yeah me too, I am fully self taught and just was exposed to the wrong information
there was a brief moment early on in 2007, when I read K&R and I started writing in C where I could have made a change, but at the time I saw it more of a oh sure I can build my own datatypes and such, but I get all this for free with python, which was a big L take and I just didn't know it
I was writing web apps
I still liked making website applications back then, before it lost all its novelty and became boring microservices/k8s and frontend build systems
skill issue tbh
it's literally the easiest thing
toolchains are really nice and all the frameworks are well documented
though there are plenty of footguns and bad tutorials around
i do agree it's boring though
yeah that's what makes it hard
yea 
drowing in noob traps + boringness inhibits mental retention
and willingness to experiment
CSS is one of those things where I wish I just knew it but I am not at all willing to put in the effort to figure out the "right" way of doing it
you largely don't need to really touch CSS much anymore, just customize a Material UI library
you'd have to want something very unique
It's so much easier to not worry about all the current trends and just write c++/python/whatever that runs on a box and marshals data around
is that how you get those aggrivating "professional" looking infiniscrolling websites
yes
but you can have pagination if you want
I hardly ever see a PR with a CSS diff
maybe it's just like that at my work
I don't really work on the frontend much
oh god please do not use mui
it is actual garbage
modern css is super shrimple, you only need to learn a tiny subset of it
most of the shitty complicated layout stuff has been deprecated in favor of flex/grid everywhere
and they are so good
like if i was building a ui system from scratch i would just copy css flexbox and grid
if you're building like internal tools where nobody cares how it looks it's fine
5 years of applications built on top of it now
I just kinda disagree but it's ok, sure there might be better options, but our UI is pretty amazing
but if you have a client they will ask you to change how this button looks and then you'll have to start yeeting !important all over the place
it also (i'm talking about the react library here) pollutes the hell out of the component tree making the inspector useless and bloating your payloads
https://www.conductorone.com/demo-center/ if you want to see what it looks like
that doesn't look like mui, not the one i know of at least
you sure you're not talkiing about some other component lib?
like one that's actually good 
oh ye that's probably fine tbh (though, web components lol
)
i'm talking about a popular react library called material ui
I think that's it
afaik it still implements material design 1.0
like you know
the ancient android lollipop one
with all the shadows
that's what that is no?
oh I don't know, this is a react UI framework
I actually don't know anymore it's been so long
idk the stuff you sent from your company looks nothing like mui, so either it's some other lib or your frontend devs are doing a lot of work 
i hope for their sake it's the former
I don't want to and probably shouldn't lol
we have really good frontend engineers
after working with mui for a couple years
i do not like that library
but hey, it could be worse, could be chakra
it's kind of crazy how all these decisions I made early on are now like what the full application is built on
and tons of engineers working on it
and I don't even know how it works anymore
yeah things tend to snowball like that
in my very first job i was asked to build a prototype for a new ui for our biggest client
this when i was like 19 and had months of work experience
so ofc i slapped together something awful in angular (what we used at the time) just to show off to the client
and of course that ended up in production
it was actually... not horrible tbh
imagine if you could actually see all the intern code pushed to production across all apps/products
i did a lot of work to improve it over the following years
is this angular 1?
ended up learning a lot from having to deal with my own shit 
also ended up as effectively lead developer managing the frontend side of a 6-7 person team with like 2yoe
i did not get paid a lead developer salary
i left

thankfully not, but it was still angular
yeah and when i started using them it was immediately obvious why
the implementation is awful but it has such a nice api especially once function components became the norm
angular was far too oop-pilled and component lifetime management was an absolute nightmare
I never used angular much
prior to react I used google closure, and how they abandoned it to switch to angular left me burned from using any of their frontend libraries
yeah don't trust google tech unless it's super proven 
it took me like 5 years to trust flutter
react has such a huge community around it it just can't die, even if the core team stopped maintaining it someone else would pick it up
nextjs is also kinda the "official" react framework in everything but name (iirc something like a third of the core react team works for vercel)
i wonder if they're ever gonna come out with the compiler stuff, in theory that would fix a lot of react's performance issues and bring it in line with stuff like svelte
that side of web development i actually do find really interesting/fun, building the frameworks themselves
I was always intrigued by dart, but never did anything with it
got fps counter
a nice 13fps
for my cpu raster
once I turned on OBS it started dropping a bit
there's an issue with the full window size not being drawn
but anyway, I got useful text now
is it multithreaded? i feel like it should be able to go faster than that
oh
it's just all speculative maybe this will work code
I want UI controls before I do anything else
I can't debug stuff without UI
i managed about 50fps with a decent number of tris on screen in my super naive cpu renderer i did for a uni project last semester, and that was single threaded running on qemu so i'm sure you can go way faster
I don't want to go into the code and change hard coded values
to see things from different angles
(though it was pretty low res, like 800x600)
try profiling it, with a cpu rasterizer drawing pixels itself is probably the bottleneck
I'm not worried about the fps right now
I have to also write a profiler to be able to profile
I'm going to work on UI some more for a bit
i actually had worse perf with one fullscreen tri than like 1500 tris covering 25% of the screen area 
just do offline rendering and never worry about fps again 
the offline RT renders look amazing
I have waited for a Maya Arnorld render to render for a bit
and Marmoset too
it's always so nice how things look if you let it render for a while
worth the wait for a pretty frame
at 13 fps I probably will need to start on perf right away if I can't interact with the UI
yeah
my renderer has so many issues tho 
turns out doing physically based pt is hard
who would've guessed
is it debug build
I'm just calling the clang compiler with cli args in a bat file I don't have the concept of build types
so I'm not telling it to do any optmization and I am telling to output debug info
so maybe it's comparable to a debug build
ye
only "optimisation" I did so far is AABB for the triangles
this is good enough for deccer cubes but not enough for sponza for me
your sw renderer can handle sponza? 
the one i did had shitty gouraud shading and handled up to a couple hundred tris
oh and no clipping
no
ππ
tbf i wrote it in an afternoon mostly from memory lol
i actually added it for fun to a computer arch assignment, the actual assignment was building a kernel
still a wip
that's cool
it was very fun
did u make gui n stuff ?
for my OS class I only had to do a FAT16 read only filesystem
can't imagine having to do a whole kernel π
oh we're not doing any fs stuff
it's a super barebones kernel and we didn't have to do the bootloader
i'm actually doing the os class rn and the final assignment is upgrade that kernel to support processes ipc and stuff
damn that's epic
so now that it'll have an actual mmu and the ability to alloc heap memory yeah i do plan on adding a little gui environment
i did do some fancy stuff for the shell tho
like color escape sequences, command history that kinda thing
nicee
honestly super fun assignment, i'm a student teacher assistant in that course now
hold on i probably have some screenshot of the 3d graphics stuff
we had to do a little game as part of the assignment (ig mostly to test our keyboard driver and stuff was good enough to work in sorta realtime), we went waay overboard 
and did like a simple terrain gen and actual physics and stuff
oh and made the players capybaras because it was funny
capybaras are very cool furry frogs
amazing userland program
(game is "userland" but all the 3d graphics stuff is a kernel api lmao)
sparky capibara golf ?
kernel
oh
also very fun
you learn a lot about how things work under the hood
i get to implement a scheduler in like uhh
two weeks 
comp arch and os are probably the best courses in uni so far, really fun and learned a lot
Architecture and my graphics courses were the peak of my college course enjoyment. I regret dodging compilers.
yea i have a compilers class in two semesters should be fun
technically it's next semester but i'm doing an exchange semester which shifts things around
i thought of taking compilers now so i could do optimizing compilers on exchange which seems really interesting, unfortunately it's taught in swedish 
graphics in my uni is kinda ass
i've been told it's just threejs 
horrible
yes 
wanted to do some graphics in my exchange semester but the gp classes are all autumn semester, i'm going in spring
sadge
i'll just have to keep teaching myself gp
tbf i'm probably above introductory uni course level at this point lol, pbr book and this server taught me a lot
and yet still feels like i haven't even scratched the surface
I don't know shit and I think I am above introductory uni course. I literally worked through an introductory uni course text book last year though
so I'm sure you are
is it even possible to know shit
every time i learn a thing i learn of three more things i don't know 
same
cool I made the AI happy and now I can focus on the next UI thing
draggable and resizable windows
once I have that I can add a slider
once I have a slider I can start working on making progress on rasterizing
I may need to start on a profiler though
maybe I can find what's slow now without it
for a profiler I was thinking a profiling thread where I define markers at compile time and then send ints that refer to declared markers to the thread from where application code runs and get high resolution times in that thread without interfering the actual application code
idk what the UI would look like, maybe it just starts as a log output

doesn't print "secret" prints "?"
it's already on msvc, clang etc
it talks about reflection
for loops over your class members :o
and parameter lists
it's like zig comptime
the question mark in a diamond is just how some fonts represent an invalid character
you'd have to inspect the numerical bytes to see what they actually are
well the speaker was saying it wouldn't be leaking what was previousily written to memory
oh
this is reflection stuff is not C++26
it's C++29
ok, anyway
back to ui stuff
tf is ^^{} lol
I'll have to watch that
being able to generate functions like that would be cool
apparently can generate code into C++ files in C++26 for some of the things that are on the earlier slides
using std::meta::info;
using token_sequence = std::meta::list_builder;
consteval auto is_nonspecial_member_function(info mem) {
return is_function(mem) && !is_special_member(mem) && !is_static_member(mem);
}
consteval auto parameter_list_of(info func) -> info {
auto ret = token_sequence{};
for (auto param : parameters...
lol the embed
I have crossed the 10k loc mark in my new project π
C:\Users\Bjorn\projects\code\palinode>tokei
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
Batch 6 110 81 9 20
C 18 7922 5399 1656 867
C Header 17 2454 2208 8 238
JSON 1 7 7 0 0
Markdown 1 1 0 1 0
===============================================================================
Total 43 10494 7695 1674 1125
===============================================================================
all it can do is render some triangles and print some characters
the chars put me over
which is kinda cheating
being able to drag a window around will be like the first dynamic thing I'll add to this project, the only sorta thing I have is hitting 1-6 to trigger which render graph to use
oh nice a third way to do metaprogramming 
the \ slash syntax hurts readability I think
ok I fixed my window dimensions not fully drawing beyond the text component dimensions
let me stick another text component in there and see if that works
holy shit that just worked π
I need floating point scale next
when window title ?
that's next
going to add a window bar and put the title in it
and make it draggable to reposition the window
epic
my font looks horrible with non-integer scale values
I think it's my math
obviously
but also the font
I use bing to set my daily desktop wallpaper, I think the universe is trying to tell me something π¨
jk
it's just some birds
I'm fine
totally fine
ok
ok I guess window bar is next
well
if I shrink my window I get perf
so
feel like there's a low hanging fruit here somewhere
how do u draw the triangle ?
Within its bounding box iterate over every pixel and check the barycentric coordinate
Which is dumb
I will fix that soon
I think if I break my bounding box into smaller boxes I could tell from the bc coordinates values if any part of the triangle will be inside
and skip empty areas
I could also work on those smaller boxes concurrently
I also will need a depth buffer and use winding order surface removal
I should memcpy window background colors as full rows
yea this can be useful for large trongles iirc
been working on making my non-integer text scaling better, it just can't look good for values under 2x so I just set it to not scale and be 8x16
was really unhappy with that code and it's cleaned up now also
now I can work on a draggable window title bar
π¨π³m, cuda, compute shaders also work
you mean software rasterizer
ah ok
a thing that rasterizes on the cpu
its the same code anyway
: )
and the gpu stuff is all happening in work groups
ye parallel loops rather than one loop
i was somehow picturing blokens driven by that cpu rasterizer
I can't use simd anyways I think it has to be 32 byte aligned https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/mm256-store-si256.html
so align your shit properly then
I'm trying to fill a window of arbitrary dimensions with a background color
I can't align it like that
you can align the parts which can be aligned and then just fill the rest as usual?
yeah, that makes the code too complex, but that could be something I do later
ah
I was just looking at maybe it was a quick win
or just dont allow resizing
I'm talking about ui windows, and I definitely want to be able to resize my window
this is just a for me project
aye
well I guess I will keep all this existing logic then
make the buffer a few px larger
and throw out the excess pixels
simd can be a win but it's never quick 
there's just one buffer
one bitmap
for the full screen
the windows are sub sections in that
copying to additional buffers isn't going to make it any faster
I can't overwrite the values in that map, that would overwrite previously rendered pixels
i see
I guess at some point creating and copying additional oversized 32 byte aligned buffers will be faster than rasterizing a bunch of surfaces using just one bitmap and worth the extra code complexity
probably ye
ok got a title bar
added some helper methods for rendering text, scaling and padding
now I need hover over detection behavior
I don't even have any cursor input right now
it all works with my scale setting too
and I can of course add and theme multiple windows
lol those windows have a huge perf impact though
I'm going to worry about the perf later
this is on the CPU
What resolution is this?
yeah whatever it takes
just trying to get the behavior where I want it
and then I'll make it faster
this perf is bad enough I can't add a second triangle
so I will have to fix it before then
honestly assuming a modern compiler it's probably better to trust the compiler and do what's algorithmically faster
unless you get into simd stuff
latest clang
Thats why I said read, not write
then yeah i might just straight up write asm lol
yea but do you really want to spend your time reading clang -O3 output 
Its actually easier to read O3 than O1 imo

O1 is doing a bunch on unnecessary shit so its sometimes confusing
fair enough, no-opts is utter garbage
at least for gcc
i haven't actually read clang output
but given how c compilers work (single pass with opts off) it probably produces garbage code too
it would also be nicer to read if it was a better arch 
this is -O3
Clang produces pretty good code in my experience
told ya, triple fps for free
O3 ftw!
does it hurt debuggability?
yes
Yes
ok
this is why you have separate debug and release builds
I will turn that right on off then
I mean I don't need a release build
this is never getting released
no, but having the extra berf is nice when you're just testing stuff
I run in release by default, I only switch to debug if I need to
and when you need to gdb the thing out comes the debug build
it seems to take about 100ms longer to build with -O3 I think
having two builds is literally two lines in your makefile
yea you'll get longer build times
be glad it's only 100ms 
Yeah but the app usually takes less time to start up too
then again this isn't cipipi so your build times should be fine
when i did cpu stuff perf was measured in minutes per frame so working with a debug build was definitely out of the question 
but for the triangle thing it probably takes less than 100ms anyways
I guess the good thing about running in release is you'll catch the UB that you might miss if you're always running debug mode?
Yup
also yes
yea, but running an optimized build helps a lot
it'll make your life generally better
ui looking nice btw
font looks great 
thanks to your help
i'd still take a pixel or two off the top of the t if i'm being super nitpicky
I like that t
ight understandable
I like that I can theme my windows differently, idk if that's a thing you can do imgui
lol my windows wrap unintentionally
I need to fix that
yea last sw thing i did (vga driver for that kernel assignment) everything wrapped lol
except the one function to draw wrapping text that actually cared about screen bounds
if you drew out of bounds vertically you'd overflow the framebuffer and summon nasal demons tho 
easy fix
yeah this was just straight UB
ye same here
kernel level ub 
you can probably ace by drawing the right pixels out of bounds lol
ezpz
oh I found this I should read https://haqr.eu/tinyrenderer/
it's a full course on software rasterization
I don't think this a course for a real time renderer though
but useful to look at anyway
yeah it just renders to a file
maybe I move all this to the gpu
I'm going to see how far I can get on the CPU
in real time
I don't want to do any offline rendering though
with multithreading and a lot of optimization, pretty far probably
iirc someone posted real time pbr on cpu stuff a while back
bjorn will be NIHing his own profiling tools so optimization is gonna be a challenge until then
Yeah I have some ideas around that
if, and it's a big if, I wanted to NIH textures I'd have to do a bunch of this
but there's like an iterative process once I get basic png working
the other thing is animations, I really don't want to support a json format
and idk what the alternatives are, I like obj but it has no animations
looks like I can export bvh and obj from maya
you are making your own image loader as well ?
well
if I am using no libraries
I'd have to if I wanted to have images
I can cheat here
there are some very simple formats
I think png is simple
idk
it's true I could start even simpler
that could be v1 yeah bmp
the cheat could be my packager I wrote for rosy, it's a simple format
I don't want anymore offline separate CLI tools right now
including slangc
yeah custom format would work too
ppm my beloved
π²π²
it's not very good, but it works. I should interpolate the movement and do it proper like as I make the UI better
do something with the cursor
idk
ooh nice
might want to make the color change condition (mouse_over || dragging) instead of just mouseover to avoid the flickering
i'm assuming you already have a dragging flag somewhere in your state so it should be trivial
yeah
nvim's lsp keeps adding wrong headers I need to tell it to stop automatically adding headers
yeah it does the same thing for me
not wrong headers, but like
stuff that's already included indirectly through some other header
the funny thing is the lsp knows it's there, but the autocomplete adds the header anyway
I need to set --header-insertion=never somehow
return {
cmd = {
'clangd',
'--background-index',
'--clang-tidy',
'--header-insertion=never',
},
filetypes = {'c', 'cpp'},
root_markers = {'compile_commands.json', '.git'},
capabilities = capabilities,
}
hrm
cpp
why is cpp in there
that must be copy pasta
it must be purged
I just gotta be reading specs and docs and code whenever I have time tbh
And writing notes
I am going to get an iPad to read with and write on
get a paper notebook
then I have to carry two things and use two things
I think these will get me to a basic crude profiler
You can use the events to debug an application and perform capacity and performance analysis.
can query cache faults
Carrying a paper notebook is good for the soul though
yeah they are nice, but on the bus I have enough arm space to barely hold my phone
paper is nice, but i got an ipad for uni stuff and i can't go back
effectively infinite paper, being able to delete stuff any number of times, move stuff around after the fact and all that is just too useful
you can use an ipad on the bus? 
why can't I?
at a lean 188cm 100kg I have big man privileges and don't have to worry about theft
I have seen people's ipads being swiped off of their table at restaurants
idk if that's going to work on a bus
I do like paper notebooks
I just need to be practical in this case
there is this device if you want paper feeling and smart device
https://remarkable.com/
looks amazing
I think I will just get an ipad though because then I can find it when I lose it
as I always lose everything
I have an air tag on everything
and I have to use my iphone to always find my shit
I guess I could stick an airtag on this thing
I am looking for something to take notes and do programming for uni. This would be greate choice for you
I was thinking about 2-1 but they suck so. notebook and maybe graphical tablet 
it's weird that they don't explain what documents they support
Document support
PDF, EPUB (importing)β¨
PDF, PNG, SVG (exporting)
those microsoft tablets were nice back in the day, I knew a few people that had them
I dunno if they hold up still
there is some export of pdfs
it looks so nice, i want to try one
but it's the same price as an ipad air for the nice one which makes it very hard to justify imo
since the ipad does quite a lot more + becomes a second monitor for my mac
yeah if apple would allow mac os on ipad it would be amazing
yeah but they'd never do that, the ipad pro would cannibalize macbook air sales 
I would buy ipad immediately
fwiw they're adding a bunch of very macos-like features to ipados 26
it all but has a full on desktop environment now
Yeah I will buying a macbook since its cheapest laptop with 13" display and amazing battery life and perf 
they're clearly aiming for a unified environment but doing so very slowly
honestly base macbook air is amazing value
I think the pressure dropped since microsoft stopped making their tablets
thats what I am buying 
the m4 one
i don't think the pressure was ever really there tbh, windows tablets were terrible 
idk if I will buying one with more than 256GB storage
I just remember people taking notes on them in high school and the pens seeming decent
windows never worked as a touchscreen os in spite of ms best efforts, it was clunky as hell
plus it running full windows 10 was kinda mindblowing when you got used to the apple environment
and you either got arm (nothing works) or x86 (battery life is dogshit)
yeah I might have much worse memories of them if I had my own instead of witnessing other people use them lmao
the thing is it's a nice gimmick but mostly impractical because desktop apps just don't work well on a touchscreen
apple is absolutely keeping ipad os limited to avoid eating into their own macbook sales but there's also another factor in play imo
they prioritize a smooth ux over user freedom
that means no, you don't get to run desktop apps on your ipad if we can't ensure they'll be absolutely flawless on the touchscreen
in the long term web is probably the great equalizer there anyway
and that's pretty much impossible without just making it two apps as ms has shown with the failed windows 10 uwp initiative
people who have the capability of shipping an app that can run in desktop and mobile modes do so today by having a unified codebase with electron
desktop and touch ui is just too different
get 512 if you need it, more than that isn't worth it imo
apple waaay overcharges for storage
is it soldered in
i have 512 in my mbp, enough for everything and i just use an external ssd for photos
the ssd isn't
iirc
the ram is (it's part of the soc)
but you can swap it if you have really good technician but its finicky 
yeah i wouldn't do that
just buy whatever storage you need on the go
probably the biggest flaw with macbooks tbh
apple being stingy with storage
its just apple
no reason either, ssds aren't even that expensive even if the ones in macbooks are pretty fancy
The macbook is going to be my first apple device
have you used macos before?
a bit
ight just make sure you actually try a mac for a bit before you go and buy one
it can be quite different coming from pcs in some ways and some people hate them
it was the opposite for me lol i got an m1 air for work and immediately loved it
I have some nit picks but its just matter of getting used to it
if you're used to dealing with windows setup taking the thing out of the box and having it ready to use in like 30 seconds and no online bullshit is amazing
yeah only pain might be the setting up the dev stuff
but for sure I am going to customize mac os. From what I have seen the tiling is bad and other stuff
get rectangle, hotkey to wherever, done
depending on what you do it's either amazingly simple or a pain in the ass
C++ 
if you do vk you'll have to go through moltenvk
what are you targeting
if you just target macos it's no different from linux
web dev is fine but the vulkan stuff is a bit iffy with rt
mesh shaders should be fine
somebody has a fork for it
no support in moltenvk
and no ootb support planned in kosmickrisp since it's an extension 
there goes my plan of rewriting platinum in vk 
I might as well wait for it or implement it by myself
goddammit
tbh metal is a very nice api if you don't mind the objc shit
I recommed daxa if you dont want to deal with raw vulkan 
(btw sorry for hijacking your project thread bjorn)
I never bother with stacking for my UI. I wonder why it is that slow
With modern CPUs you should be getting hundreds of fps for few quads
I'm painting each individual pixel
just assign values to a pointer to the bitmap
Bitmap is coming from windows API?
no
it's just bits
I copy it to my draw image in vk and blit it to my swapchain
no windows api involved
if I get rid of the ui and triangle this is very fast
I'm just doing something dumb
Hmmm. I will try it when I come home in 9 hours. It's really weird it's that slow
it's just dumb ui logic I'm sure
I'm going to write a profiler and make it go faster
I wanted to suggest Tracy but you are going full nih 
ya
Then VS profiler is a choice
I don't use VS
Transferring data like that from cpu do GPU should be really fast. I was spamming 190k copy buffer to buffers commands with 64 bytes each. It took 90 ms because I had a small bug
yeah it is very fast
You could hook it up for sake of profiling
it's just a lot of logic to draw the window
I know I want to write my own profiler
I'll just start working on the profiler next
makes sense to have that before I start on doing more on the rasterizer side
not with a naive singlethreaded no simd approach and not at that resolution
if the screen is 4k that's a lot of pixels
For 4k of course not. I have no idea what resolution he is running. But for a window 1280x720 for few quads then yeah
yea that doesn't look like 720
