Add TextureFormat::B8G8R8A8Unorm
This commit is contained in:
parent
2e31e8f0bf
commit
e862a33dac
|
@ -1190,7 +1190,8 @@
|
||||||
"values": [
|
"values": [
|
||||||
{"value": 0, "name": "r8 g8 b8 a8 unorm"},
|
{"value": 0, "name": "r8 g8 b8 a8 unorm"},
|
||||||
{"value": 1, "name": "r8 g8 b8 a8 uint"},
|
{"value": 1, "name": "r8 g8 b8 a8 uint"},
|
||||||
{"value": 2, "name": "d32 float s8 uint"}
|
{"value": 2, "name": "b8 g8 r8 a8 unorm"},
|
||||||
|
{"value": 3, "name": "d32 float s8 uint"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"vertex format": {
|
"vertex format": {
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace backend {
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||||
|
case nxt::TextureFormat::B8G8R8A8Unorm:
|
||||||
return 4;
|
return 4;
|
||||||
case nxt::TextureFormat::D32FloatS8Uint:
|
case nxt::TextureFormat::D32FloatS8Uint:
|
||||||
return 8;
|
return 8;
|
||||||
|
@ -35,6 +36,7 @@ namespace backend {
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||||
|
case nxt::TextureFormat::B8G8R8A8Unorm:
|
||||||
return false;
|
return false;
|
||||||
case nxt::TextureFormat::D32FloatS8Uint:
|
case nxt::TextureFormat::D32FloatS8Uint:
|
||||||
return true;
|
return true;
|
||||||
|
@ -47,6 +49,7 @@ namespace backend {
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||||
|
case nxt::TextureFormat::B8G8R8A8Unorm:
|
||||||
return false;
|
return false;
|
||||||
case nxt::TextureFormat::D32FloatS8Uint:
|
case nxt::TextureFormat::D32FloatS8Uint:
|
||||||
return true;
|
return true;
|
||||||
|
@ -59,6 +62,7 @@ namespace backend {
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||||
|
case nxt::TextureFormat::B8G8R8A8Unorm:
|
||||||
return false;
|
return false;
|
||||||
case nxt::TextureFormat::D32FloatS8Uint:
|
case nxt::TextureFormat::D32FloatS8Uint:
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -83,6 +83,8 @@ namespace d3d12 {
|
||||||
return DXGI_FORMAT_R8G8B8A8_UNORM;
|
return DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||||
return DXGI_FORMAT_R8G8B8A8_UINT;
|
return DXGI_FORMAT_R8G8B8A8_UINT;
|
||||||
|
case nxt::TextureFormat::B8G8R8A8Unorm:
|
||||||
|
return DXGI_FORMAT_B8G8R8A8_UNORM;
|
||||||
case nxt::TextureFormat::D32FloatS8Uint:
|
case nxt::TextureFormat::D32FloatS8Uint:
|
||||||
return DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
|
return DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -25,6 +25,8 @@ namespace metal {
|
||||||
return MTLPixelFormatRGBA8Unorm;
|
return MTLPixelFormatRGBA8Unorm;
|
||||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||||
return MTLPixelFormatRGBA8Uint;
|
return MTLPixelFormatRGBA8Uint;
|
||||||
|
case nxt::TextureFormat::B8G8R8A8Unorm:
|
||||||
|
return MTLPixelFormatBGRA8Unorm;
|
||||||
case nxt::TextureFormat::D32FloatS8Uint:
|
case nxt::TextureFormat::D32FloatS8Uint:
|
||||||
return MTLPixelFormatDepth32Float_Stencil8;
|
return MTLPixelFormatDepth32Float_Stencil8;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,10 @@ namespace opengl {
|
||||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||||
return {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE};
|
return {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE};
|
||||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||||
return { GL_RGBA8UI, GL_RGBA, GL_UNSIGNED_INT };
|
return {GL_RGBA8UI, GL_RGBA, GL_UNSIGNED_INT};
|
||||||
|
case nxt::TextureFormat::B8G8R8A8Unorm:
|
||||||
|
// This doesn't have an enum for the internal format in OpenGL.
|
||||||
|
return {GL_NONE, GL_BGRA, GL_UNSIGNED_BYTE};
|
||||||
case nxt::TextureFormat::D32FloatS8Uint:
|
case nxt::TextureFormat::D32FloatS8Uint:
|
||||||
return {GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV};
|
return {GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV};
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue