fixes(#55): add MemoryHints struct that mirrors wgpu's and allows for additional egor buffer control#78
Conversation
|
Great idea to factor in the buffer sizes as well I think passing At work now but once I get time after, I will look into this and provide better feedback/changes |
|
@wick3dr0se yeah I didnt really like the render target stuff either but couldnt find a clean way to pass in values that might differ from App. I would like to keep being able to configure those buffers as well if possible because I use quite a few off screen targets some with varying complexity. Could perhaps just introduce a new method instead eg: pub fn create_offscreen_target_with_memory_hints(
&self,
width: u32,
height: u32,
format: TextureFormat,
memory_hints: MemoryHints,
) -> OffscreenTarget That way we wont change the signature of the old one. What do you think? |
…er than changing old signatures
|
@jonatino That's a good point (for per-target buffer sizing) but targets don't own geometry buffers, they just exist transiently inside fn render_offscreen_with_profile(
&mut self,
target: &mut OffscreenTarget,
profile: MemoryProfile,
render_fn: impl FnMut(&mut Graphics),
)This would clean it up quite a bit, dropping the changes to target.rs, Also just preference but we could name it |
|
@jonatino I tinkered with it on a new branch to see what it would look like. After messing with it, I think it makes more sense to just expose db199f1 (pr-78-rev branch) |
|
@wick3dr0se yeah your changes are much much cleaner. I'm still a little new to rust so forgive me 😂 Would you like me to merge your changes into my branch? |
|
@jonatino Sweet!! haha no worries dude! There is a lot of layers to egor with the separation I can likely push it straight to your branch in your repo, which will just update the PR too. I'll see if I can do that and get it merged. Should be less work if it works lol |
|
@jonatino Sorry for the delay, been a bit tied up I just went to try this finally and it seems I either don't have permission to push to your fork or maybe main branch protection is on. If you're still open to merging the changes into your branch, seems that might be easiest. Otherwise maybe you can change permissions and I can try it out. Either way works for me |
|
@wick3dr0se done |
|
@jonatino a few broken doc links keeping CI from passing. Just need to change Perms make me create a new branch but I think it's just due to the PR being made from a main branch. If you could fix these, would be much appreciate, otherwise it's ready for merging! |
Co-authored-by: wick3dr0se <wick3dr0se@protonmail.com>
Co-authored-by: wick3dr0se <wick3dr0se@protonmail.com>
Co-authored-by: wick3dr0se <wick3dr0se@protonmail.com>
|
@jonatino Thanks for your work! Merged!!! |
This should allow for more than enough control over the biggest configurable buffers in both egor and wgpu. This more than makes egor viable for my use case of retro low-res, low memory games.
Sample:
Ran on windows 11 with nvidia 4090:
MemoryHints::Performance
#default 115mb
#gles 146mb
#angle 115mb
#vulkan 233mb
MemoryHints::Memory
#default 50mb
#gles 81mb
#angle 50mb
#vulkan 96mb