summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines/maxwell_3d.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-07-10 21:38:31 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-07-17 23:29:49 +0200
commitf2e7b29c14e0207e0476299d69dac7ed4c213c74 (patch)
tree670339fbdcb8b1cfa8e14a5c4e19cc03199a595f /src/video_core/engines/maxwell_3d.h
parentMerge pull request #2740 from lioncash/bra (diff)
downloadyuzu-f2e7b29c14e0207e0476299d69dac7ed4c213c74.tar
yuzu-f2e7b29c14e0207e0476299d69dac7ed4c213c74.tar.gz
yuzu-f2e7b29c14e0207e0476299d69dac7ed4c213c74.tar.bz2
yuzu-f2e7b29c14e0207e0476299d69dac7ed4c213c74.tar.lz
yuzu-f2e7b29c14e0207e0476299d69dac7ed4c213c74.tar.xz
yuzu-f2e7b29c14e0207e0476299d69dac7ed4c213c74.tar.zst
yuzu-f2e7b29c14e0207e0476299d69dac7ed4c213c74.zip
Diffstat (limited to 'src/video_core/engines/maxwell_3d.h')
-rw-r--r--src/video_core/engines/maxwell_3d.h74
1 files changed, 63 insertions, 11 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 8d15c8a48..84e6ca145 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -1124,23 +1124,73 @@ public:
State state{};
- struct DirtyFlags {
- std::bitset<8> color_buffer{0xFF};
- std::bitset<32> vertex_array{0xFFFFFFFF};
+ struct DirtyRegs {
+ static constexpr std::size_t NUM_REGS = 256;
+ union {
+ struct {
+ bool null_dirty;
+ // Vertex Attributes
+ bool vertex_attrib_format;
+ // Vertex Arrays
+ std::array<bool, 32> vertex_array;
+
+ bool vertex_array_buffers;
+ // Vertex Instances
+ std::array<bool, 32> vertex_instance;
+
+ bool vertex_instances;
+ // Render Targets
+ std::array<bool, 8> render_target;
+ bool depth_buffer;
+
+ bool render_settings;
+ // Shaders
+ bool shaders;
+ // State
+ bool viewport;
+ bool clip_enabled;
+ bool clip_coefficient;
+ bool cull_mode;
+ bool primitive_restart;
+ bool depth_test;
+ bool stencil_test;
+ bool blend_state;
+ bool logic_op;
+ bool fragment_color_clamp;
+ bool multi_sample;
+ bool scissor_test;
+ bool transform_feedback;
+ bool point;
+ bool color_mask;
+ bool polygon_offset;
+ bool alpha_test;
+
+ bool memory_general;
+ };
+ std::array<bool, NUM_REGS> regs;
+ };
+
+ void ResetVertexArrays() {
+ std::fill(vertex_array.begin(), vertex_array.end(), true);
+ vertex_array_buffers = true;
+ }
- bool vertex_attrib_format = true;
- bool zeta_buffer = true;
- bool shaders = true;
+ void ResetRenderTargets() {
+ depth_buffer = true;
+ std::fill(render_target.begin(), render_target.end(), true);
+ render_settings = true;
+ }
void OnMemoryWrite() {
- zeta_buffer = true;
shaders = true;
- color_buffer.set();
- vertex_array.set();
+ memory_general = true;
+ ResetRenderTargets();
+ ResetVertexArrays();
}
- };
- DirtyFlags dirty_flags;
+ } dirty{};
+
+ std::array<u8, Regs::NUM_REGS> dirty_pointers{};
/// Reads a register value located at the input method address
u32 GetRegisterValue(u32 method) const;
@@ -1200,6 +1250,8 @@ private:
/// Retrieves information about a specific TSC entry from the TSC buffer.
Texture::TSCEntry GetTSCEntry(u32 tsc_index) const;
+ void InitDirtySettings();
+
/**
* Call a macro on this engine.
* @param method Method to call