summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-09-28 17:20:06 +0200
committerLioncash <mathew1800@gmail.com>2014-10-08 02:35:13 +0200
commiteb5054e6eb0d810f26caff9f09e43dbeee4a69fa (patch)
tree58a6e4f1e07f3ee8e2ad469bca7c2b43edac20a6 /src/video_core
parentMerge pull request #118 from lioncash/chunk-file (diff)
downloadyuzu-eb5054e6eb0d810f26caff9f09e43dbeee4a69fa.tar
yuzu-eb5054e6eb0d810f26caff9f09e43dbeee4a69fa.tar.gz
yuzu-eb5054e6eb0d810f26caff9f09e43dbeee4a69fa.tar.bz2
yuzu-eb5054e6eb0d810f26caff9f09e43dbeee4a69fa.tar.lz
yuzu-eb5054e6eb0d810f26caff9f09e43dbeee4a69fa.tar.xz
yuzu-eb5054e6eb0d810f26caff9f09e43dbeee4a69fa.tar.zst
yuzu-eb5054e6eb0d810f26caff9f09e43dbeee4a69fa.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/clipper.cpp8
-rw-r--r--src/video_core/command_processor.cpp12
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp8
-rw-r--r--src/video_core/pica.h2
-rw-r--r--src/video_core/rasterizer.cpp12
-rw-r--r--src/video_core/vertex_shader.cpp2
-rw-r--r--src/video_core/vertex_shader.h2
7 files changed, 23 insertions, 23 deletions
diff --git a/src/video_core/clipper.cpp b/src/video_core/clipper.cpp
index 592f2f476..2cf166afd 100644
--- a/src/video_core/clipper.cpp
+++ b/src/video_core/clipper.cpp
@@ -86,8 +86,8 @@ static void InitScreenCoordinates(OutputVertex& vtx)
viewport.halfsize_x = float24::FromRawFloat24(registers.viewport_size_x);
viewport.halfsize_y = float24::FromRawFloat24(registers.viewport_size_y);
- viewport.offset_x = float24::FromFloat32(registers.viewport_corner.x);
- viewport.offset_y = float24::FromFloat32(registers.viewport_corner.y);
+ viewport.offset_x = float24::FromFloat32(static_cast<float>(registers.viewport_corner.x));
+ viewport.offset_y = float24::FromFloat32(static_cast<float>(registers.viewport_corner.y));
viewport.zscale = float24::FromRawFloat24(registers.viewport_depth_range);
viewport.offset_z = float24::FromRawFloat24(registers.viewport_depth_far_plane);
@@ -150,7 +150,7 @@ void ProcessTriangle(OutputVertex &v0, OutputVertex &v1, OutputVertex &v2) {
InitScreenCoordinates(*(output_list[0]));
InitScreenCoordinates(*(output_list[1]));
- for (int i = 0; i < output_list.size() - 2; i ++) {
+ for (size_t i = 0; i < output_list.size() - 2; i ++) {
OutputVertex& vtx0 = *(output_list[0]);
OutputVertex& vtx1 = *(output_list[i+1]);
OutputVertex& vtx2 = *(output_list[i+2]);
@@ -158,7 +158,7 @@ void ProcessTriangle(OutputVertex &v0, OutputVertex &v1, OutputVertex &v2) {
InitScreenCoordinates(vtx2);
DEBUG_LOG(GPU,
- "Triangle %d/%d (%d buffer vertices) at position (%.3f, %.3f, %.3f, %.3f), "
+ "Triangle %u/%u (%u buffer vertices) at position (%.3f, %.3f, %.3f, %.3f), "
"(%.3f, %.3f, %.3f, %.3f), (%.3f, %.3f, %.3f, %.3f) and "
"screen position (%.2f, %.2f, %.2f), (%.2f, %.2f, %.2f), (%.2f, %.2f, %.2f)",
i,output_list.size(), buffer_vertices.size(),
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index 9567a9849..a9510fa2e 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -63,8 +63,8 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
for (int component = 0; component < loader_config.component_count; ++component) {
u32 attribute_index = loader_config.GetComponent(component);
vertex_attribute_sources[attribute_index] = load_address;
- vertex_attribute_strides[attribute_index] = loader_config.byte_count;
- vertex_attribute_formats[attribute_index] = (u32)attribute_config.GetFormat(attribute_index);
+ vertex_attribute_strides[attribute_index] = static_cast<u32>(loader_config.byte_count);
+ vertex_attribute_formats[attribute_index] = static_cast<u32>(attribute_config.GetFormat(attribute_index));
vertex_attribute_elements[attribute_index] = attribute_config.GetNumElements(attribute_index);
vertex_attribute_element_size[attribute_index] = attribute_config.GetElementSizeInBytes(attribute_index);
load_address += attribute_config.GetStride(attribute_index);
@@ -83,9 +83,9 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
PrimitiveAssembler<VertexShader::OutputVertex> clipper_primitive_assembler(registers.triangle_topology.Value());
PrimitiveAssembler<DebugUtils::GeometryDumper::Vertex> dumping_primitive_assembler(registers.triangle_topology.Value());
- for (int index = 0; index < registers.num_vertices; ++index)
+ for (unsigned int index = 0; index < registers.num_vertices; ++index)
{
- int vertex = is_indexed ? (index_u16 ? index_address_16[index] : index_address_8[index]) : index;
+ unsigned int vertex = is_indexed ? (index_u16 ? index_address_16[index] : index_address_8[index]) : index;
if (is_indexed) {
// TODO: Implement some sort of vertex cache!
@@ -95,7 +95,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
VertexShader::InputVertex input;
for (int i = 0; i < attribute_config.GetNumTotalAttributes(); ++i) {
- for (int comp = 0; comp < vertex_attribute_elements[i]; ++comp) {
+ for (unsigned int comp = 0; comp < vertex_attribute_elements[i]; ++comp) {
const u8* srcdata = vertex_attribute_sources[i] + vertex_attribute_strides[i] * vertex + comp * vertex_attribute_element_size[i];
const float srcval = (vertex_attribute_formats[i] == 0) ? *(s8*)srcdata :
(vertex_attribute_formats[i] == 1) ? *(u8*)srcdata :
@@ -244,7 +244,7 @@ static std::ptrdiff_t ExecuteCommandBlock(const u32* first_command_word) {
WritePicaReg(header.cmd_id, *read_pointer, write_mask);
read_pointer += 2;
- for (int i = 1; i < 1+header.extra_data_length; ++i) {
+ for (unsigned int i = 1; i < 1+header.extra_data_length; ++i) {
u32 cmd = header.cmd_id + ((header.group_commands) ? i : 0);
WritePicaReg(cmd, *read_pointer, write_mask);
++read_pointer;
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index 8f4aa0ad0..22b8e9950 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -203,7 +203,7 @@ void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data
} else {
it->component_mask = it->component_mask | component_mask;
}
- } catch (const std::out_of_range& oor) {
+ } catch (const std::out_of_range& ) {
_dbg_assert_msg_(GPU, 0, "Unknown output attribute mapping");
ERROR_LOG(GPU, "Unknown output attribute mapping: %03x, %03x, %03x, %03x",
(int)output_attributes[i].map_x.Value(),
@@ -235,7 +235,7 @@ void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data
dvlp.swizzle_patterns_offset = write_offset - dvlp_offset;
dvlp.swizzle_patterns_num_entries = swizzle_size;
u32 dummy = 0;
- for (int i = 0; i < swizzle_size; ++i) {
+ for (unsigned int i = 0; i < swizzle_size; ++i) {
QueueForWriting((u8*)&swizzle_data[i], sizeof(swizzle_data[i]));
QueueForWriting((u8*)&dummy, sizeof(dummy));
}
@@ -278,7 +278,7 @@ void StartPicaTracing()
bool IsPicaTracing()
{
- return is_pica_tracing;
+ return is_pica_tracing != 0;
}
void OnPicaRegWrite(u32 id, u32 value)
@@ -428,7 +428,7 @@ void DumpTevStageConfig(const std::array<Pica::Regs::TevStageConfig,6>& stages)
using Operation = Pica::Regs::TevStageConfig::Operation;
std::string stage_info = "Tev setup:\n";
- for (int index = 0; index < stages.size(); ++index) {
+ for (size_t index = 0; index < stages.size(); ++index) {
const auto& tev_stage = stages[index];
const std::map<Source, std::string> source_map = {
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index 374cd83c1..5fe15a218 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -563,7 +563,7 @@ struct Regs {
return map[index];
}
- static inline int NumIds() {
+ static inline size_t NumIds() {
return sizeof(Regs) / sizeof(u32);
}
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,
// vertex positions in rasterizer coordinates
auto FloatToFix = [](float24 flt) {
- return Fix12P4(flt.ToFloat32() * 16.0f);
+ return Fix12P4(static_cast<unsigned short>(flt.ToFloat32() * 16.0f));
};
auto ScreenToRasterizerCoordinates = [FloatToFix](const Math::Vec3<float24> vec) {
return Math::Vec3<Fix12P4>{FloatToFix(vec.x), FloatToFix(vec.y), FloatToFix(vec.z)};
@@ -151,9 +151,9 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
auto w_inverse = Math::MakeVec(float24::FromFloat32(1.f) / v0.pos.w,
float24::FromFloat32(1.f) / v1.pos.w,
float24::FromFloat32(1.f) / v2.pos.w);
- auto baricentric_coordinates = Math::MakeVec(float24::FromFloat32(w0),
- float24::FromFloat32(w1),
- float24::FromFloat32(w2));
+ auto baricentric_coordinates = Math::MakeVec(float24::FromFloat32(static_cast<float>(w0)),
+ float24::FromFloat32(static_cast<float>(w1)),
+ float24::FromFloat32(static_cast<float>(w2)));
float24 interpolated_attr_over_w = Math::Dot(attr_over_w, baricentric_coordinates);
float24 interpolated_w_inverse = Math::Dot(w_inverse, baricentric_coordinates);
@@ -195,8 +195,8 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0,
// TODO(neobrain): Not sure if this swizzling pattern is used for all textures.
// To be flexible in case different but similar patterns are used, we keep this
// somewhat inefficient code around for now.
- int s = (int)(u * float24::FromFloat32(registers.texture0.width)).ToFloat32();
- int t = (int)(v * float24::FromFloat32(registers.texture0.height)).ToFloat32();
+ int s = (int)(u * float24::FromFloat32(static_cast<float>(registers.texture0.width))).ToFloat32();
+ int t = (int)(v * float24::FromFloat32(static_cast<float>(registers.texture0.height))).ToFloat32();
int texel_index_within_tile = 0;
for (int block_size_index = 0; block_size_index < 3; ++block_size_index) {
int sub_tile_width = 1 << block_size_index;
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index db8244317..96625791c 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -77,7 +77,7 @@ static void ProcessShaderCode(VertexShaderState& state) {
: nullptr;
const SwizzlePattern& swizzle = *(SwizzlePattern*)&swizzle_data[instr.common.operand_desc_id];
- const bool negate_src1 = swizzle.negate;
+ const bool negate_src1 = (swizzle.negate != 0);
float24 src1[4] = {
src1_[(int)swizzle.GetSelectorSrc1(0)],
diff --git a/src/video_core/vertex_shader.h b/src/video_core/vertex_shader.h
index 847fdc450..607a8e803 100644
--- a/src/video_core/vertex_shader.h
+++ b/src/video_core/vertex_shader.h
@@ -225,7 +225,7 @@ union SwizzlePattern {
}
bool DestComponentEnabled(int i) const {
- return (dest_mask & (0x8 >> i));
+ return (dest_mask & (0x8 >> i)) != 0;
}
std::string SelectorToString(bool src2) const {