From 9447ae7487f8a1d3fec94257cb1904258948bdc8 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Mon, 6 May 2019 21:03:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E9=87=8F=E6=9B=B4=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/hgl/graph/vulkan/VKRenderable.h | 4 ++-- src/RenderDevice/Vulkan/VKRenderable.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/inc/hgl/graph/vulkan/VKRenderable.h b/inc/hgl/graph/vulkan/VKRenderable.h index 023bb75c..2f681d2d 100644 --- a/inc/hgl/graph/vulkan/VKRenderable.h +++ b/inc/hgl/graph/vulkan/VKRenderable.h @@ -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) { diff --git a/src/RenderDevice/Vulkan/VKRenderable.cpp b/src/RenderDevice/Vulkan/VKRenderable.cpp index ebcb4e27..1e2194d0 100644 --- a/src/RenderDevice/Vulkan/VKRenderable.cpp +++ b/src/RenderDevice/Vulkan/VKRenderable.cpp @@ -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); }