变量更名

This commit is contained in:
hyzboy 2019-05-06 21:03:05 +08:00
parent 08bc2ab6df
commit 9447ae7487
2 changed files with 8 additions and 8 deletions

View File

@ -29,8 +29,8 @@ public:
Renderable(const VertexShaderModule *); Renderable(const VertexShaderModule *);
virtual ~Renderable(); virtual ~Renderable();
bool Set(const int binding, VertexBuffer *vb,VkDeviceSize offset=0); bool Set(const int stage_input_binding, VertexBuffer *vb,VkDeviceSize offset=0);
bool Set(const UTF8String &name,VertexBuffer *vb,VkDeviceSize offset=0); bool Set(const UTF8String &name, VertexBuffer *vb,VkDeviceSize offset=0);
bool Set(IndexBuffer *ib,VkDeviceSize offset=0) bool Set(IndexBuffer *ib,VkDeviceSize offset=0)
{ {

View File

@ -19,20 +19,20 @@ Renderable::~Renderable()
delete[] buf_list; delete[] buf_list;
} }
bool Renderable::Set(const int binding,VertexBuffer *vbo,VkDeviceSize offset) bool Renderable::Set(const int stage_input_binding,VertexBuffer *vbo,VkDeviceSize offset)
{ {
if(binding<0||binding>=buf_count||!vbo)return(false); if(stage_input_binding<0||stage_input_binding>=buf_count||!vbo)return(false);
const VkVertexInputBindingDescription *desc=vertex_sm->GetDesc(binding); const VkVertexInputBindingDescription *desc=vertex_sm->GetDesc(stage_input_binding);
const VkVertexInputAttributeDescription *attr=vertex_sm->GetAttr(binding); const VkVertexInputAttributeDescription *attr=vertex_sm->GetAttr(stage_input_binding);
if(vbo->GetFormat()!=attr->format)return(false); if(vbo->GetFormat()!=attr->format)return(false);
if(vbo->GetStride()!=desc->stride)return(false); if(vbo->GetStride()!=desc->stride)return(false);
//format信息来自于shader实际中可以不一样。但那样需要为每一个格式产生一个同样shader的material instance不同的格式又需要不同的pipeline我们不支持这种行为 //format信息来自于shader实际中可以不一样。但那样需要为每一个格式产生一个同样shader的material instance不同的格式又需要不同的pipeline我们不支持这种行为
buf_list[binding]=*vbo; buf_list[stage_input_binding]=*vbo;
buf_offset[binding]=offset; buf_offset[stage_input_binding]=offset;
return(true); return(true);
} }