summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-09-19 17:41:07 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-09-19 17:41:33 +0200
commit7761e44d186deff278e51814bdec0c25e8e1a09c (patch)
tree03e9879770a0e847bdf5bd8de624bfe9e96f8809 /src/video_core/renderer_opengl/gl_rasterizer.cpp
parentRasterizer: Address Feedback and conscerns. (diff)
downloadyuzu-7761e44d186deff278e51814bdec0c25e8e1a09c.tar
yuzu-7761e44d186deff278e51814bdec0c25e8e1a09c.tar.gz
yuzu-7761e44d186deff278e51814bdec0c25e8e1a09c.tar.bz2
yuzu-7761e44d186deff278e51814bdec0c25e8e1a09c.tar.lz
yuzu-7761e44d186deff278e51814bdec0c25e8e1a09c.tar.xz
yuzu-7761e44d186deff278e51814bdec0c25e8e1a09c.tar.zst
yuzu-7761e44d186deff278e51814bdec0c25e8e1a09c.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index b86aa49f3..b5c55482f 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -342,18 +342,6 @@ std::size_t RasterizerOpenGL::CalculateIndexBufferSize() const {
static_cast<std::size_t>(regs.index_array.FormatSizeInBytes());
}
-bool RasterizerOpenGL::AccelerateDrawBatch(bool is_indexed) {
- accelerate_draw = is_indexed ? AccelDraw::Indexed : AccelDraw::Arrays;
- DrawArrays();
- return true;
-}
-
-bool RasterizerOpenGL::AccelerateDrawMultiBatch(bool is_indexed) {
- accelerate_draw = is_indexed ? AccelDraw::Indexed : AccelDraw::Arrays;
- DrawMultiArrays();
- return true;
-}
-
template <typename Map, typename Interval>
static constexpr auto RangeFromInterval(Map& map, const Interval& interval) {
return boost::make_iterator_range(map.equal_range(interval));
@@ -764,14 +752,15 @@ struct DrawParams {
}
};
-void RasterizerOpenGL::DrawArrays() {
+bool RasterizerOpenGL::DrawBatch(bool is_indexed) {
+ accelerate_draw = is_indexed ? AccelDraw::Indexed : AccelDraw::Arrays;
DrawPrelude();
auto& maxwell3d = system.GPU().Maxwell3D();
const auto& regs = maxwell3d.regs;
const auto current_instance = maxwell3d.state.current_instance;
DrawParams draw_call{};
- draw_call.is_indexed = accelerate_draw == AccelDraw::Indexed;
+ draw_call.is_indexed = is_indexed;
draw_call.num_instances = static_cast<GLint>(1);
draw_call.base_instance = static_cast<GLint>(current_instance);
draw_call.is_instanced = current_instance > 0;
@@ -787,19 +776,20 @@ void RasterizerOpenGL::DrawArrays() {
}
draw_call.DispatchDraw();
- accelerate_draw = AccelDraw::Disabled;
maxwell3d.dirty.memory_general = false;
+ accelerate_draw = AccelDraw::Disabled;
+ return true;
}
-void RasterizerOpenGL::DrawMultiArrays() {
+bool RasterizerOpenGL::DrawMultiBatch(bool is_indexed) {
+ accelerate_draw = is_indexed ? AccelDraw::Indexed : AccelDraw::Arrays;
DrawPrelude();
auto& maxwell3d = system.GPU().Maxwell3D();
const auto& regs = maxwell3d.regs;
const auto& draw_setup = maxwell3d.mme_draw;
DrawParams draw_call{};
- draw_call.is_indexed =
- draw_setup.current_mode == Tegra::Engines::Maxwell3D::MMMEDrawMode::Indexed;
+ draw_call.is_indexed = is_indexed;
draw_call.num_instances = static_cast<GLint>(draw_setup.instance_count);
draw_call.base_instance = static_cast<GLint>(regs.vb_base_instance);
draw_call.is_instanced = draw_setup.instance_count > 1;
@@ -815,8 +805,9 @@ void RasterizerOpenGL::DrawMultiArrays() {
}
draw_call.DispatchDraw();
- accelerate_draw = AccelDraw::Disabled;
maxwell3d.dirty.memory_general = false;
+ accelerate_draw = AccelDraw::Disabled;
+ return true;
}
void RasterizerOpenGL::DispatchCompute(GPUVAddr code_addr) {