变量更名
This commit is contained in:
parent
08bc2ab6df
commit
9447ae7487
@ -29,8 +29,8 @@ public:
|
||||
Renderable(const VertexShaderModule *);
|
||||
virtual ~Renderable();
|
||||
|
||||
bool Set(const int binding, VertexBuffer *vb,VkDeviceSize offset=0);
|
||||
bool Set(const UTF8String &name,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(IndexBuffer *ib,VkDeviceSize offset=0)
|
||||
{
|
||||
|
@ -19,20 +19,20 @@ Renderable::~Renderable()
|
||||
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 VkVertexInputAttributeDescription *attr=vertex_sm->GetAttr(binding);
|
||||
const VkVertexInputBindingDescription *desc=vertex_sm->GetDesc(stage_input_binding);
|
||||
const VkVertexInputAttributeDescription *attr=vertex_sm->GetAttr(stage_input_binding);
|
||||
|
||||
if(vbo->GetFormat()!=attr->format)return(false);
|
||||
if(vbo->GetStride()!=desc->stride)return(false);
|
||||
|
||||
//format信息来自于shader,实际中可以不一样。但那样需要为每一个格式产生一个同样shader的material instance,不同的格式又需要不同的pipeline,我们不支持这种行为
|
||||
|
||||
buf_list[binding]=*vbo;
|
||||
buf_offset[binding]=offset;
|
||||
buf_list[stage_input_binding]=*vbo;
|
||||
buf_offset[stage_input_binding]=offset;
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user