material_t class final
class 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_t:: material_t(core:: resource:: cache_t& cache,
const core:: resource:: metadata& metaData,
psl:: meta:: file* metaFile,
core:: resource:: handle<core:: ivk:: context> context,
core:: resource:: handle<core:: data:: material_t> data,
core:: resource:: handle<core:: ivk:: pipeline_cache> pipelineCache,
core:: resource:: handle<core:: ivk:: buffer_t> materialBuffer)
Brief
the constructor that will create and bind the necesary resources to create a valid pipeline.
| Parameters | |
|---|---|
| cache in | resource cache that is constructing this material. |
| metaData in | metadata associated with the material. |
| metaFile in | metafile associated with the material's instance. |
| 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. |
| pipelineCache in | the cache this instance can request a pipeline from. |
| materialBuffer in | a GPU buffer that can be used by this instance to upload data to (if needed). |
core:: resource:: handle<core:: data:: material_t> core:: ivk:: material_t:: data() const
Brief
returns a handle to the material data used to construct this object.
Details
bool core:: ivk:: material_t:: bind_pipeline(vk::CommandBuffer cmdBuffer,
core:: resource:: handle<core:: ivk:: framebuffer_t> 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_t:: 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_t:: get(core:: resource:: handle<core:: ivk:: framebuffer_t> 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_t:: 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. |