Making texture swizzles dynamic. Seems to fix some color swap issues.

And probably exposes many more ;)
This commit is contained in:
Ben Vanik
2015-12-07 22:39:33 -08:00
parent 09022a6ad3
commit ec113275dc
10 changed files with 40 additions and 52 deletions

View File

@@ -621,13 +621,11 @@ void TraceViewer::DrawTextureInfo(
ImGui::Text("Cube: ?");
break;
}
static const char* swizzle_map[] = {"Red", "Green", "Blue", "Alpha",
"Zero", "One", "UNK6", "UNK7"};
ImGui::Text("Swizzle: %s %s %s %s",
swizzle_map[(texture_info.swizzle >> 0) & 0x7],
swizzle_map[(texture_info.swizzle >> 3) & 0x7],
swizzle_map[(texture_info.swizzle >> 6) & 0x7],
swizzle_map[(texture_info.swizzle >> 9) & 0x7]);
static const char* kSwizzleMap[] = {"R", "G", "B", "A", "0", "1"};
ImGui::Text("Swizzle: %s%s%s%s", kSwizzleMap[(fetch.swizzle >> 0) & 0x7],
kSwizzleMap[(fetch.swizzle >> 3) & 0x7],
kSwizzleMap[(fetch.swizzle >> 6) & 0x7],
kSwizzleMap[(fetch.swizzle >> 9) & 0x7]);
ImGui::Columns(1);
}