summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-01-13 21:20:02 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-02-28 21:56:43 +0100
commitb1498d2c54b11b9a9c0ab307f03377f6661ab873 (patch)
tree98968d61e4193a3a0d9ba0514af7975a466f5a10 /src/video_core
parentgl_rasterizer: Only apply polygon offset clamp if enabled (diff)
downloadyuzu-b1498d2c54b11b9a9c0ab307f03377f6661ab873.tar
yuzu-b1498d2c54b11b9a9c0ab307f03377f6661ab873.tar.gz
yuzu-b1498d2c54b11b9a9c0ab307f03377f6661ab873.tar.bz2
yuzu-b1498d2c54b11b9a9c0ab307f03377f6661ab873.tar.lz
yuzu-b1498d2c54b11b9a9c0ab307f03377f6661ab873.tar.xz
yuzu-b1498d2c54b11b9a9c0ab307f03377f6661ab873.tar.zst
yuzu-b1498d2c54b11b9a9c0ab307f03377f6661ab873.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 8a762fd0d..84c285db8 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -54,6 +54,8 @@ MICROPROFILE_DEFINE(OpenGL_PrimitiveAssembly, "OpenGL", "Prim Asmbl", MP_RGB(255
namespace {
+constexpr std::size_t NumSupportedVertexAttributes = 16;
+
template <typename Engine, typename Entry>
Tegra::Texture::FullTextureInfo GetTextureInfo(const Engine& engine, const Entry& entry,
Tegra::Engines::ShaderType shader_type,
@@ -134,7 +136,7 @@ void RasterizerOpenGL::SetupVertexFormat() {
// avoid OpenGL errors.
// TODO(Subv): Analyze the shader to identify which attributes are actually used and don't
// assume every shader uses them all.
- for (std::size_t index = 0; index < 16; ++index) {
+ for (std::size_t index = 0; index < NumSupportedVertexAttributes; ++index) {
if (!flags[Dirty::VertexFormat0 + index]) {
continue;
}
@@ -207,7 +209,7 @@ void RasterizerOpenGL::SetupVertexInstances() {
flags[Dirty::VertexInstances] = false;
const auto& regs = gpu.regs;
- for (std::size_t index = 0; index < 16; ++index) {
+ for (std::size_t index = 0; index < NumSupportedVertexAttributes; ++index) {
if (!flags[Dirty::VertexInstance0 + index]) {
continue;
}