class final
materialclass that creates a bindable collection of resources that can be used in conjuction with a surface to render.
The material class is a container of various resources that can, together, describe what should happen to a surface in the render pipeline on the GPU, and what is all needed. The material class also can contain instance data and will manage this for you. Together with a core::
constructors, destructors, conversion operators
member-functions
Function documentation
core:: ivk:: material:: material(core::resource::cache& cache,
const core:: resource:: metadata& metaData,
psl:: meta:: file* metaFile,
core:: resource:: handle<core:: ivk:: context> context,
core:: resource:: handle<core:: data:: material> data,
core:: resource:: handle<core:: ivk:: pipeline_cache> pipeline_cache,
core:: resource:: handle<core:: ivk:: buffer> materialBuffer)
Brief
the constructor that will create and bind the necesary resources to create a valid pipeline.
Parameters | |
---|---|
cache | |
metaData | |
metaFile | |
context in | a handle to a graphics context (needs to be valid and loaded) which will own the material. |
data in | the material data this instance will be based on. |
pipeline_cache | |
materialBuffer in | a GPU buffer that can be used by this instance to upload data to (if needed). |
core:: resource:: handle<core:: data:: material> core:: ivk:: material:: data() const
Brief
returns a handle to the material data used to construct this object.
Details
const std::vector<std::pair<uint32_t, core:: resource:: handle<core:: ivk:: buffer>>>& core:: ivk:: material:: buffers() const
Brief
returns all currently used buffers and their binding slots.
Details
bool core:: ivk:: material:: bind_pipeline(vk::CommandBuffer cmdBuffer,
core:: resource:: handle<core:: ivk:: framebuffer> framebuffer,
uint32_t drawIndex)
Brief
prepares the material for rendering by binding the pipeline.
Details
Parameters | |
---|---|
cmdBuffer in | the command buffer you'll be recording to |
framebuffer in | the framebuffer the pipeline will be bound to. |
drawIndex in | the index to be set in the push constant. |
bool core:: ivk:: material:: bind_pipeline(vk::CommandBuffer cmdBuffer,
core:: resource:: handle<core:: ivk:: swapchain> swapchain,
uint32_t drawIndex)
Brief
prepares the material for rendering by binding the pipeline.
Details
Parameters | |
---|---|
cmdBuffer in | the command buffer you'll be recording to |
swapchain in | the swapchain the pipeline will be bound to. |
drawIndex in | the index to be set in the push constant. |
core:: resource:: handle<core:: ivk:: pipeline> core:: ivk:: material:: get(core:: resource:: handle<core:: ivk:: framebuffer> framebuffer) private
Details
tries to find, and return a core::
Parameters | |
---|---|
framebuffer in | the framebuffer to bind to. |
Returns | the pipeline this material instance uses for the given framebuffer. |
core:: resource:: handle<core:: ivk:: pipeline> core:: ivk:: material:: get(core:: resource:: handle<core:: ivk:: swapchain> swapchain) private
Details
tries to find, and return a core::
Parameters | |
---|---|
swapchain in | the swapchain to bind to. |
Returns | the pipeline this material instance uses for the given framebuffer. |