support "u8char" type

This commit is contained in:
hyzboy 2020-07-07 19:16:23 +08:00
parent 57a0326ee8
commit e6aeff6b65
30 changed files with 78 additions and 56 deletions

@ -1 +1 @@
Subproject commit a100a10dc8750903e5bf3779c1f337f5a940910e Subproject commit c2a18897ee57706681ed8b803187a129df5b3e40

@ -1 +1 @@
Subproject commit 2b3b225659aa182b69a53b887815aa915dd8723e Subproject commit 5530bcc0dc92f76adc0716a4c3c0ca64d8240642

2
CMCore

@ -1 +1 @@
Subproject commit 02cb4bb8b3f086321c8dd5773cc6355e72a5c8cb Subproject commit f6a846c655dbf2b50f600f61809419075069990a

@ -1 +1 @@
Subproject commit 165e95c0d54e4ba978bcba50a0f7b43200648309 Subproject commit cdd9d4eb14f4c7f852362f59c14d680f39370685

View File

@ -35,11 +35,13 @@ CreateProject(08.SceneTree SceneTree.cpp)
CreateProject(09.LoadStaticMesh LoadStaticMesh.cpp LoadScene.cpp) CreateProject(09.LoadStaticMesh LoadStaticMesh.cpp LoadScene.cpp)
CreateProject(10.InlineGeometryScene InlineGeometryScene.cpp) CreateProject(10.InlineGeometryScene InlineGeometryScene.cpp)
CreateProject(11.Atomsphere Atomsphere.cpp) CreateProject(11.Atomsphere Atomsphere.cpp)
CreateProject(12.DrawText DrawText.cpp)
CreateProject(12.RectanglePrimivate RectanglePrimivate.cpp)
CreateProject(13.DrawText DrawText.cpp)
IF(SUPPORT_QT_VULKAN) IF(SUPPORT_QT_VULKAN)
include(QtCommon) include(QtCommon)
CreateQtProject(13.VulkanQT VulkanQtApp.cpp CreateQtProject(14.VulkanQT VulkanQtApp.cpp
QtVulkanWindow.cpp QtVulkanWindow.cpp
QtVulkanWindow.h QtVulkanWindow.h
QtVulkanMainWindow.h QtVulkanMainWindow.h

View File

@ -112,7 +112,7 @@ public:
cili.khronos.validation = true; cili.khronos.validation = true;
cili.RenderDoc.Capture = true; cili.RenderDoc.Capture = true;
inst=vulkan::CreateInstance(U8_TEXT("VulkanTest"),nullptr,&cili); inst=vulkan::CreateInstance("VulkanTest",nullptr,&cili);
if(!inst) if(!inst)
return(false); return(false);

View File

@ -15,7 +15,7 @@ namespace hgl
*/ */
class TileFont class TileFont
{ {
FontSource *source;
TileData *tile_data; TileData *tile_data;
public: public:

View File

@ -7,7 +7,7 @@
VK_NAMESPACE_BEGIN VK_NAMESPACE_BEGIN
struct ShaderStage struct ShaderStage
{ {
UTF8String name; AnsiString name;
uint location; uint location;
VkFormat format; VkFormat format;
};//struct ShaderStage };//struct ShaderStage
@ -17,7 +17,7 @@ VK_NAMESPACE_BEGIN
struct ShaderDescriptorList struct ShaderDescriptorList
{ {
UTF8StringList name_list; AnsiStringList name_list;
ShaderBindingList binding_list; ShaderBindingList binding_list;
}; };
@ -60,7 +60,7 @@ VK_NAMESPACE_BEGIN
ShaderStageList &GetStageInputs(){return stage_inputs;} ShaderStageList &GetStageInputs(){return stage_inputs;}
ShaderStageList &GetStageOutputs(){return stage_outputs;} ShaderStageList &GetStageOutputs(){return stage_outputs;}
const int GetStageInputBinding(const UTF8String &); const int GetStageInputBinding(const AnsiString &);
const ShaderDescriptorList *GetDescriptorList()const{return descriptor_list;} const ShaderDescriptorList *GetDescriptorList()const{return descriptor_list;}
ShaderDescriptorList *GetDescriptorList(VkDescriptorType desc_type) ShaderDescriptorList *GetDescriptorList(VkDescriptorType desc_type)
@ -75,7 +75,7 @@ VK_NAMESPACE_BEGIN
ShaderDescriptorList &GetSSBO(){return descriptor_list[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER];} ShaderDescriptorList &GetSSBO(){return descriptor_list[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER];}
ShaderDescriptorList &GetSampler(){return descriptor_list[VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER];} ShaderDescriptorList &GetSampler(){return descriptor_list[VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER];}
const int GetBinding (VkDescriptorType desc_type,const UTF8String &name)const; const int GetBinding (VkDescriptorType desc_type,const AnsiString &name)const;
const ShaderBindingList * GetBindingList (VkDescriptorType desc_type)const const ShaderBindingList * GetBindingList (VkDescriptorType desc_type)const
{ {
if(desc_type<VK_DESCRIPTOR_TYPE_BEGIN_RANGE if(desc_type<VK_DESCRIPTOR_TYPE_BEGIN_RANGE

View File

@ -184,7 +184,7 @@ public: //Texture
public: // public: //
Sampler *CreateSampler(VkSamplerCreateInfo *); Sampler *CreateSampler(VkSamplerCreateInfo *sci=nullptr);
ShaderModuleManage *CreateShaderModuleManage(); ShaderModuleManage *CreateShaderModuleManage();

View File

@ -59,7 +59,7 @@ VK_NAMESPACE_BEGIN
private: private:
friend Instance *CreateInstance(const UTF8String &app_name,VKDebugOut *out=nullptr,CreateInstanceLayerInfo *cili=nullptr); friend Instance *CreateInstance(const AnsiString &app_name,VKDebugOut *out=nullptr,CreateInstanceLayerInfo *cili=nullptr);
Instance(VkInstance,VKDebugOut *); Instance(VkInstance,VKDebugOut *);
@ -78,6 +78,6 @@ VK_NAMESPACE_BEGIN
const List<VkExtensionProperties> & GetExtensionProperties(); const List<VkExtensionProperties> & GetExtensionProperties();
const bool CheckLayerSupport(const char *); const bool CheckLayerSupport(const char *);
Instance *CreateInstance(const UTF8String &,VKDebugOut *,CreateInstanceLayerInfo *); ///<创建一个Vulkan实例 Instance *CreateInstance(const AnsiString &,VKDebugOut *,CreateInstanceLayerInfo *); ///<创建一个Vulkan实例
VK_NAMESPACE_END VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_INSTANCE_INCLUDE #endif//HGL_GRAPH_VULKAN_INSTANCE_INCLUDE

View File

@ -30,9 +30,9 @@ public:
const VertexShaderModule *GetVertexShaderModule()const{return vertex_sm;} const VertexShaderModule *GetVertexShaderModule()const{return vertex_sm;}
const int GetBinding(VkDescriptorType,const UTF8String &)const; const int GetBinding(VkDescriptorType,const AnsiString &)const;
#define GET_BO_BINDING(name,vk_name) const int Get##name(const UTF8String &obj_name)const{return GetBinding(VK_DESCRIPTOR_TYPE_##vk_name,obj_name);} #define GET_BO_BINDING(name,vk_name) const int Get##name(const AnsiString &obj_name)const{return GetBinding(VK_DESCRIPTOR_TYPE_##vk_name,obj_name);}
// GET_BO_BINDING(Sampler, SAMPLER) // GET_BO_BINDING(Sampler, SAMPLER)
GET_BO_BINDING(Sampler, COMBINED_IMAGE_SAMPLER) GET_BO_BINDING(Sampler, COMBINED_IMAGE_SAMPLER)

View File

@ -25,8 +25,8 @@ public:
~MaterialInstance(); ~MaterialInstance();
bool BindUBO(const UTF8String &name,vulkan::Buffer *ubo); bool BindUBO(const AnsiString &name,vulkan::Buffer *ubo);
bool BindSampler(const UTF8String &name,Texture *tex,Sampler *sampler); bool BindSampler(const AnsiString &name,Texture *tex,Sampler *sampler);
void Update(); void Update();
};//class MaterialInstance };//class MaterialInstance

View File

@ -33,7 +33,7 @@ public:
const VkPhysicalDeviceProperties & GetProperties ()const{return properties;} const VkPhysicalDeviceProperties & GetProperties ()const{return properties;}
const VkPhysicalDeviceMemoryProperties &GetMemoryProperties ()const{return memory_properties;} const VkPhysicalDeviceMemoryProperties &GetMemoryProperties ()const{return memory_properties;}
const uint32_t GetExtensionSpecVersion(const UTF8String &name)const; const uint32_t GetExtensionSpecVersion(const AnsiString &name)const;
const VkDriverIdKHR GetDriverId ()const{return driver_properties.driverID;} const VkDriverIdKHR GetDriverId ()const{return driver_properties.driverID;}
const char * GetDriverName ()const{return driver_properties.driverName;} const char * GetDriverName ()const{return driver_properties.driverName;}

View File

@ -83,7 +83,7 @@ public:
PipelineCreater(Device *dev,const Material *,const RenderTarget *,uchar *,uint); PipelineCreater(Device *dev,const Material *,const RenderTarget *,uchar *,uint);
~PipelineCreater()=default; ~PipelineCreater()=default;
bool Set(const VkPrimitiveTopology,bool=false); bool Set(const uint prim,bool=false);
void SetViewport( float x,float y,float w,float h){viewport.x=x;viewport.y=y;viewport.width=w;viewport.height=h;} void SetViewport( float x,float y,float w,float h){viewport.x=x;viewport.y=y;viewport.width=w;viewport.height=h;}
void SetDepthRange( float min_depth,float max_depth){viewport.minDepth=min_depth;viewport.maxDepth=max_depth;} void SetDepthRange( float min_depth,float max_depth){viewport.minDepth=min_depth;viewport.maxDepth=max_depth;}

View File

@ -14,7 +14,7 @@
#define PRIM_TRIANGLES_ADJ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY ///<代表一个有六个顶点的Primitive,其中第1,3,5个顶点代表一个Triangle,而地2,4,6个点提供邻近信息.(由1起算) #define PRIM_TRIANGLES_ADJ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY ///<代表一个有六个顶点的Primitive,其中第1,3,5个顶点代表一个Triangle,而地2,4,6个点提供邻近信息.(由1起算)
#define PRIM_TRIANGLE_STRIP_ADJ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY ///<4+2N个Vertices代表N个Primitive,其中1,3,5,7,9...代表原本的Triangle strip形成Triangle,而2,4,6,8,10...代表邻近提供信息的点.(由1起算) #define PRIM_TRIANGLE_STRIP_ADJ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY ///<4+2N个Vertices代表N个Primitive,其中1,3,5,7,9...代表原本的Triangle strip形成Triangle,而2,4,6,8,10...代表邻近提供信息的点.(由1起算)
#define PRIM_PATCHS VK_PRIMITIVE_TOPOLOGY_PATCH_LIST #define PRIM_PATCHS VK_PRIMITIVE_TOPOLOGY_PATCH_LIST
#define PRIM_RECTANGLE 0x100 ///<矩形(并非原生支持。以画点形式在每个点的Position中传递Left,Top,Width,Height。在Geometry Shader中转换为2个三角形。用于2D游戏或UI) #define PRIM_RECTANGLES 0x100 ///<矩形(并非原生支持。以画点形式在每个点的Position中传递Left,Top,Width,Height。在Geometry Shader中转换为2个三角形。用于2D游戏或UI)
#define PRIM_BEGIN VK_PRIMITIVE_TOPOLOGY_POINT_LIST #define PRIM_BEGIN VK_PRIMITIVE_TOPOLOGY_POINT_LIST
#define PRIM_END VK_PRIMITIVE_TOPOLOGY_PATCH_LIST #define PRIM_END VK_PRIMITIVE_TOPOLOGY_PATCH_LIST
constexpr uint32_t PRIM_RANGE =PRIM_END-PRIM_BEGIN+1; constexpr uint32_t PRIM_RANGE =PRIM_END-PRIM_BEGIN+1;

View File

@ -48,7 +48,7 @@ public:
const AABB &GetBoundingBox()const {return BoundingBox;} const AABB &GetBoundingBox()const {return BoundingBox;}
bool Set(const int stage_input_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 AnsiString &name, VertexBuffer *vb,VkDeviceSize offset=0);
bool Set(IndexBuffer *ib,VkDeviceSize offset=0) bool Set(IndexBuffer *ib,VkDeviceSize offset=0)
{ {

View File

@ -39,7 +39,7 @@ public:
const VkShaderStageFlagBits GetStage ()const{return stage_create_info->stage;} const VkShaderStageFlagBits GetStage ()const{return stage_create_info->stage;}
const VkPipelineShaderStageCreateInfo * GetCreateInfo ()const{return stage_create_info;} const VkPipelineShaderStageCreateInfo * GetCreateInfo ()const{return stage_create_info;}
const int GetBinding (VkDescriptorType desc_type,const UTF8String &name)const const int GetBinding (VkDescriptorType desc_type,const AnsiString &name)const
{ {
return shader_resource->GetBinding(desc_type,name); return shader_resource->GetBinding(desc_type,name);
} }
@ -71,7 +71,7 @@ public:
/** /**
* binding并非是shader中的binding/locationvkCmdBindVertexBuffer的缓冲区序列号 * binding并非是shader中的binding/locationvkCmdBindVertexBuffer的缓冲区序列号
*/ */
const int GetStageInputBinding(const UTF8String &name)const{return shader_resource->GetStageInputBinding(name);} const int GetStageInputBinding(const AnsiString &name)const{return shader_resource->GetStageInputBinding(name);}
const uint32_t GetAttrCount()const{return attr_count;} const uint32_t GetAttrCount()const{return attr_count;}

View File

@ -25,17 +25,17 @@ public:
~VertexAttributeBinding(); ~VertexAttributeBinding();
const uint GetStageInputBinding(const UTF8String &name); ///<取得一个变量的绑定点 const uint GetStageInputBinding(const AnsiString &name); ///<取得一个变量的绑定点
bool SetInstance(const uint binding,bool instance); bool SetInstance(const uint binding,bool instance);
bool SetStride (const uint binding,const uint32_t & stride); bool SetStride (const uint binding,const uint32_t & stride);
bool SetFormat (const uint binding,const VkFormat & format); bool SetFormat (const uint binding,const VkFormat & format);
bool SetOffset (const uint binding,const uint32_t offset); bool SetOffset (const uint binding,const uint32_t offset);
bool SetInstance(const UTF8String &name,bool instance){return SetInstance(GetStageInputBinding(name),instance);} bool SetInstance(const AnsiString &name,bool instance){return SetInstance(GetStageInputBinding(name),instance);}
bool SetStride (const UTF8String &name,const uint32_t &stride ){return SetStride (GetStageInputBinding(name),stride);} bool SetStride (const AnsiString &name,const uint32_t &stride ){return SetStride (GetStageInputBinding(name),stride);}
bool SetFormat (const UTF8String &name,const VkFormat &format ){return SetFormat (GetStageInputBinding(name),format);} bool SetFormat (const AnsiString &name,const VkFormat &format ){return SetFormat (GetStageInputBinding(name),format);}
bool SetOffset (const UTF8String &name,const uint32_t offset ){return SetOffset (GetStageInputBinding(name),offset);} bool SetOffset (const AnsiString &name,const uint32_t offset ){return SetOffset (GetStageInputBinding(name),offset);}
void Write(VkPipelineVertexInputStateCreateInfo &vis)const; void Write(VkPipelineVertexInputStateCreateInfo &vis)const;
};//class VertexAttributeBinding };//class VertexAttributeBinding

View File

@ -350,7 +350,7 @@ namespace
std::cout<<" deviceType: "<<DeviceTypeString[pdp.deviceType]<<std::endl; std::cout<<" deviceType: "<<DeviceTypeString[pdp.deviceType]<<std::endl;
std::cout<<" deviceName: "<<pdp.deviceName<<std::endl; std::cout<<" deviceName: "<<pdp.deviceName<<std::endl;
UTF8String uuid=HexToString<char>(pdp.pipelineCacheUUID); AnsiString uuid=HexToString<char>(pdp.pipelineCacheUUID);
std::cout<<"pipelineCahceUUID: "<<uuid.c_str()<<std::endl; std::cout<<"pipelineCahceUUID: "<<uuid.c_str()<<std::endl;

View File

@ -217,7 +217,30 @@ bool Device::SubmitTexture(const VkCommandBuffer *cmd_bufs,const uint32_t count)
Sampler *Device::CreateSampler(VkSamplerCreateInfo *sci) Sampler *Device::CreateSampler(VkSamplerCreateInfo *sci)
{ {
if(!sci)return(nullptr); static VkSamplerCreateInfo default_sampler_create_info
{
.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
.pNext = nullptr,
.flags = 0,
.magFilter = VK_FILTER_LINEAR,
.minFilter = VK_FILTER_LINEAR,
.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR,
.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
.mipLodBias = 0.0f,
.anisotropyEnable = false,
.maxAnisotropy = 0,
.compareEnable = false,
.compareOp = VK_COMPARE_OP_NEVER,
.minLod = 0.0f,
.maxLod = 1.0f,
.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK,
.unnormalizedCoordinates = false
};
if(!sci)
sci=&default_sampler_create_info;
VkSampler sampler; VkSampler sampler;

View File

@ -9,7 +9,7 @@ Device *CreateRenderDevice(VkInstance,const PhysicalDevice *,Window *);
void CheckInstanceLayer(CharPointerList &layer_list,CreateInstanceLayerInfo *layer_info); void CheckInstanceLayer(CharPointerList &layer_list,CreateInstanceLayerInfo *layer_info);
Instance *CreateInstance(const UTF8String &app_name,VKDebugOut *out,CreateInstanceLayerInfo *layer_info) Instance *CreateInstance(const AnsiString &app_name,VKDebugOut *out,CreateInstanceLayerInfo *layer_info)
{ {
VkApplicationInfo app_info; VkApplicationInfo app_info;
VkInstanceCreateInfo inst_info; VkInstanceCreateInfo inst_info;

View File

@ -75,7 +75,7 @@ Material::~Material()
delete shader_maps; delete shader_maps;
} }
const int Material::GetBinding(VkDescriptorType desc_type,const UTF8String &name)const const int Material::GetBinding(VkDescriptorType desc_type,const AnsiString &name)const
{ {
if(desc_type<VK_DESCRIPTOR_TYPE_BEGIN_RANGE if(desc_type<VK_DESCRIPTOR_TYPE_BEGIN_RANGE
||desc_type>VK_DESCRIPTOR_TYPE_END_RANGE ||desc_type>VK_DESCRIPTOR_TYPE_END_RANGE

View File

@ -15,7 +15,7 @@ MaterialInstance::~MaterialInstance()
delete descriptor_sets; delete descriptor_sets;
} }
bool MaterialInstance::BindUBO(const UTF8String &name,vulkan::Buffer *ubo) bool MaterialInstance::BindUBO(const AnsiString &name,vulkan::Buffer *ubo)
{ {
if(name.IsEmpty()||!ubo) if(name.IsEmpty()||!ubo)
return(false); return(false);
@ -31,7 +31,7 @@ bool MaterialInstance::BindUBO(const UTF8String &name,vulkan::Buffer *ubo)
return(true); return(true);
} }
bool MaterialInstance::BindSampler(const UTF8String &name,Texture *tex,Sampler *sampler) bool MaterialInstance::BindSampler(const AnsiString &name,Texture *tex,Sampler *sampler)
{ {
if(name.IsEmpty()||!tex||!sampler) if(name.IsEmpty()||!tex||!sampler)
return(false); return(false);

View File

@ -58,7 +58,7 @@ PhysicalDevice::PhysicalDevice(VkInstance inst,VkPhysicalDevice pd)
} }
} }
const uint32_t PhysicalDevice::GetExtensionSpecVersion(const UTF8String &name)const const uint32_t PhysicalDevice::GetExtensionSpecVersion(const AnsiString &name)const
{ {
const uint count=extension_properties.GetCount(); const uint count=extension_properties.GetCount();
const VkExtensionProperties *ep=extension_properties.GetData(); const VkExtensionProperties *ep=extension_properties.GetData();

View File

@ -217,15 +217,15 @@ PipelineCreater::PipelineCreater(Device *dev,const Material *material,const Rend
} }
} }
bool PipelineCreater::Set(const VkPrimitiveTopology topology,bool restart) bool PipelineCreater::Set(const uint topology,bool restart)
{ {
if(topology<PRIM_BEGIN||topology>PRIM_END) if(topology<PRIM_BEGIN||topology>PRIM_END)
if(topology!=PRIM_RECTANGLE)return(false); if(topology!=PRIM_RECTANGLES)return(false);
inputAssembly.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; inputAssembly.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
inputAssembly.pNext = nullptr; inputAssembly.pNext = nullptr;
inputAssembly.flags = 0; inputAssembly.flags = 0;
inputAssembly.topology = (topology==PRIM_RECTANGLE?VK_PRIMITIVE_TOPOLOGY_POINT_LIST:topology); inputAssembly.topology = VkPrimitiveTopology(topology==PRIM_RECTANGLES?VK_PRIMITIVE_TOPOLOGY_POINT_LIST:topology);
inputAssembly.primitiveRestartEnable = restart; inputAssembly.primitiveRestartEnable = restart;
pipelineInfo.pInputAssemblyState = &inputAssembly; pipelineInfo.pInputAssemblyState = &inputAssembly;

View File

@ -38,7 +38,7 @@ bool Renderable::Set(const int stage_input_binding,VertexBuffer *vbo,VkDeviceSiz
return(true); return(true);
} }
bool Renderable::Set(const UTF8String &name,VertexBuffer *vbo,VkDeviceSize offset) bool Renderable::Set(const AnsiString &name,VertexBuffer *vbo,VkDeviceSize offset)
{ {
return Set(vertex_sm->GetStageInputBinding(name),vbo,offset); return Set(vertex_sm->GetStageInputBinding(name),vbo,offset);
} }

View File

@ -27,7 +27,7 @@ VertexAttributeBinding::~VertexAttributeBinding()
vsm->Release(this); vsm->Release(this);
} }
const uint VertexAttributeBinding::GetStageInputBinding(const UTF8String &name) const uint VertexAttributeBinding::GetStageInputBinding(const AnsiString &name)
{ {
return vsm->GetStageInputBinding(name); return vsm->GetStageInputBinding(name);
} }

View File

@ -21,4 +21,4 @@ namespace hgl
return source; return source;
} }
}//namespace graph }//namespace graph
}//namespace hgl }//namespace hgl

View File

@ -10,22 +10,19 @@ namespace hgl
TileFont::TileFont(TileData *td,FontSource *fs) TileFont::TileFont(TileData *td,FontSource *fs)
{ {
hgl_zero(source_map);
tile_data=td; tile_data=td;
for(uint i=0;i<(uint)UnicodeBlock::RANGE_SIZE;i++)
source_map[i]=fs;
fs->RefAcquire(this); if(fs)
{
source=fs;
source->RefAcquire(this);
}
} }
TileFont::~TileFont() TileFont::~TileFont()
{ {
for(uint i=0;i<(uint)UnicodeBlock::RANGE_SIZE;i++) if(source)
{ source->RefRelease(this);
if(source_map[i])
source_map[i]->RefRelease(this);
}
SAFE_CLEAR(tile_data); SAFE_CLEAR(tile_data);
} }

View File

@ -65,7 +65,7 @@ VK_NAMESPACE_BEGIN
{ {
sd_list->binding_list.Add(*data++); sd_list->binding_list.Add(*data++);
str_len=*data++; str_len=*data++;
sd_list->name_list.Add(UTF8String((char *)data,str_len)); sd_list->name_list.Add(AnsiString((char *)data,str_len));
data+=str_len; data+=str_len;
} }
@ -86,7 +86,7 @@ VK_NAMESPACE_BEGIN
delete[] data; delete[] data;
} }
const int ShaderResource::GetStageInputBinding(const UTF8String &name) const int ShaderResource::GetStageInputBinding(const AnsiString &name)
{ {
const int count=stage_inputs.GetCount(); const int count=stage_inputs.GetCount();
ShaderStage **ss=stage_inputs.GetData(); ShaderStage **ss=stage_inputs.GetData();
@ -102,7 +102,7 @@ VK_NAMESPACE_BEGIN
return -1; return -1;
} }
const int ShaderResource::GetBinding(VkDescriptorType desc_type,const UTF8String &name)const const int ShaderResource::GetBinding(VkDescriptorType desc_type,const AnsiString &name)const
{ {
if(desc_type>=VK_DESCRIPTOR_TYPE_RANGE_SIZE)return -1; if(desc_type>=VK_DESCRIPTOR_TYPE_RANGE_SIZE)return -1;
if(name.IsEmpty())return -1; if(name.IsEmpty())return -1;