yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

shader: Fix bugs and build issues on GCC

This commit is contained in:
Rodrigo Locatti 2021-04-23 02:38:02 -03:00 committed by ameerj
parent 7a1f296cda
commit 2dc86372c7
3 changed files with 4 additions and 4 deletions

View File

@ -95,7 +95,7 @@ void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute,
ASSERT(((qmd.const_buffer_enable_mask >> desc.cbuf_index) & 1) != 0); ASSERT(((qmd.const_buffer_enable_mask >> desc.cbuf_index) & 1) != 0);
const u32 index_offset{index << desc.size_shift}; const u32 index_offset{index << desc.size_shift};
const u32 offset{desc.cbuf_offset + index_offset}; const u32 offset{desc.cbuf_offset + index_offset};
const GPUVAddr addr{cbufs[desc.cbuf_index].Address() + desc.cbuf_offset}; const GPUVAddr addr{cbufs[desc.cbuf_index].Address() + offset};
if constexpr (std::is_same_v<decltype(desc), const Shader::TextureDescriptor&> || if constexpr (std::is_same_v<decltype(desc), const Shader::TextureDescriptor&> ||
std::is_same_v<decltype(desc), const Shader::TextureBufferDescriptor&>) { std::is_same_v<decltype(desc), const Shader::TextureBufferDescriptor&>) {
if (desc.has_secondary) { if (desc.has_secondary) {
@ -136,7 +136,7 @@ void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute,
ImageId* texture_buffer_ids{image_view_ids.data()}; ImageId* texture_buffer_ids{image_view_ids.data()};
size_t index{}; size_t index{};
const auto add_buffer{[&](const auto& desc) { const auto add_buffer{[&](const auto& desc) {
for (u32 index = 0; index < desc.count; ++index) { for (u32 i = 0; index < desc.count; ++i) {
bool is_written{false}; bool is_written{false};
if constexpr (std::is_same_v<decltype(desc), const Shader::ImageBufferDescriptor&>) { if constexpr (std::is_same_v<decltype(desc), const Shader::ImageBufferDescriptor&>) {
is_written = desc.is_written; is_written = desc.is_written;

View File

@ -226,7 +226,7 @@ void GraphicsPipeline::Configure(bool is_indexed) {
for (size_t stage = 0; stage < Maxwell::MaxShaderStage; ++stage) { for (size_t stage = 0; stage < Maxwell::MaxShaderStage; ++stage) {
size_t index{}; size_t index{};
const auto add_buffer{[&](const auto& desc) { const auto add_buffer{[&](const auto& desc) {
for (u32 index = 0; index < desc.count; ++index) { for (u32 i = 0; i < desc.count; ++i) {
bool is_written{false}; bool is_written{false};
if constexpr (std::is_same_v<decltype(desc), if constexpr (std::is_same_v<decltype(desc),
const Shader::ImageBufferDescriptor&>) { const Shader::ImageBufferDescriptor&>) {

View File

@ -4,10 +4,10 @@
#pragma once #pragma once
#include <span>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <unordered_map> #include <unordered_map>
#include <span>
#include <vector> #include <vector>
#include "common/common_types.h" #include "common/common_types.h"