Removed KRPipeline::setPushConstant methods, as we have switched entirely to reflected objects.
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
This commit is contained in:
@@ -595,82 +595,6 @@ bool KRPipeline::setPushConstants(const KRCamera* camera, const std::vector<cons
|
||||
return success;
|
||||
}
|
||||
|
||||
void KRPipeline::setPushConstant(ShaderValue location, float value)
|
||||
{
|
||||
for (StageInfo& stageInfo : m_stages) {
|
||||
PushConstantInfo& pushConstants = stageInfo.pushConstants;
|
||||
if (pushConstants.size[static_cast<size_t>(location)] == sizeof(value)) {
|
||||
float* constant = (float*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(location)]);
|
||||
*constant = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void KRPipeline::setPushConstant(ShaderValue location, int value)
|
||||
{
|
||||
for (StageInfo& stageInfo : m_stages) {
|
||||
PushConstantInfo& pushConstants = stageInfo.pushConstants;
|
||||
if (pushConstants.size[static_cast<size_t>(location)] == sizeof(value)) {
|
||||
int* constant = (int*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(location)]);
|
||||
*constant = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KRPipeline::setPushConstant(ShaderValue location, const Vector2& value)
|
||||
{
|
||||
for (StageInfo& stageInfo : m_stages) {
|
||||
PushConstantInfo& pushConstants = stageInfo.pushConstants;
|
||||
if (pushConstants.size[static_cast<size_t>(location)] == sizeof(value)) {
|
||||
Vector2* constant = (Vector2*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(location)]);
|
||||
*constant = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KRPipeline::setPushConstant(ShaderValue location, const Vector3& value)
|
||||
{
|
||||
for (StageInfo& stageInfo : m_stages) {
|
||||
PushConstantInfo& pushConstants = stageInfo.pushConstants;
|
||||
if (pushConstants.size[static_cast<size_t>(location)] == sizeof(value)) {
|
||||
Vector3* constant = (Vector3*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(location)]);
|
||||
*constant = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KRPipeline::setPushConstant(ShaderValue location, const Vector4& value)
|
||||
{
|
||||
for (StageInfo& stageInfo : m_stages) {
|
||||
PushConstantInfo& pushConstants = stageInfo.pushConstants;
|
||||
if (pushConstants.size[static_cast<size_t>(location)] == sizeof(value)) {
|
||||
Vector4* constant = (Vector4*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(location)]);
|
||||
*constant = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KRPipeline::setPushConstant(ShaderValue location, const Matrix4& value)
|
||||
{
|
||||
for (StageInfo& stageInfo : m_stages) {
|
||||
PushConstantInfo& pushConstants = stageInfo.pushConstants;
|
||||
if (pushConstants.size[static_cast<size_t>(location)] == sizeof(value)) {
|
||||
Matrix4* constant = (Matrix4*)(pushConstants.buffer + pushConstants.offset[static_cast<size_t>(location)]);
|
||||
*constant = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KRPipeline::setPushConstant(ShaderValue location, const Matrix4* value, const size_t count)
|
||||
{
|
||||
for (StageInfo& stageInfo : m_stages) {
|
||||
PushConstantInfo& pushConstants = stageInfo.pushConstants;
|
||||
// TODO - Vulkan refactoring
|
||||
// GLDEBUG(glUniformMatrix4fv(pushConstants.offset[KRPipeline::PushConstant::bone_transforms], (int)bones.size(), GL_FALSE, bone_mats));
|
||||
}
|
||||
}
|
||||
|
||||
void KRPipeline::updateDescriptorBinding()
|
||||
{
|
||||
// TODO - Implement
|
||||
|
||||
@@ -224,13 +224,6 @@ public:
|
||||
bool setImageBindings(const std::vector<const KRReflectedObject*> objects);
|
||||
bool setPushConstants(const KRCamera* camera, const std::vector<const KRReflectedObject*> objects);
|
||||
bool hasPushConstant(ShaderValue location) const;
|
||||
void setPushConstant(ShaderValue location, float value);
|
||||
void setPushConstant(ShaderValue location, int value);
|
||||
void setPushConstant(ShaderValue location, const hydra::Vector2& value);
|
||||
void setPushConstant(ShaderValue location, const hydra::Vector3& value);
|
||||
void setPushConstant(ShaderValue location, const hydra::Vector4& value);
|
||||
void setPushConstant(ShaderValue location, const hydra::Matrix4& value);
|
||||
void setPushConstant(ShaderValue location, const hydra::Matrix4* value, const size_t count);
|
||||
|
||||
VkPipeline& getPipeline();
|
||||
void bindDescriptorSets(VkCommandBuffer& commandBuffer);
|
||||
|
||||
@@ -820,9 +820,12 @@ bool KRMaterial::bind(KRNode::RenderInfo& ri, ModelFormat modelFormat, __uint32_
|
||||
*bone_mat_component++ = t[i];
|
||||
}
|
||||
}
|
||||
/*
|
||||
* TODO: Implement Skinned Mesh bone transform buffer upload
|
||||
if (pShader->hasPushConstant(ShaderValue::bone_transforms)) {
|
||||
pShader->setPushConstant(ShaderValue::bone_transforms, (Matrix4*)bone_mats, bones.size());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
bool success = true;
|
||||
|
||||
Reference in New Issue
Block a user