mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 07:36:15 +00:00
Fix MSVC warnings on enum class switches
This commit is contained in:
committed by
Corentin Wallez
parent
6fb3aebf0c
commit
96acaef95e
@@ -41,6 +41,8 @@ namespace opengl {
|
||||
return GL_UNSIGNED_SHORT;
|
||||
case nxt::IndexFormat::Uint32:
|
||||
return GL_UNSIGNED_INT;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +53,8 @@ namespace opengl {
|
||||
case nxt::VertexFormat::FloatR32G32:
|
||||
case nxt::VertexFormat::FloatR32:
|
||||
return GL_FLOAT;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "backend/opengl/OpenGLBackend.h"
|
||||
#include "backend/opengl/PersistentPipelineStateGL.h"
|
||||
#include "common/Assert.h"
|
||||
|
||||
namespace backend {
|
||||
namespace opengl {
|
||||
@@ -39,6 +40,8 @@ namespace opengl {
|
||||
return GL_EQUAL;
|
||||
case nxt::CompareFunction::Always:
|
||||
return GL_ALWAYS;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +63,8 @@ namespace opengl {
|
||||
return GL_INCR_WRAP;
|
||||
case nxt::StencilOperation::DecrementWrap:
|
||||
return GL_DECR_WRAP;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ namespace opengl {
|
||||
return GL_FRAGMENT_SHADER;
|
||||
case nxt::ShaderStage::Compute:
|
||||
return GL_COMPUTE_SHADER;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "backend/opengl/SamplerGL.h"
|
||||
|
||||
#include "common/Assert.h"
|
||||
|
||||
namespace backend {
|
||||
namespace opengl {
|
||||
|
||||
@@ -24,6 +26,8 @@ namespace opengl {
|
||||
return GL_NEAREST;
|
||||
case nxt::FilterMode::Linear:
|
||||
return GL_LINEAR;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +39,8 @@ namespace opengl {
|
||||
return GL_NEAREST_MIPMAP_NEAREST;
|
||||
case nxt::FilterMode::Linear:
|
||||
return GL_NEAREST_MIPMAP_LINEAR;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
case nxt::FilterMode::Linear:
|
||||
switch (mipMapFilter) {
|
||||
@@ -42,7 +48,11 @@ namespace opengl {
|
||||
return GL_LINEAR_MIPMAP_NEAREST;
|
||||
case nxt::FilterMode::Linear:
|
||||
return GL_LINEAR_MIPMAP_LINEAR;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "backend/opengl/TextureGL.h"
|
||||
|
||||
#include "common/Assert.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
@@ -26,6 +28,8 @@ namespace opengl {
|
||||
switch (dimension) {
|
||||
case nxt::TextureDimension::e2D:
|
||||
return GL_TEXTURE_2D;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +37,8 @@ namespace opengl {
|
||||
switch (format) {
|
||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||
return {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE};
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user