diff options
| author | 2015-11-18 23:17:25 -0500 | |
|---|---|---|
| committer | 2016-02-05 17:17:34 -0500 | |
| commit | 6307999116d250a9805c0d7ae2c131407772fc3f (patch) | |
| tree | 00185bba2a68393b348ff4d54bf869ec6e2f1539 /src/video_core | |
| parent | gl_rasterizer: Minor naming refactor on Pica register naming. (diff) | |
| download | yuzu-6307999116d250a9805c0d7ae2c131407772fc3f.tar.gz yuzu-6307999116d250a9805c0d7ae2c131407772fc3f.tar.xz yuzu-6307999116d250a9805c0d7ae2c131407772fc3f.zip | |
pica: Cleanup and add some comments to lighting registers.
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/pica.h | 36 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 2 |
2 files changed, 19 insertions, 19 deletions
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 1808d4396..48854dda2 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h | |||
| @@ -695,8 +695,8 @@ struct Regs { | |||
| 695 | INSERT_PADDING_WORDS(0x3); | 695 | INSERT_PADDING_WORDS(0x3); |
| 696 | 696 | ||
| 697 | union { | 697 | union { |
| 698 | BitField<0, 1, u32> w; // 1.f if 0, otherwise 0.f | 698 | BitField<0, 1, u32> directional; |
| 699 | BitField<1, 1, u32> two_sided_diffuse; // when disabled, clamp dot-product to 0 | 699 | BitField<1, 1, u32> two_sided_diffuse; // 1: GL_TRUE, 0: GL_FALSE; when disabled, clamp dot-product to 0 |
| 700 | }; | 700 | }; |
| 701 | }; | 701 | }; |
| 702 | 702 | ||
| @@ -714,21 +714,21 @@ struct Regs { | |||
| 714 | 714 | ||
| 715 | union { | 715 | union { |
| 716 | BitField< 4, 4, u32> config; | 716 | BitField< 4, 4, u32> config; |
| 717 | BitField<27, 1, u32> clamp_highlights; | 717 | BitField<27, 1, u32> clamp_highlights; // 1: GL_TRUE, 0: GL_FALSE |
| 718 | }; | 718 | }; |
| 719 | 719 | ||
| 720 | union { | 720 | union { |
| 721 | // Each bit specifies whether distance attenuation should be applied for the | 721 | // Each bit specifies whether distance attenuation should be applied for the |
| 722 | // corresponding light | 722 | // corresponding light |
| 723 | 723 | ||
| 724 | BitField<24, 1, u32> dist_atten_enable_light_0; | 724 | BitField<24, 1, u32> dist_atten_enable_light_0; // 0: GL_TRUE, 1: GL_FALSE |
| 725 | BitField<25, 1, u32> dist_atten_enable_light_1; | 725 | BitField<25, 1, u32> dist_atten_enable_light_1; // 0: GL_TRUE, 1: GL_FALSE |
| 726 | BitField<26, 1, u32> dist_atten_enable_light_2; | 726 | BitField<26, 1, u32> dist_atten_enable_light_2; // 0: GL_TRUE, 1: GL_FALSE |
| 727 | BitField<27, 1, u32> dist_atten_enable_light_3; | 727 | BitField<27, 1, u32> dist_atten_enable_light_3; // 0: GL_TRUE, 1: GL_FALSE |
| 728 | BitField<28, 1, u32> dist_atten_enable_light_4; | 728 | BitField<28, 1, u32> dist_atten_enable_light_4; // 0: GL_TRUE, 1: GL_FALSE |
| 729 | BitField<29, 1, u32> dist_atten_enable_light_5; | 729 | BitField<29, 1, u32> dist_atten_enable_light_5; // 0: GL_TRUE, 1: GL_FALSE |
| 730 | BitField<30, 1, u32> dist_atten_enable_light_6; | 730 | BitField<30, 1, u32> dist_atten_enable_light_6; // 0: GL_TRUE, 1: GL_FALSE |
| 731 | BitField<31, 1, u32> dist_atten_enable_light_7; | 731 | BitField<31, 1, u32> dist_atten_enable_light_7; // 0: GL_TRUE, 1: GL_FALSE |
| 732 | }; | 732 | }; |
| 733 | 733 | ||
| 734 | bool IsDistAttenEnabled(unsigned index) const { | 734 | bool IsDistAttenEnabled(unsigned index) const { |
| @@ -754,13 +754,13 @@ struct Regs { | |||
| 754 | u32 lut_data[8]; | 754 | u32 lut_data[8]; |
| 755 | 755 | ||
| 756 | union { | 756 | union { |
| 757 | BitField< 1, 1, u32> d0; | 757 | BitField< 1, 1, u32> d0; // 0: GL_TRUE, 1: GL_FALSE |
| 758 | BitField< 5, 1, u32> d1; | 758 | BitField< 5, 1, u32> d1; // 0: GL_TRUE, 1: GL_FALSE |
| 759 | BitField< 9, 1, u32> sp; | 759 | BitField< 9, 1, u32> sp; // 0: GL_TRUE, 1: GL_FALSE |
| 760 | BitField<13, 1, u32> fr; | 760 | BitField<13, 1, u32> fr; // 0: GL_TRUE, 1: GL_FALSE |
| 761 | BitField<17, 1, u32> rb; | 761 | BitField<17, 1, u32> rb; // 0: GL_TRUE, 1: GL_FALSE |
| 762 | BitField<21, 1, u32> rg; | 762 | BitField<21, 1, u32> rg; // 0: GL_TRUE, 1: GL_FALSE |
| 763 | BitField<25, 1, u32> rr; | 763 | BitField<25, 1, u32> rr; // 0: GL_TRUE, 1: GL_FALSE |
| 764 | } abs_lut_input; | 764 | } abs_lut_input; |
| 765 | 765 | ||
| 766 | union { | 766 | union { |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 17bda2d1d..6be161efd 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -80,7 +80,7 @@ struct PicaShaderConfig { | |||
| 80 | unsigned num = regs.lighting.light_enable.GetNum(light_index); | 80 | unsigned num = regs.lighting.light_enable.GetNum(light_index); |
| 81 | const auto& light = regs.lighting.light[num]; | 81 | const auto& light = regs.lighting.light[num]; |
| 82 | res.light_src[light_index].num = num; | 82 | res.light_src[light_index].num = num; |
| 83 | res.light_src[light_index].directional = light.w != 0; | 83 | res.light_src[light_index].directional = light.directional != 0; |
| 84 | res.light_src[light_index].two_sided_diffuse = light.two_sided_diffuse != 0; | 84 | res.light_src[light_index].two_sided_diffuse = light.two_sided_diffuse != 0; |
| 85 | res.light_src[light_index].dist_atten_enabled = regs.lighting.IsDistAttenEnabled(num); | 85 | res.light_src[light_index].dist_atten_enabled = regs.lighting.IsDistAttenEnabled(num); |
| 86 | res.light_src[light_index].dist_atten_bias = Pica::float20::FromRawFloat20(light.dist_atten_bias).ToFloat32(); | 86 | res.light_src[light_index].dist_atten_bias = Pica::float20::FromRawFloat20(light.dist_atten_bias).ToFloat32(); |