Merge branch 'master' into d3d12

This commit is contained in:
Triang3l 2018-10-22 23:15:07 +03:00 committed by GitHub
commit abdb37464d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 61 additions and 42 deletions

View File

@ -114,6 +114,8 @@ inline TextureFormat GetBaseFormat(TextureFormat texture_format) {
return TextureFormat::k_10_11_11;
case TextureFormat::k_11_11_10_AS_16_16_16_16:
return TextureFormat::k_11_11_10;
case TextureFormat::k_8_8_8_8_GAMMA:
return TextureFormat::k_8_8_8_8;
default:
break;
}
@ -211,6 +213,7 @@ inline bool IsSRGBCapable(TextureFormat format) {
case TextureFormat::k_2_10_10_10_AS_16_16_16_16:
case TextureFormat::k_10_11_11_AS_16_16_16_16:
case TextureFormat::k_11_11_10_AS_16_16_16_16:
case TextureFormat::k_8_8_8_8_GAMMA:
return true;
default:
return false;

View File

@ -56,7 +56,7 @@ const TextureConfig texture_configs[64] = {
/* k_8_8 */ ___(R8G8_UNORM),
/* k_Cr_Y1_Cb_Y0_REP */ ___(UNDEFINED),
/* k_Y1_Cr_Y0_Cb_REP */ ___(UNDEFINED),
/* k_16_16_EDRAM */ ___(R16G16_UNORM),
/* k_16_16_EDRAM */ ___(UNDEFINED),
/* k_8_8_8_8_A */ ___(UNDEFINED),
/* k_4_4_4_4 */ __v(R4G4B4A4_UNORM_PACK16, YXWZ),
// TODO: Verify if these two are correct (I think not).
@ -66,7 +66,7 @@ const TextureConfig texture_configs[64] = {
/* k_DXT1 */ ___(BC1_RGBA_UNORM_BLOCK),
/* k_DXT2_3 */ ___(BC2_UNORM_BLOCK),
/* k_DXT4_5 */ ___(BC3_UNORM_BLOCK),
/* k_16_16_16_16_EDRAM */ ___(R16G16B16A16_UNORM),
/* k_16_16_16_16_EDRAM */ ___(UNDEFINED),
// TODO: D24 unsupported on AMD.
/* k_24_8 */ ___(D24_UNORM_S8_UINT),
@ -121,7 +121,7 @@ const TextureConfig texture_configs[64] = {
/* k_DXT3A_AS_1_1_1_1 */ ___(UNDEFINED),
/* k_8_8_8_8_GAMMA_EDRAM */ ___(R8G8B8A8_UNORM),
/* k_8_8_8_8_GAMMA_EDRAM */ ___(UNDEFINED),
/* k_2_10_10_10_FLOAT_EDRAM */ ___(UNDEFINED),
};

View File

@ -180,7 +180,7 @@ enum class DepthRenderTargetFormat : uint32_t {
kD24FS8 = 1,
};
// Subset of a2xx_sq_surfaceformat.
// Subset of a2xx_sq_surfaceformat - formats that RTs can be resolved to.
enum class ColorFormat : uint32_t {
k_8 = 2,
k_1_5_5_5 = 3,
@ -204,8 +204,10 @@ enum class ColorFormat : uint32_t {
k_32_FLOAT = 36,
k_32_32_FLOAT = 37,
k_32_32_32_32_FLOAT = 38,
kUnknown0x36 = 0x36, // not sure, but like 8888
k_8_8_8_8_AS_16_16_16_16 = 50,
k_2_10_10_10_AS_16_16_16_16 = 54,
k_10_11_11_AS_16_16_16_16 = 55,
k_11_11_10_AS_16_16_16_16 = 56,
};
enum class VertexFormat : uint32_t {

View File

@ -55,34 +55,41 @@ X_RESULT XmpApp::XMPCreateTitlePlaylist(uint32_t songs_ptr, uint32_t song_count,
playlist->handle = ++next_playlist_handle_;
playlist->name = std::move(playlist_name);
playlist->flags = flags;
for (uint32_t i = 0; i < song_count; ++i) {
auto song = std::make_unique<Song>();
song->handle = ++next_song_handle_;
uint8_t* song_base = memory_->TranslateVirtual(songs_ptr + (i * 36));
song->file_path = xe::load_and_swap<std::wstring>(
memory_->TranslateVirtual(xe::load_and_swap<uint32_t>(song_base + 0)));
song->name = xe::load_and_swap<std::wstring>(
memory_->TranslateVirtual(xe::load_and_swap<uint32_t>(song_base + 4)));
song->artist = xe::load_and_swap<std::wstring>(
memory_->TranslateVirtual(xe::load_and_swap<uint32_t>(song_base + 8)));
song->album = xe::load_and_swap<std::wstring>(
memory_->TranslateVirtual(xe::load_and_swap<uint32_t>(song_base + 12)));
song->album_artist = xe::load_and_swap<std::wstring>(
memory_->TranslateVirtual(xe::load_and_swap<uint32_t>(song_base + 16)));
song->genre = xe::load_and_swap<std::wstring>(
memory_->TranslateVirtual(xe::load_and_swap<uint32_t>(song_base + 20)));
song->track_number = xe::load_and_swap<uint32_t>(song_base + 24);
song->duration_ms = xe::load_and_swap<uint32_t>(song_base + 28);
song->format =
static_cast<Song::Format>(xe::load_and_swap<uint32_t>(song_base + 32));
if (out_song_handles) {
xe::store_and_swap<uint32_t>(
memory_->TranslateVirtual(out_song_handles + (i * 4)), song->handle);
if (songs_ptr) {
for (uint32_t i = 0; i < song_count; ++i) {
auto song = std::make_unique<Song>();
song->handle = ++next_song_handle_;
uint8_t* song_base = memory_->TranslateVirtual(songs_ptr + (i * 36));
song->file_path =
xe::load_and_swap<std::wstring>(memory_->TranslateVirtual(
xe::load_and_swap<uint32_t>(song_base + 0)));
song->name = xe::load_and_swap<std::wstring>(memory_->TranslateVirtual(
xe::load_and_swap<uint32_t>(song_base + 4)));
song->artist = xe::load_and_swap<std::wstring>(memory_->TranslateVirtual(
xe::load_and_swap<uint32_t>(song_base + 8)));
song->album = xe::load_and_swap<std::wstring>(memory_->TranslateVirtual(
xe::load_and_swap<uint32_t>(song_base + 12)));
song->album_artist =
xe::load_and_swap<std::wstring>(memory_->TranslateVirtual(
xe::load_and_swap<uint32_t>(song_base + 16)));
song->genre = xe::load_and_swap<std::wstring>(memory_->TranslateVirtual(
xe::load_and_swap<uint32_t>(song_base + 20)));
song->track_number = xe::load_and_swap<uint32_t>(song_base + 24);
song->duration_ms = xe::load_and_swap<uint32_t>(song_base + 28);
song->format = static_cast<Song::Format>(
xe::load_and_swap<uint32_t>(song_base + 32));
if (out_song_handles) {
xe::store_and_swap<uint32_t>(
memory_->TranslateVirtual(out_song_handles + (i * 4)),
song->handle);
}
playlist->songs.emplace_back(std::move(song));
}
playlist->songs.emplace_back(std::move(song));
}
xe::store_and_swap<uint32_t>(memory_->TranslateVirtual(out_playlist_handle),
playlist->handle);
if (out_playlist_handle) {
xe::store_and_swap<uint32_t>(memory_->TranslateVirtual(out_playlist_handle),
playlist->handle);
}
auto global_lock = global_critical_region_.Acquire();
playlists_.insert({playlist->handle, playlist.get()});
@ -404,12 +411,19 @@ X_RESULT XmpApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
assert_true(xmp_client == 0x00000002);
XELOGD("XMPGetPlaybackBehavior(%.8X, %.8X, %.8X)", playback_mode_ptr,
repeat_mode_ptr, unk3_ptr);
xe::store_and_swap<uint32_t>(memory_->TranslateVirtual(playback_mode_ptr),
static_cast<uint32_t>(playback_mode_));
xe::store_and_swap<uint32_t>(memory_->TranslateVirtual(repeat_mode_ptr),
static_cast<uint32_t>(repeat_mode_));
xe::store_and_swap<uint32_t>(memory_->TranslateVirtual(unk3_ptr),
unknown_flags_);
if (playback_mode_ptr) {
xe::store_and_swap<uint32_t>(
memory_->TranslateVirtual(playback_mode_ptr),
static_cast<uint32_t>(playback_mode_));
}
if (repeat_mode_ptr) {
xe::store_and_swap<uint32_t>(memory_->TranslateVirtual(repeat_mode_ptr),
static_cast<uint32_t>(repeat_mode_));
}
if (unk3_ptr) {
xe::store_and_swap<uint32_t>(memory_->TranslateVirtual(unk3_ptr),
unknown_flags_);
}
return X_ERROR_SUCCESS;
}
case 0x0007002E: {

View File

@ -925,7 +925,7 @@ SHIM_CALL _snwprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
StackArgList args(ppc_context, 3);
WideStringFormatData data(format);
int32_t count = format_core(ppc_context, data, args, false);
int32_t count = format_core(ppc_context, data, args, true);
if (count < 0) {
if (buffer_count > 0) {
buffer[0] = '\0'; // write a null, just to be safe

View File

@ -36,9 +36,9 @@ class CDialogEventHandler : public IFileDialogEvents,
IFACEMETHODIMP QueryInterface(REFIID riid, void** ppv) {
static const QITAB qit[] = {
{&__uuidof(IFileDialogEvents),
OFFSETOFCLASS(IFileDialogEvents, CDialogEventHandler)},
(int)OFFSETOFCLASS(IFileDialogEvents, CDialogEventHandler)},
{&__uuidof(IFileDialogControlEvents),
OFFSETOFCLASS(IFileDialogControlEvents, CDialogEventHandler)},
(int)OFFSETOFCLASS(IFileDialogControlEvents, CDialogEventHandler)},
{0},
};
return QISearch(this, qit, riid, ppv);

View File

@ -389,7 +389,7 @@ def get_build_bin_path(args):
platform = 'windows'
else:
platform = 'linux'
return os.path.join(self_path, 'build', 'bin', platform, args['config'])
return os.path.join(self_path, 'build', 'bin', platform.capitalize(), args['config'].capitalize())
def discover_commands(subparsers):