Add RGBA8Uint texture format
This commit is contained in:
parent
d474c2597a
commit
fb19c3606b
|
@ -1183,7 +1183,8 @@
|
|||
"category": "enum",
|
||||
"values": [
|
||||
{"value": 0, "name": "r8 g8 b8 a8 unorm"},
|
||||
{"value": 1, "name": "d32 float s8 uint"}
|
||||
{"value": 1, "name": "r8 g8 b8 a8 uint"},
|
||||
{"value": 2, "name": "d32 float s8 uint"}
|
||||
]
|
||||
},
|
||||
"vertex format": {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue