From 391b6e9bb772161ca9e99e247c2fe869c19ea745 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Fri, 4 Nov 2016 19:21:24 -0500 Subject: [PATCH] Vulkan: Include the blit shaders too! --- .../ui/vulkan/shaders/bin/blit_color_frag.h | 84 ++++++++++++ .../ui/vulkan/shaders/bin/blit_color_frag.spv | Bin 0 -> 956 bytes .../ui/vulkan/shaders/bin/blit_color_frag.txt | 65 ++++++++++ .../ui/vulkan/shaders/bin/blit_depth_frag.h | 62 +++++++++ .../ui/vulkan/shaders/bin/blit_depth_frag.spv | Bin 0 -> 692 bytes .../ui/vulkan/shaders/bin/blit_depth_frag.txt | 48 +++++++ src/xenia/ui/vulkan/shaders/bin/blit_vert.h | 120 ++++++++++++++++++ src/xenia/ui/vulkan/shaders/bin/blit_vert.spv | Bin 0 -> 1392 bytes src/xenia/ui/vulkan/shaders/bin/blit_vert.txt | 84 ++++++++++++ src/xenia/ui/vulkan/shaders/blit.vert | 19 +++ src/xenia/ui/vulkan/shaders/blit_color.frag | 19 +++ src/xenia/ui/vulkan/shaders/blit_depth.frag | 14 ++ 12 files changed, 515 insertions(+) create mode 100644 src/xenia/ui/vulkan/shaders/bin/blit_color_frag.h create mode 100644 src/xenia/ui/vulkan/shaders/bin/blit_color_frag.spv create mode 100644 src/xenia/ui/vulkan/shaders/bin/blit_color_frag.txt create mode 100644 src/xenia/ui/vulkan/shaders/bin/blit_depth_frag.h create mode 100644 src/xenia/ui/vulkan/shaders/bin/blit_depth_frag.spv create mode 100644 src/xenia/ui/vulkan/shaders/bin/blit_depth_frag.txt create mode 100644 src/xenia/ui/vulkan/shaders/bin/blit_vert.h create mode 100644 src/xenia/ui/vulkan/shaders/bin/blit_vert.spv create mode 100644 src/xenia/ui/vulkan/shaders/bin/blit_vert.txt create mode 100644 src/xenia/ui/vulkan/shaders/blit.vert create mode 100644 src/xenia/ui/vulkan/shaders/blit_color.frag create mode 100644 src/xenia/ui/vulkan/shaders/blit_depth.frag diff --git a/src/xenia/ui/vulkan/shaders/bin/blit_color_frag.h b/src/xenia/ui/vulkan/shaders/bin/blit_color_frag.h new file mode 100644 index 000000000..50ef6d10f --- /dev/null +++ b/src/xenia/ui/vulkan/shaders/bin/blit_color_frag.h @@ -0,0 +1,84 @@ +// generated from `xb genspirv` +// source: blit_color.frag +const uint8_t blit_color_frag[] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x02, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x6F, 0x43, 0x00, 0x00, + 0x05, 0x00, 0x05, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x73, 0x72, 0x63, 0x5F, + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x05, 0x00, 0x04, 0x00, + 0x11, 0x00, 0x00, 0x00, 0x76, 0x74, 0x78, 0x5F, 0x75, 0x76, 0x00, 0x00, + 0x05, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00, 0x00, 0x50, 0x75, 0x73, 0x68, + 0x43, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74, 0x73, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x73, 0x77, 0x61, 0x70, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, + 0x17, 0x00, 0x00, 0x00, 0x70, 0x75, 0x73, 0x68, 0x5F, 0x63, 0x6F, 0x6E, + 0x73, 0x74, 0x61, 0x6E, 0x74, 0x73, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, + 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, + 0x11, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, + 0x15, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x03, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x0A, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x15, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x03, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x16, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x15, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x1A, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x02, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x1A, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x19, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x1C, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0xAB, 0x00, 0x05, 0x00, + 0x1D, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x1F, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x22, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x09, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, + 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, + 0x21, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x21, 0x00, 0x00, 0x00, + 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, +}; diff --git a/src/xenia/ui/vulkan/shaders/bin/blit_color_frag.spv b/src/xenia/ui/vulkan/shaders/bin/blit_color_frag.spv new file mode 100644 index 0000000000000000000000000000000000000000..60de2cb10e45e1f09c78bf1f9713ddb6de713bb1 GIT binary patch literal 956 zcmY+C%Su~e6oq%pMXT0mW0J;HJ<-kz(m|C%Q78`VK&arL!w^)^fl)js>O1u<`cl0> zq2G6sQ{$GM{jasx**7fDY|loN_?wHjF}9VM0Y@xEEssaXr^h>KcE0mr_q~dxDCa^o z^_YzcQNJEs4NbhjSMX(Y@-*O8rfS3wKB~e_>#OAa=H}2`HD2;g@6P(!#bY+QyU6v{ zyU!l`qkA>AXo62h>E+?gFwF+TECtud$ZP4t;MS^mz?A^y)C0_GRaBICIFYe%)z1N6pt+&cV>qK?p;^uqY+*!Ss=3RclREhhr?zx1! zqu4!O;qLGam3M96YUB^7U{ATvc=c3;JRl#lNq=s!h=Oz1P6p z;d0u1 zT-4+{@_iRWcc&)e{CP{~P+y?W<@`u}sWE#??y~9ZHvP(91f`3N+=dH>hi7}O#YD^EAYTWhpBZ~!n~otZB5L~12?_7b64l8 zxY&8ccqiL|yHr0gGr;w2L!ZB6cV#Q^fs~uNKo={Y*)cfkfq4Vg6K*Kdi@DG@6{!V} z9?YBI(C;duXWt$D?kUD{?D!vdJaqMXIx{- iW@^cq=TRzZw&iHx@5M12{}nuTt*Yz~?pLq4kpBTt93f-? literal 0 HcmV?d00001 diff --git a/src/xenia/ui/vulkan/shaders/bin/blit_depth_frag.txt b/src/xenia/ui/vulkan/shaders/bin/blit_depth_frag.txt new file mode 100644 index 000000000..72b6da8fe --- /dev/null +++ b/src/xenia/ui/vulkan/shaders/bin/blit_depth_frag.txt @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 1 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %4 "main" %8 %16 %24 + OpExecutionMode %4 OriginUpperLeft + OpExecutionMode %4 DepthReplacing + OpSource GLSL 450 + OpName %4 "main" + OpName %8 "gl_FragDepth" + OpName %12 "src_texture" + OpName %16 "vtx_uv" + OpName %24 "oC" + OpDecorate %8 BuiltIn FragDepth + OpDecorate %12 DescriptorSet 0 + OpDecorate %12 Binding 0 + OpDecorate %16 Location 0 + OpDecorate %24 Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeFloat 32 + %7 = OpTypePointer Output %6 + %8 = OpVariable %7 Output + %9 = OpTypeImage %6 2D 0 0 0 1 Unknown + %10 = OpTypeSampledImage %9 + %11 = OpTypePointer UniformConstant %10 + %12 = OpVariable %11 UniformConstant + %14 = OpTypeVector %6 2 + %15 = OpTypePointer Input %14 + %16 = OpVariable %15 Input + %18 = OpTypeVector %6 4 + %20 = OpTypeInt 32 0 + %21 = OpConstant %20 0 + %23 = OpTypePointer Output %18 + %24 = OpVariable %23 Output + %4 = OpFunction %2 None %3 + %5 = OpLabel + %13 = OpLoad %10 %12 + %17 = OpLoad %14 %16 + %19 = OpImageSampleImplicitLod %18 %13 %17 + %22 = OpCompositeExtract %6 %19 0 + OpStore %8 %22 + OpReturn + OpFunctionEnd diff --git a/src/xenia/ui/vulkan/shaders/bin/blit_vert.h b/src/xenia/ui/vulkan/shaders/bin/blit_vert.h new file mode 100644 index 000000000..316125fbd --- /dev/null +++ b/src/xenia/ui/vulkan/shaders/bin/blit_vert.h @@ -0,0 +1,120 @@ +// generated from `xb genspirv` +// source: blit.vert +const uint8_t blit_vert[] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00, + 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x11, 0x00, 0x02, 0x00, 0x21, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, + 0x2E, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, + 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, + 0xC2, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, 0x65, 0x72, 0x56, 0x65, + 0x72, 0x74, 0x65, 0x78, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, + 0x6F, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x06, 0x00, 0x07, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, + 0x6F, 0x69, 0x6E, 0x74, 0x53, 0x69, 0x7A, 0x65, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x07, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x67, 0x6C, 0x5F, 0x43, 0x6C, 0x69, 0x70, 0x44, 0x69, 0x73, 0x74, 0x61, + 0x6E, 0x63, 0x65, 0x00, 0x06, 0x00, 0x07, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x43, 0x75, 0x6C, 0x6C, 0x44, + 0x69, 0x73, 0x74, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x05, 0x00, 0x03, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x12, 0x00, 0x00, 0x00, 0x76, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5F, 0x70, + 0x6F, 0x73, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x76, 0x74, 0x78, 0x5F, 0x75, 0x76, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, + 0x25, 0x00, 0x00, 0x00, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6F, 0x6E, 0x73, + 0x74, 0x61, 0x6E, 0x74, 0x73, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, + 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x72, 0x63, 0x5F, + 0x75, 0x76, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x27, 0x00, 0x00, 0x00, + 0x70, 0x75, 0x73, 0x68, 0x5F, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, + 0x74, 0x73, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x03, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, + 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x25, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x1C, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x06, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, + 0x0A, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x15, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xC0, 0x2C, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x16, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x3F, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xBF, 0x2C, 0x00, 0x05, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x19, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x03, 0x00, + 0x25, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x26, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x12, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x83, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x50, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, + 0x1D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x21, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x12, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x29, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, + 0x29, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x2D, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x2D, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x2F, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, + 0x2F, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, +}; diff --git a/src/xenia/ui/vulkan/shaders/bin/blit_vert.spv b/src/xenia/ui/vulkan/shaders/bin/blit_vert.spv new file mode 100644 index 0000000000000000000000000000000000000000..489bd0c8e32a45e85f552005f96525da78fb2467 GIT binary patch literal 1392 zcmZ9K-A@xy5XG-8TND&T1pL6Vweq20g#?X>@hg~=2NG&Xd~HZwWs|aPy4!~EgfaeI z8viO^Ogz8cJJmSNbmp9U?%bJsw_K`EI(JFG%WlUNHs?yh&JjZ&Yl_pZlJm`jqk~48 zeQfML-4^X;T$zxs&8iMIAwNBi6Y^{F8}homtY1m-rw$0D`d1gI{AA`r(56Av_{S#~A zID>pqSw%6FFR7kBpd54df-qk|D91KEzM`BNmW8Jj*$-D$Mz2JE(FdV8Rp-q17GLpigeM??Kba`;0b=GpWdJhL;i s&90!mnopF&;TZFM@prSWoVsY3fp>%ZE!A`RAN?j-PXGV_ literal 0 HcmV?d00001 diff --git a/src/xenia/ui/vulkan/shaders/bin/blit_vert.txt b/src/xenia/ui/vulkan/shaders/bin/blit_vert.txt new file mode 100644 index 000000000..c1c008b6c --- /dev/null +++ b/src/xenia/ui/vulkan/shaders/bin/blit_vert.txt @@ -0,0 +1,84 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 1 +; Bound: 49 +; Schema: 0 + OpCapability Shader + OpCapability ClipDistance + OpCapability CullDistance + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %4 "main" %13 %18 %35 + OpSource GLSL 450 + OpName %4 "main" + OpName %11 "gl_PerVertex" + OpMemberName %11 0 "gl_Position" + OpMemberName %11 1 "gl_PointSize" + OpMemberName %11 2 "gl_ClipDistance" + OpMemberName %11 3 "gl_CullDistance" + OpName %13 "" + OpName %18 "vfetch_pos" + OpName %35 "vtx_uv" + OpName %37 "PushConstants" + OpMemberName %37 0 "src_uv" + OpName %39 "push_constants" + OpMemberDecorate %11 0 BuiltIn Position + OpMemberDecorate %11 1 BuiltIn PointSize + OpMemberDecorate %11 2 BuiltIn ClipDistance + OpMemberDecorate %11 3 BuiltIn CullDistance + OpDecorate %11 Block + OpDecorate %18 Location 0 + OpDecorate %35 Location 0 + OpMemberDecorate %37 0 Offset 0 + OpDecorate %37 Block + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeFloat 32 + %7 = OpTypeVector %6 4 + %8 = OpTypeInt 32 0 + %9 = OpConstant %8 1 + %10 = OpTypeArray %6 %9 + %11 = OpTypeStruct %7 %6 %10 %10 + %12 = OpTypePointer Output %11 + %13 = OpVariable %12 Output + %14 = OpTypeInt 32 1 + %15 = OpConstant %14 0 + %16 = OpTypeVector %6 2 + %17 = OpTypePointer Input %16 + %18 = OpVariable %17 Input + %20 = OpConstant %6 2 + %21 = OpConstant %6 -2 + %22 = OpConstantComposite %16 %20 %21 + %24 = OpConstant %6 1 + %25 = OpConstant %6 -1 + %26 = OpConstantComposite %16 %24 %25 + %28 = OpConstant %6 0 + %32 = OpTypePointer Output %7 + %34 = OpTypePointer Output %16 + %35 = OpVariable %34 Output + %37 = OpTypeStruct %7 + %38 = OpTypePointer PushConstant %37 + %39 = OpVariable %38 PushConstant + %40 = OpTypePointer PushConstant %7 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %19 = OpLoad %16 %18 + %23 = OpFMul %16 %19 %22 + %27 = OpFSub %16 %23 %26 + %29 = OpCompositeExtract %6 %27 0 + %30 = OpCompositeExtract %6 %27 1 + %31 = OpCompositeConstruct %7 %29 %30 %28 %24 + %33 = OpAccessChain %32 %13 %15 + OpStore %33 %31 + %36 = OpLoad %16 %18 + %41 = OpAccessChain %40 %39 %15 + %42 = OpLoad %7 %41 + %43 = OpVectorShuffle %16 %42 %42 2 3 + %44 = OpFMul %16 %36 %43 + %45 = OpAccessChain %40 %39 %15 + %46 = OpLoad %7 %45 + %47 = OpVectorShuffle %16 %46 %46 0 1 + %48 = OpFAdd %16 %44 %47 + OpStore %35 %48 + OpReturn + OpFunctionEnd diff --git a/src/xenia/ui/vulkan/shaders/blit.vert b/src/xenia/ui/vulkan/shaders/blit.vert new file mode 100644 index 000000000..937c27795 --- /dev/null +++ b/src/xenia/ui/vulkan/shaders/blit.vert @@ -0,0 +1,19 @@ +// NOTE: This file is compiled and embedded into the exe. +// Use `xenia-build genspirv` and check in any changes under bin/. + +#version 450 core +precision highp float; + +layout(push_constant) uniform PushConstants { + vec4 src_uv; +} push_constants; + +layout(location = 0) in vec2 vfetch_pos; +layout(location = 0) out vec2 vtx_uv; + +void main() { + gl_Position = vec4(vfetch_pos.xy * vec2(2.0, -2.0) - + vec2(1.0, -1.0), 0.0, 1.0); + vtx_uv = vfetch_pos.xy * push_constants.src_uv.zw + + push_constants.src_uv.xy; +} \ No newline at end of file diff --git a/src/xenia/ui/vulkan/shaders/blit_color.frag b/src/xenia/ui/vulkan/shaders/blit_color.frag new file mode 100644 index 000000000..4d136d166 --- /dev/null +++ b/src/xenia/ui/vulkan/shaders/blit_color.frag @@ -0,0 +1,19 @@ +// NOTE: This file is compiled and embedded into the exe. +// Use `xenia-build genspirv` and check in any changes under bin/. + +#version 450 core +precision highp float; + +layout(push_constant) uniform PushConstants { + bool swap; +} push_constants; + +layout(set = 0, binding = 0) uniform sampler2D src_texture; + +layout(location = 0) in vec2 vtx_uv; +layout(location = 0) out vec4 oC; + +void main() { + oC = texture(src_texture, vtx_uv); + if (push_constants.swap) oC = oC.bgra; +} \ No newline at end of file diff --git a/src/xenia/ui/vulkan/shaders/blit_depth.frag b/src/xenia/ui/vulkan/shaders/blit_depth.frag new file mode 100644 index 000000000..622871de8 --- /dev/null +++ b/src/xenia/ui/vulkan/shaders/blit_depth.frag @@ -0,0 +1,14 @@ +// NOTE: This file is compiled and embedded into the exe. +// Use `xenia-build genspirv` and check in any changes under bin/. + +#version 450 core +precision highp float; + +layout(set = 0, binding = 0) uniform sampler2D src_texture; + +layout(location = 0) in vec2 vtx_uv; +layout(location = 0) out vec4 oC; + +void main() { + gl_FragDepth = texture(src_texture, vtx_uv).r; +} \ No newline at end of file