summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-12-17 05:23:50 +0100
committerbunnei <bunneidev@gmail.com>2016-02-05 23:20:22 +0100
commita949fd5f2560b94dc8e8571497d0cfbebdb6bed7 (patch)
treeeab5c9fc98630fbb6e3934f43a8da5b70ec6237f /src/video_core/renderer_opengl
parentcommand_processor: Add an assertion to ensure LUTs are not written past their boundaries. (diff)
downloadyuzu-a949fd5f2560b94dc8e8571497d0cfbebdb6bed7.tar
yuzu-a949fd5f2560b94dc8e8571497d0cfbebdb6bed7.tar.gz
yuzu-a949fd5f2560b94dc8e8571497d0cfbebdb6bed7.tar.bz2
yuzu-a949fd5f2560b94dc8e8571497d0cfbebdb6bed7.tar.lz
yuzu-a949fd5f2560b94dc8e8571497d0cfbebdb6bed7.tar.xz
yuzu-a949fd5f2560b94dc8e8571497d0cfbebdb6bed7.tar.zst
yuzu-a949fd5f2560b94dc8e8571497d0cfbebdb6bed7.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp14
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h4
2 files changed, 9 insertions, 9 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 6e7d6a40d..d70d62ede 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -810,8 +810,8 @@ void RasterizerOpenGL::SyncCullMode() {
}
void RasterizerOpenGL::SyncDepthModifiers() {
- float depth_scale = -Pica::float24::FromRawFloat24(Pica::g_state.regs.viewport_depth_range).ToFloat32();
- float depth_offset = Pica::float24::FromRawFloat24(Pica::g_state.regs.viewport_depth_far_plane).ToFloat32() / 2.0f;
+ float depth_scale = -Pica::float24::FromRaw(Pica::g_state.regs.viewport_depth_range).ToFloat32();
+ float depth_offset = Pica::float24::FromRaw(Pica::g_state.regs.viewport_depth_far_plane).ToFloat32() / 2.0f;
// TODO: Implement scale modifier
uniform_block_data.data.depth_offset = depth_offset;
@@ -948,9 +948,9 @@ void RasterizerOpenGL::SyncLightAmbient(int light_index) {
void RasterizerOpenGL::SyncLightPosition(int light_index) {
std::array<GLfloat, 3> position = {
- Pica::float16::FromRawFloat16(Pica::g_state.regs.lighting.light[light_index].x).ToFloat32(),
- Pica::float16::FromRawFloat16(Pica::g_state.regs.lighting.light[light_index].y).ToFloat32(),
- Pica::float16::FromRawFloat16(Pica::g_state.regs.lighting.light[light_index].z).ToFloat32() };
+ Pica::float16::FromRaw(Pica::g_state.regs.lighting.light[light_index].x).ToFloat32(),
+ Pica::float16::FromRaw(Pica::g_state.regs.lighting.light[light_index].y).ToFloat32(),
+ Pica::float16::FromRaw(Pica::g_state.regs.lighting.light[light_index].z).ToFloat32() };
if (position != uniform_block_data.data.light_src[light_index].position) {
uniform_block_data.data.light_src[light_index].position = position;
@@ -962,8 +962,8 @@ void RasterizerOpenGL::SyncDrawState() {
const auto& regs = Pica::g_state.regs;
// Sync the viewport
- GLsizei viewport_width = (GLsizei)Pica::float24::FromRawFloat24(regs.viewport_size_x).ToFloat32() * 2;
- GLsizei viewport_height = (GLsizei)Pica::float24::FromRawFloat24(regs.viewport_size_y).ToFloat32() * 2;
+ GLsizei viewport_width = (GLsizei)Pica::float24::FromRaw(regs.viewport_size_x).ToFloat32() * 2;
+ GLsizei viewport_height = (GLsizei)Pica::float24::FromRaw(regs.viewport_size_y).ToFloat32() * 2;
// OpenGL uses different y coordinates, so negate corner offset and flip origin
// TODO: Ensure viewport_corner.x should not be negated or origin flipped
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index 4e681f9ea..b9c1d61bd 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -83,8 +83,8 @@ struct PicaShaderConfig {
res.lighting.light[light_index].directional = light.directional != 0;
res.lighting.light[light_index].two_sided_diffuse = light.two_sided_diffuse != 0;
res.lighting.light[light_index].dist_atten_enable = regs.lighting.IsDistAttenEnabled(num);
- res.lighting.light[light_index].dist_atten_bias = Pica::float20::FromRawFloat20(light.dist_atten_bias).ToFloat32();
- res.lighting.light[light_index].dist_atten_scale = Pica::float20::FromRawFloat20(light.dist_atten_scale).ToFloat32();
+ res.lighting.light[light_index].dist_atten_bias = Pica::float20::FromRaw(light.dist_atten_bias).ToFloat32();
+ res.lighting.light[light_index].dist_atten_scale = Pica::float20::FromRaw(light.dist_atten_scale).ToFloat32();
}
res.lighting.lut_d0.enable = regs.lighting.lut_enable_d0 == 0;