diff --git a/src/core/game_list.cpp b/src/core/game_list.cpp index 814cb3d4b..533c3be12 100644 --- a/src/core/game_list.cpp +++ b/src/core/game_list.cpp @@ -1033,7 +1033,7 @@ TinyString GameList::FormatTimespan(std::time_t timespan, bool long_format) } std::vector> -GameList::GetMatchingEntriesForSerial(const gsl::span serials) +GameList::GetMatchingEntriesForSerial(const std::span serials) { std::vector> ret; ret.reserve(serials.size()); diff --git a/src/core/game_list.h b/src/core/game_list.h index 802e69fb5..1d1a7d98d 100644 --- a/src/core/game_list.h +++ b/src/core/game_list.h @@ -10,11 +10,10 @@ #include "common/string.h" -#include "gsl/span" - #include #include #include +#include #include class ByteStream; @@ -107,7 +106,7 @@ std::string GetNewCoverImagePathForEntry(const Entry* entry, const char* new_fil /// Returns a list of (title, entry) for entries matching serials. Titles will match the gamedb title, /// except when two files have the same serial, in which case the filename will be used instead. std::vector> -GetMatchingEntriesForSerial(const gsl::span serials); +GetMatchingEntriesForSerial(const std::span serials); /// Downloads covers using the specified URL templates. By default, covers are saved by title, but this can be changed /// with the use_serial parameter. save_callback optionall takes the entry and the path the new cover is saved to. diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index 2b1fcb885..5f5a3354f 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -774,11 +774,11 @@ bool GPU_HW::CompilePipelines() plconfig.input_layout.vertex_attributes = textured ? - (m_using_uv_limits ? gsl::span( + (m_using_uv_limits ? std::span( vertex_attributes, NUM_BATCH_TEXTURED_LIMITS_VERTEX_ATTRIBUTES) : - gsl::span( + std::span( vertex_attributes, NUM_BATCH_TEXTURED_VERTEX_ATTRIBUTES)) : - gsl::span(vertex_attributes, NUM_BATCH_VERTEX_ATTRIBUTES); + std::span(vertex_attributes, NUM_BATCH_VERTEX_ATTRIBUTES); plconfig.vertex_shader = batch_vertex_shaders[BoolToUInt8(textured)].get(); plconfig.fragment_shader = @@ -856,7 +856,7 @@ bool GPU_HW::CompilePipelines() GL_OBJECT_NAME(fs, "Batch Wireframe Fragment Shader"); plconfig.input_layout.vertex_attributes = - gsl::span(vertex_attributes, NUM_BATCH_VERTEX_ATTRIBUTES); + std::span(vertex_attributes, NUM_BATCH_VERTEX_ATTRIBUTES); plconfig.blend = (m_wireframe_mode == GPUWireframeMode::OverlayWireframe) ? GPUPipeline::BlendState::GetAlphaBlendingState() : GPUPipeline::BlendState::GetNoBlendingState(); diff --git a/src/core/imgui_overlays.cpp b/src/core/imgui_overlays.cpp index a13cc5df9..9484ac508 100644 --- a/src/core/imgui_overlays.cpp +++ b/src/core/imgui_overlays.cpp @@ -30,7 +30,6 @@ #include "IconsFontAwesome5.h" #include "fmt/chrono.h" #include "fmt/format.h" -#include "gsl/span" #include "imgui.h" #include "imgui_internal.h" @@ -39,6 +38,7 @@ #include #include #include +#include #include #if defined(CPU_X64) @@ -64,7 +64,7 @@ namespace SaveStateSelectorUI { static void Draw(); } -static std::tuple GetMinMax(gsl::span values) +static std::tuple GetMinMax(std::span values) { #if defined(CPU_X64) __m128 vmin(_mm_loadu_ps(values.data())); diff --git a/src/util/d3d11_device.h b/src/util/d3d11_device.h index bf696bacc..6a522c206 100644 --- a/src/util/d3d11_device.h +++ b/src/util/d3d11_device.h @@ -68,7 +68,7 @@ public: std::unique_ptr CreateFramebuffer(GPUTexture* rt_or_ds, GPUTexture* ds = nullptr) override; - std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, gsl::span data) override; + std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, std::span data) override; std::unique_ptr CreateShaderFromSource(GPUShaderStage stage, const std::string_view& source, const char* entry_point, DynamicHeapArray* binary) override; std::unique_ptr CreatePipeline(const GPUPipeline::GraphicsConfig& config) override; diff --git a/src/util/d3d11_pipeline.cpp b/src/util/d3d11_pipeline.cpp index c115366c3..299f3c50c 100644 --- a/src/util/d3d11_pipeline.cpp +++ b/src/util/d3d11_pipeline.cpp @@ -51,7 +51,7 @@ void D3D11Shader::SetDebugName(const std::string_view& name) SetD3DDebugObjectName(m_shader.Get(), name); } -std::unique_ptr D3D11Device::CreateShaderFromBinary(GPUShaderStage stage, gsl::span data) +std::unique_ptr D3D11Device::CreateShaderFromBinary(GPUShaderStage stage, std::span data) { ComPtr shader; std::vector bytecode; diff --git a/src/util/d3d12_device.h b/src/util/d3d12_device.h index 2b5651b3e..591fb342d 100644 --- a/src/util/d3d12_device.h +++ b/src/util/d3d12_device.h @@ -88,7 +88,7 @@ public: std::unique_ptr CreateFramebuffer(GPUTexture* rt_or_ds, GPUTexture* ds = nullptr) override; - std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, gsl::span data) override; + std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, std::span data) override; std::unique_ptr CreateShaderFromSource(GPUShaderStage stage, const std::string_view& source, const char* entry_point, DynamicHeapArray* out_binary) override; std::unique_ptr CreatePipeline(const GPUPipeline::GraphicsConfig& config) override; diff --git a/src/util/d3d12_pipeline.cpp b/src/util/d3d12_pipeline.cpp index 47c188a5f..f5ba720a4 100644 --- a/src/util/d3d12_pipeline.cpp +++ b/src/util/d3d12_pipeline.cpp @@ -25,7 +25,7 @@ void D3D12Shader::SetDebugName(const std::string_view& name) { } -std::unique_ptr D3D12Device::CreateShaderFromBinary(GPUShaderStage stage, gsl::span data) +std::unique_ptr D3D12Device::CreateShaderFromBinary(GPUShaderStage stage, std::span data) { // Can't do much at this point. std::vector bytecode(data.begin(), data.end()); diff --git a/src/util/gpu_device.h b/src/util/gpu_device.h index 8bd633487..55bf8e5df 100644 --- a/src/util/gpu_device.h +++ b/src/util/gpu_device.h @@ -12,10 +12,9 @@ #include "common/rectangle.h" #include "common/types.h" -#include "gsl/span" - #include #include +#include #include #include #include @@ -231,7 +230,7 @@ public: struct InputLayout { - gsl::span vertex_attributes; + std::span vertex_attributes; u32 vertex_stride; bool operator==(const InputLayout& rhs) const; @@ -634,7 +633,7 @@ protected: virtual bool ReadPipelineCache(const std::string& filename); virtual bool GetPipelineCacheData(DynamicHeapArray* data); - virtual std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, gsl::span data) = 0; + virtual std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, std::span data) = 0; virtual std::unique_ptr CreateShaderFromSource(GPUShaderStage stage, const std::string_view& source, const char* entry_point, DynamicHeapArray* out_binary) = 0; diff --git a/src/util/metal_device.h b/src/util/metal_device.h index 0f6de6815..50f6f50cb 100644 --- a/src/util/metal_device.h +++ b/src/util/metal_device.h @@ -224,7 +224,7 @@ public: std::unique_ptr CreateFramebuffer(GPUTexture* rt_or_ds, GPUTexture* ds = nullptr) override; - std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, gsl::span data) override; + std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, std::span data) override; std::unique_ptr CreateShaderFromSource(GPUShaderStage stage, const std::string_view& source, const char* entry_point, DynamicHeapArray* out_binary = nullptr) override; diff --git a/src/util/metal_device.mm b/src/util/metal_device.mm index 9ab6fbaa4..f5a044539 100644 --- a/src/util/metal_device.mm +++ b/src/util/metal_device.mm @@ -637,7 +637,7 @@ std::unique_ptr MetalDevice::CreateShaderFromMSL(GPUShaderStage stage } } -std::unique_ptr MetalDevice::CreateShaderFromBinary(GPUShaderStage stage, gsl::span data) +std::unique_ptr MetalDevice::CreateShaderFromBinary(GPUShaderStage stage, std::span data) { const std::string_view str_data(reinterpret_cast(data.data()), data.size()); return CreateShaderFromMSL(stage, str_data, "main0"); diff --git a/src/util/opengl_device.h b/src/util/opengl_device.h index de7f0bb12..960a30706 100644 --- a/src/util/opengl_device.h +++ b/src/util/opengl_device.h @@ -68,7 +68,7 @@ public: std::unique_ptr CreateFramebuffer(GPUTexture* rt_or_ds, GPUTexture* ds = nullptr) override; - std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, gsl::span data) override; + std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, std::span data) override; std::unique_ptr CreateShaderFromSource(GPUShaderStage stage, const std::string_view& source, const char* entry_point, DynamicHeapArray* out_binary) override; std::unique_ptr CreatePipeline(const GPUPipeline::GraphicsConfig& config) override; @@ -111,7 +111,7 @@ public: void UnrefProgram(const OpenGLPipeline::ProgramCacheKey& key); GLuint LookupVAOCache(const OpenGLPipeline::VertexArrayCacheKey& key); - GLuint CreateVAO(gsl::span attributes, u32 stride); + GLuint CreateVAO(std::span attributes, u32 stride); void UnrefVAO(const OpenGLPipeline::VertexArrayCacheKey& key); void SetActiveTexture(u32 slot); diff --git a/src/util/opengl_pipeline.cpp b/src/util/opengl_pipeline.cpp index 995e877ff..3aaed538e 100644 --- a/src/util/opengl_pipeline.cpp +++ b/src/util/opengl_pipeline.cpp @@ -168,7 +168,7 @@ bool OpenGLShader::Compile() return true; } -std::unique_ptr OpenGLDevice::CreateShaderFromBinary(GPUShaderStage stage, gsl::span data) +std::unique_ptr OpenGLDevice::CreateShaderFromBinary(GPUShaderStage stage, std::span data) { // Not supported.. except spir-v maybe? but no point really... return {}; @@ -455,7 +455,7 @@ GLuint OpenGLDevice::LookupVAOCache(const OpenGLPipeline::VertexArrayCacheKey& k OpenGLPipeline::VertexArrayCacheItem item; item.vao_id = - CreateVAO(gsl::span(key.vertex_attributes, key.num_vertex_attributes), + CreateVAO(std::span(key.vertex_attributes, key.num_vertex_attributes), key.vertex_attribute_stride); if (item.vao_id == 0) return 0; @@ -465,7 +465,7 @@ GLuint OpenGLDevice::LookupVAOCache(const OpenGLPipeline::VertexArrayCacheKey& k return item.vao_id; } -GLuint OpenGLDevice::CreateVAO(gsl::span attributes, u32 stride) +GLuint OpenGLDevice::CreateVAO(std::span attributes, u32 stride) { glGetError(); GLuint vao; diff --git a/src/util/pch.h b/src/util/pch.h index 43c2fc050..4d1f0bb5f 100644 --- a/src/util/pch.h +++ b/src/util/pch.h @@ -6,7 +6,6 @@ #include "common/types.h" #include "fmt/format.h" -#include "gsl/span" #include #include @@ -18,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/src/util/spirv_compiler.cpp b/src/util/spirv_compiler.cpp index 198685483..56e120685 100644 --- a/src/util/spirv_compiler.cpp +++ b/src/util/spirv_compiler.cpp @@ -173,7 +173,7 @@ std::optional SPIRVCompiler::CompileShader(GPUSh #ifdef __APPLE__ -std::optional SPIRVCompiler::CompileSPIRVToMSL(gsl::span spv) +std::optional SPIRVCompiler::CompileSPIRVToMSL(std::span spv) { spirv_cross::CompilerMSL compiler(spv.data(), spv.size()); std::string msl = compiler.compile(); diff --git a/src/util/spirv_compiler.h b/src/util/spirv_compiler.h index 01e71f2ae..1e4885421 100644 --- a/src/util/spirv_compiler.h +++ b/src/util/spirv_compiler.h @@ -5,9 +5,8 @@ #include "common/types.h" -#include "gsl/span" - #include +#include #include #include #include @@ -43,7 +42,7 @@ std::optional CompileShader(GPUShaderStage stage, std::string_v #ifdef __APPLE__ // Converts a SPIR-V shader into MSL. -std::optional CompileSPIRVToMSL(gsl::span spv); +std::optional CompileSPIRVToMSL(std::span spv); #endif diff --git a/src/util/vulkan_device.h b/src/util/vulkan_device.h index c72e0fba4..850969360 100644 --- a/src/util/vulkan_device.h +++ b/src/util/vulkan_device.h @@ -89,7 +89,7 @@ public: std::unique_ptr CreateFramebuffer(GPUTexture* rt_or_ds, GPUTexture* ds = nullptr) override; - std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, gsl::span data) override; + std::unique_ptr CreateShaderFromBinary(GPUShaderStage stage, std::span data) override; std::unique_ptr CreateShaderFromSource(GPUShaderStage stage, const std::string_view& source, const char* entry_point, DynamicHeapArray* out_binary) override; std::unique_ptr CreatePipeline(const GPUPipeline::GraphicsConfig& config) override; diff --git a/src/util/vulkan_pipeline.cpp b/src/util/vulkan_pipeline.cpp index 610ad9991..e5ee2996a 100644 --- a/src/util/vulkan_pipeline.cpp +++ b/src/util/vulkan_pipeline.cpp @@ -25,7 +25,7 @@ void VulkanShader::SetDebugName(const std::string_view& name) Vulkan::SetObjectName(VulkanDevice::GetInstance().GetVulkanDevice(), m_module, name); } -std::unique_ptr VulkanDevice::CreateShaderFromBinary(GPUShaderStage stage, gsl::span data) +std::unique_ptr VulkanDevice::CreateShaderFromBinary(GPUShaderStage stage, std::span data) { VkShaderModule mod; @@ -67,7 +67,7 @@ std::unique_ptr VulkanDevice::CreateShaderFromSource(GPUShaderStage s std::memcpy(out_binary->data(), spirv->data(), spirv_size); } - return CreateShaderFromBinary(stage, gsl::span(reinterpret_cast(spirv->data()), spirv_size)); + return CreateShaderFromBinary(stage, std::span(reinterpret_cast(spirv->data()), spirv_size)); } //////////////////////////////////////////////////////////////////////////