summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jannik Vogel2016-05-23 23:11:06 +0200
committerGravatar Jannik Vogel2016-05-23 23:28:13 +0200
commit30a01584f200df1a71d322bad10a02f60d17aa22 (patch)
tree776b0a4490cced231bfe7e9e4259a9aa2b784e48 /src
parentPica: Name lighting.config0 and .config1 registers (diff)
downloadyuzu-30a01584f200df1a71d322bad10a02f60d17aa22.tar.gz
yuzu-30a01584f200df1a71d322bad10a02f60d17aa22.tar.xz
yuzu-30a01584f200df1a71d322bad10a02f60d17aa22.zip
Pica: Name LightSrc.config register
Diffstat (limited to 'src')
-rw-r--r--src/video_core/pica.h28
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h4
2 files changed, 15 insertions, 17 deletions
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index 88cb306c9..544ea037f 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -787,23 +787,21 @@ struct Regs {
787 LightColor diffuse; // material.diffuse * light.diffuse 787 LightColor diffuse; // material.diffuse * light.diffuse
788 LightColor ambient; // material.ambient * light.ambient 788 LightColor ambient; // material.ambient * light.ambient
789 789
790 struct { 790 // Encoded as 16-bit floating point
791 // Encoded as 16-bit floating point 791 union {
792 union { 792 BitField< 0, 16, u32> x;
793 BitField< 0, 16, u32> x; 793 BitField<16, 16, u32> y;
794 BitField<16, 16, u32> y; 794 };
795 }; 795 union {
796 union { 796 BitField< 0, 16, u32> z;
797 BitField< 0, 16, u32> z; 797 };
798 };
799 798
800 INSERT_PADDING_WORDS(0x3); 799 INSERT_PADDING_WORDS(0x3);
801 800
802 union { 801 union {
803 BitField<0, 1, u32> directional; 802 BitField<0, 1, u32> directional;
804 BitField<1, 1, u32> two_sided_diffuse; // When disabled, clamp dot-product to 0 803 BitField<1, 1, u32> two_sided_diffuse; // When disabled, clamp dot-product to 0
805 }; 804 } config;
806 };
807 805
808 BitField<0, 20, u32> dist_atten_bias; 806 BitField<0, 20, u32> dist_atten_bias;
809 BitField<0, 20, u32> dist_atten_scale; 807 BitField<0, 20, u32> dist_atten_scale;
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index 96ee4b1dc..bb7f20161 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -89,8 +89,8 @@ union PicaShaderConfig {
89 unsigned num = regs.lighting.light_enable.GetNum(light_index); 89 unsigned num = regs.lighting.light_enable.GetNum(light_index);
90 const auto& light = regs.lighting.light[num]; 90 const auto& light = regs.lighting.light[num];
91 state.lighting.light[light_index].num = num; 91 state.lighting.light[light_index].num = num;
92 state.lighting.light[light_index].directional = light.directional != 0; 92 state.lighting.light[light_index].directional = light.config.directional != 0;
93 state.lighting.light[light_index].two_sided_diffuse = light.two_sided_diffuse != 0; 93 state.lighting.light[light_index].two_sided_diffuse = light.config.two_sided_diffuse != 0;
94 state.lighting.light[light_index].dist_atten_enable = !regs.lighting.IsDistAttenDisabled(num); 94 state.lighting.light[light_index].dist_atten_enable = !regs.lighting.IsDistAttenDisabled(num);
95 } 95 }
96 96