ERROR phobos::core::debug > [VALIDATION]: VUID-VkRayTracingPipelineCreateInfoKHR-layout-07987 (1242222997): Validation Error: [ VUID-VkRayTracingPipelineCreateInfoKHR-layout-07987 ] Object 0: handle = 0x72303f0000000052, type = VK_OBJECT_TYPE_SHADER_MODULE; Object 1: handle = 0x7ddd740000000051, type = VK_OBJECT_TYPE_PIPELINE_LAYOUT; | MessageID = 0x4a0ad195 | vkCreateRayTracingPipelinesKHR(): pCreateInfos[0] VK_SHADER_STAGE_RAYGEN_BIT_KHR has a push constant buffer Block with range [0, 136] which outside the pipeline layout range of [0, 128]. The Vulkan spec states: If a push constant block is declared in a shader, a push constant range in layout must match both the shader stage and range (https://vulkan.lunarg.com/doc/view/1.3.250.1/windows/1.3-extensions/vkspec.html#VUID-VkRayTracingPipelineCreateInfoKHR-layout-07987)
ERROR phobos::core::debug > [VALIDATION]: VUID-vkCmdPushConstants-offset-01795 (666667206): Validation Error: [ VUID-vkCmdPushConstants-offset-01795 ] Object 0: handle = 0x250c95a24a0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x27bc88c6 | vkCmdPushConstants(): VK_SHADER_STAGE_RAYGEN_BIT_KHR, VkPushConstantRange in VkPipelineLayout 0x7ddd740000000051[] overlapping offset = 128 and size = 8, do not contain VK_SHADER_STAGE_RAYGEN_BIT_KHR. The Vulkan spec states: For each byte in the range specified by offset and size and for each shader stage in stageFlags, there must be a push constant range in layout that includes that byte and that stage (https://vulkan.lunarg.com/doc/view/1.3.250.1/windows/1.3-extensions/vkspec.html#VUID-vkCmdPushConstants-offset-01795)
#DARE (Danny's Awesome Rendering Engine)
1 messages · Page 5 of 1
are these used in the shader
shader reflection is running for rt pipelines too yeah
and theres no special handling for them there
Ahhh that might br why
Let me try using it in the shader
ERROR phobos::core::debug > [VALIDATION]: VUID-vkCmdPushConstants-offset-01795 (666667206): Validation Error: [ VUID-vkCmdPushConstants-offset-01795 ] Object 0: handle = 0x201b6126490, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x27bc88c6 | vkCmdPushConstants(): VK_SHADER_STAGE_RAYGEN_BIT_KHR, VkPushConstantRange in VkPipelineLayout 0x7ddd740000000051[] overlapping offset = 128 and size = 8, do not contain VK_SHADER_STAGE_RAYGEN_BIT_KHR. The Vulkan spec states: For each byte in the range specified by offset and size and for each shader stage in stageFlags, there must be a push constant range in layout that includes that byte and that stage (https://vulkan.lunarg.com/doc/view/1.3.250.1/windows/1.3-extensions/vkspec.html#VUID-vkCmdPushConstants-offset-01795)
hnnn
i have no clue why this bug is happening
hm
Mat4
Mat4
u32
that shouldn't be an issue...?
I think phobos borked
layout(push_constant) uniform PushConstants {
mat4 view;
mat4 projection;
uint frame_id;
} pc;
if (pc.frame_id > 1) {
vec3 old_color = imageLoad(old_image, ivec2(gl_LaunchIDEXT.xy)).rgb;
// Caulcate contribution
float a = 1.0f / float(pc.frame_id);
// Mix the old and new colors together
vec3 final_color = mix(old_color, payload.incoming_light, a);
imageStore(rt_out, ivec2(gl_LaunchIDEXT.xy), vec4(final_color, 1.0));
imageStore(old_image, ivec2(gl_LaunchIDEXT.xy), vec4(final_color, 1.0));
} else {
// First frame, do not worry about accumulation
imageStore(old_image, ivec2(gl_LaunchIDEXT.xy), vec4(payload.incoming_light, 1.0));
imageStore(rt_out, ivec2(gl_LaunchIDEXT.xy), vec4(payload.incoming_light, 1.0));
}
I mean it should be fine?
yet why
it seems like it can't detect the uint push constant and keeps spamming out that one message over and over
does it still work even with that message
no it seems like the shader defaults frame_id to zero. It does run but frame_id is set to zero
ive gotten that message before too and i dont really know where it comes from but it always worked fine for me
hmm
ill have to look into it then
make sure each shader stage declares the same push constant block
even if some variables are unused in that stage
oh each shader stage
wait really?
so like my rchit, rmiss
also should declare the same block?
Ye

wat why
pls fix the error message
i could look into as well
it shouldn't be that bad
seems like you might be forgetting to change the layout size
it's weird though
as keeping two mat4s runs perfectly fine
its in the shader reflection find_push_constants i assume
something is going wrong there
iirc this wouldn't be a shader problem however
ah fuck
hmmm
setting the push constant in each shader
does not remove the error
some good news however
check if the pipeline layout is what you expect it to be
it seems like frame_id is working and it's incrementing up
in the debugger
but the error message is still being thrown
okok will do
OpMemberDecorate %100 0 ColMajor
OpMemberDecorate %100 0 Offset 0
OpMemberDecorate %100 0 MatrixStride 16
OpMemberDecorate %100 1 ColMajor
OpMemberDecorate %100 1 Offset 64
OpMemberDecorate %100 1 MatrixStride 16
OpMemberDecorate %100 2 Offset 128
This seems fine?
uhh
i can't seem to find the pipeline layout
@tropic vigil It says 3 push constants were made
can you show the struct with pipeline layout info
uh hold on
#[derive(Debug, Clone, Default)]
pub struct PipelineLayoutCreateInfo {
/// Pipeline layout flags
pub flags: vk::PipelineLayoutCreateFlags,
/// Descriptor set layouts for this pipeline layout.
pub set_layouts: Vec<DescriptorSetLayoutCreateInfo>,
/// Push constant ranges used in this pipeline
pub push_constants: Vec<PushConstantRange>,
/// Whether this pipeline layout is persistent, e.g. whether it should be kept alive forever
/// by the cache. Use this with caution, as it can cause large memory spikes for frequently changing
/// pipeline layouts.
pub persistent: bool,
}
This one
The push_constants field
ohh okok
You can set a breakpoint on line 349 in shader_reflection.rs
pipeline/shader_reflection.rs
All the way at the bottom it returns the completed layout
self = {*mut phobos::pipeline::pipeline_layout::PushConstantRange} 0x000002317ec47bf0 {stage_flags={__0=256}, offset=0, size=132}
stage_flags = {ash::vk::bitflags::ShaderStageFlags} {__0=256}
offset = {u32} 0
size = {u32} 132
isn't that the correct size?
hmmm
this is your pc block right
yeah
looks about right then
then ig my validation layer is simply built different 
what type is frame_id
u32
thonk
🤔
do you have push constants in any other shader
no i don't
hmm
let me try to update vulkan
so the pipeline layout looks correct
One more thing you can try is lookign at command_buffer/incomplete.rs line 568 and check if the byte buffer data has 4 elements
so uh
news
the issue dissapeared
huh
less noise
@tropic vigil Idfk what happened but the problem went away 
maybe my shader weren't updating?
contact hardening
wtf
and jitter yes
what is contact hardening
oh soft shadows?
hmmm how to contact harden
oh i probably should add area lights to do that
oh no light sampling
oh no
randomize ray target towards the sun by a small amount
good
impl rendering equation time
I will now crush your dreams
o :(
yes except its performance in debug is really bad
It’s way faster than my original method 
I was iterating over the entire image with a par_iter to add the alpha channel
Bruh lmao
I have no clue where to start when learning light transport theory 
I have to also learn some more probability mainly monte carlo stuff (i don't understand why pdfs exist)
man raw vulkan is hard :(
i forgor most things already from learnopengl 
this is big
(i should be learning light transport theory lmaooo instead of learning raw vulkan)
why are you doing this
I honestly don’t know 
I think it would be a cool learning resource for my engine and also to understand what the hell phobos is actually doing
Also maybe defect
LVSTRI you got a version of bistro with the exterior + interior?
aw
I need the scene
I can't find an online one which has lights + emissives
uhh
isn't there any alternatives to bistro?
just diy in blender
also it's time to bikeshed how should i store my lights in my scene
we got the obvious solution:
Buffer containing vec4 -> r,g,b,intensity
i'm gonna dissapoint lvstri
instead of studying
ill just implement rt in one weekend 
i need to see pretty pictures
yeahh but it isn't pbrt level
as long as you read properly 
did you never take a stats course
i only got grade 12 stats
pdf's arent too complicated conceptually
if you understand what a normal distribution is and how to interpret a bell curve you understand pdfs

but the wording is confuzzling
i'm too used to having it be explained to me nicely by a hs teacher
lmao
like i search what a pdf is and 3 different definitions come back
idk i'm following the pbrt one iirc it was something like a pdf describes the relative probability of given variable(s) x occuring
thats not really accurate since your variable is not discrete typically
yeah if it's continious then iirc it describes a domain within the function
can't be a single value well it can I think? but it'll be zero
I still don't get the difference between it and a probability distribution function is however as iirc in my stats class P(2<=x<=4) would cover the same thing unless I'm stupid (i am)
bro
infinity mirrors
are wack
stare into the cube long enough and the cube stares back at you
suzanne
Ok you fucking lost me there bud (explain in gr 11 terms pls)
me neither
:D
i vaguely understand what a domain is
but i cannot describe it to you
but uhh
I can give you a reasonable example
f(x) => x in real numbers
essentially that means [0.0, 5.3] would be in the domain of x
Oh okok so like the same domain/ranges shit as in gr 11 functions
sorta?
idfk man 
domains contain a lot of things
all i know is it's usage within vulkan and co. in terms of algos.
Yea welp I guess I'll have to look more into that before calc and vectors
it's not covered in grade 12 
Oh ok well... before Uni at least!
just understand what the terminology means in your case the grade 11 definition is probably good
GOOD MORNING (i have yet to sleep)
So
today's lesson: store your acceleration structure data in gpu memory
buffer: 102382998272 scratch: 18281826688
nvm
stoday's lesson
implement LODs
you don't really LOD with RT
ah
well it seems like I can't import the scene because of memory limits
shockingly importing 100gb into video memory is a bad idea
what scenere are u using for 100gigs 
he imported an ue5 scene
bro i feel so fucking stupid
i was malding why my transfer buffer wasn't working
only to figure out it was because i forgot to include it in my submit info
Wait what
ash::Device is a fucking reference countedp ointer
what the fuck
BRO
IVE BEEN PASSING IT AROUND
AS AR EFERENCE
THIS WHOLE FUCKING TIME
OH MY FUCKING GOD
BRO
WHY DID NO ONE TELL ME
that's good..?
why would you needlessly increase the refcount
nono
like all my very light abstraciton layers for vulkan
all required me to pass in a device
for everything

i could've just cloned the device
and stored it onto the struct
huh
seems like phobos also stores it in their structs. they put device into their structs as well
brain dead mode time
so like what does x' mean
the derivative of x?
bro im too dumb 😭
fuck man i need to review grade 12 calc
might as well to prep for uni
it's just another way
leibniz tells us to be explicit and use df(x)/dx when deriving
huh alright
probably
will do
hmmmmm 🤔
what does x' represent?
oh the value of the intregral 
i'm stupid
it's just another variable bro
they used x' instead of x because x is already used somewhere else (in the bounds of the integral)
it's just to let you know that this x and the other x are NOT the same
nono i get that i'm just trying to figure out what x' means
OH MY FUCKING GOD
i am stupid
Bruh why didn’t they just call it y or something
We call that subscripts

Math 2 biggest upgrade is "naming limit has been removed, mathematicians can now use variables of any length"
it won't be until calc 2 that it will become ingrained in your brain
highschool did calculus dirty bro 😭 I just only know how to memorize the ideas despite my teacher trying so hard for understanding
I can't ever forget how completely my pants were shitted and pissed, due to the sheer ridiculousness of triple integrals with polar coordinates
And the prof just goes: oh yeah, we'll have 3 of them in the finals, no biggie

legit scared shitless, I can never forget calc now
oh god
ill uh figure out a way to remember that
man maybe the cs + physics minor wasn't the play 
physics is beta math
yeah but i got cs which is pre-release math
"it hasn't been fully tested but it somewhat works so its all good"
just study math on your own bruh

i'm doing that rn
uni is going to be so fun!!!11 (I am going to lose it)
and besides my cs course has calc 1 2 and 3, real analysis, complex analysis, algebra and abstract algebra & more
we have something like 10 classes that are pure math
oh mines is way less on math
uni issue smh
actually
oh my god
only 3 pure maths
we're dying out here bro
maybe i take a math minor to save it
the one I'm for the record
wth is prestige creep
I mean
I even heard some people with 99% averages don't get in waterloo bruh
yeah
(I am done for)
to get into private universities you need money + big grades
give up only two people got into it at my ib school 😭
these are public i think
but if you go to a private uni you're dumb
public means "state regulated" here fyi
so basically the ministry of education handles public unis
oh idfk then
yeah they don't 💀
yeah but grade inflation is insane
maybe i cope for a transfer 
what is grade inflation even
main reason is high schools do it here in Ontario Canada is because they have to if they want their students to get into universities. we need standardized testing so badly
bruh
it's a vicious cycle as if one highschool increases their grades (they do) everyone else does and it keeps repeating
... which causes universities to be harsher and raise the requirements. Infinite feedback loop, fun!
I'm half joking though, for some courses you need to get tested
like medicine, law, etc
yeah ofc
like dawg i don't really like this uni as everything i've seen
points towards it have zero intest in cg
but i guess i gotta make it myself
still in time to book a flight to germany or ireland or smth
it's too late 
well, your masters then
i could transfer
Based
man who knew learning light transport theory takes a long time
Tbh that shit scares me I'm never touching it
I'd rather get stuck in the infinite loop of trying to micro-optimize 0.01ms than learn light transport theory
uhh
maybe place more cameras?
like have 3 cameras
one front
one left
one right
boom
problem solved
🦅 QUADS RAHHH
every time I am amazed at your will to hate yourself this much
One project is using phobos the other is me trying to figure out how to use vulkan
ohh neat
I must go further
write it all in C
AHHH APNIC
ZERO PROGRESS ON VULAN
ZERO PROGRESS OF LIGHT TRANSPORT THEORY
how do I stop being burnt out
step one
sit in front of your pc
step two
do the goddamn work (in alternative, you can either stare at the screen or go lay down in bed)
step three
profit
I’ll trust you
do note that you have NO other alternatives
you sit there and do the work, or you stare at the screen doing nothing, or you go sleep
it works pretty good, I use this method myself sometimes 
that's not on the list of allowed activities sir
I remembered what it was like to have a decent devex
you will now be deported to the mines
I'm jk do whatever you want

LVSTRI has been holding me hostage until I show him a physically based pathtracer
I am now forbidden from touching any asset system

LVSTRI uh do you know of any good streaming + LODing techniques
Tried running this on a 6gb rtx 4050
vram 
For RT? The one I'm working on
completion time should be between 2026 and the heat death of the universe
o-week 
I hate it bro. My math class is the prof teaching us about grade 10 algebra and graphing 😭
that makes sense
he needs to repeat that at some point
as an introduction
Yeah esp with Covid many people are all over the place
They speedrun review and hop straight new content
Man is first year this easy?
You gotta tell me more fam I'm in 12th I have no idea what to do next year
They’re literally reviewing all the way back to 10th grade 💀
Prof really pulled out a parabola and started teaching use the quadratic equation
Discrete math is easy 🗣️
Thank you
Nvm
It’s dogshit
Why the hell do I need to write a fucking paragraph
To just solve 2x-1=1
“It’s correct math” 🤓
There is a fucking reason no one follows it you dipshit
I hate it
Lol
Man all that graphics programming is really useful in discrete. 😅
“Zamn that’s the formal notation huh”
AHHH I REALIZED
I NEED TO DO RAY TRACING
yeah
side project pitch
im gonna get someone smarter than me to actually help me figure out how tf to light transport
im too stupid pbrt.org went over my head 😭
Absolutely real
That way if I get accepted you'll have to pass down the knowledge lol
Who wouldn't want to learn light transport theory all on their own?!?!

Oh actually which one is it
Is it the one that utilizes phobos or raw VK
raw vk is horrible to use
Yea that's what I imagined lol
Phobos is such a nice abstraction imo because it allows me to shoot myself in the foot with vk validation errors which is nice :3
(nah jk I just really like the task graph system. Totally new to me compared to wgpu / opengl)
But i must try
Wanna do phobos 2: electric boogaloo
Except i just only use it myself
thats how phobos started lol
i would strongly suggest to use phobos instead
You guys think
This can also just be applied in Vulkan?
I just need to keep in mind glsl is column major vs hlsl which is row major
You know maybe I should just switch over to hlsl 
Oh nvm wtf
// WorldNormal is the vector towards which the ray position will be offseted.
void ApplyPositionBias(inout float3 RayOrigin, float3 RayDirection, const float3 WorldNormal, const float MaxNormalBias)
{
// Apply normal perturbation when defining ray to:
// * avoid self intersection with current underlying triangle
// * hide mismatch between shading surface & geometric surface
//
// While using shading normal is not correct (we should use the
// geometry normal, but it is not available atm/too costly to compute),
// it is good enough for a cheap solution
const float MinBias = 5e-6f;
const float MaxBias = max(MinBias, MaxNormalBias);
const float NormalBias = lerp(MaxBias, MinBias, saturate(dot(WorldNormal, RayDirection)));
RayOrigin += RayDirection * NormalBias;
}
This is so much better
Cleaner, better, simpler, more like c++, PascalCase
nah cringw
snake_case
PascalCase is nice if you only have 2< capitals
Then it becomes a pain after
I also dfigoured out why my random point algos were f’d
I was using rng(0,1) and not rng(-1,1)
🥶🥶🥶
idk, whenever I look at snake_case it looks like legacy code for some reason
it's so over
how the fuck
what?
these geometry normals are 100% wrong
i tried to convert them to world space
wtf
kekw
i solved it
v0 - v1, v2 - v0 which is wrong
v1 - v0, v2 - v0
now its time for: normal mapping
oh no :(
did you figure out light transport theory btw
i was close
then university
going back to my renderer is like getting a whiplash of flashbacks
i don't think they should? I am using the geometry normals
iirc interpolated should be used if you got a texture, no?
no
oh no
you see here
you can see tringles
if you want smooth shading, you don't want to see tringles
therefore you interpolate
oh yeah getting the 3 normals
i was just calculating the normal of the triangle then literally applying that
spoonza
now its time for mission impossible 2: normal mapping
we did it baby
normal mapping
should i uh
i should probably calculate the tangent coordinate prior shouldn't i
then cross product T x N to be the Bitangent
Hmm how should I handle transparencies?
When colliding with a transparent object, should I just send another ray into the object + apply snell's law?
anyhit shader?
Oh, if refractive transparent object then yeah snells law
anyhit shaders for alpha transparencies
no shot i am not adding mf alpha transparencies
wait no i should
but only for completely transparent
should I: learnt light transport theory
or procrastinate and try to get culling working
so i can load massive scenes on my laptop
and maybe lods??? but no clue how to achieve that on rt
the best you can do is world partition
but why
what's the massive scene you can't load right now
my laptop gpu has very little vram
but bistro
any large-ish scene, my laptop's gpu says goodbye
and im back onto my 12gb desktop gpu
also i wanna render out that 2 trillion polygon nanite scene you had
kekw
LETS GOOOO BABY
DECCER CUBES BROKE IT AGAIN
you can probably do it right now
it's all instances anyways
so your TLAS is gonna be massive
buy a 4090 then
chump change, go for it
the urge
to stop doing work and stare at this picture
i literally just need to implement transmission
but fuck
i actually need to learn light transport theory
or else this is gonna be very fucking bad for me
yoo preview works
How the hell do you make time for personal projects
I haven’t done any serious GP in a while. I forgotten so much 😭
FUCK IT
ill learn vulkan from scratch again
also
oh my god
i forgot this website existed
i wanna kms
i don't need to trudge through pbrt.org and have no clue what half of it is yapping about
its just magic
probably is
HOW
im so lost how tf do get rust_window
to actually enumerate over my required extensions
no examples at all
wtf
what are you doing
btw
i tried getting egui (imgui) working on phobos but kinda borked seems like integration is borked
have you ever actually done a Vulkan app
on your own
I feel like in your case it could be beneficial
no it's why im doing it rn
without phobos I mean
epic
i was on a roll a while ago then i got caught up with uni
uni literally killed off so many projects that were so active
holy shit
i wish i had those skills (first year LETS GOOOO)
the advanced time management techniques are as follows
no sleep
use boring lectures to work on your shit
use boring work hours to work on your shit
do the assignments later deep in the night
by no sleep I mean you should average 3 hours per night
but if you do less that's great
uh huh
my advanced time management technique is as followed
- can i do what i said on my todo list?
- no?
- panik
but true i should probably be doing my pesonal projects in my intro to c courses
someone was caught using chatgpt during our midterm
very bad news
Extension: VK_KHR_surface
Extension: VK_KHR_win32_surface
Failed to create instance: ERROR_EXTENSION_NOT_PRESENT
WHAT
????/
// Extensions
let mut extensions_names = ash_window::enumerate_required_extensions(window.raw_display_handle()).unwrap().to_vec();
extensions_names.push(ash::extensions::ext::DebugUtils::name().as_ptr());
let create_info = vk::InstanceCreateInfo {
s_type: vk::StructureType::INSTANCE_CREATE_INFO,
p_next: ptr::null(),
flags: vk::InstanceCreateFlags::empty(),
p_application_info: &app_info,
pp_enabled_extension_names: ptr::null(),
enabled_layer_count: 0,
pp_enabled_layer_names: extensions_names.as_ptr(),
enabled_extension_count: extensions_names.len() as u32,
};
thonk
snake_case and its affects on lvstri's emotional state
nah that's not it
or maybe it is idk, my code is always snake_case
even my types are snake_case
wat
c quiz?
i finish all the work that is due at the end of each work https://cdn.discordapp.com/emojis/766411783384596500.webp?size=48&name=KEK&quality=lossless
because my intro to c course is braindead
epic
discrete math on the other hand 
that's what i thought
until my prof showed me proofs
and now im scared
but proof by contradiction is the most real one
proofs can either be your worst enemy or your best friend
be someone who thinks of proofs as an ally
i mean some proofs i get like proof by contradiction as it's how ive kinda been proving my code works
but other stuff is just ah
proof by induction and contradiction are the easiest to reason with yeah
luckily, that's 80% of proofs 
thank god 🙏
okay
i geniunely have no clue
what the fuck is causing it to detect zero extensions
fn create_instance(entry: &ash::Entry, window: &winit::window::Window) -> ash::Instance {
let app_name = CString::new(WINDOW_TITLE).unwrap();
let engine_name = CString::new("Vulkan Engine").unwrap();
let app_info = vk::ApplicationInfo {
s_type: vk::StructureType::APPLICATION_INFO,
p_next: ptr::null(),
p_application_name: app_name.as_ptr(),
application_version: vk::make_api_version(0, 1, 0, 0),
p_engine_name: engine_name.as_ptr(),
engine_version: vk::make_api_version(0, 1, 0, 0),
api_version: vk::API_VERSION_1_3,
};
// Extensions
let mut extensions_names = ash_window::enumerate_required_extensions(window.raw_display_handle()).unwrap().to_vec();
extensions_names.push(ash::extensions::ext::DebugUtils::name().as_ptr());
let create_info = vk::InstanceCreateInfo {
s_type: vk::StructureType::INSTANCE_CREATE_INFO,
p_next: ptr::null(),
flags: vk::InstanceCreateFlags::empty(),
p_application_info: &app_info,
pp_enabled_extension_names: ptr::null(),
enabled_layer_count: 0,
pp_enabled_layer_names: extensions_names.as_ptr(),
enabled_extension_count: extensions_names.len() as u32,
};
let instance: ash::Instance = unsafe {
entry
.create_instance(&create_info, None)
.expect("Failed to create instance")
};
instance
}
hmmhmmhmhmhhmm
I GET IT
MONTE CARLO INTEGRATIIN
AHAHAAHHA
MAYBE IM NOT THAT STUPID
THE PDFs
THEY MAKE SENSE
turns out selecting the frist one makes sense
the os will order them for you
to some extent
thais also allows the device selection in win11 to work
imo you should reject all gpus that do not meet your requirements
then select first
ideally you can also have a device selector witin the app
this is bikeshedding 532.0
when handling queues and logical devices
do you guys just combine them together?
i.e. have a queue struct, but have it all stored in the logical device
or do you guys just make it a seperate class
also we need a name for this library
DAVL
Danny's Awesome Vulkan Library
DAVOUR
Danny's Awesome Vulkan Objects and Utilities Resource
I have a separate class but I store the queues in the device
yo @tropic vigil sorry for pinging, if I clone a Device in rust, does it stil refer to the same device underneath the hood?
so you can just clone any vulkan object
oh god
swapchains
why are they so fucking
long
i mean makes sense considering the millions of monitors configurations
but sadge :( where is vk-bootstrap-rs when you need it
heh
heh
my ssd corrupted
i forgor to commit
all my progress
gone
poof
:(
so like uh how would I make a rendergraph...
Medium
Designing an efficient renderer can be quite a tough task. Especially with the new low-level graphics APIs like DirectX 12 and Vulkan where…
maybe wpotrick is cooking something
wait tf is a task graph?
a graph of tasks
nodes are tasks
edges are dependencies between tasks
if node A uses the output of node B, then theres i a (directed) edge from node B to node A (or the other way around, you can choose this)
In a render graph, the inputs and outputs become gpu resources such as attachments and buffers
The nodes could be renderpasses, but they dont have to be
huh alright
this makes sense now
it can't be that hard
(im about to go on a 5 year journey on a scale never seen before in history)
Conceptually it’s not, implementing it without bugs and with proper sync is a bit more work :)
huh alright
another question, why do you re-export all the wsi + ash types?
since i would assume you could just state in crates.toml a hard coded version phobos is made for (ash and wsi)
also really dumb question
uhh why does Device.rs in phobos but Arc<> but not Instance should they not both use it to ensure that Drop doesn't get called too early?
im kinda lost now how tf ash destroys and cleans vulkan objects? Drop I assume immedietly causes a cleanup of a vulkan object?
fuck it
what if i just wrapped it all in Arc<>
#[derive(Clone)]
pub struct Instance {
pub entry: Arc<ash::Entry>,
pub instance: Arc<ash::Instance>,
}
wrapping vulkan objects in a shared pointer sounds very wrong
yeah feels like so
#[derive(Clone)]
pub struct Instance {
pub entry: ash::Entry,
pub instance: ash::Instance,
}
impl Drop for Instance {
fn drop(&mut self) {
unsafe {
self.instance.destroy_instance(None);
}
}
}
let instance = Arc::new(Instance { ... });
@devout mesa how do you handle managing the lifetimes of vulkan objects?
im 100% overthinking this problem
my assumption was to just throw reference counters everywhere then have the destructor that destroys the vulkan object itself
oh i meant this
then yes
what is this sentence
💀
💀 oh ok i figured it out
why does the handle of device.rs using Arc<>
but literally everything else doesn't
i think
I'm just really lost on how Phobos ensures lifetimes as I don't see phobos making use of reference counting for other stuff
arc is refcounting
but uh
device is used kinda everywhere
so its easier to just refcount it
for most other objects i rely on the user to create them in the right order
should probably document that properly

i havent done much programming except for school lately
I mean the overhead can't be that bad by just throwing Arc around
its not no
me too sadge
theres also nothing stopping you from doing that in user code
since i doubt im making millions of vulkan objects at once
but theres no reason the library should enforce that
fair
😎
problem numero two
how the hell do i abstract the pipeline in a nice way
"yeah bro it isn't that bad you just gotta make these 11 vulkan objects which only 3 you'll really only need"
fuck it builder pattern
you make structs
with sane defaults
and let the user only change what they need
good idea
auto tonemapPipeline = Retina::CGraphicsPipeline::Make(*device, {
.Name = "TonemapPipeline",
.VertexShader = "FullscreenTriangle.vert.glsl",
.FragmentShader = "Tonemap.frag.glsl",
.DescriptorLayouts = { { shaderResourceTable->GetDescriptorLayout() } },
.DynamicState = { {
Retina::EDynamicState::E_VIEWPORT,
Retina::EDynamicState::E_SCISSOR,
} },
.RenderingInfo = { {
.ColorAttachmentFormats = {
finalImage->GetFormat()
}
} },
});``` e.g
what actually goes on behind the scenes:
uhh well it's too big
wym
like you use a lot of SPipelineStencilState or ECompareOperator which I assume are your own abstracted types from Vulkan?
or like EDynamicState
yeah, I like type safety
vulkan.h is not typesafe and vulkan.hpp is a scam

nah i forgot how to even do dynamic rendering 💀
no i figured it out
so uh do you guys combine the renderpass and pipeline
or keep them seperated?
they have no relationship
besides a single handle that you need for pass compatibility
just do dynamic rendering
ok o7
i uh kinda forgot how to enable extensions again 💀
i just attach the features in the .pNext chain yeah of physical device features?
wait so can extensions be enabled from the device + instance or must they only be enabled from only one?
oh

eh who cares
good exercise
wait i have an issue
uh my device suitability checks
need a surface but that also enables the extensions there

do i just seperate it into two stages:
first one just checks extension support
the second checks for surface support?
i guess i have to bite the bullet
and accept instance extensions for just this
uh when doing dynamic rendering would I still need to make my attachments descriptions?
so like should i just do this in hlsl
or stay in glsl
do NOT do HLSL
why :(
bad buffers
but byte address buffers are fine
mostlz
im used to them from work
i think its ok IF you know what to do to be fast