summaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-02-19 18:10:18 -0300
committerGravatar ameerj2021-07-22 21:51:22 -0400
commit6db69990da9f232e6d982cdcb69c2e27d93075cf (patch)
tree9367909cd030622ea36c4cadccd2fabc6f28d471 /src/video_core
parentshader: Primitive Vulkan integration (diff)
downloadyuzu-6db69990da9f232e6d982cdcb69c2e27d93075cf.tar.gz
yuzu-6db69990da9f232e6d982cdcb69c2e27d93075cf.tar.xz
yuzu-6db69990da9f232e6d982cdcb69c2e27d93075cf.zip
spirv: Add lower fp16 to fp32 pass
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pass.cpp3
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp8
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp2
-rw-r--r--src/video_core/vulkan_common/vulkan_device.cpp10
4 files changed, 14 insertions, 9 deletions
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp
index 4181d83ee..a444d55d3 100644
--- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp
+++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp
@@ -206,6 +206,8 @@ VKComputePass::VKComputePass(const Device& device, VKDescriptorPool& descriptor_
206 .codeSize = static_cast<u32>(code.size_bytes()), 206 .codeSize = static_cast<u32>(code.size_bytes()),
207 .pCode = code.data(), 207 .pCode = code.data(),
208 }); 208 });
209 /*
210 FIXME
209 pipeline = device.GetLogical().CreateComputePipeline({ 211 pipeline = device.GetLogical().CreateComputePipeline({
210 .sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, 212 .sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO,
211 .pNext = nullptr, 213 .pNext = nullptr,
@@ -224,6 +226,7 @@ VKComputePass::VKComputePass(const Device& device, VKDescriptorPool& descriptor_
224 .basePipelineHandle = nullptr, 226 .basePipelineHandle = nullptr,
225 .basePipelineIndex = 0, 227 .basePipelineIndex = 0,
226 }); 228 });
229 */
227} 230}
228 231
229VKComputePass::~VKComputePass() = default; 232VKComputePass::~VKComputePass() = default;
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 4bf3e4819..c2a41a360 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -31,8 +31,6 @@
31#include "video_core/vulkan_common/vulkan_device.h" 31#include "video_core/vulkan_common/vulkan_device.h"
32#include "video_core/vulkan_common/vulkan_wrapper.h" 32#include "video_core/vulkan_common/vulkan_wrapper.h"
33 33
34#pragma optimize("", off)
35
36namespace Vulkan { 34namespace Vulkan {
37MICROPROFILE_DECLARE(Vulkan_PipelineCache); 35MICROPROFILE_DECLARE(Vulkan_PipelineCache);
38 36
@@ -180,6 +178,12 @@ ComputePipeline PipelineCache::CreateComputePipeline(ShaderInfo* shader_info) {
180 // TODO: Load from cache 178 // TODO: Load from cache
181 } 179 }
182 const auto [info, code]{Shader::RecompileSPIRV(env, qmd.program_start)}; 180 const auto [info, code]{Shader::RecompileSPIRV(env, qmd.program_start)};
181
182 FILE* file = fopen("D:\\shader.spv", "wb");
183 fwrite(code.data(), 4, code.size(), file);
184 fclose(file);
185 std::system("spirv-dis D:\\shader.spv");
186
183 shader_info->unique_hash = env.ComputeHash(); 187 shader_info->unique_hash = env.ComputeHash();
184 shader_info->size_bytes = env.ShaderSize(); 188 shader_info->size_bytes = env.ShaderSize();
185 return ComputePipeline{device, descriptor_pool, update_descriptor_queue, info, 189 return ComputePipeline{device, descriptor_pool, update_descriptor_queue, info,
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index b757454c4..1b662f9f3 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -36,8 +36,6 @@
36#include "video_core/vulkan_common/vulkan_device.h" 36#include "video_core/vulkan_common/vulkan_device.h"
37#include "video_core/vulkan_common/vulkan_wrapper.h" 37#include "video_core/vulkan_common/vulkan_wrapper.h"
38 38
39#pragma optimize("", off)
40
41namespace Vulkan { 39namespace Vulkan {
42 40
43using Maxwell = Tegra::Engines::Maxwell3D::Regs; 41using Maxwell = Tegra::Engines::Maxwell3D::Regs;
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp
index f214510da..85f903125 100644
--- a/src/video_core/vulkan_common/vulkan_device.cpp
+++ b/src/video_core/vulkan_common/vulkan_device.cpp
@@ -247,9 +247,9 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
247 .shaderStorageImageArrayDynamicIndexing = false, 247 .shaderStorageImageArrayDynamicIndexing = false,
248 .shaderClipDistance = false, 248 .shaderClipDistance = false,
249 .shaderCullDistance = false, 249 .shaderCullDistance = false,
250 .shaderFloat64 = false, 250 .shaderFloat64 = true,
251 .shaderInt64 = false, 251 .shaderInt64 = true,
252 .shaderInt16 = false, 252 .shaderInt16 = true,
253 .shaderResourceResidency = false, 253 .shaderResourceResidency = false,
254 .shaderResourceMinLod = false, 254 .shaderResourceMinLod = false,
255 .sparseBinding = false, 255 .sparseBinding = false,
@@ -420,8 +420,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
420 } 420 }
421 if (is_float16_supported && driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) { 421 if (is_float16_supported && driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) {
422 // Intel's compiler crashes when using fp16 on Astral Chain, disable it for the time being. 422 // Intel's compiler crashes when using fp16 on Astral Chain, disable it for the time being.
423 LOG_WARNING(Render_Vulkan, "Blacklisting Intel proprietary from float16 math"); 423 // LOG_WARNING(Render_Vulkan, "Blacklisting Intel proprietary from float16 math");
424 is_float16_supported = false; 424 // is_float16_supported = false;
425 } 425 }
426 426
427 graphics_queue = logical.GetQueue(graphics_family); 427 graphics_queue = logical.GetQueue(graphics_family);