summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines/maxwell_3d.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-30 04:36:03 +0100
committerbunnei <bunneidev@gmail.com>2018-11-01 04:29:21 +0100
commitde0ab806df4575df93068e128d911dabbf396d2c (patch)
treeae9ce164967cd5bcfa824a1b7f0330957c792824 /src/video_core/engines/maxwell_3d.h
parentMerge pull request #1604 from FearlessTobi/port-4369 (diff)
downloadyuzu-de0ab806df4575df93068e128d911dabbf396d2c.tar
yuzu-de0ab806df4575df93068e128d911dabbf396d2c.tar.gz
yuzu-de0ab806df4575df93068e128d911dabbf396d2c.tar.bz2
yuzu-de0ab806df4575df93068e128d911dabbf396d2c.tar.lz
yuzu-de0ab806df4575df93068e128d911dabbf396d2c.tar.xz
yuzu-de0ab806df4575df93068e128d911dabbf396d2c.tar.zst
yuzu-de0ab806df4575df93068e128d911dabbf396d2c.zip
Diffstat (limited to 'src/video_core/engines/maxwell_3d.h')
-rw-r--r--src/video_core/engines/maxwell_3d.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 443affc36..50873813e 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -475,12 +475,13 @@ public:
INSERT_PADDING_WORDS(0x45);
struct {
- INSERT_PADDING_WORDS(1);
+ u32 upload_address;
u32 data;
u32 entry;
+ u32 bind;
} macros;
- INSERT_PADDING_WORDS(0x189);
+ INSERT_PADDING_WORDS(0x188);
u32 tfb_enabled;
@@ -994,12 +995,25 @@ public:
/// Returns the texture information for a specific texture in a specific shader stage.
Texture::FullTextureInfo GetStageTexture(Regs::ShaderStage stage, std::size_t offset) const;
+ /// Memory for macro code - it's undetermined how big this is, however 1MB is much larger than
+ /// we've seen used.
+ using MacroMemory = std::array<u32, 0x40000>;
+
+ /// Gets a reference to macro memory.
+ const MacroMemory& GetMacroMemory() const {
+ return macro_memory;
+ }
+
private:
void InitializeRegisterDefaults();
VideoCore::RasterizerInterface& rasterizer;
- std::unordered_map<u32, std::vector<u32>> uploaded_macros;
+ /// Start offsets of each macro in macro_memory
+ std::unordered_map<u32, u32> macro_offsets;
+
+ /// Memory for macro code
+ MacroMemory macro_memory;
/// Macro method that is currently being executed / being fed parameters.
u32 executing_macro = 0;
@@ -1022,9 +1036,12 @@ private:
*/
void CallMacroMethod(u32 method, std::vector<u32> parameters);
- /// Handles writes to the macro uploading registers.
+ /// Handles writes to the macro uploading register.
void ProcessMacroUpload(u32 data);
+ /// Handles writes to the macro bind register.
+ void ProcessMacroBind(u32 data);
+
/// Handles a write to the CLEAR_BUFFERS register.
void ProcessClearBuffers();