Updated constants to be set as part of descriptor layout

This commit is contained in:
Alejandro Saucedo 2021-03-04 08:10:28 +00:00
parent 9edbac4b94
commit c211c22a78
7 changed files with 106 additions and 24 deletions

View file

@ -24,7 +24,8 @@ class Algorithm
const std::vector<std::shared_ptr<Tensor>>& tensors = {},
const std::vector<uint32_t>& spirv = {},
const Workgroup& workgroup = {},
const Constants& specializationConstants = {});
const Constants& specializationConstants = {},
const Constants& pushConstants = {});
/**
* Initialiser for the shader data provided to the algorithm as well as
@ -38,7 +39,8 @@ class Algorithm
void rebuild(const std::vector<std::shared_ptr<Tensor>>& tensors,
const std::vector<uint32_t>& spirv,
const Workgroup& workgroup = {},
const Constants& specializationConstants = {});
const Constants& specializationConstants = {},
const Constants& pushConstants = {});
/**
* Destructor for Algorithm which is responsible for freeing and desroying
@ -58,15 +60,16 @@ class Algorithm
void bindCore(const vk::CommandBuffer& commandBuffer);
void bindPush(const vk::CommandBuffer& commandBuffer,
const Constants& pushConstants);
void bindPush(const vk::CommandBuffer& commandBuffer);
bool isInit();
void setWorkgroup(const Workgroup& workgroup, uint32_t minSize = 1);
void setPush(const Constants& pushConstants);
const Workgroup& getWorkgroup();
const Constants& getSpecializationConstants();
const Constants& getPush();
const std::vector<std::shared_ptr<Tensor>>& getTensors();
void destroy();
@ -95,6 +98,7 @@ class Algorithm
// -------------- ALWAYS OWNED RESOURCES
std::vector<uint32_t> mSpirv;
Constants mSpecializationConstants;
Constants mPushConstants;
Workgroup mWorkgroup;
bool mIsInit;