From 9e3d64cafcddf04582ec71278439f695fdfd7f6e Mon Sep 17 00:00:00 2001 From: hyzboy Date: Fri, 19 Jul 2019 18:25:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=86=E5=A4=87=E5=A2=9E=E5=8A=A0=E7=BA=B9?= =?UTF-8?q?=E7=90=86=E6=A0=BC=E5=BC=8F=E6=B5=8B=E8=AF=95=EF=BC=8C=E4=B8=8B?= =?UTF-8?q?=E4=B8=80=E6=AD=A5=E5=A2=9E=E5=8A=A0Linear=E7=BA=B9=E7=90=86?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=EF=BC=8C=E7=94=A8=E4=BA=8E=E8=AF=95=E9=AA=8C?= =?UTF-8?q?CPU=E7=AB=AF=E4=BF=AE=E6=94=B9=E7=BA=B9=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E4=BE=BF=E9=AB=98=E6=95=88=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E5=AD=97=E5=90=88=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/Vulkan/CMakeLists.txt | 4 +++- example/Vulkan/TextureFormat.cpp | 0 res/shader/gbuffer_opaque.frag | 2 +- src/RenderDevice/Vulkan/VKRenderTarget.cpp | 8 ++++---- 4 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 example/Vulkan/TextureFormat.cpp diff --git a/example/Vulkan/CMakeLists.txt b/example/Vulkan/CMakeLists.txt index bbe9c64d..c126892d 100644 --- a/example/Vulkan/CMakeLists.txt +++ b/example/Vulkan/CMakeLists.txt @@ -21,4 +21,6 @@ CreateProject(7.InlineGeometryScene InlineGeometryScene.cpp) CreateProject(8.Atomsphere Atomsphere.cpp) -CreateProject(9.Deferred Deferred.cpp TGATexture.cpp) \ No newline at end of file +CreateProject(9.Deferred Deferred.cpp TGATexture.cpp) + +CreateProject(10.TextureFormat TextureFormat.cpp TGATexture.cpp) \ No newline at end of file diff --git a/example/Vulkan/TextureFormat.cpp b/example/Vulkan/TextureFormat.cpp new file mode 100644 index 00000000..e69de29b diff --git a/res/shader/gbuffer_opaque.frag b/res/shader/gbuffer_opaque.frag index b90df622..6eecfe1f 100644 --- a/res/shader/gbuffer_opaque.frag +++ b/res/shader/gbuffer_opaque.frag @@ -23,7 +23,7 @@ void main() vec3 tnorm = (texture(TextureNormal,FragmentTexCoord).xyz*2.0-vec3(1.0))*TBN; outNormal=vec4(normalize(tnorm),1.0); -// outNormal=vec4(normalize(FragmentNormal),1.0); + //outNormal=vec4(normalize(FragmentNormal),1.0); outColor=texture(TextureColor,FragmentTexCoord); } diff --git a/src/RenderDevice/Vulkan/VKRenderTarget.cpp b/src/RenderDevice/Vulkan/VKRenderTarget.cpp index 1cafd3e3..38a7dc8d 100644 --- a/src/RenderDevice/Vulkan/VKRenderTarget.cpp +++ b/src/RenderDevice/Vulkan/VKRenderTarget.cpp @@ -86,7 +86,7 @@ bool SubmitQueue::Submit(const VkCommandBuffer *cmd_buf,const uint32_t cb_count, return(result==VK_SUCCESS); } - + bool SubmitQueue::Submit(const VkCommandBuffer &cmd_buf,vulkan::Semaphore *wait_sem,vulkan::Semaphore *complete_sem) { return Submit(&cmd_buf,1,wait_sem,complete_sem); @@ -149,9 +149,9 @@ bool SwapchainRenderTarget::PresentBackbuffer(vulkan::Semaphore *render_complete { VkSemaphore sem=*render_complete_semaphore; - present_info.waitSemaphoreCount=1; - present_info.pWaitSemaphores=&sem; - present_info.pImageIndices=¤t_frame; + present_info.waitSemaphoreCount =1; + present_info.pWaitSemaphores =&sem; + present_info.pImageIndices =¤t_frame; VkResult result=vkQueuePresentKHR(queue,&present_info);