Fixed renew ubo bug.
This commit is contained in:
parent
774f106738
commit
ce095f97f2
@ -17,7 +17,7 @@ static float position_data_float[VERTEX_COUNT][2]=
|
||||
{0.25, 0.75}
|
||||
};
|
||||
|
||||
static uint16 position_data_u16[VERTEX_COUNT][2]={};
|
||||
static uint16 position_data[VERTEX_COUNT][2]={};
|
||||
|
||||
constexpr uint8 color_data[VERTEX_COUNT*4]=
|
||||
{
|
||||
@ -26,16 +26,6 @@ constexpr uint8 color_data[VERTEX_COUNT*4]=
|
||||
0,0,255,255
|
||||
};
|
||||
|
||||
//#define USE_ZERO2ONE_COORD //使用左上角0,0右下角1,1的坐标系
|
||||
|
||||
#ifdef USE_ZERO2ONE_COORD
|
||||
constexpr VkFormat PositionFormat=VF_V2F;
|
||||
#define position_data position_data_float
|
||||
#else
|
||||
constexpr VkFormat PositionFormat=VF_V2U16;
|
||||
#define position_data position_data_u16
|
||||
#endif//
|
||||
|
||||
class TestApp:public WorkObject
|
||||
{
|
||||
private:
|
||||
@ -55,9 +45,6 @@ private:
|
||||
|
||||
VILConfig vil_config;
|
||||
|
||||
#ifdef USE_ZERO2ONE_COORD
|
||||
cfg.coordinate_system=CoordinateSystem2D::ZeroToOne;
|
||||
#else
|
||||
cfg.coordinate_system=CoordinateSystem2D::Ortho;
|
||||
|
||||
cfg.position_format =VAT_UVEC2; //这里指定shader中使用uvec2当做顶点输入格式
|
||||
@ -70,10 +57,9 @@ private:
|
||||
|
||||
for(uint i=0;i<VERTEX_COUNT;i++)
|
||||
{
|
||||
position_data_u16[i][0]=position_data_float[i][0]*ext.width;
|
||||
position_data_u16[i][1]=position_data_float[i][1]*ext.height;
|
||||
position_data[i][0]=position_data_float[i][0]*ext.width;
|
||||
position_data[i][1]=position_data_float[i][1]*ext.height;
|
||||
}
|
||||
#endif//USE_ZERO2ONE_COORD
|
||||
|
||||
vil_config.Add(VAN::Color,VF_V4UN8); //这里指定VAB中使用RGBA8UNorm当做颜色数据格式
|
||||
|
||||
@ -96,8 +82,8 @@ private:
|
||||
{
|
||||
render_obj=CreateRenderable("Triangle",VERTEX_COUNT,material_instance,pipeline,
|
||||
{
|
||||
{VAN::Position,PositionFormat, position_data},
|
||||
{VAN::Color, VF_V4UN8, color_data}
|
||||
{VAN::Position,VF_V2U16,position_data},
|
||||
{VAN::Color, VF_V4UN8,color_data}
|
||||
});
|
||||
return(render_obj);
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ void DescriptorSet::Clear()
|
||||
image_list.Clear();
|
||||
wds_list.Clear();
|
||||
binded_sets.Clear();
|
||||
is_dirty=true;
|
||||
is_dirty=false;
|
||||
}
|
||||
|
||||
bool DescriptorSet::BindUBO(const int binding,const DeviceBuffer *buf,bool dynamic)
|
||||
@ -191,6 +191,6 @@ void DescriptorSet::Update()
|
||||
if(wds_list.GetCount()>0)
|
||||
vkUpdateDescriptorSets(device,wds_list.GetCount(),wds_list.GetData(),0,nullptr);
|
||||
|
||||
is_dirty=false;
|
||||
Clear();
|
||||
}
|
||||
VK_NAMESPACE_END
|
||||
|
Loading…
x
Reference in New Issue
Block a user