diff options
| author | 2020-05-02 00:45:41 -0400 | |
|---|---|---|
| committer | 2020-05-02 00:45:41 -0400 | |
| commit | e6b4311178b4f87b67eb2383f2a64520c2a8dd25 (patch) | |
| tree | 066f25773f9db49747f26ddf94b23a5007502ff8 /src/video_core/renderer_vulkan | |
| parent | Merge pull request #3859 from jbeich/clang (diff) | |
| parent | shader/texture: Support multiple unknown sampler properties (diff) | |
| download | yuzu-e6b4311178b4f87b67eb2383f2a64520c2a8dd25.tar.gz yuzu-e6b4311178b4f87b67eb2383f2a64520c2a8dd25.tar.xz yuzu-e6b4311178b4f87b67eb2383f2a64520c2a8dd25.zip | |
Merge pull request #3693 from ReinUsesLisp/clean-samplers
shader/texture: Support multiple unknown sampler properties
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 9b703a2f0..8fbd63dbc 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -85,7 +85,7 @@ void AddBindings(std::vector<VkDescriptorSetLayoutBinding>& bindings, u32& bindi | |||
| 85 | u32 count = 1; | 85 | u32 count = 1; |
| 86 | if constexpr (descriptor_type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) { | 86 | if constexpr (descriptor_type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) { |
| 87 | // Combined image samplers can be arrayed. | 87 | // Combined image samplers can be arrayed. |
| 88 | count = container[i].Size(); | 88 | count = container[i].size; |
| 89 | } | 89 | } |
| 90 | VkDescriptorSetLayoutBinding& entry = bindings.emplace_back(); | 90 | VkDescriptorSetLayoutBinding& entry = bindings.emplace_back(); |
| 91 | entry.binding = binding++; | 91 | entry.binding = binding++; |
| @@ -362,7 +362,7 @@ void AddEntry(std::vector<VkDescriptorUpdateTemplateEntry>& template_entries, u3 | |||
| 362 | 362 | ||
| 363 | if constexpr (descriptor_type == COMBINED_IMAGE_SAMPLER) { | 363 | if constexpr (descriptor_type == COMBINED_IMAGE_SAMPLER) { |
| 364 | for (u32 i = 0; i < count; ++i) { | 364 | for (u32 i = 0; i < count; ++i) { |
| 365 | const u32 num_samplers = container[i].Size(); | 365 | const u32 num_samplers = container[i].size; |
| 366 | VkDescriptorUpdateTemplateEntry& entry = template_entries.emplace_back(); | 366 | VkDescriptorUpdateTemplateEntry& entry = template_entries.emplace_back(); |
| 367 | entry.dstBinding = binding; | 367 | entry.dstBinding = binding; |
| 368 | entry.dstArrayElement = 0; | 368 | entry.dstArrayElement = 0; |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 776053de5..ccfd0e670 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 { |
| @@ -971,7 +970,7 @@ void RasterizerVulkan::SetupGraphicsTextures(const ShaderEntries& entries, std:: | |||
| 971 | MICROPROFILE_SCOPE(Vulkan_Textures); | 970 | MICROPROFILE_SCOPE(Vulkan_Textures); |
| 972 | const auto& gpu = system.GPU().Maxwell3D(); | 971 | const auto& gpu = system.GPU().Maxwell3D(); |
| 973 | for (const auto& entry : entries.samplers) { | 972 | for (const auto& entry : entries.samplers) { |
| 974 | for (std::size_t i = 0; i < entry.Size(); ++i) { | 973 | for (std::size_t i = 0; i < entry.size; ++i) { |
| 975 | const auto texture = GetTextureInfo(gpu, entry, stage, i); | 974 | const auto texture = GetTextureInfo(gpu, entry, stage, i); |
| 976 | SetupTexture(texture, entry); | 975 | SetupTexture(texture, entry); |
| 977 | } | 976 | } |
| @@ -1023,7 +1022,7 @@ void RasterizerVulkan::SetupComputeTextures(const ShaderEntries& entries) { | |||
| 1023 | MICROPROFILE_SCOPE(Vulkan_Textures); | 1022 | MICROPROFILE_SCOPE(Vulkan_Textures); |
| 1024 | const auto& gpu = system.GPU().KeplerCompute(); | 1023 | const auto& gpu = system.GPU().KeplerCompute(); |
| 1025 | for (const auto& entry : entries.samplers) { | 1024 | for (const auto& entry : entries.samplers) { |
| 1026 | for (std::size_t i = 0; i < entry.Size(); ++i) { | 1025 | for (std::size_t i = 0; i < entry.size; ++i) { |
| 1027 | const auto texture = GetTextureInfo(gpu, entry, ComputeShaderIndex, i); | 1026 | const auto texture = GetTextureInfo(gpu, entry, ComputeShaderIndex, i); |
| 1028 | SetupTexture(texture, entry); | 1027 | SetupTexture(texture, entry); |
| 1029 | } | 1028 | } |
| @@ -1105,7 +1104,7 @@ void RasterizerVulkan::SetupTexture(const Tegra::Texture::FullTextureInfo& textu | |||
| 1105 | void RasterizerVulkan::SetupImage(const Tegra::Texture::TICEntry& tic, const ImageEntry& entry) { | 1104 | void RasterizerVulkan::SetupImage(const Tegra::Texture::TICEntry& tic, const ImageEntry& entry) { |
| 1106 | auto view = texture_cache.GetImageSurface(tic, entry); | 1105 | auto view = texture_cache.GetImageSurface(tic, entry); |
| 1107 | 1106 | ||
| 1108 | if (entry.IsWritten()) { | 1107 | if (entry.is_written) { |
| 1109 | view->MarkAsModified(texture_cache.Tick()); | 1108 | view->MarkAsModified(texture_cache.Tick()); |
| 1110 | } | 1109 | } |
| 1111 | 1110 | ||
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index 20b6ca0ad..18678968c 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 | } |
| @@ -1620,11 +1620,11 @@ private: | |||
| 1620 | 1620 | ||
| 1621 | Id GetTextureSampler(Operation operation) { | 1621 | Id GetTextureSampler(Operation operation) { |
| 1622 | const auto& meta = std::get<MetaTexture>(operation.GetMeta()); | 1622 | const auto& meta = std::get<MetaTexture>(operation.GetMeta()); |
| 1623 | ASSERT(!meta.sampler.IsBuffer()); | 1623 | ASSERT(!meta.sampler.is_buffer); |
| 1624 | 1624 | ||
| 1625 | const auto& entry = sampled_images.at(meta.sampler.GetIndex()); | 1625 | const auto& entry = sampled_images.at(meta.sampler.index); |
| 1626 | Id sampler = entry.variable; | 1626 | Id sampler = entry.variable; |
| 1627 | if (meta.sampler.IsIndexed()) { | 1627 | if (meta.sampler.is_indexed) { |
| 1628 | const Id index = AsInt(Visit(meta.index)); | 1628 | const Id index = AsInt(Visit(meta.index)); |
| 1629 | sampler = OpAccessChain(entry.sampler_pointer_type, sampler, index); | 1629 | sampler = OpAccessChain(entry.sampler_pointer_type, sampler, index); |
| 1630 | } | 1630 | } |
| @@ -1633,8 +1633,8 @@ private: | |||
| 1633 | 1633 | ||
| 1634 | Id GetTextureImage(Operation operation) { | 1634 | Id GetTextureImage(Operation operation) { |
| 1635 | const auto& meta = std::get<MetaTexture>(operation.GetMeta()); | 1635 | const auto& meta = std::get<MetaTexture>(operation.GetMeta()); |
| 1636 | const u32 index = meta.sampler.GetIndex(); | 1636 | const u32 index = meta.sampler.index; |
| 1637 | if (meta.sampler.IsBuffer()) { | 1637 | if (meta.sampler.is_buffer) { |
| 1638 | const auto& entry = texel_buffers.at(index); | 1638 | const auto& entry = texel_buffers.at(index); |
| 1639 | return OpLoad(entry.image_type, entry.image); | 1639 | return OpLoad(entry.image_type, entry.image); |
| 1640 | } else { | 1640 | } else { |
| @@ -1645,7 +1645,7 @@ private: | |||
| 1645 | 1645 | ||
| 1646 | Id GetImage(Operation operation) { | 1646 | Id GetImage(Operation operation) { |
| 1647 | const auto& meta = std::get<MetaImage>(operation.GetMeta()); | 1647 | const auto& meta = std::get<MetaImage>(operation.GetMeta()); |
| 1648 | const auto entry = images.at(meta.image.GetIndex()); | 1648 | const auto entry = images.at(meta.image.index); |
| 1649 | return OpLoad(entry.image_type, entry.image); | 1649 | return OpLoad(entry.image_type, entry.image); |
| 1650 | } | 1650 | } |
| 1651 | 1651 | ||
| @@ -1661,7 +1661,7 @@ private: | |||
| 1661 | } | 1661 | } |
| 1662 | if (const auto meta = std::get_if<MetaTexture>(&operation.GetMeta())) { | 1662 | if (const auto meta = std::get_if<MetaTexture>(&operation.GetMeta())) { |
| 1663 | // Add array coordinate for textures | 1663 | // Add array coordinate for textures |
| 1664 | if (meta->sampler.IsArray()) { | 1664 | if (meta->sampler.is_array) { |
| 1665 | Id array = AsInt(Visit(meta->array)); | 1665 | Id array = AsInt(Visit(meta->array)); |
| 1666 | if (type == Type::Float) { | 1666 | if (type == Type::Float) { |
| 1667 | array = OpConvertSToF(t_float, array); | 1667 | array = OpConvertSToF(t_float, array); |
| @@ -1767,7 +1767,7 @@ private: | |||
| 1767 | operands.push_back(GetOffsetCoordinates(operation)); | 1767 | operands.push_back(GetOffsetCoordinates(operation)); |
| 1768 | } | 1768 | } |
| 1769 | 1769 | ||
| 1770 | if (meta.sampler.IsShadow()) { | 1770 | if (meta.sampler.is_shadow) { |
| 1771 | const Id dref = AsFloat(Visit(meta.depth_compare)); | 1771 | const Id dref = AsFloat(Visit(meta.depth_compare)); |
| 1772 | return {OpImageSampleDrefExplicitLod(t_float, sampler, coords, dref, mask, operands), | 1772 | return {OpImageSampleDrefExplicitLod(t_float, sampler, coords, dref, mask, operands), |
| 1773 | Type::Float}; | 1773 | Type::Float}; |
| @@ -1782,7 +1782,7 @@ private: | |||
| 1782 | 1782 | ||
| 1783 | const Id coords = GetCoordinates(operation, Type::Float); | 1783 | const Id coords = GetCoordinates(operation, Type::Float); |
| 1784 | Id texture{}; | 1784 | Id texture{}; |
| 1785 | if (meta.sampler.IsShadow()) { | 1785 | if (meta.sampler.is_shadow) { |
| 1786 | texture = OpImageDrefGather(t_float4, GetTextureSampler(operation), coords, | 1786 | texture = OpImageDrefGather(t_float4, GetTextureSampler(operation), coords, |
| 1787 | AsFloat(Visit(meta.depth_compare))); | 1787 | AsFloat(Visit(meta.depth_compare))); |
| 1788 | } else { | 1788 | } else { |
| @@ -1809,8 +1809,8 @@ private: | |||
| 1809 | } | 1809 | } |
| 1810 | 1810 | ||
| 1811 | const Id lod = AsUint(Visit(operation[0])); | 1811 | const Id lod = AsUint(Visit(operation[0])); |
| 1812 | const std::size_t coords_count = [&]() { | 1812 | const std::size_t coords_count = [&meta] { |
| 1813 | switch (const auto type = meta.sampler.GetType(); type) { | 1813 | switch (const auto type = meta.sampler.type) { |
| 1814 | case Tegra::Shader::TextureType::Texture1D: | 1814 | case Tegra::Shader::TextureType::Texture1D: |
| 1815 | return 1; | 1815 | return 1; |
| 1816 | case Tegra::Shader::TextureType::Texture2D: | 1816 | case Tegra::Shader::TextureType::Texture2D: |
| @@ -1819,7 +1819,7 @@ private: | |||
| 1819 | case Tegra::Shader::TextureType::Texture3D: | 1819 | case Tegra::Shader::TextureType::Texture3D: |
| 1820 | return 3; | 1820 | return 3; |
| 1821 | default: | 1821 | default: |
| 1822 | UNREACHABLE_MSG("Invalid texture type={}", static_cast<u32>(type)); | 1822 | UNREACHABLE_MSG("Invalid texture type={}", static_cast<int>(type)); |
| 1823 | return 2; | 1823 | return 2; |
| 1824 | } | 1824 | } |
| 1825 | }(); | 1825 | }(); |
| @@ -1862,7 +1862,7 @@ private: | |||
| 1862 | const Id image = GetTextureImage(operation); | 1862 | const Id image = GetTextureImage(operation); |
| 1863 | const Id coords = GetCoordinates(operation, Type::Int); | 1863 | const Id coords = GetCoordinates(operation, Type::Int); |
| 1864 | Id fetch; | 1864 | Id fetch; |
| 1865 | if (meta.lod && !meta.sampler.IsBuffer()) { | 1865 | if (meta.lod && !meta.sampler.is_buffer) { |
| 1866 | fetch = OpImageFetch(t_float4, image, coords, spv::ImageOperandsMask::Lod, | 1866 | fetch = OpImageFetch(t_float4, image, coords, spv::ImageOperandsMask::Lod, |
| 1867 | AsInt(Visit(meta.lod))); | 1867 | AsInt(Visit(meta.lod))); |
| 1868 | } else { | 1868 | } else { |
| @@ -2980,7 +2980,7 @@ ShaderEntries GenerateShaderEntries(const VideoCommon::Shader::ShaderIR& ir) { | |||
| 2980 | entries.global_buffers.emplace_back(base.cbuf_index, base.cbuf_offset, usage.is_written); | 2980 | entries.global_buffers.emplace_back(base.cbuf_index, base.cbuf_offset, usage.is_written); |
| 2981 | } | 2981 | } |
| 2982 | for (const auto& sampler : ir.GetSamplers()) { | 2982 | for (const auto& sampler : ir.GetSamplers()) { |
| 2983 | if (sampler.IsBuffer()) { | 2983 | if (sampler.is_buffer) { |
| 2984 | entries.texel_buffers.emplace_back(sampler); | 2984 | entries.texel_buffers.emplace_back(sampler); |
| 2985 | } else { | 2985 | } else { |
| 2986 | entries.samplers.emplace_back(sampler); | 2986 | entries.samplers.emplace_back(sampler); |