diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-11-19 15:49:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-19 15:49:38 +0100 |
commit | 61fed8a3a6d072725bdbc594b490128423bcff38 (patch) | |
tree | ec48466f32051026d196347872c7b79e17be9f16 /src | |
parent | Merge pull request #12072 from FernandoS27/winter-is-2-seconds-too-soon (diff) | |
parent | gl_graphics_pipeline: GLASM: Fix transform feedback attribs buffer mode (diff) | |
download | yuzu-61fed8a3a6d072725bdbc594b490128423bcff38.tar yuzu-61fed8a3a6d072725bdbc594b490128423bcff38.tar.gz yuzu-61fed8a3a6d072725bdbc594b490128423bcff38.tar.bz2 yuzu-61fed8a3a6d072725bdbc594b490128423bcff38.tar.lz yuzu-61fed8a3a6d072725bdbc594b490128423bcff38.tar.xz yuzu-61fed8a3a6d072725bdbc594b490128423bcff38.tar.zst yuzu-61fed8a3a6d072725bdbc594b490128423bcff38.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_graphics_pipeline.cpp | 6 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_graphics_pipeline.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp index 44a771d65..af0a453ee 100644 --- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp +++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp @@ -559,7 +559,9 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { } void GraphicsPipeline::ConfigureTransformFeedbackImpl() const { - glTransformFeedbackAttribsNV(num_xfb_attribs, xfb_attribs.data(), GL_SEPARATE_ATTRIBS); + const GLenum buffer_mode = + num_xfb_buffers_active == 1 ? GL_INTERLEAVED_ATTRIBS : GL_SEPARATE_ATTRIBS; + glTransformFeedbackAttribsNV(num_xfb_attribs, xfb_attribs.data(), buffer_mode); } void GraphicsPipeline::GenerateTransformFeedbackState() { @@ -567,12 +569,14 @@ void GraphicsPipeline::GenerateTransformFeedbackState() { // when this is required. GLint* cursor{xfb_attribs.data()}; + num_xfb_buffers_active = 0; for (size_t feedback = 0; feedback < Maxwell::NumTransformFeedbackBuffers; ++feedback) { const auto& layout = key.xfb_state.layouts[feedback]; UNIMPLEMENTED_IF_MSG(layout.stride != layout.varying_count * 4, "Stride padding"); if (layout.varying_count == 0) { continue; } + num_xfb_buffers_active++; const auto& locations = key.xfb_state.varyings[feedback]; std::optional<u32> current_index; diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.h b/src/video_core/renderer_opengl/gl_graphics_pipeline.h index 74fc9cc3d..2f70c1ae9 100644 --- a/src/video_core/renderer_opengl/gl_graphics_pipeline.h +++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.h @@ -154,6 +154,7 @@ private: static constexpr std::size_t XFB_ENTRY_STRIDE = 3; GLsizei num_xfb_attribs{}; + u32 num_xfb_buffers_active{}; std::array<GLint, 128 * XFB_ENTRY_STRIDE * Maxwell::NumTransformFeedbackBuffers> xfb_attribs{}; std::mutex built_mutex; |