Cleaning up clang warnings in gpu/.

This commit is contained in:
Ben Vanik 2016-01-01 16:04:47 +00:00
parent 95d3a9c345
commit e029c9abdc
5 changed files with 49 additions and 40 deletions

View File

@ -9,6 +9,8 @@
#include "xenia/gpu/spirv_shader_translator.h"
#include <cstring>
namespace xe {
namespace gpu {
@ -23,7 +25,7 @@ void SpirvShaderTranslator::StartTranslation() {
auto float_1_0 = e.MakeFloatConstant(1.0f);
auto acos = e.CreateGlslStd450InstructionCall(
spv::Decoration::Invariant, e.MakeFloatType(32), spv::GLSLstd450::Acos,
{{float_1_0}});
{float_1_0});
e.MakeReturn(true);
}
@ -164,28 +166,22 @@ spv::Id SpirvShaderTranslator::LoadFromOperand(const InstructionOperand& op) {
// storage_addressing_mode
switch (op.storage_source) {
case InstructionStorageSource::kRegister:
//
op.storage_index;
// TODO(benvanik): op.storage_index
break;
case InstructionStorageSource::kConstantFloat:
//
op.storage_index;
// TODO(benvanik): op.storage_index
break;
case InstructionStorageSource::kConstantInt:
//
op.storage_index;
// TODO(benvanik): op.storage_index
break;
case InstructionStorageSource::kConstantBool:
//
op.storage_index;
// TODO(benvanik): op.storage_index
break;
case InstructionStorageSource::kVertexFetchConstant:
//
op.storage_index;
// TODO(benvanik): op.storage_index
break;
case InstructionStorageSource::kTextureFetchConstant:
//
op.storage_index;
// TODO(benvanik): op.storage_index
break;
}
@ -217,25 +213,25 @@ void SpirvShaderTranslator::StoreToResult(spv::Id source_value_id,
// storage_addressing_mode
switch (result.storage_target) {
case InstructionStorageTarget::kRegister:
//
result.storage_index;
// TODO(benvanik): result.storage_index
break;
case InstructionStorageTarget::kInterpolant:
//
result.storage_index;
// TODO(benvanik): result.storage_index
break;
case InstructionStorageTarget::kPosition:
//
// TODO(benvanik): result.storage_index
break;
case InstructionStorageTarget::kPointSize:
//
// TODO(benvanik): result.storage_index
break;
case InstructionStorageTarget::kColorTarget:
//
result.storage_index;
// TODO(benvanik): result.storage_index
break;
case InstructionStorageTarget::kDepth:
//
// TODO(benvanik): result.storage_index
break;
case InstructionStorageTarget::kNone:
assert_unhandled_case(result.storage_target);
break;
}

View File

@ -59,7 +59,7 @@ class TracePlayer : public TraceReader {
int current_frame_index_;
int current_command_index_;
bool playing_trace_ = false;
std::atomic<uint32_t> playback_percent_ = 0;
std::atomic<uint32_t> playback_percent_ = {0};
std::unique_ptr<xe::threading::Event> playback_event_;
};

View File

@ -127,8 +127,9 @@ void TraceReader::ParseTrace() {
last_ptr = trace_ptr;
break;
}
case PacketCategory::kSwap: {
//
case PacketCategory::kSwap:
case PacketCategory::kGeneric: {
// Ignored.
break;
}
}

View File

@ -11,6 +11,8 @@
#include <gflags/gflags.h>
#include <cinttypes>
#include "third_party/imgui/imgui.h"
#include "xenia/base/clock.h"
#include "xenia/base/logging.h"
@ -317,7 +319,7 @@ void TraceViewer::DrawPacketDisassemblerUI() {
if (packet_info.predicated) {
ImGui::PushStyleColor(ImGuiCol_Text, kColorIgnored);
}
ImGui::BulletText(packet_info.type_info->name);
ImGui::BulletText("%s", packet_info.type_info->name);
ImGui::TreePush((const char*)0);
for (auto action : packet_info.actions) {
switch (action.type) {
@ -338,11 +340,11 @@ void TraceViewer::DrawPacketDisassemblerUI() {
break;
}
case PacketAction::Type::kSetBinMask: {
ImGui::Text("%.16llX", action.set_bin_mask.value);
ImGui::Text("%.16" PRIX64, action.set_bin_mask.value);
break;
}
case PacketAction::Type::kSetBinSelect: {
ImGui::Text("%.16llX", action.set_bin_select.value);
ImGui::Text("%.16" PRIX64, action.set_bin_select.value);
break;
}
}
@ -707,6 +709,9 @@ void TraceViewer::DrawVertexFetcher(Shader* shader,
case VertexFormat::k_32_32_32_32_FLOAT:
column_count += 4;
break;
case VertexFormat::kUndefined:
assert_unhandled_case(attrib.fetch_instr.attributes.data_format);
break;
}
}
ImGui::BeginChild("#indices", ImVec2(0, 300));
@ -724,30 +729,30 @@ void TraceViewer::DrawVertexFetcher(Shader* shader,
switch (attrib.fetch_instr.attributes.data_format) {
case VertexFormat::k_32:
case VertexFormat::k_32_FLOAT:
ImGui::Text("e%d.x", el_index);
ImGui::Text("e%" PRId64 ".x", el_index);
ImGui::NextColumn();
break;
case VertexFormat::k_16_16:
case VertexFormat::k_16_16_FLOAT:
case VertexFormat::k_32_32:
case VertexFormat::k_32_32_FLOAT:
ImGui::Text("e%d.x", el_index);
ImGui::Text("e%" PRId64 ".x", el_index);
ImGui::NextColumn();
ImGui::Text("e%d.y", el_index);
ImGui::Text("e%" PRId64 ".y", el_index);
ImGui::NextColumn();
break;
case VertexFormat::k_10_11_11:
case VertexFormat::k_11_11_10:
case VertexFormat::k_32_32_32_FLOAT:
ImGui::Text("e%d.x", el_index);
ImGui::Text("e%" PRId64 ".x", el_index);
ImGui::NextColumn();
ImGui::Text("e%d.y", el_index);
ImGui::Text("e%" PRId64 ".y", el_index);
ImGui::NextColumn();
ImGui::Text("e%d.z", el_index);
ImGui::Text("e%" PRId64 ".z", el_index);
ImGui::NextColumn();
break;
case VertexFormat::k_8_8_8_8:
ImGui::Text("e%d.xyzw", el_index);
ImGui::Text("e%" PRId64 ".xyzw", el_index);
ImGui::NextColumn();
break;
case VertexFormat::k_2_10_10_10:
@ -755,15 +760,18 @@ void TraceViewer::DrawVertexFetcher(Shader* shader,
case VertexFormat::k_32_32_32_32:
case VertexFormat::k_16_16_16_16_FLOAT:
case VertexFormat::k_32_32_32_32_FLOAT:
ImGui::Text("e%d.x", el_index);
ImGui::Text("e%" PRId64 ".x", el_index);
ImGui::NextColumn();
ImGui::Text("e%d.y", el_index);
ImGui::Text("e%" PRId64 ".y", el_index);
ImGui::NextColumn();
ImGui::Text("e%d.z", el_index);
ImGui::Text("e%" PRId64 ".z", el_index);
ImGui::NextColumn();
ImGui::Text("e%d.w", el_index);
ImGui::Text("e%" PRId64 ".w", el_index);
ImGui::NextColumn();
break;
case VertexFormat::kUndefined:
assert_unhandled_case(attrib.fetch_instr.attributes.data_format);
break;
}
}
ImGui::Separator();
@ -865,6 +873,9 @@ void TraceViewer::DrawVertexFetcher(Shader* shader,
ImGui::Text("%.2f", LOADEL(float, 3));
ImGui::NextColumn();
break;
case VertexFormat::kUndefined:
assert_unhandled_case(attrib.fetch_instr.attributes.data_format);
break;
}
}
}

View File

@ -9,11 +9,12 @@
#include "xenia/gpu/trace_writer.h"
#include <cstring>
#include "third_party/snappy/snappy-sinksource.h"
#include "third_party/snappy/snappy.h"
#include "build/version.h"
#include "xenia/base/assert.h"
#include "xenia/base/logging.h"
#include "xenia/base/string.h"