GPUDevice: Don't recreate device on SW switch in GLES:

This commit is contained in:
Stenzek
2023-09-23 13:40:51 +10:00
parent 2a5b3aa695
commit 9517638bcb
3 changed files with 14 additions and 6 deletions

View File

@ -108,10 +108,9 @@ bool GPUPipeline::InputLayout::operator==(const InputLayout& rhs) const
bool GPUPipeline::InputLayout::operator!=(const InputLayout& rhs) const
{
return (vertex_stride != rhs.vertex_stride ||
vertex_attributes.size() != rhs.vertex_attributes.size() ||
std::memcmp(vertex_attributes.data(), rhs.vertex_attributes.data(),
sizeof(VertexAttribute) * rhs.vertex_attributes.size()) != 0);
return (vertex_stride != rhs.vertex_stride || vertex_attributes.size() != rhs.vertex_attributes.size() ||
std::memcmp(vertex_attributes.data(), rhs.vertex_attributes.data(),
sizeof(VertexAttribute) * rhs.vertex_attributes.size()) != 0);
}
GPUPipeline::RasterizationState GPUPipeline::RasterizationState::GetNoCullState()
@ -199,7 +198,6 @@ RenderAPI GPUDevice::GetPreferredAPI()
const char* GPUDevice::RenderAPIToString(RenderAPI api)
{
// TODO: Combine ES
switch (api)
{
// clang-format off
@ -218,6 +216,12 @@ const char* GPUDevice::RenderAPIToString(RenderAPI api)
}
}
bool GPUDevice::IsSameRenderAPI(RenderAPI lhs, RenderAPI rhs)
{
return (lhs == rhs || ((lhs == RenderAPI::OpenGL || lhs == RenderAPI::OpenGLES) &&
(rhs == RenderAPI::OpenGL || rhs == RenderAPI::OpenGLES)));
}
bool GPUDevice::Create(const std::string_view& adapter, const std::string_view& shader_cache_path,
u32 shader_cache_version, bool debug_device, bool vsync, bool threaded_presentation)
{