fix: restore backpack material import output
This commit is contained in:
@@ -138,6 +138,7 @@ inline DXGI_FORMAT ToD3D12(Format format) {
|
||||
case Format::R8_UNorm: return DXGI_FORMAT_R8_UNORM;
|
||||
case Format::R8G8_UNorm: return DXGI_FORMAT_R8G8_UNORM;
|
||||
case Format::R8G8B8A8_UNorm: return DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
case Format::R8G8B8A8_SRGB: return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
|
||||
case Format::R16_UInt: return DXGI_FORMAT_R16_UINT;
|
||||
case Format::R16G16B16A16_Float: return DXGI_FORMAT_R16G16B16A16_FLOAT;
|
||||
case Format::R32G32B32A32_Float: return DXGI_FORMAT_R32G32B32A32_FLOAT;
|
||||
@@ -167,6 +168,7 @@ inline Format FromD3D12(DXGI_FORMAT format) {
|
||||
case DXGI_FORMAT_R8_UNORM: return Format::R8_UNorm;
|
||||
case DXGI_FORMAT_R8G8_UNORM: return Format::R8G8_UNorm;
|
||||
case DXGI_FORMAT_R8G8B8A8_UNORM: return Format::R8G8B8A8_UNorm;
|
||||
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: return Format::R8G8B8A8_SRGB;
|
||||
case DXGI_FORMAT_R16_UINT: return Format::R16_UInt;
|
||||
case DXGI_FORMAT_R16G16B16A16_FLOAT: return Format::R16G16B16A16_Float;
|
||||
case DXGI_FORMAT_R32G32B32A32_FLOAT: return Format::R32G32B32A32_Float;
|
||||
|
||||
@@ -132,6 +132,9 @@ inline void ToOpenGLFormat(OpenGLFormat fmt, GLint& internalFormat, GLenum& glFo
|
||||
case OpenGLFormat::RGBA8:
|
||||
internalFormat = GL_RGBA8; glFormat = GL_RGBA; glType = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case OpenGLFormat::RGBA8_SRGB:
|
||||
internalFormat = GL_SRGB8_ALPHA8; glFormat = GL_RGBA; glType = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case OpenGLFormat::RGBA16F:
|
||||
internalFormat = GL_RGBA16F; glFormat = GL_RGBA; glType = GL_HALF_FLOAT;
|
||||
break;
|
||||
|
||||
@@ -27,7 +27,8 @@ enum class OpenGLFormat {
|
||||
Depth24Stencil8,
|
||||
Depth32F,
|
||||
CompressedDXT1,
|
||||
CompressedDXT5
|
||||
CompressedDXT5,
|
||||
RGBA8_SRGB
|
||||
};
|
||||
|
||||
enum class OpenGLInternalFormat {
|
||||
@@ -40,7 +41,8 @@ enum class OpenGLInternalFormat {
|
||||
Depth24Stencil8 = 38,
|
||||
Depth32F = 31,
|
||||
CompressedDXT1 = 21,
|
||||
CompressedDXT5 = 22
|
||||
CompressedDXT5 = 22,
|
||||
RGBA8_SRGB = 39
|
||||
};
|
||||
|
||||
class OpenGLTexture : public RHITexture {
|
||||
|
||||
@@ -317,7 +317,8 @@ enum class Format : uint32_t {
|
||||
R32G32B32A32_UInt,
|
||||
R32_UInt,
|
||||
R32G32_Float,
|
||||
R32G32B32_Float
|
||||
R32G32B32_Float,
|
||||
R8G8B8A8_SRGB
|
||||
};
|
||||
|
||||
enum class ResourceStates : uint32_t {
|
||||
|
||||
@@ -77,6 +77,8 @@ inline VkFormat ToVulkanFormat(Format format) {
|
||||
return VK_FORMAT_R8G8_UNORM;
|
||||
case Format::R8G8B8A8_UNorm:
|
||||
return VK_FORMAT_R8G8B8A8_UNORM;
|
||||
case Format::R8G8B8A8_SRGB:
|
||||
return VK_FORMAT_R8G8B8A8_SRGB;
|
||||
case Format::R16_UInt:
|
||||
return VK_FORMAT_R16_UINT;
|
||||
case Format::R16_Float:
|
||||
@@ -107,6 +109,7 @@ inline uint32_t GetFormatSize(Format format) {
|
||||
case Format::R8G8_UNorm:
|
||||
return 2;
|
||||
case Format::R8G8B8A8_UNorm:
|
||||
case Format::R8G8B8A8_SRGB:
|
||||
return 4;
|
||||
case Format::R16_UInt:
|
||||
case Format::R16_Float:
|
||||
@@ -136,6 +139,9 @@ inline Format ToRHIFormat(VkFormat format) {
|
||||
case VK_FORMAT_R8G8B8A8_UNORM:
|
||||
case VK_FORMAT_B8G8R8A8_UNORM:
|
||||
return Format::R8G8B8A8_UNorm;
|
||||
case VK_FORMAT_R8G8B8A8_SRGB:
|
||||
case VK_FORMAT_B8G8R8A8_SRGB:
|
||||
return Format::R8G8B8A8_SRGB;
|
||||
case VK_FORMAT_R16_UINT:
|
||||
return Format::R16_UInt;
|
||||
case VK_FORMAT_R16_SFLOAT:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEngine/Core/Asset/ImportSettings.h>
|
||||
#include <XCEngine/Core/IO/IResourceLoader.h>
|
||||
#include "Texture.h"
|
||||
|
||||
@@ -15,7 +16,11 @@ public:
|
||||
Containers::Array<Containers::String> GetSupportedExtensions() const override;
|
||||
bool CanLoad(const Containers::String& path) const override;
|
||||
LoadResult Load(const Containers::String& path, const ImportSettings* settings = nullptr) override;
|
||||
LoadResult LoadFromMemory(const Containers::String& path, const void* data, size_t dataSize) const;
|
||||
LoadResult LoadFromMemory(
|
||||
const Containers::String& path,
|
||||
const void* data,
|
||||
size_t dataSize,
|
||||
const ImportSettings* settings = nullptr) const;
|
||||
ImportSettings* GetDefaultSettings() const override;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user