Merge branch 'master' into vulkan

This commit is contained in:
Triang3l
2022-02-07 22:22:43 +03:00
130 changed files with 12384 additions and 16792 deletions

View File

@@ -25,8 +25,10 @@ namespace ui {
namespace vulkan {
// Generated with `xb buildshaders`.
#include "xenia/ui/shaders/bytecode/vulkan_spirv/immediate_frag.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/immediate_vert.h"
namespace shaders {
#include "xenia/ui/shaders/bytecode/vulkan_spirv/immediate_ps.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/immediate_vs.h"
} // namespace shaders
VulkanImmediateDrawer::VulkanImmediateTexture::~VulkanImmediateTexture() {
if (immediate_drawer_) {
@@ -578,8 +580,8 @@ bool VulkanImmediateDrawer::EnsurePipelinesCreatedForCurrentRenderPass() {
VkPipelineShaderStageCreateInfo stages[2] = {};
stages[0].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
stages[0].stage = VK_SHADER_STAGE_VERTEX_BIT;
stages[0].module = util::CreateShaderModule(provider_, immediate_vert,
sizeof(immediate_vert));
stages[0].module = util::CreateShaderModule(provider_, shaders::immediate_vs,
sizeof(shaders::immediate_vs));
if (stages[0].module == VK_NULL_HANDLE) {
XELOGE("VulkanImmediateDrawer: Failed to create the vertex shader module");
return false;
@@ -587,8 +589,8 @@ bool VulkanImmediateDrawer::EnsurePipelinesCreatedForCurrentRenderPass() {
stages[0].pName = "main";
stages[1].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
stages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
stages[1].module = util::CreateShaderModule(provider_, immediate_frag,
sizeof(immediate_frag));
stages[1].module = util::CreateShaderModule(provider_, shaders::immediate_ps,
sizeof(shaders::immediate_ps));
if (stages[1].module == VK_NULL_HANDLE) {
XELOGE(
"VulkanImmediateDrawer: Failed to create the fragment shader module");

View File

@@ -60,16 +60,16 @@ namespace vulkan {
// Generated with `xb buildshaders`.
namespace shaders {
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_bilinear_dither_frag.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_bilinear_frag.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_cas_resample_dither_frag.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_cas_resample_frag.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_cas_sharpen_dither_frag.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_cas_sharpen_frag.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_fsr_easu_frag.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_fsr_rcas_dither_frag.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_fsr_rcas_frag.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_triangle_strip_rect_vert.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_bilinear_dither_ps.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_bilinear_ps.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_cas_resample_dither_ps.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_cas_resample_ps.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_cas_sharpen_dither_ps.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_cas_sharpen_ps.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_fsr_easu_ps.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_fsr_rcas_dither_ps.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_ffx_fsr_rcas_ps.h"
#include "xenia/ui/shaders/bytecode/vulkan_spirv/guest_output_triangle_strip_rect_vs.h"
} // namespace shaders
VulkanPresenter::PaintContext::Submission::~Submission() {
@@ -2213,9 +2213,9 @@ bool VulkanPresenter::InitializeSurfaceIndependent() {
shader_module_create_info.pNext = nullptr;
shader_module_create_info.flags = 0;
shader_module_create_info.codeSize =
sizeof(shaders::guest_output_triangle_strip_rect_vert);
shader_module_create_info.pCode = reinterpret_cast<const uint32_t*>(
shaders::guest_output_triangle_strip_rect_vert);
sizeof(shaders::guest_output_triangle_strip_rect_vs);
shader_module_create_info.pCode =
shaders::guest_output_triangle_strip_rect_vs;
if (dfn.vkCreateShaderModule(device, &shader_module_create_info, nullptr,
&guest_output_paint_vs_) != VK_SUCCESS) {
XELOGE(
@@ -2229,57 +2229,54 @@ bool VulkanPresenter::InitializeSurfaceIndependent() {
switch (guest_output_paint_effect) {
case GuestOutputPaintEffect::kBilinear:
shader_module_create_info.codeSize =
sizeof(shaders::guest_output_bilinear_frag);
shader_module_create_info.pCode = reinterpret_cast<const uint32_t*>(
shaders::guest_output_bilinear_frag);
sizeof(shaders::guest_output_bilinear_ps);
shader_module_create_info.pCode = shaders::guest_output_bilinear_ps;
break;
case GuestOutputPaintEffect::kBilinearDither:
shader_module_create_info.codeSize =
sizeof(shaders::guest_output_bilinear_dither_frag);
shader_module_create_info.pCode = reinterpret_cast<const uint32_t*>(
shaders::guest_output_bilinear_dither_frag);
sizeof(shaders::guest_output_bilinear_dither_ps);
shader_module_create_info.pCode =
shaders::guest_output_bilinear_dither_ps;
break;
case GuestOutputPaintEffect::kCasSharpen:
shader_module_create_info.codeSize =
sizeof(shaders::guest_output_ffx_cas_sharpen_frag);
shader_module_create_info.pCode = reinterpret_cast<const uint32_t*>(
shaders::guest_output_ffx_cas_sharpen_frag);
sizeof(shaders::guest_output_ffx_cas_sharpen_ps);
shader_module_create_info.pCode =
shaders::guest_output_ffx_cas_sharpen_ps;
break;
case GuestOutputPaintEffect::kCasSharpenDither:
shader_module_create_info.codeSize =
sizeof(shaders::guest_output_ffx_cas_sharpen_dither_frag);
shader_module_create_info.pCode = reinterpret_cast<const uint32_t*>(
shaders::guest_output_ffx_cas_sharpen_dither_frag);
sizeof(shaders::guest_output_ffx_cas_sharpen_dither_ps);
shader_module_create_info.pCode =
shaders::guest_output_ffx_cas_sharpen_dither_ps;
break;
case GuestOutputPaintEffect::kCasResample:
shader_module_create_info.codeSize =
sizeof(shaders::guest_output_ffx_cas_resample_frag);
shader_module_create_info.pCode = reinterpret_cast<const uint32_t*>(
shaders::guest_output_ffx_cas_resample_frag);
sizeof(shaders::guest_output_ffx_cas_resample_ps);
shader_module_create_info.pCode =
shaders::guest_output_ffx_cas_resample_ps;
break;
case GuestOutputPaintEffect::kCasResampleDither:
shader_module_create_info.codeSize =
sizeof(shaders::guest_output_ffx_cas_resample_dither_frag);
shader_module_create_info.pCode = reinterpret_cast<const uint32_t*>(
shaders::guest_output_ffx_cas_resample_dither_frag);
sizeof(shaders::guest_output_ffx_cas_resample_dither_ps);
shader_module_create_info.pCode =
shaders::guest_output_ffx_cas_resample_dither_ps;
break;
case GuestOutputPaintEffect::kFsrEasu:
shader_module_create_info.codeSize =
sizeof(shaders::guest_output_ffx_fsr_easu_frag);
shader_module_create_info.pCode = reinterpret_cast<const uint32_t*>(
shaders::guest_output_ffx_fsr_easu_frag);
sizeof(shaders::guest_output_ffx_fsr_easu_ps);
shader_module_create_info.pCode = shaders::guest_output_ffx_fsr_easu_ps;
break;
case GuestOutputPaintEffect::kFsrRcas:
shader_module_create_info.codeSize =
sizeof(shaders::guest_output_ffx_fsr_rcas_frag);
shader_module_create_info.pCode = reinterpret_cast<const uint32_t*>(
shaders::guest_output_ffx_fsr_rcas_frag);
sizeof(shaders::guest_output_ffx_fsr_rcas_ps);
shader_module_create_info.pCode = shaders::guest_output_ffx_fsr_rcas_ps;
break;
case GuestOutputPaintEffect::kFsrRcasDither:
shader_module_create_info.codeSize =
sizeof(shaders::guest_output_ffx_fsr_rcas_dither_frag);
shader_module_create_info.pCode = reinterpret_cast<const uint32_t*>(
shaders::guest_output_ffx_fsr_rcas_dither_frag);
sizeof(shaders::guest_output_ffx_fsr_rcas_dither_ps);
shader_module_create_info.pCode =
shaders::guest_output_ffx_fsr_rcas_dither_ps;
break;
default:
// Not supported by this implementation.

View File

@@ -147,13 +147,14 @@ bool CreateDedicatedAllocationImage(const VulkanProvider& provider,
VkDeviceSize* memory_size_out = nullptr);
inline VkShaderModule CreateShaderModule(const VulkanProvider& provider,
const void* code, size_t code_size) {
const uint32_t* code,
size_t code_size_bytes) {
VkShaderModuleCreateInfo shader_module_create_info;
shader_module_create_info.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
shader_module_create_info.pNext = nullptr;
shader_module_create_info.flags = 0;
shader_module_create_info.codeSize = code_size;
shader_module_create_info.pCode = reinterpret_cast<const uint32_t*>(code);
shader_module_create_info.codeSize = code_size_bytes;
shader_module_create_info.pCode = code;
VkShaderModule shader_module;
return provider.dfn().vkCreateShaderModule(
provider.device(), &shader_module_create_info, nullptr,