diff options
| author | 2018-09-05 11:36:50 +0200 | |
|---|---|---|
| committer | 2018-09-05 18:46:35 +0200 | |
| commit | d3ad9469a172eeaaf34ca641a6bf679b7b10eedf (patch) | |
| tree | f4883bd9d06a1f370039e96c41beea70ff1a3f2b /src/video_core/engines | |
| parent | Merge pull request #1217 from degasus/vbo_cache2 (diff) | |
| download | yuzu-d3ad9469a172eeaaf34ca641a6bf679b7b10eedf.tar.gz yuzu-d3ad9469a172eeaaf34ca641a6bf679b7b10eedf.tar.xz yuzu-d3ad9469a172eeaaf34ca641a6bf679b7b10eedf.zip | |
gl_rasterizer: Implement a VAO cache.
This patch caches VAO objects instead of re-emiting all pointers per draw call.
Configuring this pointers is known as a fast task, but it yields too many GL
calls. So for better performance, just bind the VAO instead of 16 pointers.
Diffstat (limited to 'src/video_core/engines')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 92bfda053..f59d01738 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -127,6 +127,7 @@ public: | |||
| 127 | BitField<21, 6, Size> size; | 127 | BitField<21, 6, Size> size; |
| 128 | BitField<27, 3, Type> type; | 128 | BitField<27, 3, Type> type; |
| 129 | BitField<31, 1, u32> bgra; | 129 | BitField<31, 1, u32> bgra; |
| 130 | u32 hex; | ||
| 130 | }; | 131 | }; |
| 131 | 132 | ||
| 132 | u32 ComponentCount() const { | 133 | u32 ComponentCount() const { |
| @@ -262,6 +263,10 @@ public: | |||
| 262 | bool IsValid() const { | 263 | bool IsValid() const { |
| 263 | return size != Size::Invalid; | 264 | return size != Size::Invalid; |
| 264 | } | 265 | } |
| 266 | |||
| 267 | bool operator<(const VertexAttribute& other) const { | ||
| 268 | return hex < other.hex; | ||
| 269 | } | ||
| 265 | }; | 270 | }; |
| 266 | 271 | ||
| 267 | enum class PrimitiveTopology : u32 { | 272 | enum class PrimitiveTopology : u32 { |
| @@ -545,7 +550,7 @@ public: | |||
| 545 | 550 | ||
| 546 | INSERT_PADDING_WORDS(0x5B); | 551 | INSERT_PADDING_WORDS(0x5B); |
| 547 | 552 | ||
| 548 | VertexAttribute vertex_attrib_format[NumVertexAttributes]; | 553 | std::array<VertexAttribute, NumVertexAttributes> vertex_attrib_format; |
| 549 | 554 | ||
| 550 | INSERT_PADDING_WORDS(0xF); | 555 | INSERT_PADDING_WORDS(0xF); |
| 551 | 556 | ||
| @@ -964,7 +969,7 @@ ASSERT_REG_POSITION(stencil_back_func_ref, 0x3D5); | |||
| 964 | ASSERT_REG_POSITION(stencil_back_mask, 0x3D6); | 969 | ASSERT_REG_POSITION(stencil_back_mask, 0x3D6); |
| 965 | ASSERT_REG_POSITION(stencil_back_func_mask, 0x3D7); | 970 | ASSERT_REG_POSITION(stencil_back_func_mask, 0x3D7); |
| 966 | ASSERT_REG_POSITION(zeta, 0x3F8); | 971 | ASSERT_REG_POSITION(zeta, 0x3F8); |
| 967 | ASSERT_REG_POSITION(vertex_attrib_format[0], 0x458); | 972 | ASSERT_REG_POSITION(vertex_attrib_format, 0x458); |
| 968 | ASSERT_REG_POSITION(rt_control, 0x487); | 973 | ASSERT_REG_POSITION(rt_control, 0x487); |
| 969 | ASSERT_REG_POSITION(zeta_width, 0x48a); | 974 | ASSERT_REG_POSITION(zeta_width, 0x48a); |
| 970 | ASSERT_REG_POSITION(zeta_height, 0x48b); | 975 | ASSERT_REG_POSITION(zeta_height, 0x48b); |