Cleaning up clang warnings in gpu/.
This commit is contained in:
parent
95d3a9c345
commit
e029c9abdc
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
#include "xenia/gpu/spirv_shader_translator.h"
|
#include "xenia/gpu/spirv_shader_translator.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace gpu {
|
namespace gpu {
|
||||||
|
|
||||||
|
@ -23,7 +25,7 @@ void SpirvShaderTranslator::StartTranslation() {
|
||||||
auto float_1_0 = e.MakeFloatConstant(1.0f);
|
auto float_1_0 = e.MakeFloatConstant(1.0f);
|
||||||
auto acos = e.CreateGlslStd450InstructionCall(
|
auto acos = e.CreateGlslStd450InstructionCall(
|
||||||
spv::Decoration::Invariant, e.MakeFloatType(32), spv::GLSLstd450::Acos,
|
spv::Decoration::Invariant, e.MakeFloatType(32), spv::GLSLstd450::Acos,
|
||||||
{{float_1_0}});
|
{float_1_0});
|
||||||
e.MakeReturn(true);
|
e.MakeReturn(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,28 +166,22 @@ spv::Id SpirvShaderTranslator::LoadFromOperand(const InstructionOperand& op) {
|
||||||
// storage_addressing_mode
|
// storage_addressing_mode
|
||||||
switch (op.storage_source) {
|
switch (op.storage_source) {
|
||||||
case InstructionStorageSource::kRegister:
|
case InstructionStorageSource::kRegister:
|
||||||
//
|
// TODO(benvanik): op.storage_index
|
||||||
op.storage_index;
|
|
||||||
break;
|
break;
|
||||||
case InstructionStorageSource::kConstantFloat:
|
case InstructionStorageSource::kConstantFloat:
|
||||||
//
|
// TODO(benvanik): op.storage_index
|
||||||
op.storage_index;
|
|
||||||
break;
|
break;
|
||||||
case InstructionStorageSource::kConstantInt:
|
case InstructionStorageSource::kConstantInt:
|
||||||
//
|
// TODO(benvanik): op.storage_index
|
||||||
op.storage_index;
|
|
||||||
break;
|
break;
|
||||||
case InstructionStorageSource::kConstantBool:
|
case InstructionStorageSource::kConstantBool:
|
||||||
//
|
// TODO(benvanik): op.storage_index
|
||||||
op.storage_index;
|
|
||||||
break;
|
break;
|
||||||
case InstructionStorageSource::kVertexFetchConstant:
|
case InstructionStorageSource::kVertexFetchConstant:
|
||||||
//
|
// TODO(benvanik): op.storage_index
|
||||||
op.storage_index;
|
|
||||||
break;
|
break;
|
||||||
case InstructionStorageSource::kTextureFetchConstant:
|
case InstructionStorageSource::kTextureFetchConstant:
|
||||||
//
|
// TODO(benvanik): op.storage_index
|
||||||
op.storage_index;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,25 +213,25 @@ void SpirvShaderTranslator::StoreToResult(spv::Id source_value_id,
|
||||||
// storage_addressing_mode
|
// storage_addressing_mode
|
||||||
switch (result.storage_target) {
|
switch (result.storage_target) {
|
||||||
case InstructionStorageTarget::kRegister:
|
case InstructionStorageTarget::kRegister:
|
||||||
//
|
// TODO(benvanik): result.storage_index
|
||||||
result.storage_index;
|
|
||||||
break;
|
break;
|
||||||
case InstructionStorageTarget::kInterpolant:
|
case InstructionStorageTarget::kInterpolant:
|
||||||
//
|
// TODO(benvanik): result.storage_index
|
||||||
result.storage_index;
|
|
||||||
break;
|
break;
|
||||||
case InstructionStorageTarget::kPosition:
|
case InstructionStorageTarget::kPosition:
|
||||||
//
|
// TODO(benvanik): result.storage_index
|
||||||
break;
|
break;
|
||||||
case InstructionStorageTarget::kPointSize:
|
case InstructionStorageTarget::kPointSize:
|
||||||
//
|
// TODO(benvanik): result.storage_index
|
||||||
break;
|
break;
|
||||||
case InstructionStorageTarget::kColorTarget:
|
case InstructionStorageTarget::kColorTarget:
|
||||||
//
|
// TODO(benvanik): result.storage_index
|
||||||
result.storage_index;
|
|
||||||
break;
|
break;
|
||||||
case InstructionStorageTarget::kDepth:
|
case InstructionStorageTarget::kDepth:
|
||||||
//
|
// TODO(benvanik): result.storage_index
|
||||||
|
break;
|
||||||
|
case InstructionStorageTarget::kNone:
|
||||||
|
assert_unhandled_case(result.storage_target);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ class TracePlayer : public TraceReader {
|
||||||
int current_frame_index_;
|
int current_frame_index_;
|
||||||
int current_command_index_;
|
int current_command_index_;
|
||||||
bool playing_trace_ = false;
|
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_;
|
std::unique_ptr<xe::threading::Event> playback_event_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -127,8 +127,9 @@ void TraceReader::ParseTrace() {
|
||||||
last_ptr = trace_ptr;
|
last_ptr = trace_ptr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PacketCategory::kSwap: {
|
case PacketCategory::kSwap:
|
||||||
//
|
case PacketCategory::kGeneric: {
|
||||||
|
// Ignored.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
#include <gflags/gflags.h>
|
#include <gflags/gflags.h>
|
||||||
|
|
||||||
|
#include <cinttypes>
|
||||||
|
|
||||||
#include "third_party/imgui/imgui.h"
|
#include "third_party/imgui/imgui.h"
|
||||||
#include "xenia/base/clock.h"
|
#include "xenia/base/clock.h"
|
||||||
#include "xenia/base/logging.h"
|
#include "xenia/base/logging.h"
|
||||||
|
@ -317,7 +319,7 @@ void TraceViewer::DrawPacketDisassemblerUI() {
|
||||||
if (packet_info.predicated) {
|
if (packet_info.predicated) {
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, kColorIgnored);
|
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);
|
ImGui::TreePush((const char*)0);
|
||||||
for (auto action : packet_info.actions) {
|
for (auto action : packet_info.actions) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
|
@ -338,11 +340,11 @@ void TraceViewer::DrawPacketDisassemblerUI() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PacketAction::Type::kSetBinMask: {
|
case PacketAction::Type::kSetBinMask: {
|
||||||
ImGui::Text("%.16llX", action.set_bin_mask.value);
|
ImGui::Text("%.16" PRIX64, action.set_bin_mask.value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PacketAction::Type::kSetBinSelect: {
|
case PacketAction::Type::kSetBinSelect: {
|
||||||
ImGui::Text("%.16llX", action.set_bin_select.value);
|
ImGui::Text("%.16" PRIX64, action.set_bin_select.value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -707,6 +709,9 @@ void TraceViewer::DrawVertexFetcher(Shader* shader,
|
||||||
case VertexFormat::k_32_32_32_32_FLOAT:
|
case VertexFormat::k_32_32_32_32_FLOAT:
|
||||||
column_count += 4;
|
column_count += 4;
|
||||||
break;
|
break;
|
||||||
|
case VertexFormat::kUndefined:
|
||||||
|
assert_unhandled_case(attrib.fetch_instr.attributes.data_format);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::BeginChild("#indices", ImVec2(0, 300));
|
ImGui::BeginChild("#indices", ImVec2(0, 300));
|
||||||
|
@ -724,30 +729,30 @@ void TraceViewer::DrawVertexFetcher(Shader* shader,
|
||||||
switch (attrib.fetch_instr.attributes.data_format) {
|
switch (attrib.fetch_instr.attributes.data_format) {
|
||||||
case VertexFormat::k_32:
|
case VertexFormat::k_32:
|
||||||
case VertexFormat::k_32_FLOAT:
|
case VertexFormat::k_32_FLOAT:
|
||||||
ImGui::Text("e%d.x", el_index);
|
ImGui::Text("e%" PRId64 ".x", el_index);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
break;
|
break;
|
||||||
case VertexFormat::k_16_16:
|
case VertexFormat::k_16_16:
|
||||||
case VertexFormat::k_16_16_FLOAT:
|
case VertexFormat::k_16_16_FLOAT:
|
||||||
case VertexFormat::k_32_32:
|
case VertexFormat::k_32_32:
|
||||||
case VertexFormat::k_32_32_FLOAT:
|
case VertexFormat::k_32_32_FLOAT:
|
||||||
ImGui::Text("e%d.x", el_index);
|
ImGui::Text("e%" PRId64 ".x", el_index);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::Text("e%d.y", el_index);
|
ImGui::Text("e%" PRId64 ".y", el_index);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
break;
|
break;
|
||||||
case VertexFormat::k_10_11_11:
|
case VertexFormat::k_10_11_11:
|
||||||
case VertexFormat::k_11_11_10:
|
case VertexFormat::k_11_11_10:
|
||||||
case VertexFormat::k_32_32_32_FLOAT:
|
case VertexFormat::k_32_32_32_FLOAT:
|
||||||
ImGui::Text("e%d.x", el_index);
|
ImGui::Text("e%" PRId64 ".x", el_index);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::Text("e%d.y", el_index);
|
ImGui::Text("e%" PRId64 ".y", el_index);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::Text("e%d.z", el_index);
|
ImGui::Text("e%" PRId64 ".z", el_index);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
break;
|
break;
|
||||||
case VertexFormat::k_8_8_8_8:
|
case VertexFormat::k_8_8_8_8:
|
||||||
ImGui::Text("e%d.xyzw", el_index);
|
ImGui::Text("e%" PRId64 ".xyzw", el_index);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
break;
|
break;
|
||||||
case VertexFormat::k_2_10_10_10:
|
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_32_32_32_32:
|
||||||
case VertexFormat::k_16_16_16_16_FLOAT:
|
case VertexFormat::k_16_16_16_16_FLOAT:
|
||||||
case VertexFormat::k_32_32_32_32_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::NextColumn();
|
||||||
ImGui::Text("e%d.y", el_index);
|
ImGui::Text("e%" PRId64 ".y", el_index);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::Text("e%d.z", el_index);
|
ImGui::Text("e%" PRId64 ".z", el_index);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::Text("e%d.w", el_index);
|
ImGui::Text("e%" PRId64 ".w", el_index);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
break;
|
break;
|
||||||
|
case VertexFormat::kUndefined:
|
||||||
|
assert_unhandled_case(attrib.fetch_instr.attributes.data_format);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
@ -865,6 +873,9 @@ void TraceViewer::DrawVertexFetcher(Shader* shader,
|
||||||
ImGui::Text("%.2f", LOADEL(float, 3));
|
ImGui::Text("%.2f", LOADEL(float, 3));
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
break;
|
break;
|
||||||
|
case VertexFormat::kUndefined:
|
||||||
|
assert_unhandled_case(attrib.fetch_instr.attributes.data_format);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,11 +9,12 @@
|
||||||
|
|
||||||
#include "xenia/gpu/trace_writer.h"
|
#include "xenia/gpu/trace_writer.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
#include "third_party/snappy/snappy-sinksource.h"
|
#include "third_party/snappy/snappy-sinksource.h"
|
||||||
#include "third_party/snappy/snappy.h"
|
#include "third_party/snappy/snappy.h"
|
||||||
|
|
||||||
#include "build/version.h"
|
#include "build/version.h"
|
||||||
|
|
||||||
#include "xenia/base/assert.h"
|
#include "xenia/base/assert.h"
|
||||||
#include "xenia/base/logging.h"
|
#include "xenia/base/logging.h"
|
||||||
#include "xenia/base/string.h"
|
#include "xenia/base/string.h"
|
||||||
|
|
Loading…
Reference in New Issue