diff options
| author | 2023-08-13 16:50:01 -0400 | |
|---|---|---|
| committer | 2023-08-13 16:50:01 -0400 | |
| commit | c34ed4bbd810447e4434599a5b5fae48acb5748f (patch) | |
| tree | 52b3a49312e7027799f666e2dd023099020623ab | |
| parent | Merge pull request #11219 from zeltermann/title-id-search (diff) | |
| download | yuzu-c34ed4bbd810447e4434599a5b5fae48acb5748f.tar.gz yuzu-c34ed4bbd810447e4434599a5b5fae48acb5748f.tar.xz yuzu-c34ed4bbd810447e4434599a5b5fae48acb5748f.zip | |
gl_graphics_pipeline: GLASM: Fix transform feedback with multiple buffers
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_graphics_pipeline.cpp | 14 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_graphics_pipeline.h | 2 |
2 files changed, 1 insertions, 15 deletions
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp index f822fa856..2d68abf98 100644 --- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp +++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp | |||
| @@ -559,15 +559,13 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { | |||
| 559 | } | 559 | } |
| 560 | 560 | ||
| 561 | void GraphicsPipeline::ConfigureTransformFeedbackImpl() const { | 561 | void GraphicsPipeline::ConfigureTransformFeedbackImpl() const { |
| 562 | glTransformFeedbackStreamAttribsNV(num_xfb_attribs, xfb_attribs.data(), num_xfb_strides, | 562 | glTransformFeedbackAttribsNV(num_xfb_attribs, xfb_attribs.data(), GL_SEPARATE_ATTRIBS); |
| 563 | xfb_streams.data(), GL_INTERLEAVED_ATTRIBS); | ||
| 564 | } | 563 | } |
| 565 | 564 | ||
| 566 | void GraphicsPipeline::GenerateTransformFeedbackState() { | 565 | void GraphicsPipeline::GenerateTransformFeedbackState() { |
| 567 | // TODO(Rodrigo): Inject SKIP_COMPONENTS*_NV when required. An unimplemented message will signal | 566 | // TODO(Rodrigo): Inject SKIP_COMPONENTS*_NV when required. An unimplemented message will signal |
| 568 | // when this is required. | 567 | // when this is required. |
| 569 | GLint* cursor{xfb_attribs.data()}; | 568 | GLint* cursor{xfb_attribs.data()}; |
| 570 | GLint* current_stream{xfb_streams.data()}; | ||
| 571 | 569 | ||
| 572 | for (size_t feedback = 0; feedback < Maxwell::NumTransformFeedbackBuffers; ++feedback) { | 570 | for (size_t feedback = 0; feedback < Maxwell::NumTransformFeedbackBuffers; ++feedback) { |
| 573 | const auto& layout = key.xfb_state.layouts[feedback]; | 571 | const auto& layout = key.xfb_state.layouts[feedback]; |
| @@ -575,15 +573,6 @@ void GraphicsPipeline::GenerateTransformFeedbackState() { | |||
| 575 | if (layout.varying_count == 0) { | 573 | if (layout.varying_count == 0) { |
| 576 | continue; | 574 | continue; |
| 577 | } | 575 | } |
| 578 | *current_stream = static_cast<GLint>(feedback); | ||
| 579 | if (current_stream != xfb_streams.data()) { | ||
| 580 | // When stepping one stream, push the expected token | ||
| 581 | cursor[0] = GL_NEXT_BUFFER_NV; | ||
| 582 | cursor[1] = 0; | ||
| 583 | cursor[2] = 0; | ||
| 584 | cursor += XFB_ENTRY_STRIDE; | ||
| 585 | } | ||
| 586 | ++current_stream; | ||
| 587 | 576 | ||
| 588 | const auto& locations = key.xfb_state.varyings[feedback]; | 577 | const auto& locations = key.xfb_state.varyings[feedback]; |
| 589 | std::optional<u32> current_index; | 578 | std::optional<u32> current_index; |
| @@ -619,7 +608,6 @@ void GraphicsPipeline::GenerateTransformFeedbackState() { | |||
| 619 | } | 608 | } |
| 620 | } | 609 | } |
| 621 | num_xfb_attribs = static_cast<GLsizei>((cursor - xfb_attribs.data()) / XFB_ENTRY_STRIDE); | 610 | num_xfb_attribs = static_cast<GLsizei>((cursor - xfb_attribs.data()) / XFB_ENTRY_STRIDE); |
| 622 | num_xfb_strides = static_cast<GLsizei>(current_stream - xfb_streams.data()); | ||
| 623 | } | 611 | } |
| 624 | 612 | ||
| 625 | void GraphicsPipeline::WaitForBuild() { | 613 | void GraphicsPipeline::WaitForBuild() { |
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.h b/src/video_core/renderer_opengl/gl_graphics_pipeline.h index 7b3d7eae8..74fc9cc3d 100644 --- a/src/video_core/renderer_opengl/gl_graphics_pipeline.h +++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.h | |||
| @@ -154,9 +154,7 @@ private: | |||
| 154 | 154 | ||
| 155 | static constexpr std::size_t XFB_ENTRY_STRIDE = 3; | 155 | static constexpr std::size_t XFB_ENTRY_STRIDE = 3; |
| 156 | GLsizei num_xfb_attribs{}; | 156 | GLsizei num_xfb_attribs{}; |
| 157 | GLsizei num_xfb_strides{}; | ||
| 158 | std::array<GLint, 128 * XFB_ENTRY_STRIDE * Maxwell::NumTransformFeedbackBuffers> xfb_attribs{}; | 157 | std::array<GLint, 128 * XFB_ENTRY_STRIDE * Maxwell::NumTransformFeedbackBuffers> xfb_attribs{}; |
| 159 | std::array<GLint, Maxwell::NumTransformFeedbackBuffers> xfb_streams{}; | ||
| 160 | 158 | ||
| 161 | std::mutex built_mutex; | 159 | std::mutex built_mutex; |
| 162 | std::condition_variable built_condvar; | 160 | std::condition_variable built_condvar; |