summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-03-05 17:42:46 +0100
committerGitHub <noreply@github.com>2020-03-05 17:42:46 +0100
commit0361aa1915468ec55ea0e70778c041f13c0d6746 (patch)
tree3b16308a82001e6bd9ff5576c3958b3fb1cb433a /src/video_core/renderer_opengl
parentMerge pull request #3469 from namkazt/patch-1 (diff)
parentvk_shader_decompiler: Implement indexed textures (diff)
downloadyuzu-0361aa1915468ec55ea0e70778c041f13c0d6746.tar
yuzu-0361aa1915468ec55ea0e70778c041f13c0d6746.tar.gz
yuzu-0361aa1915468ec55ea0e70778c041f13c0d6746.tar.bz2
yuzu-0361aa1915468ec55ea0e70778c041f13c0d6746.tar.lz
yuzu-0361aa1915468ec55ea0e70778c041f13c0d6746.tar.xz
yuzu-0361aa1915468ec55ea0e70778c041f13c0d6746.tar.zst
yuzu-0361aa1915468ec55ea0e70778c041f13c0d6746.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index e1965fb21..3fcd319fd 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -36,6 +36,7 @@ namespace OpenGL {
using Maxwell = Tegra::Engines::Maxwell3D::Regs;
+using Tegra::Engines::ShaderType;
using VideoCore::Surface::PixelFormat;
using VideoCore::Surface::SurfaceTarget;
using VideoCore::Surface::SurfaceType;
@@ -56,8 +57,7 @@ namespace {
template <typename Engine, typename Entry>
Tegra::Texture::FullTextureInfo GetTextureInfo(const Engine& engine, const Entry& entry,
- Tegra::Engines::ShaderType shader_type,
- std::size_t index = 0) {
+ ShaderType shader_type, std::size_t index = 0) {
if (entry.IsBindless()) {
const Tegra::Texture::TextureHandle tex_handle =
engine.AccessConstBuffer32(shader_type, entry.GetBuffer(), entry.GetOffset());
@@ -910,15 +910,10 @@ void RasterizerOpenGL::SetupDrawTextures(std::size_t stage_index, const Shader&
const auto& maxwell3d = system.GPU().Maxwell3D();
u32 binding = device.GetBaseBindings(stage_index).sampler;
for (const auto& entry : shader->GetShaderEntries().samplers) {
- const auto shader_type = static_cast<Tegra::Engines::ShaderType>(stage_index);
- if (!entry.IsIndexed()) {
- const auto texture = GetTextureInfo(maxwell3d, entry, shader_type);
+ const auto shader_type = static_cast<ShaderType>(stage_index);
+ for (std::size_t i = 0; i < entry.Size(); ++i) {
+ const auto texture = GetTextureInfo(maxwell3d, entry, shader_type, i);
SetupTexture(binding++, texture, entry);
- } else {
- for (std::size_t i = 0; i < entry.Size(); ++i) {
- const auto texture = GetTextureInfo(maxwell3d, entry, shader_type, i);
- SetupTexture(binding++, texture, entry);
- }
}
}
}
@@ -928,16 +923,9 @@ void RasterizerOpenGL::SetupComputeTextures(const Shader& kernel) {
const auto& compute = system.GPU().KeplerCompute();
u32 binding = 0;
for (const auto& entry : kernel->GetShaderEntries().samplers) {
- if (!entry.IsIndexed()) {
- const auto texture =
- GetTextureInfo(compute, entry, Tegra::Engines::ShaderType::Compute);
+ for (std::size_t i = 0; i < entry.Size(); ++i) {
+ const auto texture = GetTextureInfo(compute, entry, ShaderType::Compute, i);
SetupTexture(binding++, texture, entry);
- } else {
- for (std::size_t i = 0; i < entry.Size(); ++i) {
- const auto texture =
- GetTextureInfo(compute, entry, Tegra::Engines::ShaderType::Compute, i);
- SetupTexture(binding++, texture, entry);
- }
}
}
}