PushConstant暂时只保留local_to_world

This commit is contained in:
hyzboy 2020-06-12 15:51:56 +08:00
parent 4862e81f21
commit 4cf5b0dce3
4 changed files with 2 additions and 8 deletions

View File

@ -75,9 +75,6 @@ enum class ShaderStageBit
struct PushConstant
{
Matrix4f local_to_world;
Matrix3f normal;
Vector3f object_position;
Vector3f object_size;
};
constexpr uint32_t MAX_PUSH_CONSTANT_BYTES=sizeof(PushConstant);

View File

@ -120,7 +120,7 @@ public:
vkCmdPushConstants(cmd_buf,pipeline_layout,(VkShaderStageFlagBits)shader_stage_bit,offset,size,pValues);
}
void PushConstants(const PushConstant *pc){vkCmdPushConstants(cmd_buf,pipeline_layout,VK_SHADER_STAGE_VERTEX_BIT,0,sizeof(PushConstant),pc);}
void PushConstants(const void *data,const uint32_t size){vkCmdPushConstants(cmd_buf,pipeline_layout,VK_SHADER_STAGE_VERTEX_BIT,0,size,data);}
bool Bind(Renderable *);

View File

@ -49,7 +49,7 @@ namespace hgl
{
last_pc=node->GetPushConstant();
cmd_buf->PushConstants(last_pc);
cmd_buf->PushConstants(last_pc,sizeof(vulkan::PushConstant));
}
//更新fin_mvp

View File

@ -12,8 +12,6 @@ namespace hgl
LocalToWorldMatrix =Matrix4f::identity;
InverseLocalMatrix =Matrix4f::identity;
InverseLocalToWorldMatrix =Matrix4f::identity;
pc.normal =Matrix3f::identity;
}
Matrix4f &SceneOrient::SetLocalMatrix(const Matrix4f &m)
@ -32,7 +30,6 @@ namespace hgl
InverseLocalToWorldMatrix=inverse(LocalToWorldMatrix);
pc.local_to_world =LocalToWorldMatrix;
pc.normal =pc.local_to_world.Float3x3Part();
// pc.object_position =;
// pc.object_size =;