diff --git a/src/vht/Drawer.cppm b/src/vht/Drawer.cppm
index e41271f..aa42d44 100644
--- a/src/vht/Drawer.cppm
+++ b/src/vht/Drawer.cppm
@@ -1,6 +1,7 @@
 export module Drawer;
 
 import std;
+import glfw;
 import vulkan_hpp;
 
 import Config;
@@ -8,7 +9,8 @@ import DataLoader;
 import Window;
 import Device;
 import Swapchain;
-import RenderPass;
+// import RenderPass;
+import DepthImage;
 import GraphicsPipeline;
 import CommandPool;
 import InputAssembly;
@@ -41,7 +43,8 @@ export namespace vht {
         std::shared_ptr<vht::Window> m_window{ nullptr };
         std::shared_ptr<vht::Device> m_device{ nullptr };
         std::shared_ptr<vht::Swapchain> m_swapchain{ nullptr };
-        std::shared_ptr<vht::RenderPass> m_render_pass{ nullptr };
+        std::shared_ptr<vht::DepthImage> m_depth_image{ nullptr };
+        // std::shared_ptr<vht::RenderPass> m_render_pass{ nullptr };
         std::shared_ptr<vht::GraphicsPipeline> m_graphics_pipeline{ nullptr };
         std::shared_ptr<vht::CommandPool> m_command_pool{ nullptr };
         std::shared_ptr<vht::InputAssembly> m_input_assembly{ nullptr };
@@ -58,7 +61,8 @@ export namespace vht {
             std::shared_ptr<vht::Window> window,
             std::shared_ptr<vht::Device> device,
             std::shared_ptr<vht::Swapchain> swapchain,
-            std::shared_ptr<vht::RenderPass> render_pass,
+            std::shared_ptr<vht::DepthImage> depth_image,
+            // std::shared_ptr<vht::RenderPass> render_pass,
             std::shared_ptr<vht::GraphicsPipeline> graphics_pipeline,
             std::shared_ptr<vht::CommandPool> command_pool,
             std::shared_ptr<vht::InputAssembly> input_assembly,
@@ -68,7 +72,8 @@ export namespace vht {
             m_window(std::move(window)),
             m_device(std::move(device)),
             m_swapchain(std::move(swapchain)),
-            m_render_pass(std::move(render_pass)),
+            m_depth_image(std::move(depth_image)),
+            // m_render_pass(std::move(render_pass)),
             m_graphics_pipeline(std::move(graphics_pipeline)),
             m_command_pool(std::move(command_pool)),
             m_input_assembly(std::move(input_assembly)),
@@ -94,7 +99,7 @@ export namespace vht {
                 );
                 image_index = idx;
             } catch (const vk::OutOfDateKHRError&){
-                m_render_pass->recreate();
+                recreate_swapchain();
                 return;
             }
 
@@ -140,20 +145,36 @@ export namespace vht {
             // 提交呈现命令
             try{
                 if(  m_device->present_queue().presentKHR(present_info) == vk::Result::eSuboptimalKHR ) {
-                    m_render_pass->recreate();
+                    recreate_swapchain();
                 }
             } catch (const vk::OutOfDateKHRError&){
-                m_render_pass->recreate();
+                recreate_swapchain();
             }
             // 检查窗口是否被调整大小
             if( m_window->framebuffer_resized() ){
-                m_render_pass->recreate();
+                recreate_swapchain();
             }
             // 更新飞行中的帧索引
             m_current_frame = (m_current_frame + 1) % MAX_FRAMES_IN_FLIGHT;
         }
 
     private:
+
+        void recreate_swapchain() const {
+            int width = 0, height = 0;
+            glfw::get_framebuffer_size(m_window->ptr(), &width, &height);
+            while (width == 0 || height == 0) {
+                glfw::get_framebuffer_size(m_window->ptr(), &width, &height);
+                glfw::wait_events();
+            }
+            m_device->device().waitIdle();
+
+            m_swapchain->recreate();
+            m_depth_image->recreate();
+
+            m_window->reset_framebuffer_resized();
+        }
+
         void init() {
             create_sync_object();
             create_command_buffers();
@@ -189,19 +210,43 @@ export namespace vht {
         void record_command_buffer(const vk::raii::CommandBuffer& command_buffer, const std::uint32_t image_index) const {
             command_buffer.begin( vk::CommandBufferBeginInfo{} );
 
-            vk::RenderPassBeginInfo render_pass_begin_info;
-            render_pass_begin_info.renderPass = m_render_pass->render_pass();
-            render_pass_begin_info.framebuffer = m_render_pass->framebuffers()[image_index];
+            vk::ImageMemoryBarrier2 color_barrier;
+            color_barrier.setImage( m_swapchain->images()[image_index] );
+            color_barrier.setOldLayout( vk::ImageLayout::eUndefined );
+            color_barrier.setNewLayout( vk::ImageLayout::eAttachmentOptimal );
+            color_barrier.setSrcStageMask( vk::PipelineStageFlagBits2::eColorAttachmentOutput );
+            color_barrier.setSrcAccessMask( vk::AccessFlagBits2::eNone );
+            color_barrier.setDstStageMask( vk::PipelineStageFlagBits2::eColorAttachmentOutput );
+            color_barrier.setDstAccessMask( vk::AccessFlagBits2::eColorAttachmentWrite );
+            color_barrier.setSubresourceRange( { vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1 } );
+            color_barrier.srcQueueFamilyIndex = vk::QueueFamilyIgnored;
+            color_barrier.dstQueueFamilyIndex = vk::QueueFamilyIgnored;
+
+            vk::DependencyInfo dependency_info;
+            dependency_info.setImageMemoryBarriers( color_barrier );
+            command_buffer.pipelineBarrier2( dependency_info );
 
-            render_pass_begin_info.renderArea.offset = vk::Offset2D{0, 0};
-            render_pass_begin_info.renderArea.extent = m_swapchain->extent();
+            vk::RenderingAttachmentInfo color_attachment;
+            color_attachment.setImageView( m_swapchain->image_views()[image_index] );
+            color_attachment.setImageLayout( vk::ImageLayout::eColorAttachmentOptimal );
+            color_attachment.setLoadOp( vk::AttachmentLoadOp::eClear );
+            color_attachment.setStoreOp( vk::AttachmentStoreOp::eStore );
+            color_attachment.setClearValue( vk::ClearColorValue{ 0.0f, 0.0f, 0.0f, 1.0f } );
 
-            std::array<vk::ClearValue, 2> clear_values;
-            clear_values[0] = vk::ClearColorValue{ 0.0f, 0.0f, 0.0f, 1.0f };
-            clear_values[1] = vk::ClearDepthStencilValue{ 1.0f ,0 };
-            render_pass_begin_info.setClearValues( clear_values );
+            vk::RenderingAttachmentInfo depth_attachment;
+            depth_attachment.setImageView( m_depth_image->image_view() );
+            depth_attachment.setImageLayout( vk::ImageLayout::eDepthAttachmentOptimal );
+            depth_attachment.setLoadOp( vk::AttachmentLoadOp::eClear );
+            depth_attachment.setStoreOp( vk::AttachmentStoreOp::eDontCare );
+            depth_attachment.setClearValue( vk::ClearDepthStencilValue{ 1.0f, 0 } );
 
-            command_buffer.beginRenderPass( render_pass_begin_info, vk::SubpassContents::eInline);
+            vk::RenderingInfo render_info;
+            render_info.setRenderArea( vk::Rect2D{ vk::Offset2D{0, 0}, m_swapchain->extent() } );
+            render_info.setLayerCount( 1 );
+            render_info.setColorAttachments( color_attachment );
+            render_info.setPDepthAttachment( &depth_attachment );
+
+            command_buffer.beginRendering( render_info );
 
             command_buffer.bindPipeline( vk::PipelineBindPoint::eGraphics, m_graphics_pipeline->pipeline() );
 
@@ -237,7 +282,27 @@ export namespace vht {
 
             command_buffer.drawIndexed(static_cast<std::uint32_t>(m_data_loader->indices().size()), 1, 0, 0, 0);
 
-            command_buffer.endRenderPass();
+            // command_buffer.endRenderPass();
+
+            command_buffer.endRendering();
+
+            vk::ImageMemoryBarrier2 present_barrier;
+            present_barrier.setImage( m_swapchain->images()[image_index] );
+            present_barrier.setOldLayout( vk::ImageLayout::eAttachmentOptimal );
+            present_barrier.setNewLayout( vk::ImageLayout::ePresentSrcKHR );
+            present_barrier.setSrcStageMask( vk::PipelineStageFlagBits2::eColorAttachmentOutput ); // 等待色彩写入完成
+            present_barrier.setSrcAccessMask( vk::AccessFlagBits2::eColorAttachmentWrite );
+            present_barrier.setDstStageMask( vk::PipelineStageFlagBits2::eNone );   // 后续没有其他阶段
+            present_barrier.setDstAccessMask( vk::AccessFlagBits2::eNone );
+            present_barrier.setSubresourceRange( { vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1 } );
+            present_barrier.setSrcQueueFamilyIndex( vk::QueueFamilyIgnored );
+            present_barrier.setDstQueueFamilyIndex( vk::QueueFamilyIgnored );
+
+            vk::DependencyInfo present_dependency;
+            present_dependency.setImageMemoryBarriers( present_barrier );
+
+            command_buffer.pipelineBarrier2( present_dependency );
+
             command_buffer.end();
         }
     };
