updated texture_rect.cpp, but it can't run.

This commit is contained in:
hyzboy 2021-06-19 21:04:02 +08:00
parent 8512d4169c
commit c49131e517
2 changed files with 23 additions and 6 deletions

View File

@ -51,9 +51,9 @@ private:
Texture2D * texture =nullptr;
Sampler * sampler =nullptr;
MaterialParameters * material_instance =nullptr;
MaterialInstance * material_instance =nullptr;
RenderableInstance *renderable_instance =nullptr;
GPUBuffer * ubo_camera_info =nullptr;
GPUBuffer * ubo_camera_info =nullptr;
Pipeline * pipeline =nullptr;
private:
@ -71,7 +71,15 @@ private:
sampler=db->CreateSampler();
material_instance->BindSampler("tex",texture,sampler);
{
MaterialParameters *mp_texture=material_instance->GetMP(DescriptorSetsType::Value);
if(!mp_texture)
if(!mp_texture->BindUBO("tex",ubo_camera_info))return(false);
mp_texture->Update();
}
return(true);
}
@ -90,8 +98,17 @@ private:
if(!ubo_camera_info)
return(false);
if(!material_instance->BindUBO("camera",ubo_camera_info))return(false);
material_instance->Update();
{
MaterialParameters *mp_global=material_instance->GetMP(DescriptorSetsType::Global);
if(!mp_global)
return(false);
if(!mp_global->BindUBO("g_camera",ubo_camera_info))return(false);
mp_global->Update();
}
return(true);
}

2
res

@ -1 +1 @@
Subproject commit 897770ef1d59af09b4863c34fc3040466b95b437
Subproject commit 27da09e0b6027a5651a030334d5026adef2aaff7