diff options
| author | 2020-04-16 01:34:45 -0300 | |
|---|---|---|
| committer | 2020-04-23 18:00:06 -0300 | |
| commit | 72deb773fdcc59b1df9752de4e846422b7bb5280 (patch) | |
| tree | 524006956b6dbb6789831652129013e54f185f16 /src/video_core/renderer_vulkan | |
| parent | Merge pull request #3768 from H27CK/cmd-title-fmt (diff) | |
| download | yuzu-72deb773fdcc59b1df9752de4e846422b7bb5280.tar.gz yuzu-72deb773fdcc59b1df9752de4e846422b7bb5280.tar.xz yuzu-72deb773fdcc59b1df9752de4e846422b7bb5280.zip | |
shader_ir: Turn classes into data structures
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 13 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 72 |
3 files changed, 44 insertions, 45 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 91b1b16a5..fcbcadc8e 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -133,7 +133,7 @@ void AddBindings(std::vector<VkDescriptorSetLayoutBinding>& bindings, u32& bindi | |||
| 133 | u32 count = 1; | 133 | u32 count = 1; |
| 134 | if constexpr (descriptor_type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) { | 134 | if constexpr (descriptor_type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) { |
| 135 | // Combined image samplers can be arrayed. | 135 | // Combined image samplers can be arrayed. |
| 136 | count = container[i].Size(); | 136 | count = container[i].size; |
| 137 | } | 137 | } |
| 138 | VkDescriptorSetLayoutBinding& entry = bindings.emplace_back(); | 138 | VkDescriptorSetLayoutBinding& entry = bindings.emplace_back(); |
| 139 | entry.binding = binding++; | 139 | entry.binding = binding++; |
| @@ -393,7 +393,7 @@ void AddEntry(std::vector<VkDescriptorUpdateTemplateEntry>& template_entries, u3 | |||
| 393 | 393 | ||
| 394 | if constexpr (descriptor_type == COMBINED_IMAGE_SAMPLER) { | 394 | if constexpr (descriptor_type == COMBINED_IMAGE_SAMPLER) { |
| 395 | for (u32 i = 0; i < count; ++i) { | 395 | for (u32 i = 0; i < count; ++i) { |
| 396 | const u32 num_samplers = container[i].Size(); | 396 | const u32 num_samplers = container[i].size; |
| 397 | VkDescriptorUpdateTemplateEntry& entry = template_entries.emplace_back(); | 397 | VkDescriptorUpdateTemplateEntry& entry = template_entries.emplace_back(); |
| 398 | entry.dstBinding = binding; | 398 | entry.dstBinding = binding; |
| 399 | entry.dstArrayElement = 0; | 399 | entry.dstArrayElement = 0; |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 8a1f57891..4ac844212 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -119,14 +119,13 @@ template <typename Engine, typename Entry> | |||
| 119 | Tegra::Texture::FullTextureInfo GetTextureInfo(const Engine& engine, const Entry& entry, | 119 | Tegra::Texture::FullTextureInfo GetTextureInfo(const Engine& engine, const Entry& entry, |
| 120 | std::size_t stage, std::size_t index = 0) { | 120 | std::size_t stage, std::size_t index = 0) { |
| 121 | const auto stage_type = static_cast<Tegra::Engines::ShaderType>(stage); | 121 | const auto stage_type = static_cast<Tegra::Engines::ShaderType>(stage); |
| 122 | if (entry.IsBindless()) { | 122 | if (entry.is_bindless) { |
| 123 | const Tegra::Texture::TextureHandle tex_handle = | 123 | const auto tex_handle = engine.AccessConstBuffer32(stage_type, entry.buffer, entry.offset); |
| 124 | engine.AccessConstBuffer32(stage_type, entry.GetBuffer(), entry.GetOffset()); | ||
| 125 | return engine.GetTextureInfo(tex_handle); | 124 | return engine.GetTextureInfo(tex_handle); |
| 126 | } | 125 | } |
| 127 | const auto& gpu_profile = engine.AccessGuestDriverProfile(); | 126 | const auto& gpu_profile = engine.AccessGuestDriverProfile(); |
| 128 | const u32 entry_offset = static_cast<u32>(index * gpu_profile.GetTextureHandlerSize()); | 127 | const u32 entry_offset = static_cast<u32>(index * gpu_profile.GetTextureHandlerSize()); |
| 129 | const u32 offset = entry.GetOffset() + entry_offset; | 128 | const u32 offset = entry.offset + entry_offset; |
| 130 | if constexpr (std::is_same_v<Engine, Tegra::Engines::Maxwell3D>) { | 129 | if constexpr (std::is_same_v<Engine, Tegra::Engines::Maxwell3D>) { |
| 131 | return engine.GetStageTexture(stage_type, offset); | 130 | return engine.GetStageTexture(stage_type, offset); |
| 132 | } else { | 131 | } else { |
| @@ -961,7 +960,7 @@ void RasterizerVulkan::SetupGraphicsTextures(const ShaderEntries& entries, std:: | |||
| 961 | MICROPROFILE_SCOPE(Vulkan_Textures); | 960 | MICROPROFILE_SCOPE(Vulkan_Textures); |
| 962 | const auto& gpu = system.GPU().Maxwell3D(); | 961 | const auto& gpu = system.GPU().Maxwell3D(); |
| 963 | for (const auto& entry : entries.samplers) { | 962 | for (const auto& entry : entries.samplers) { |
| 964 | for (std::size_t i = 0; i < entry.Size(); ++i) { | 963 | for (std::size_t i = 0; i < entry.size; ++i) { |
| 965 | const auto texture = GetTextureInfo(gpu, entry, stage, i); | 964 | const auto texture = GetTextureInfo(gpu, entry, stage, i); |
| 966 | SetupTexture(texture, entry); | 965 | SetupTexture(texture, entry); |
| 967 | } | 966 | } |
| @@ -1013,7 +1012,7 @@ void RasterizerVulkan::SetupComputeTextures(const ShaderEntries& entries) { | |||
| 1013 | MICROPROFILE_SCOPE(Vulkan_Textures); | 1012 | MICROPROFILE_SCOPE(Vulkan_Textures); |
| 1014 | const auto& gpu = system.GPU().KeplerCompute(); | 1013 | const auto& gpu = system.GPU().KeplerCompute(); |
| 1015 | for (const auto& entry : entries.samplers) { | 1014 | for (const auto& entry : entries.samplers) { |
| 1016 | for (std::size_t i = 0; i < entry.Size(); ++i) { | 1015 | for (std::size_t i = 0; i < entry.size; ++i) { |
| 1017 | const auto texture = GetTextureInfo(gpu, entry, ComputeShaderIndex, i); | 1016 | const auto texture = GetTextureInfo(gpu, entry, ComputeShaderIndex, i); |
| 1018 | SetupTexture(texture, entry); | 1017 | SetupTexture(texture, entry); |
| 1019 | } | 1018 | } |
| @@ -1094,7 +1093,7 @@ void RasterizerVulkan::SetupTexture(const Tegra::Texture::FullTextureInfo& textu | |||
| 1094 | void RasterizerVulkan::SetupImage(const Tegra::Texture::TICEntry& tic, const ImageEntry& entry) { | 1093 | void RasterizerVulkan::SetupImage(const Tegra::Texture::TICEntry& tic, const ImageEntry& entry) { |
| 1095 | auto view = texture_cache.GetImageSurface(tic, entry); | 1094 | auto view = texture_cache.GetImageSurface(tic, entry); |
| 1096 | 1095 | ||
| 1097 | if (entry.IsWritten()) { | 1096 | if (entry.is_written) { |
| 1098 | view->MarkAsModified(texture_cache.Tick()); | 1097 | view->MarkAsModified(texture_cache.Tick()); |
| 1099 | } | 1098 | } |
| 1100 | 1099 | ||
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index aaa138f52..8ffdd19d7 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | |||
| @@ -103,8 +103,8 @@ struct GenericVaryingDescription { | |||
| 103 | }; | 103 | }; |
| 104 | 104 | ||
| 105 | spv::Dim GetSamplerDim(const Sampler& sampler) { | 105 | spv::Dim GetSamplerDim(const Sampler& sampler) { |
| 106 | ASSERT(!sampler.IsBuffer()); | 106 | ASSERT(!sampler.is_buffer); |
| 107 | switch (sampler.GetType()) { | 107 | switch (sampler.type) { |
| 108 | case Tegra::Shader::TextureType::Texture1D: | 108 | case Tegra::Shader::TextureType::Texture1D: |
| 109 | return spv::Dim::Dim1D; | 109 | return spv::Dim::Dim1D; |
| 110 | case Tegra::Shader::TextureType::Texture2D: | 110 | case Tegra::Shader::TextureType::Texture2D: |
| @@ -114,13 +114,13 @@ spv::Dim GetSamplerDim(const Sampler& sampler) { | |||
| 114 | case Tegra::Shader::TextureType::TextureCube: | 114 | case Tegra::Shader::TextureType::TextureCube: |
| 115 | return spv::Dim::Cube; | 115 | return spv::Dim::Cube; |
| 116 | default: | 116 | default: |
| 117 | UNIMPLEMENTED_MSG("Unimplemented sampler type={}", static_cast<u32>(sampler.GetType())); | 117 | UNIMPLEMENTED_MSG("Unimplemented sampler type={}", static_cast<int>(sampler.type)); |
| 118 | return spv::Dim::Dim2D; | 118 | return spv::Dim::Dim2D; |
| 119 | } | 119 | } |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | std::pair<spv::Dim, bool> GetImageDim(const Image& image) { | 122 | std::pair<spv::Dim, bool> GetImageDim(const Image& image) { |
| 123 | switch (image.GetType()) { | 123 | switch (image.type) { |
| 124 | case Tegra::Shader::ImageType::Texture1D: | 124 | case Tegra::Shader::ImageType::Texture1D: |
| 125 | return {spv::Dim::Dim1D, false}; | 125 | return {spv::Dim::Dim1D, false}; |
| 126 | case Tegra::Shader::ImageType::TextureBuffer: | 126 | case Tegra::Shader::ImageType::TextureBuffer: |
| @@ -134,7 +134,7 @@ std::pair<spv::Dim, bool> GetImageDim(const Image& image) { | |||
| 134 | case Tegra::Shader::ImageType::Texture3D: | 134 | case Tegra::Shader::ImageType::Texture3D: |
| 135 | return {spv::Dim::Dim3D, false}; | 135 | return {spv::Dim::Dim3D, false}; |
| 136 | default: | 136 | default: |
| 137 | UNIMPLEMENTED_MSG("Unimplemented image type={}", static_cast<u32>(image.GetType())); | 137 | UNIMPLEMENTED_MSG("Unimplemented image type={}", static_cast<int>(image.type)); |
| 138 | return {spv::Dim::Dim2D, false}; | 138 | return {spv::Dim::Dim2D, false}; |
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| @@ -879,11 +879,11 @@ private: | |||
| 879 | 879 | ||
| 880 | u32 DeclareTexelBuffers(u32 binding) { | 880 | u32 DeclareTexelBuffers(u32 binding) { |
| 881 | for (const auto& sampler : ir.GetSamplers()) { | 881 | for (const auto& sampler : ir.GetSamplers()) { |
| 882 | if (!sampler.IsBuffer()) { | 882 | if (!sampler.is_buffer) { |
| 883 | continue; | 883 | continue; |
| 884 | } | 884 | } |
| 885 | ASSERT(!sampler.IsArray()); | 885 | ASSERT(!sampler.is_array); |
| 886 | ASSERT(!sampler.IsShadow()); | 886 | ASSERT(!sampler.is_shadow); |
| 887 | 887 | ||
| 888 | constexpr auto dim = spv::Dim::Buffer; | 888 | constexpr auto dim = spv::Dim::Buffer; |
| 889 | constexpr int depth = 0; | 889 | constexpr int depth = 0; |
| @@ -894,23 +894,23 @@ private: | |||
| 894 | const Id image_type = TypeImage(t_float, dim, depth, arrayed, ms, sampled, format); | 894 | const Id image_type = TypeImage(t_float, dim, depth, arrayed, ms, sampled, format); |
| 895 | const Id pointer_type = TypePointer(spv::StorageClass::UniformConstant, image_type); | 895 | const Id pointer_type = TypePointer(spv::StorageClass::UniformConstant, image_type); |
| 896 | const Id id = OpVariable(pointer_type, spv::StorageClass::UniformConstant); | 896 | const Id id = OpVariable(pointer_type, spv::StorageClass::UniformConstant); |
| 897 | AddGlobalVariable(Name(id, fmt::format("sampler_{}", sampler.GetIndex()))); | 897 | AddGlobalVariable(Name(id, fmt::format("sampler_{}", sampler.index))); |
| 898 | Decorate(id, spv::Decoration::Binding, binding++); | 898 | Decorate(id, spv::Decoration::Binding, binding++); |
| 899 | Decorate(id, spv::Decoration::DescriptorSet, DESCRIPTOR_SET); | 899 | Decorate(id, spv::Decoration::DescriptorSet, DESCRIPTOR_SET); |
| 900 | 900 | ||
| 901 | texel_buffers.emplace(sampler.GetIndex(), TexelBuffer{image_type, id}); | 901 | texel_buffers.emplace(sampler.index, TexelBuffer{image_type, id}); |
| 902 | } | 902 | } |
| 903 | return binding; | 903 | return binding; |
| 904 | } | 904 | } |
| 905 | 905 | ||
| 906 | u32 DeclareSamplers(u32 binding) { | 906 | u32 DeclareSamplers(u32 binding) { |
| 907 | for (const auto& sampler : ir.GetSamplers()) { | 907 | for (const auto& sampler : ir.GetSamplers()) { |
| 908 | if (sampler.IsBuffer()) { | 908 | if (sampler.is_buffer) { |
| 909 | continue; | 909 | continue; |
| 910 | } | 910 | } |
| 911 | const auto dim = GetSamplerDim(sampler); | 911 | const auto dim = GetSamplerDim(sampler); |
| 912 | const int depth = sampler.IsShadow() ? 1 : 0; | 912 | const int depth = sampler.is_shadow ? 1 : 0; |
| 913 | const int arrayed = sampler.IsArray() ? 1 : 0; | 913 | const int arrayed = sampler.is_array ? 1 : 0; |
| 914 | constexpr bool ms = false; | 914 | constexpr bool ms = false; |
| 915 | constexpr int sampled = 1; | 915 | constexpr int sampled = 1; |
| 916 | constexpr auto format = spv::ImageFormat::Unknown; | 916 | constexpr auto format = spv::ImageFormat::Unknown; |
| @@ -918,17 +918,17 @@ private: | |||
| 918 | const Id sampler_type = TypeSampledImage(image_type); | 918 | const Id sampler_type = TypeSampledImage(image_type); |
| 919 | const Id sampler_pointer_type = | 919 | const Id sampler_pointer_type = |
| 920 | TypePointer(spv::StorageClass::UniformConstant, sampler_type); | 920 | TypePointer(spv::StorageClass::UniformConstant, sampler_type); |
| 921 | const Id type = sampler.IsIndexed() | 921 | const Id type = sampler.is_indexed |
| 922 | ? TypeArray(sampler_type, Constant(t_uint, sampler.Size())) | 922 | ? TypeArray(sampler_type, Constant(t_uint, sampler.size)) |
| 923 | : sampler_type; | 923 | : sampler_type; |
| 924 | const Id pointer_type = TypePointer(spv::StorageClass::UniformConstant, type); | 924 | const Id pointer_type = TypePointer(spv::StorageClass::UniformConstant, type); |
| 925 | const Id id = OpVariable(pointer_type, spv::StorageClass::UniformConstant); | 925 | const Id id = OpVariable(pointer_type, spv::StorageClass::UniformConstant); |
| 926 | AddGlobalVariable(Name(id, fmt::format("sampler_{}", sampler.GetIndex()))); | 926 | AddGlobalVariable(Name(id, fmt::format("sampler_{}", sampler.index))); |
| 927 | Decorate(id, spv::Decoration::Binding, binding++); | 927 | Decorate(id, spv::Decoration::Binding, binding++); |
| 928 | Decorate(id, spv::Decoration::DescriptorSet, DESCRIPTOR_SET); | 928 | Decorate(id, spv::Decoration::DescriptorSet, DESCRIPTOR_SET); |
| 929 | 929 | ||
| 930 | sampled_images.emplace(sampler.GetIndex(), SampledImage{image_type, sampler_type, | 930 | sampled_images.emplace( |
| 931 | sampler_pointer_type, id}); | 931 | sampler.index, SampledImage{image_type, sampler_type, sampler_pointer_type, id}); |
| 932 | } | 932 | } |
| 933 | return binding; | 933 | return binding; |
| 934 | } | 934 | } |
| @@ -943,17 +943,17 @@ private: | |||
| 943 | const Id image_type = TypeImage(t_uint, dim, depth, arrayed, ms, sampled, format, {}); | 943 | const Id image_type = TypeImage(t_uint, dim, depth, arrayed, ms, sampled, format, {}); |
| 944 | const Id pointer_type = TypePointer(spv::StorageClass::UniformConstant, image_type); | 944 | const Id pointer_type = TypePointer(spv::StorageClass::UniformConstant, image_type); |
| 945 | const Id id = OpVariable(pointer_type, spv::StorageClass::UniformConstant); | 945 | const Id id = OpVariable(pointer_type, spv::StorageClass::UniformConstant); |
| 946 | AddGlobalVariable(Name(id, fmt::format("image_{}", image.GetIndex()))); | 946 | AddGlobalVariable(Name(id, fmt::format("image_{}", image.index))); |
| 947 | 947 | ||
| 948 | Decorate(id, spv::Decoration::Binding, binding++); | 948 | Decorate(id, spv::Decoration::Binding, binding++); |
| 949 | Decorate(id, spv::Decoration::DescriptorSet, DESCRIPTOR_SET); | 949 | Decorate(id, spv::Decoration::DescriptorSet, DESCRIPTOR_SET); |
| 950 | if (image.IsRead() && !image.IsWritten()) { | 950 | if (image.is_read && !image.is_written) { |
| 951 | Decorate(id, spv::Decoration::NonWritable); | 951 | Decorate(id, spv::Decoration::NonWritable); |
| 952 | } else if (image.IsWritten() && !image.IsRead()) { | 952 | } else if (image.is_written && !image.is_read) { |
| 953 | Decorate(id, spv::Decoration::NonReadable); | 953 | Decorate(id, spv::Decoration::NonReadable); |
| 954 | } | 954 | } |
| 955 | 955 | ||
| 956 | images.emplace(static_cast<u32>(image.GetIndex()), StorageImage{image_type, id}); | 956 | images.emplace(image.index, StorageImage{image_type, id}); |
| 957 | } | 957 | } |
| 958 | return binding; | 958 | return binding; |
| 959 | } | 959 | } |
| @@ -1611,11 +1611,11 @@ private: | |||
| 1611 | 1611 | ||
| 1612 | Id GetTextureSampler(Operation operation) { | 1612 | Id GetTextureSampler(Operation operation) { |
| 1613 | const auto& meta = std::get<MetaTexture>(operation.GetMeta()); | 1613 | const auto& meta = std::get<MetaTexture>(operation.GetMeta()); |
| 1614 | ASSERT(!meta.sampler.IsBuffer()); | 1614 | ASSERT(!meta.sampler.is_buffer); |
| 1615 | 1615 | ||
| 1616 | const auto& entry = sampled_images.at(meta.sampler.GetIndex()); | 1616 | const auto& entry = sampled_images.at(meta.sampler.index); |
| 1617 | Id sampler = entry.variable; | 1617 | Id sampler = entry.variable; |
| 1618 | if (meta.sampler.IsIndexed()) { | 1618 | if (meta.sampler.is_indexed) { |
| 1619 | const Id index = AsInt(Visit(meta.index)); | 1619 | const Id index = AsInt(Visit(meta.index)); |
| 1620 | sampler = OpAccessChain(entry.sampler_pointer_type, sampler, index); | 1620 | sampler = OpAccessChain(entry.sampler_pointer_type, sampler, index); |
| 1621 | } | 1621 | } |
| @@ -1624,8 +1624,8 @@ private: | |||
| 1624 | 1624 | ||
| 1625 | Id GetTextureImage(Operation operation) { | 1625 | Id GetTextureImage(Operation operation) { |
| 1626 | const auto& meta = std::get<MetaTexture>(operation.GetMeta()); | 1626 | const auto& meta = std::get<MetaTexture>(operation.GetMeta()); |
| 1627 | const u32 index = meta.sampler.GetIndex(); | 1627 | const u32 index = meta.sampler.index; |
| 1628 | if (meta.sampler.IsBuffer()) { | 1628 | if (meta.sampler.is_buffer) { |
| 1629 | const auto& entry = texel_buffers.at(index); | 1629 | const auto& entry = texel_buffers.at(index); |
| 1630 | return OpLoad(entry.image_type, entry.image); | 1630 | return OpLoad(entry.image_type, entry.image); |
| 1631 | } else { | 1631 | } else { |
| @@ -1636,7 +1636,7 @@ private: | |||
| 1636 | 1636 | ||
| 1637 | Id GetImage(Operation operation) { | 1637 | Id GetImage(Operation operation) { |
| 1638 | const auto& meta = std::get<MetaImage>(operation.GetMeta()); | 1638 | const auto& meta = std::get<MetaImage>(operation.GetMeta()); |
| 1639 | const auto entry = images.at(meta.image.GetIndex()); | 1639 | const auto entry = images.at(meta.image.index); |
| 1640 | return OpLoad(entry.image_type, entry.image); | 1640 | return OpLoad(entry.image_type, entry.image); |
| 1641 | } | 1641 | } |
| 1642 | 1642 | ||
| @@ -1652,7 +1652,7 @@ private: | |||
| 1652 | } | 1652 | } |
| 1653 | if (const auto meta = std::get_if<MetaTexture>(&operation.GetMeta())) { | 1653 | if (const auto meta = std::get_if<MetaTexture>(&operation.GetMeta())) { |
| 1654 | // Add array coordinate for textures | 1654 | // Add array coordinate for textures |
| 1655 | if (meta->sampler.IsArray()) { | 1655 | if (meta->sampler.is_array) { |
| 1656 | Id array = AsInt(Visit(meta->array)); | 1656 | Id array = AsInt(Visit(meta->array)); |
| 1657 | if (type == Type::Float) { | 1657 | if (type == Type::Float) { |
| 1658 | array = OpConvertSToF(t_float, array); | 1658 | array = OpConvertSToF(t_float, array); |
| @@ -1758,7 +1758,7 @@ private: | |||
| 1758 | operands.push_back(GetOffsetCoordinates(operation)); | 1758 | operands.push_back(GetOffsetCoordinates(operation)); |
| 1759 | } | 1759 | } |
| 1760 | 1760 | ||
| 1761 | if (meta.sampler.IsShadow()) { | 1761 | if (meta.sampler.is_shadow) { |
| 1762 | const Id dref = AsFloat(Visit(meta.depth_compare)); | 1762 | const Id dref = AsFloat(Visit(meta.depth_compare)); |
| 1763 | return {OpImageSampleDrefExplicitLod(t_float, sampler, coords, dref, mask, operands), | 1763 | return {OpImageSampleDrefExplicitLod(t_float, sampler, coords, dref, mask, operands), |
| 1764 | Type::Float}; | 1764 | Type::Float}; |
| @@ -1773,7 +1773,7 @@ private: | |||
| 1773 | 1773 | ||
| 1774 | const Id coords = GetCoordinates(operation, Type::Float); | 1774 | const Id coords = GetCoordinates(operation, Type::Float); |
| 1775 | Id texture{}; | 1775 | Id texture{}; |
| 1776 | if (meta.sampler.IsShadow()) { | 1776 | if (meta.sampler.is_shadow) { |
| 1777 | texture = OpImageDrefGather(t_float4, GetTextureSampler(operation), coords, | 1777 | texture = OpImageDrefGather(t_float4, GetTextureSampler(operation), coords, |
| 1778 | AsFloat(Visit(meta.depth_compare))); | 1778 | AsFloat(Visit(meta.depth_compare))); |
| 1779 | } else { | 1779 | } else { |
| @@ -1800,8 +1800,8 @@ private: | |||
| 1800 | } | 1800 | } |
| 1801 | 1801 | ||
| 1802 | const Id lod = AsUint(Visit(operation[0])); | 1802 | const Id lod = AsUint(Visit(operation[0])); |
| 1803 | const std::size_t coords_count = [&]() { | 1803 | const std::size_t coords_count = [&meta] { |
| 1804 | switch (const auto type = meta.sampler.GetType(); type) { | 1804 | switch (const auto type = meta.sampler.type) { |
| 1805 | case Tegra::Shader::TextureType::Texture1D: | 1805 | case Tegra::Shader::TextureType::Texture1D: |
| 1806 | return 1; | 1806 | return 1; |
| 1807 | case Tegra::Shader::TextureType::Texture2D: | 1807 | case Tegra::Shader::TextureType::Texture2D: |
| @@ -1810,7 +1810,7 @@ private: | |||
| 1810 | case Tegra::Shader::TextureType::Texture3D: | 1810 | case Tegra::Shader::TextureType::Texture3D: |
| 1811 | return 3; | 1811 | return 3; |
| 1812 | default: | 1812 | default: |
| 1813 | UNREACHABLE_MSG("Invalid texture type={}", static_cast<u32>(type)); | 1813 | UNREACHABLE_MSG("Invalid texture type={}", static_cast<int>(type)); |
| 1814 | return 2; | 1814 | return 2; |
| 1815 | } | 1815 | } |
| 1816 | }(); | 1816 | }(); |
| @@ -1853,7 +1853,7 @@ private: | |||
| 1853 | const Id image = GetTextureImage(operation); | 1853 | const Id image = GetTextureImage(operation); |
| 1854 | const Id coords = GetCoordinates(operation, Type::Int); | 1854 | const Id coords = GetCoordinates(operation, Type::Int); |
| 1855 | Id fetch; | 1855 | Id fetch; |
| 1856 | if (meta.lod && !meta.sampler.IsBuffer()) { | 1856 | if (meta.lod && !meta.sampler.is_buffer) { |
| 1857 | fetch = OpImageFetch(t_float4, image, coords, spv::ImageOperandsMask::Lod, | 1857 | fetch = OpImageFetch(t_float4, image, coords, spv::ImageOperandsMask::Lod, |
| 1858 | AsInt(Visit(meta.lod))); | 1858 | AsInt(Visit(meta.lod))); |
| 1859 | } else { | 1859 | } else { |
| @@ -2969,7 +2969,7 @@ ShaderEntries GenerateShaderEntries(const VideoCommon::Shader::ShaderIR& ir) { | |||
| 2969 | entries.global_buffers.emplace_back(base.cbuf_index, base.cbuf_offset, usage.is_written); | 2969 | entries.global_buffers.emplace_back(base.cbuf_index, base.cbuf_offset, usage.is_written); |
| 2970 | } | 2970 | } |
| 2971 | for (const auto& sampler : ir.GetSamplers()) { | 2971 | for (const auto& sampler : ir.GetSamplers()) { |
| 2972 | if (sampler.IsBuffer()) { | 2972 | if (sampler.is_buffer) { |
| 2973 | entries.texel_buffers.emplace_back(sampler); | 2973 | entries.texel_buffers.emplace_back(sampler); |
| 2974 | } else { | 2974 | } else { |
| 2975 | entries.samplers.emplace_back(sampler); | 2975 | entries.samplers.emplace_back(sampler); |