Renderer: Improve texture view support (and support emulation for OGL)
This commit is contained in:
committed by
Jérôme Leclercq
parent
08ea4c87a7
commit
56acbb2694
@@ -37,13 +37,32 @@ namespace Nz
|
||||
NazaraAssert(params.IsValid(), "Invalid TextureParams");
|
||||
|
||||
Nz::TextureInfo texParams;
|
||||
texParams.depth = image.GetDepth();
|
||||
texParams.height = image.GetHeight();
|
||||
texParams.pixelFormat = image.GetFormat();
|
||||
texParams.type = image.GetType();
|
||||
texParams.width = image.GetWidth();
|
||||
texParams.usageFlags = params.usageFlags;
|
||||
|
||||
switch (image.GetType())
|
||||
{
|
||||
case ImageType::E1D:
|
||||
case ImageType::E2D:
|
||||
case ImageType::E3D:
|
||||
break;
|
||||
|
||||
case ImageType::E1D_Array:
|
||||
texParams.layerCount = image.GetHeight();
|
||||
break;
|
||||
|
||||
case ImageType::E2D_Array:
|
||||
texParams.layerCount = image.GetDepth();
|
||||
break;
|
||||
|
||||
case ImageType::Cubemap:
|
||||
texParams.layerCount = 6;
|
||||
break;
|
||||
}
|
||||
|
||||
std::shared_ptr<Texture> texture = params.renderDevice->InstantiateTexture(texParams);
|
||||
if (!texture->Update(image.GetConstPixels()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user