Skip to content

Ability to allocate transient buffers/textures + hint to lazy allocate #219

@EriKWDev

Description

@EriKWDev

Popped up during discussion in #213

The current Memory enum and TextureUsage still doesn't quite allow expressing what in vulkan becomes a lazilly allocated texture with transient flags set as is ideal for MSAA as outlined in https://docs.vulkan.org/samples/latest/samples/performance/msaa/README.html

I still have not measured what the drivers do when given user-code that uses textures allocated in the current way, but the link seems to suggest there is measurable bandwidth differences if one can correctly specify these options.

Vulkan

The gpu_allocator that is used by blade's vulkan backend has a UsageFlags::TRANSIENT and some special code paths to make those allocations more optimal. It also has MemoryPropertyFlags::LAZILY_ALLOCATED

I think the lazilly_allocated bit is marked as a valid one if supported (

let known_memory_flags = vk::MemoryPropertyFlags::DEVICE_LOCAL
), so a new blade_graphics::Memory profile would be needed
let alloc_usage = match memory {

The final piece would then be to also be able to specify the requirement of being lazilly-allocated for image creation at

let requirements = unsafe { self.device.core.get_image_memory_requirements(raw) };

Metal

At least the Metal docs on multisampling seem to indicate nothing this granular is required to be specified by the user https://developer.apple.com/documentation/metal/mtlrenderpassattachmentdescriptor#1968767

The concept of transient attachments seems not explicit in Metal

Opengl Es

Even possible to specify this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions