mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 00:47:13 +00:00
Add 1- and 2-component texture formats.
Implemented {uint8, unorm8} x {r, rg} texture formats.
Backend support added for Metal, D3D12 and OpenGL.
This commit is contained in:
committed by
Corentin Wallez
parent
8d742d1375
commit
cd4f8a2e2f
@@ -36,8 +36,16 @@ namespace backend { namespace opengl {
|
||||
switch (format) {
|
||||
case nxt::TextureFormat::R8G8B8A8Unorm:
|
||||
return {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE};
|
||||
case nxt::TextureFormat::R8G8Unorm:
|
||||
return {GL_RG8, GL_RG, GL_UNSIGNED_BYTE};
|
||||
case nxt::TextureFormat::R8Unorm:
|
||||
return {GL_R8, GL_RED, GL_UNSIGNED_BYTE};
|
||||
case nxt::TextureFormat::R8G8B8A8Uint:
|
||||
return {GL_RGBA8UI, GL_RGBA, GL_UNSIGNED_INT};
|
||||
case nxt::TextureFormat::R8G8Uint:
|
||||
return {GL_RG8UI, GL_RG, GL_UNSIGNED_INT};
|
||||
case nxt::TextureFormat::R8Uint:
|
||||
return {GL_R8UI, GL_RED, GL_UNSIGNED_INT};
|
||||
case nxt::TextureFormat::B8G8R8A8Unorm:
|
||||
// This doesn't have an enum for the internal format in OpenGL, so use RGBA8.
|
||||
return {GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE};
|
||||
|
||||
Reference in New Issue
Block a user