mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +00:00
Add RGBA8Uint texture format
This commit is contained in:
@@ -22,6 +22,7 @@ namespace backend {
|
||||
uint32_t TextureFormatPixelSize(nxt::TextureFormat format) {
|
||||
switch (format) {
|
||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||
return 4;
|
||||
case nxt::TextureFormat::D32FloatS8Uint:
|
||||
return 8;
|
||||
@@ -33,6 +34,7 @@ namespace backend {
|
||||
bool TextureFormatHasDepth(nxt::TextureFormat format) {
|
||||
switch (format) {
|
||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||
return false;
|
||||
case nxt::TextureFormat::D32FloatS8Uint:
|
||||
return true;
|
||||
@@ -44,6 +46,7 @@ namespace backend {
|
||||
bool TextureFormatHasStencil(nxt::TextureFormat format) {
|
||||
switch (format) {
|
||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||
return false;
|
||||
case nxt::TextureFormat::D32FloatS8Uint:
|
||||
return true;
|
||||
|
||||
@@ -81,6 +81,8 @@ namespace d3d12 {
|
||||
switch (format) {
|
||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||
return DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||
return DXGI_FORMAT_R8G8B8A8_UINT;
|
||||
case nxt::TextureFormat::D32FloatS8Uint:
|
||||
return DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
|
||||
default:
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace metal {
|
||||
switch (format) {
|
||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||
return MTLPixelFormatRGBA8Unorm;
|
||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||
return MTLPixelFormatRGBA8Uint;
|
||||
case nxt::TextureFormat::D32FloatS8Uint:
|
||||
return MTLPixelFormatDepth32Float_Stencil8;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user