From 5cb8e5dea1aa13b650ddbd84242f2fe7d8e6247b Mon Sep 17 00:00:00 2001 From: hyzboy Date: Mon, 21 Sep 2020 19:10:58 +0800 Subject: [PATCH] optimize the HQFilterTexture.cpp --- example/Vulkan/HQFilterTexture.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/example/Vulkan/HQFilterTexture.cpp b/example/Vulkan/HQFilterTexture.cpp index 692c2669..c5fc8be0 100644 --- a/example/Vulkan/HQFilterTexture.cpp +++ b/example/Vulkan/HQFilterTexture.cpp @@ -45,8 +45,10 @@ class TestApp:public VulkanApplicationFramework { private: - vulkan::PipelineData * pipeline_data =nullptr;; + vulkan::PipelineData * pipeline_data =nullptr; vulkan::Renderable * render_obj =nullptr; + vulkan::Sampler * sampler_linear =nullptr; + vulkan::Sampler * sampler_nearest =nullptr; struct MP { @@ -56,16 +58,12 @@ private: struct MIR { - MP * mp =nullptr; vulkan::MaterialInstance * material_instance =nullptr; vulkan::RenderableInstance *renderable_instance =nullptr; }mir_nearest,mir_linear,mir_nearest_hq,mir_linear_hq; vulkan::Texture2D * texture =nullptr; - vulkan::Sampler * sampler_linear =nullptr; - vulkan::Sampler * sampler_nearest =nullptr; - vulkan::VAB * vertex_buffer =nullptr; vulkan::VAB * tex_coord_buffer =nullptr; vulkan::IndexBuffer * index_buffer =nullptr; @@ -174,8 +172,6 @@ private: if(!mir->material_instance->BindSampler("tex",texture,sampler))return(false); mir->material_instance->Update(); - mir->mp=mp; - mir->renderable_instance=db->CreateRenderableInstance(render_obj,mir->material_instance,mp->pipeline); if(!mir->renderable_instance)