mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 23:56:16 +00:00
@@ -23,11 +23,36 @@ namespace backend {
|
||||
switch (format) {
|
||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||
return 4;
|
||||
case nxt::TextureFormat::D32FloatS8Uint:
|
||||
return 8;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
bool TextureFormatHasDepth(nxt::TextureFormat format) {
|
||||
switch (format) {
|
||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||
return false;
|
||||
case nxt::TextureFormat::D32FloatS8Uint:
|
||||
return true;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
bool TextureFormatHasStencil(nxt::TextureFormat format) {
|
||||
switch (format) {
|
||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||
return false;
|
||||
case nxt::TextureFormat::D32FloatS8Uint:
|
||||
return true;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TextureBase
|
||||
|
||||
TextureBase::TextureBase(TextureBuilder* builder)
|
||||
@@ -95,15 +120,6 @@ namespace backend {
|
||||
currentUsage = usage;
|
||||
}
|
||||
|
||||
bool TextureBase::IsDepthFormat(nxt::TextureFormat format) {
|
||||
switch (format) {
|
||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||
return false;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
void TextureBase::TransitionUsage(nxt::TextureUsageBit usage) {
|
||||
if (!IsTransitionPossible(usage)) {
|
||||
device->HandleError("Texture frozen or usage not allowed");
|
||||
|
||||
Reference in New Issue
Block a user