diff options
author | Jannik Vogel <email@jannikvogel.de> | 2016-05-21 01:04:57 +0200 |
---|---|---|
committer | Jannik Vogel <email@jannikvogel.de> | 2016-06-07 00:06:28 +0200 |
commit | a12571c709c5af840bb89c43344bd982a496f21a (patch) | |
tree | 12af20634c98eb2bfa86aaafdf06f8f87e7f7095 /src/video_core/renderer_opengl/gl_rasterizer.h | |
parent | Rasterizer: Implement fog (diff) | |
download | yuzu-a12571c709c5af840bb89c43344bd982a496f21a.tar yuzu-a12571c709c5af840bb89c43344bd982a496f21a.tar.gz yuzu-a12571c709c5af840bb89c43344bd982a496f21a.tar.bz2 yuzu-a12571c709c5af840bb89c43344bd982a496f21a.tar.lz yuzu-a12571c709c5af840bb89c43344bd982a496f21a.tar.xz yuzu-a12571c709c5af840bb89c43344bd982a496f21a.tar.zst yuzu-a12571c709c5af840bb89c43344bd982a496f21a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index bdc7bd0f2..42482df4b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -76,6 +76,9 @@ union PicaShaderConfig { state.tev_stages[i].scales_raw = tev_stage.scales_raw; } + state.fog_mode = regs.fog_mode; + state.fog_flip = regs.fog_flip; + state.combiner_buffer_input = regs.tev_combiner_buffer_input.update_mask_rgb.Value() | regs.tev_combiner_buffer_input.update_mask_a.Value() << 4; @@ -168,13 +171,14 @@ union PicaShaderConfig { }; struct State { - Pica::Regs::CompareFunc alpha_test_func; Pica::Regs::TextureConfig::TextureType texture0_type; std::array<TevStageConfigRaw, 6> tev_stages; u8 combiner_buffer_input; Pica::Regs::DepthBuffering depthmap_enable; + Pica::Regs::FogMode fog_mode; + bool fog_flip; struct { struct { @@ -324,13 +328,14 @@ private: GLint alphatest_ref; GLfloat depth_scale; GLfloat depth_offset; + alignas(16) GLvec3 fog_color; alignas(16) GLvec3 lighting_global_ambient; LightSrc light_src[8]; alignas(16) GLvec4 const_color[6]; // A vec4 color for each of the six tev stages alignas(16) GLvec4 tev_combiner_buffer_color; }; - static_assert(sizeof(UniformData) == 0x390, "The size of the UniformData structure has changed, update the structure in the shader"); + static_assert(sizeof(UniformData) == 0x3A0, "The size of the UniformData structure has changed, update the structure in the shader"); static_assert(sizeof(UniformData) < 16384, "UniformData structure must be less than 16kb as per the OpenGL spec"); /// Sets the OpenGL shader in accordance with the current PICA register state @@ -354,6 +359,10 @@ private: /// Syncs the blend color to match the PICA register void SyncBlendColor(); + /// Syncs the fog states to match the PICA register + void SyncFogColor(); + void SyncFogLUT(); + /// Syncs the alpha test states to match the PICA register void SyncAlphaTest(); @@ -421,6 +430,7 @@ private: struct { UniformData data; bool lut_dirty[6]; + bool fog_lut_dirty; bool dirty; } uniform_block_data = {}; @@ -432,4 +442,7 @@ private: std::array<OGLTexture, 6> lighting_luts; std::array<std::array<GLvec4, 256>, 6> lighting_lut_data{}; + + OGLTexture fog_lut; + std::array<GLuint, 128> fog_lut_data{}; }; |