summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-11-14 05:04:19 +0100
committerbunnei <bunneidev@gmail.com>2016-02-05 23:17:30 +0100
commite34fa6365ff87af247b0ae8ed880c4032bcb2ed0 (patch)
tree5ca6d502f680761246eca4033daf1c7ad658a4aa /src/video_core/renderer_opengl/gl_rasterizer.h
parentrenderer_opengl: Implement HW fragment lighting LUTs within our default UBO. (diff)
downloadyuzu-e34fa6365ff87af247b0ae8ed880c4032bcb2ed0.tar
yuzu-e34fa6365ff87af247b0ae8ed880c4032bcb2ed0.tar.gz
yuzu-e34fa6365ff87af247b0ae8ed880c4032bcb2ed0.tar.bz2
yuzu-e34fa6365ff87af247b0ae8ed880c4032bcb2ed0.tar.lz
yuzu-e34fa6365ff87af247b0ae8ed880c4032bcb2ed0.tar.xz
yuzu-e34fa6365ff87af247b0ae8ed880c4032bcb2ed0.tar.zst
yuzu-e34fa6365ff87af247b0ae8ed880c4032bcb2ed0.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.h')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index fa4a78cb1..ba0b05802 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -78,9 +78,13 @@ struct PicaShaderConfig {
for (unsigned light_index = 0; light_index < res.num_lights; ++light_index) {
unsigned num = regs.lighting.light_enable.GetNum(light_index);
+ const auto& light = regs.lighting.light[num];
res.light_src[light_index].num = num;
- res.light_src[light_index].directional = regs.lighting.light[num].w;
- res.light_src[light_index].two_sided_diffuse = regs.lighting.light[num].two_sided_diffuse;
+ res.light_src[light_index].directional = light.w;
+ res.light_src[light_index].two_sided_diffuse = light.two_sided_diffuse;
+ res.light_src[light_index].dist_atten_enabled = regs.lighting.dist_atten_enable.IsEnabled(num);
+ res.light_src[light_index].dist_atten_bias = Pica::float20::FromRawFloat20(light.dist_atten_bias).ToFloat32();
+ res.light_src[light_index].dist_atten_scale = Pica::float20::FromRawFloat20(light.dist_atten_scale).ToFloat32();
}
return res;
@@ -98,19 +102,23 @@ struct PicaShaderConfig {
return std::memcmp(this, &o, sizeof(PicaShaderConfig)) == 0;
};
- Pica::Regs::CompareFunc alpha_test_func;
- std::array<Pica::Regs::TevStageConfig, 6> tev_stages = {};
- u8 combiner_buffer_input;
-
struct {
- unsigned num;
- bool directional;
- bool two_sided_diffuse;
- bool dist_atten_enabled;
- } light_src[8];
-
- bool lighting_enabled;
- unsigned num_lights;
+ Pica::Regs::CompareFunc alpha_test_func = Pica::Regs::CompareFunc::Never;
+ std::array<Pica::Regs::TevStageConfig, 6> tev_stages = {};
+ u8 combiner_buffer_input = 0;
+
+ struct {
+ unsigned num = 0;
+ bool directional = false;
+ bool two_sided_diffuse = false;
+ bool dist_atten_enabled = false;
+ GLfloat dist_atten_scale = 0.0f;
+ GLfloat dist_atten_bias = 0.0f;
+ } light_src[8];
+
+ bool lighting_enabled = false;
+ unsigned num_lights = 0;
+ };
};
namespace std {