diff options
Diffstat (limited to 'src/video_core/rasterizer.cpp')
| -rw-r--r-- | src/video_core/rasterizer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index b55391e5e..a35f0c0d8 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp | |||
| @@ -65,7 +65,7 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0, | |||
| 65 | 65 | ||
| 66 | // vertex positions in rasterizer coordinates | 66 | // vertex positions in rasterizer coordinates |
| 67 | auto FloatToFix = [](float24 flt) { | 67 | auto FloatToFix = [](float24 flt) { |
| 68 | return Fix12P4(flt.ToFloat32() * 16.0f); | 68 | return Fix12P4(static_cast<unsigned short>(flt.ToFloat32() * 16.0f)); |
| 69 | }; | 69 | }; |
| 70 | auto ScreenToRasterizerCoordinates = [FloatToFix](const Math::Vec3<float24> vec) { | 70 | auto ScreenToRasterizerCoordinates = [FloatToFix](const Math::Vec3<float24> vec) { |
| 71 | return Math::Vec3<Fix12P4>{FloatToFix(vec.x), FloatToFix(vec.y), FloatToFix(vec.z)}; | 71 | return Math::Vec3<Fix12P4>{FloatToFix(vec.x), FloatToFix(vec.y), FloatToFix(vec.z)}; |
| @@ -151,9 +151,9 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0, | |||
| 151 | auto w_inverse = Math::MakeVec(float24::FromFloat32(1.f) / v0.pos.w, | 151 | auto w_inverse = Math::MakeVec(float24::FromFloat32(1.f) / v0.pos.w, |
| 152 | float24::FromFloat32(1.f) / v1.pos.w, | 152 | float24::FromFloat32(1.f) / v1.pos.w, |
| 153 | float24::FromFloat32(1.f) / v2.pos.w); | 153 | float24::FromFloat32(1.f) / v2.pos.w); |
| 154 | auto baricentric_coordinates = Math::MakeVec(float24::FromFloat32(w0), | 154 | auto baricentric_coordinates = Math::MakeVec(float24::FromFloat32(static_cast<float>(w0)), |
| 155 | float24::FromFloat32(w1), | 155 | float24::FromFloat32(static_cast<float>(w1)), |
| 156 | float24::FromFloat32(w2)); | 156 | float24::FromFloat32(static_cast<float>(w2))); |
| 157 | 157 | ||
| 158 | float24 interpolated_attr_over_w = Math::Dot(attr_over_w, baricentric_coordinates); | 158 | float24 interpolated_attr_over_w = Math::Dot(attr_over_w, baricentric_coordinates); |
| 159 | float24 interpolated_w_inverse = Math::Dot(w_inverse, baricentric_coordinates); | 159 | float24 interpolated_w_inverse = Math::Dot(w_inverse, baricentric_coordinates); |
| @@ -195,8 +195,8 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0, | |||
| 195 | // TODO(neobrain): Not sure if this swizzling pattern is used for all textures. | 195 | // TODO(neobrain): Not sure if this swizzling pattern is used for all textures. |
| 196 | // To be flexible in case different but similar patterns are used, we keep this | 196 | // To be flexible in case different but similar patterns are used, we keep this |
| 197 | // somewhat inefficient code around for now. | 197 | // somewhat inefficient code around for now. |
| 198 | int s = (int)(u * float24::FromFloat32(registers.texture0.width)).ToFloat32(); | 198 | int s = (int)(u * float24::FromFloat32(static_cast<float>(registers.texture0.width))).ToFloat32(); |
| 199 | int t = (int)(v * float24::FromFloat32(registers.texture0.height)).ToFloat32(); | 199 | int t = (int)(v * float24::FromFloat32(static_cast<float>(registers.texture0.height))).ToFloat32(); |
| 200 | int texel_index_within_tile = 0; | 200 | int texel_index_within_tile = 0; |
| 201 | for (int block_size_index = 0; block_size_index < 3; ++block_size_index) { | 201 | for (int block_size_index = 0; block_size_index < 3; ++block_size_index) { |
| 202 | int sub_tile_width = 1 << block_size_index; | 202 | int sub_tile_width = 1 << block_size_index; |