fix RenderableCreater and VertexAttribData, VertexAttribDataAccess..... and then test CreateRenderableRectangle passed.

This commit is contained in:
hyzboy 2020-07-20 18:12:02 +08:00
parent 4898592c32
commit 79b012d5b9
6 changed files with 1181 additions and 1177 deletions

View File

@ -34,9 +34,9 @@ private:
vulkan::Material * material =nullptr; vulkan::Material * material =nullptr;
vulkan::MaterialInstance * material_instance =nullptr; vulkan::MaterialInstance * material_instance =nullptr;
vulkan::Renderable *ro_rectangle =nullptr, vulkan::Renderable *ro_rectangle =nullptr;/*,
*ro_circle =nullptr, *ro_circle =nullptr,
*ro_round_rectangle =nullptr; *ro_round_rectangle =nullptr;*/
vulkan::Buffer * ubo_world_matrix =nullptr; vulkan::Buffer * ubo_world_matrix =nullptr;
vulkan::Buffer * ubo_color_material =nullptr; vulkan::Buffer * ubo_color_material =nullptr;
@ -69,32 +69,32 @@ private:
ro_rectangle=CreateRenderableRectangle(db,material,&rci); ro_rectangle=CreateRenderableRectangle(db,material,&rci);
} }
{ //{
struct RoundRectangleCreateInfo rrci; // struct RoundRectangleCreateInfo rrci;
rrci.scope.Set(SCREEN_WIDTH-30,10,20,20); // rrci.scope.Set(SCREEN_WIDTH-30,10,20,20);
rrci.radius=5; // rrci.radius=5;
rrci.round_per=5; // rrci.round_per=5;
ro_round_rectangle=CreateRenderableRoundRectangle(db,material,&rrci); // ro_round_rectangle=CreateRenderableRoundRectangle(db,material,&rrci);
//}
//{
// struct CircleCreateInfo cci;
// cci.center.x=SCREEN_WIDTH/2;
// cci.center.y=SCREEN_HEIGHT/2;
// cci.radius.x=SCREEN_WIDTH*0.35;
// cci.radius.y=SCREEN_HEIGHT*0.35;
// cci.field_count=8;
// ro_circle=CreateRenderableCircle(db,material,&cci);
//}
} }
{ vulkan::Buffer *CreateUBO(const AnsiString &name,const VkDeviceSize size,void *data)
struct CircleCreateInfo cci;
cci.center.x=SCREEN_WIDTH/2;
cci.center.y=SCREEN_HEIGHT/2;
cci.radius.x=SCREEN_WIDTH*0.35;
cci.radius.y=SCREEN_HEIGHT*0.35;
cci.field_count=8;
ro_circle=CreateRenderableCircle(db,material,&cci);
}
}
vulkan::Buffer *CreateUBO(const UTF8String &name,const VkDeviceSize size,void *data)
{ {
vulkan::Buffer *ubo=device->CreateUBO(size,data); vulkan::Buffer *ubo=device->CreateUBO(size,data);
@ -107,6 +107,8 @@ private:
return(nullptr); return(nullptr);
} }
db->Add(ubo);
return ubo; return ubo;
} }
@ -143,8 +145,8 @@ private:
bool InitScene() bool InitScene()
{ {
render_root.Add(db->CreateRenderableInstance(pipeline,material_instance,ro_rectangle)); render_root.Add(db->CreateRenderableInstance(pipeline,material_instance,ro_rectangle));
render_root.Add(db->CreateRenderableInstance(pipeline,material_instance,ro_round_rectangle)); // render_root.Add(db->CreateRenderableInstance(pipeline,material_instance,ro_round_rectangle));
render_root.Add(db->CreateRenderableInstance(pipeline,material_instance,ro_circle)); // render_root.Add(db->CreateRenderableInstance(pipeline,material_instance,ro_circle));
render_root.ExpendToList(&render_list); render_root.ExpendToList(&render_list);
BuildCommandBuffer(&render_list); BuildCommandBuffer(&render_list);

View File

@ -42,7 +42,7 @@ namespace hgl
} }
};//struct ShaderStageBind };//struct ShaderStageBind
using VABCreaterMaps=MapObject<AnsiString,ShaderStageBind>; using VADMaps=MapObject<AnsiString,ShaderStageBind>;
/** /**
* *
@ -61,7 +61,7 @@ namespace hgl
uint32 vertices_number; uint32 vertices_number;
vulkan::IndexBuffer * ibo; vulkan::IndexBuffer * ibo;
VABCreaterMaps vabc_maps; VADMaps vab_maps;
virtual VAD *CreateVAD(const AnsiString &name,const vulkan::ShaderStage *ss); ///<创建一个顶点属性缓冲区 virtual VAD *CreateVAD(const AnsiString &name,const vulkan::ShaderStage *ss); ///<创建一个顶点属性缓冲区
@ -90,7 +90,11 @@ namespace hgl
if(!vad) if(!vad)
return(nullptr); return(nullptr);
return T::Create(vad); T *vada=T::Create(vad);
vada->Begin();
return vada;
} }
uint16 * CreateIBO16(uint count,const uint16 *data=nullptr); ///<创建16位的索引缓冲区 uint16 * CreateIBO16(uint count,const uint16 *data=nullptr); ///<创建16位的索引缓冲区

View File

@ -16,7 +16,6 @@ namespace hgl
protected: protected:
const uint32_t dc_num; ///<每个数据成员数(比如二维坐标为2、三维坐标为3) const uint32_t dc_num; ///<每个数据成员数(比如二维坐标为2、三维坐标为3)
const uint32_t comp_stride; ///<单个成员数据字节数
uint32_t count; ///<数据个数 uint32_t count; ///<数据个数
const uint32_t stride; ///<每组数据字节数 const uint32_t stride; ///<每组数据字节数
@ -26,7 +25,7 @@ namespace hgl
public: public:
VertexAttribData(uint32_t c,uint32_t dc,uint32_t cs,VkFormat fmt):count(c),dc_num(dc),comp_stride(cs),stride(dc*cs),total_bytes(dc*cs*c),vk_format(fmt) VertexAttribData(uint32_t c,uint32_t dc,uint32_t cs,VkFormat fmt):count(c),dc_num(dc),stride(cs),total_bytes(cs*c),vk_format(fmt)
{ {
mem_data = hgl_malloc(total_bytes); //在很多情况下hgl_malloc分配的内存是对齐的这样有效率上的提升 mem_data = hgl_malloc(total_bytes); //在很多情况下hgl_malloc分配的内存是对齐的这样有效率上的提升
} }
@ -38,7 +37,6 @@ namespace hgl
} }
const VkFormat GetVulkanFormat ()const{return vk_format;} ///<取得数据类型 const VkFormat GetVulkanFormat ()const{return vk_format;} ///<取得数据类型
const uint32_t GetDataBytes ()const{return comp_stride;} ///<取得每数据字节数
const uint32_t GetComponent ()const{return dc_num;} ///<取数缓冲区元数据数量 const uint32_t GetComponent ()const{return dc_num;} ///<取数缓冲区元数据数量
const uint32_t GetCount ()const{return count;} ///<取得数据数量 const uint32_t GetCount ()const{return count;} ///<取得数据数量
const uint32_t GetStride ()const{return stride;} ///<取得每一组数据字节数 const uint32_t GetStride ()const{return stride;} ///<取得每一组数据字节数

View File

@ -83,7 +83,7 @@ namespace hgl
access=Get(offset); access=Get(offset);
if(access) if(access)
start=access; start_access=access;
return access; return access;
} }
@ -94,7 +94,7 @@ namespace hgl
void End() void End()
{ {
access=nullptr; access=nullptr;
start=nullptr; start_access=nullptr;
} }
/** /**
@ -104,7 +104,7 @@ namespace hgl
*/ */
bool WriteData(const T *vp,const uint32_t number) bool WriteData(const T *vp,const uint32_t number)
{ {
if(!this->access||this->access+C*number>=this->data_end) if(!this->access||this->access+C*number>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribBuffer::Write(const T *,number) out,number:")+OSString::valueOf(number)); LOG_HINT(OS_TEXT("VertexAttribBuffer::Write(const T *,number) out,number:")+OSString::valueOf(number));
return(false); return(false);
@ -182,7 +182,7 @@ namespace hgl
bool Write(const T v1) bool Write(const T v1)
{ {
if(!this->access||this->access+1>=this->data_end) if(!this->access||this->access+1>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess1::Write(const T) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess1::Write(const T) out"));
return(false); return(false);
@ -199,7 +199,7 @@ namespace hgl
*/ */
bool Write(const T v,const uint32_t count) bool Write(const T v,const uint32_t count)
{ {
if(!this->access||this->access+count>=this->data_end) if(!this->access||this->access+count>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess1::Write(const T,")+OSString::valueOf(count)+OS_TEXT(") out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess1::Write(const T,")+OSString::valueOf(count)+OS_TEXT(") out"));
return(false); return(false);
@ -277,7 +277,7 @@ namespace hgl
bool Write(const T v1,const T v2) bool Write(const T v1,const T v2)
{ {
if(!this->access||this->access+2>=this->data_end) if(!this->access||this->access+2>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess2::Write(const T ,const T) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess2::Write(const T ,const T) out"));
return(false); return(false);
@ -291,7 +291,7 @@ namespace hgl
bool Write(const T *v) bool Write(const T *v)
{ {
if(!this->access||this->access+2>=this->data_end) if(!this->access||this->access+2>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess2::Write(T *) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess2::Write(T *) out"));
return(false); return(false);
@ -306,7 +306,7 @@ namespace hgl
template<typename V2> template<typename V2>
bool Write(const V2 &v) bool Write(const V2 &v)
{ {
if(!this->access||this->access+2>=this->data_end) if(!this->access||this->access+2>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess2::Write(vec2 &) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess2::Write(vec2 &) out"));
return(false); return(false);
@ -326,7 +326,7 @@ namespace hgl
template<typename V2> template<typename V2>
bool Fill(const V2 &v,const uint32_t count) bool Fill(const V2 &v,const uint32_t count)
{ {
if(!this->access||this->access+(count<<1)>=this->data_end) if(!this->access||this->access+(count<<1)>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess1::Write(const Vector2f &,")+OSString::valueOf(count)+OS_TEXT(") out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess1::Write(const Vector2f &,")+OSString::valueOf(count)+OS_TEXT(") out"));
return(false); return(false);
@ -343,7 +343,7 @@ namespace hgl
bool WriteLine(const T start_x,const T start_y,const T end_x,const T end_y) bool WriteLine(const T start_x,const T start_y,const T end_x,const T end_y)
{ {
if(!this->access||this->access+4>=this->data_end) if(!this->access||this->access+4>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteLine(T,T,T,T) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteLine(T,T,T,T) out"));
return(false); return(false);
@ -360,7 +360,7 @@ namespace hgl
template<typename V2> template<typename V2>
bool WriteLine(const V2 &start,const V2 &end) bool WriteLine(const V2 &start,const V2 &end)
{ {
if(!this->access||this->access+4>=this->data_end) if(!this->access||this->access+4>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteLine(vec2,vec2) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteLine(vec2,vec2) out"));
return(false); return(false);
@ -380,7 +380,7 @@ namespace hgl
template<typename V2> template<typename V2>
bool WriteTriangle(const V2 &v1,const V2 &v2,const V2 &v3) bool WriteTriangle(const V2 &v1,const V2 &v2,const V2 &v3)
{ {
if(!this->access||this->access+6>=this->data_end) if(!this->access||this->access+6>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteTriangle(vec2,vec2,vec2) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteTriangle(vec2,vec2,vec2) out"));
return(false); return(false);
@ -404,7 +404,7 @@ namespace hgl
template<typename V2> template<typename V2>
bool WriteTriangle(const V2 *v) bool WriteTriangle(const V2 *v)
{ {
if(!this->access||this->access+6>=this->data_end) if(!this->access||this->access+6>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteTriangle(vec2 *) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteTriangle(vec2 *) out"));
return(false); return(false);
@ -464,7 +464,7 @@ namespace hgl
template<typename V> template<typename V>
bool WriteRectFan(const RectScope2<V> &scope) bool WriteRectFan(const RectScope2<V> &scope)
{ {
if(!this->access||this->access+8>=this->data_end) if(!this->access||this->access+8>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteRectFan(RectScope2 *) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteRectFan(RectScope2 *) out"));
return(false); return(false);
@ -488,7 +488,7 @@ namespace hgl
template<typename V> template<typename V>
bool WriteRectTriangleStrip(const RectScope2<V> &scope) bool WriteRectTriangleStrip(const RectScope2<V> &scope)
{ {
if(!this->access||this->access+8>=this->data_end) if(!this->access||this->access+8>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteRectTriangleStrip(RectScope2 *) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess2::WriteRectTriangleStrip(RectScope2 *) out"));
return(false); return(false);
@ -579,7 +579,7 @@ namespace hgl
bool Write(const T v1,const T v2,const T v3) bool Write(const T v1,const T v2,const T v3)
{ {
if(!this->access||this->access+3>=this->data_end) if(!this->access||this->access+3>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(T,T,T) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(T,T,T) out"));
return(false); return(false);
@ -594,7 +594,7 @@ namespace hgl
bool Write3(const T *v) bool Write3(const T *v)
{ {
if(!this->access||this->access+3>=this->data_end) if(!this->access||this->access+3>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(T *) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(T *) out"));
return(false); return(false);
@ -610,7 +610,7 @@ namespace hgl
template<typename V3> template<typename V3>
bool Write(const V3 &v) bool Write(const V3 &v)
{ {
if(!this->access||this->access+3>=this->data_end) if(!this->access||this->access+3>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(vec3 &) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(vec3 &) out"));
return(false); return(false);
@ -631,7 +631,7 @@ namespace hgl
template<typename V3> template<typename V3>
bool Fill(const V3 &v,const uint32_t count) bool Fill(const V3 &v,const uint32_t count)
{ {
if(!this->access||this->access+(count*3)>=this->data_end) if(!this->access||this->access+(count*3)>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(const Vector3f,")+OSString::valueOf(count)+OS_TEXT(") out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(const Vector3f,")+OSString::valueOf(count)+OS_TEXT(") out"));
return(false); return(false);
@ -655,7 +655,7 @@ namespace hgl
template<typename V3> template<typename V3>
bool Write(const V3 *v,const uint32_t count) bool Write(const V3 *v,const uint32_t count)
{ {
if(!this->access||this->access+(count*3)>=this->data_end) if(!this->access||this->access+(count*3)>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(const Vector3f,")+OSString::valueOf(count)+OS_TEXT(") out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(const Vector3f,")+OSString::valueOf(count)+OS_TEXT(") out"));
return(false); return(false);
@ -675,7 +675,7 @@ namespace hgl
bool Write(const Color3f &v) bool Write(const Color3f &v)
{ {
if(!this->access||this->access+3>=this->data_end) if(!this->access||this->access+3>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(color3f &) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess3::Write(color3f &) out"));
return(false); return(false);
@ -690,7 +690,7 @@ namespace hgl
bool WriteLine(const T start_x,const T start_y,const T start_z,const T end_x,const T end_y,const T end_z) bool WriteLine(const T start_x,const T start_y,const T start_z,const T end_x,const T end_y,const T end_z)
{ {
if(!this->access||this->access+6>=this->data_end) if(!this->access||this->access+6>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess3::WriteLine(T,T,T,T,T,T) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess3::WriteLine(T,T,T,T,T,T) out"));
return(false); return(false);
@ -709,7 +709,7 @@ namespace hgl
template<typename V3> template<typename V3>
bool WriteLine(const V3 &start,const V3 &end) bool WriteLine(const V3 &start,const V3 &end)
{ {
if(!this->access||this->access+6>=this->data_end) if(!this->access||this->access+6>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess3::WriteLine(vec3,vec3) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess3::WriteLine(vec3,vec3) out"));
return(false); return(false);
@ -731,7 +731,7 @@ namespace hgl
template<typename V3> template<typename V3>
bool WriteTriangle(const V3 &v1,const V3 &v2,const V3 &v3) bool WriteTriangle(const V3 &v1,const V3 &v2,const V3 &v3)
{ {
if(!this->access||this->access+9>=this->data_end) if(!this->access||this->access+9>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess3::WriteTriangle(vec3,vec3,vec3) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess3::WriteTriangle(vec3,vec3,vec3) out"));
return(false); return(false);
@ -758,7 +758,7 @@ namespace hgl
template<typename V3> template<typename V3>
bool WriteTriangle(const V3 *v) bool WriteTriangle(const V3 *v)
{ {
if(!this->access||this->access+9>=this->data_end) if(!this->access||this->access+9>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess3::WriteTriangle(vec3 *) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess3::WriteTriangle(vec3 *) out"));
return(false); return(false);
@ -854,7 +854,7 @@ namespace hgl
bool Write(const T v1,const T v2,const T v3,const T v4) bool Write(const T v1,const T v2,const T v3,const T v4)
{ {
if(!this->access||this->access+4>=this->data_end) if(!this->access||this->access+4>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(T,T,T,T) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(T,T,T,T) out"));
return(false); return(false);
@ -870,7 +870,7 @@ namespace hgl
bool Write(const T *v) bool Write(const T *v)
{ {
if(!this->access||this->access+4>=this->data_end) if(!this->access||this->access+4>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(T *) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(T *) out"));
return(false); return(false);
@ -887,7 +887,7 @@ namespace hgl
template<typename V4> template<typename V4>
bool Write(const V4 &v) bool Write(const V4 &v)
{ {
if(!this->access||this->access+4>=this->data_end) if(!this->access||this->access+4>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(color4 &) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(color4 &) out"));
return(false); return(false);
@ -903,7 +903,7 @@ namespace hgl
bool Write(const Color4f &v) bool Write(const Color4f &v)
{ {
if(!this->access||this->access+4>=this->data_end) if(!this->access||this->access+4>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(color4 &) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(color4 &) out"));
return(false); return(false);
@ -921,7 +921,7 @@ namespace hgl
{ {
if(count<=0)return(false); if(count<=0)return(false);
if(!this->access||this->access+(4*count)>=this->data_end) if(!this->access||this->access+(4*count)>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(color4 &,count) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(color4 &,count) out"));
return(false); return(false);
@ -946,7 +946,7 @@ namespace hgl
template<typename V4> template<typename V4>
bool Fill(const V4 &v,const uint32_t count) bool Fill(const V4 &v,const uint32_t count)
{ {
if(!this->access||this->access+(count<<2)>=this->data_end) if(!this->access||this->access+(count<<2)>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(const Vector4f,")+OSString::valueOf(count)+OS_TEXT(") out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(const Vector4f,")+OSString::valueOf(count)+OS_TEXT(") out"));
return(false); return(false);
@ -971,7 +971,7 @@ namespace hgl
template<typename V4> template<typename V4>
bool Write(const V4 *v,const uint32_t count) bool Write(const V4 *v,const uint32_t count)
{ {
if(!this->access||this->access+(count<<2)>=this->data_end) if(!this->access||this->access+(count<<2)>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(const Vector4f,")+OSString::valueOf(count)+OS_TEXT(") out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::Write(const Vector4f,")+OSString::valueOf(count)+OS_TEXT(") out"));
return(false); return(false);
@ -992,7 +992,7 @@ namespace hgl
bool WriteLine(const T start_x,const T start_y,const T start_z,const T end_x,const T end_y,const T end_z) bool WriteLine(const T start_x,const T start_y,const T start_z,const T end_x,const T end_y,const T end_z)
{ {
if(!this->access||this->access+8>=this->data_end) if(!this->access||this->access+8>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteLine(T,T,T,T,T,T) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteLine(T,T,T,T,T,T) out"));
return(false); return(false);
@ -1013,7 +1013,7 @@ namespace hgl
template<typename V4> template<typename V4>
bool WriteLine(const V4 &start,const V4 &end) bool WriteLine(const V4 &start,const V4 &end)
{ {
if(!this->access||this->access+8>=this->data_end) if(!this->access||this->access+8>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteLine(vec3,vec3) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteLine(vec3,vec3) out"));
return(false); return(false);
@ -1037,7 +1037,7 @@ namespace hgl
template<typename V4> template<typename V4>
bool WriteTriangle(const V4 &v1,const V4 &v2,const V4 &v3) bool WriteTriangle(const V4 &v1,const V4 &v2,const V4 &v3)
{ {
if(!this->access||this->access+12>=this->data_end) if(!this->access||this->access+12>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteTriangle(vec3,vec3,vec3) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteTriangle(vec3,vec3,vec3) out"));
return(false); return(false);
@ -1067,7 +1067,7 @@ namespace hgl
template<typename V4> template<typename V4>
bool WriteTriangle(const V4 *v) bool WriteTriangle(const V4 *v)
{ {
if(!this->access||this->access+12>=this->data_end) if(!this->access||this->access+12>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteTriangle(vec3 *) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteTriangle(vec3 *) out"));
return(false); return(false);
@ -1099,7 +1099,7 @@ namespace hgl
template<typename V> template<typename V>
bool WriteRectangle2D(const RectScope2<V> &rect) bool WriteRectangle2D(const RectScope2<V> &rect)
{ {
if(!this->access||this->access+4>=this->data_end) if(!this->access||this->access+4>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteRectangle2D(RectScope2 ) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteRectangle2D(RectScope2 ) out"));
return(false); return(false);
@ -1119,7 +1119,7 @@ namespace hgl
template<typename V> template<typename V>
bool WriteRectangle2D(const RectScope2<V> *rect,const uint32_t count) bool WriteRectangle2D(const RectScope2<V> *rect,const uint32_t count)
{ {
if(!this->access||this->access+(4*count)>=this->data_end) if(!this->access||this->access+(4*count)>this->data_end)
{ {
LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteRectangle2D(RectScope2 *,count) out")); LOG_HINT(OS_TEXT("VertexAttribDataAccess4::WriteRectangle2D(RectScope2 *,count) out"));
return(false); return(false);

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@ namespace hgl
ShaderStageBind *ssb; ShaderStageBind *ssb;
if(vabc_maps.Get(name,ssb)) if(vab_maps.Get(name,ssb))
return ssb->data; return ssb->data;
ssb=new ShaderStageBind; ssb=new ShaderStageBind;
@ -39,7 +39,7 @@ namespace hgl
ssb->name =name; ssb->name =name;
ssb->binding=ss->binding; ssb->binding=ss->binding;
vabc_maps.Add(name,ssb); vab_maps.Add(name,ssb);
return ssb->data; return ssb->data;
} }
@ -77,12 +77,12 @@ namespace hgl
{ {
const uint si_count=vsm->GetStageInputCount(); const uint si_count=vsm->GetStageInputCount();
if(vabc_maps.GetCount()!=si_count) if(vab_maps.GetCount()!=si_count)
return(nullptr); return(nullptr);
vulkan::Renderable *render_obj=mtl->CreateRenderable(vertices_number); vulkan::Renderable *render_obj=mtl->CreateRenderable(vertices_number);
const auto *sp=vabc_maps.GetDataList(); const auto *sp=vab_maps.GetDataList();
for(uint i=0;i<si_count;i++) for(uint i=0;i<si_count;i++)
{ {
render_obj->Set((*sp)->right->binding,db->CreateVAB((*sp)->right->data)); render_obj->Set((*sp)->right->binding,db->CreateVAB((*sp)->right->data));