diff --git a/source/common/audio/music/music.cpp b/source/common/audio/music/music.cpp index ffc0b5ad8..37617761e 100644 --- a/source/common/audio/music/music.cpp +++ b/source/common/audio/music/music.cpp @@ -117,10 +117,11 @@ int MusicEnabled() // int return is for scripting static std::unique_ptr musicStream; static TArray customStreams; -SoundStream *S_CreateCustomStream(size_t size, int samplerate, int numchannels, StreamCallback cb, void *userdata) +SoundStream *S_CreateCustomStream(size_t size, int samplerate, int numchannels, MusicCustomStreamType sampletype, StreamCallback cb, void *userdata) { int flags = 0; if (numchannels < 2) flags |= SoundStream::Mono; + if (sampletype == MusicSamplesFloat) flags |= SoundStream::Float; auto stream = GSnd->CreateStream(cb, int(size), flags, samplerate, userdata); if (stream) { diff --git a/source/common/audio/music/s_music.h b/source/common/audio/music/s_music.h index fc1b86ca0..1970a57da 100644 --- a/source/common/audio/music/s_music.h +++ b/source/common/audio/music/s_music.h @@ -11,9 +11,13 @@ class FileReader; class SoundStream; +enum MusicCustomStreamType : bool { + MusicSamples16bit, + MusicSamplesFloat +}; int MusicEnabled(); typedef bool(*StreamCallback)(SoundStream* stream, void* buff, int len, void* userdata); -SoundStream *S_CreateCustomStream(size_t size, int samplerate, int numchannels, StreamCallback cb, void *userdata); +SoundStream *S_CreateCustomStream(size_t size, int samplerate, int numchannels, MusicCustomStreamType sampletype, StreamCallback cb, void *userdata); void S_StopCustomStream(SoundStream* stream); void S_PauseAllCustomStreams(bool on); diff --git a/source/common/cutscenes/movieplayer.cpp b/source/common/cutscenes/movieplayer.cpp index d808fd60b..6b8a050af 100644 --- a/source/common/cutscenes/movieplayer.cpp +++ b/source/common/cutscenes/movieplayer.cpp @@ -618,7 +618,7 @@ public: if (adata.inf.bitsPerSample == 8) copy8bitSamples(read); else copy16bitSamples(read); if (!stream && read) // the sound may not start in the first frame, but the stream cannot start without any sound data present. - stream = S_CreateCustomStream(6000, adata.inf.sampleRate, adata.inf.nChannels, StreamCallbackFunc, this); + stream = S_CreateCustomStream(6000, adata.inf.sampleRate, adata.inf.nChannels, MusicSamples16bit, StreamCallbackFunc, this); } diff --git a/source/common/cutscenes/playmve.cpp b/source/common/cutscenes/playmve.cpp index 26165de0e..ffd830d19 100644 --- a/source/common/cutscenes/playmve.cpp +++ b/source/common/cutscenes/playmve.cpp @@ -291,7 +291,7 @@ bool InterplayDecoder::RunFrame(uint64_t clock) if (!bAudioStarted) { // start audio playback - stream = S_CreateCustomStream(6000, audio.nSampleRate, audio.nChannels, StreamCallbackFunc, this); + stream = S_CreateCustomStream(6000, audio.nSampleRate, audio.nChannels, MusicSamples16bit, StreamCallbackFunc, this); bAudioStarted = true; } diff --git a/source/common/rendering/vulkan/system/vk_swapchain.cpp b/source/common/rendering/vulkan/system/vk_swapchain.cpp index fd21c462e..f44139b1f 100644 --- a/source/common/rendering/vulkan/system/vk_swapchain.cpp +++ b/source/common/rendering/vulkan/system/vk_swapchain.cpp @@ -250,7 +250,7 @@ void VulkanSwapChain::CreateViews() bool VulkanSwapChain::IsHdrModeActive() const { - return swapChainFormat.colorSpace == VK_COLOR_SPACE_HDR10_ST2084_EXT || swapChainFormat.colorSpace == VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT; + return swapChainFormat.colorSpace == VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT; } void VulkanSwapChain::SelectFormat() @@ -276,16 +276,6 @@ void VulkanSwapChain::SelectFormat() return; } } - - // For older drivers that reported the wrong colorspace - for (const auto &format : surfaceFormats) - { - if (format.format == VK_FORMAT_R16G16B16A16_SFLOAT && format.colorSpace == VK_COLOR_SPACE_HDR10_ST2084_EXT) - { - swapChainFormat = format; - return; - } - } } for (const auto &format : surfaceFormats) diff --git a/source/games/exhumed/src/movie.cpp b/source/games/exhumed/src/movie.cpp index 861f2055e..bbbe08fd0 100644 --- a/source/games/exhumed/src/movie.cpp +++ b/source/games/exhumed/src/movie.cpp @@ -205,7 +205,7 @@ public: audio.nWrite = 5; // play 5 blocks (i.e. half a second) of silence to get ahead of the stream. For this video it isn't necessary to sync it perfectly. // start audio playback - stream = S_CreateCustomStream(kSampleSize * 2, kSampleRate, 1, StreamCallbackFunc, this); // size must be doubled here or dropouts can be heard. + stream = S_CreateCustomStream(kSampleSize * 2, kSampleRate, 1, MusicSamples16bit, StreamCallbackFunc, this); // size must be doubled here or dropouts can be heard. animtex.SetSize(AnimTexture::Paletted, 200, 320); }