mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-10-22 16:09:06 +00:00
VideoCommon: add TextureAndSamplerAsset, this asset contains both the raw texture data and data about how the texture should be sampled
This commit is contained in:
parent
90a137ffdc
commit
4489ea0ec2
5 changed files with 55 additions and 39 deletions
|
@ -298,8 +298,8 @@ CustomAssetLibrary::LoadInfo DirectFilesystemAssetLibrary::LoadTexture(const Ass
|
|||
return {};
|
||||
}
|
||||
|
||||
if (!LoadTextureDataFromFile(asset_id, texture_path->second,
|
||||
TextureAndSamplerData::Type::Type_Texture2D, data))
|
||||
if (!LoadTextureDataFromFile(asset_id, texture_path->second, AbstractTextureType::Texture_2D,
|
||||
data))
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
@ -370,16 +370,16 @@ CustomAssetLibrary::LoadInfo DirectFilesystemAssetLibrary::LoadTexture(const Ass
|
|||
}
|
||||
else
|
||||
{
|
||||
data->m_sampler = RenderState::GetLinearSamplerState();
|
||||
data->m_type = TextureAndSamplerData::Type::Type_Texture2D;
|
||||
data->sampler = RenderState::GetLinearSamplerState();
|
||||
data->type = AbstractTextureType::Texture_2D;
|
||||
}
|
||||
|
||||
if (!LoadTextureDataFromFile(asset_id, texture_path->second, data->m_type, &data->m_texture))
|
||||
if (!LoadTextureDataFromFile(asset_id, texture_path->second, data->type, &data->texture_data))
|
||||
return {};
|
||||
if (!PurgeInvalidMipsFromTextureData(asset_id, &data->m_texture))
|
||||
if (!PurgeInvalidMipsFromTextureData(asset_id, &data->texture_data))
|
||||
return {};
|
||||
|
||||
return LoadInfo{GetAssetSize(data->m_texture) + metadata_size};
|
||||
return LoadInfo{GetAssetSize(data->texture_data) + metadata_size};
|
||||
}
|
||||
|
||||
void DirectFilesystemAssetLibrary::SetAssetIDMapData(const AssetID& asset_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue