Merge pull request #12819 from iwubcode/texture_asset_sampler_in_pipeline
VideoCommon: update custom pipeline to use a texture's sampler instead of linear sampler if the texture is used
This commit is contained in:
commit
71171a9e4d
|
@ -306,7 +306,7 @@ void CustomPipeline::UpdatePixelData(
|
||||||
if (texture_asset->m_texture)
|
if (texture_asset->m_texture)
|
||||||
{
|
{
|
||||||
g_gfx->SetTexture(sampler_index, texture_asset->m_texture.get());
|
g_gfx->SetTexture(sampler_index, texture_asset->m_texture.get());
|
||||||
g_gfx->SetSamplerState(sampler_index, RenderState::GetLinearSamplerState());
|
g_gfx->SetSamplerState(sampler_index, texture_data->m_sampler);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -336,17 +336,20 @@ void CustomPipeline::UpdatePixelData(
|
||||||
first_slice.m_levels[0].format, 0, texture_type);
|
first_slice.m_levels[0].format, 0, texture_type);
|
||||||
texture_asset->m_texture = g_gfx->CreateTexture(
|
texture_asset->m_texture = g_gfx->CreateTexture(
|
||||||
texture_config, fmt::format("Custom shader texture '{}'", property.m_code_name));
|
texture_config, fmt::format("Custom shader texture '{}'", property.m_code_name));
|
||||||
for (std::size_t slice_index = 0; slice_index < texture_data->m_texture.m_slices.size();
|
if (texture_asset->m_texture)
|
||||||
slice_index++)
|
|
||||||
{
|
{
|
||||||
auto& slice = texture_data->m_texture.m_slices[slice_index];
|
for (std::size_t slice_index = 0; slice_index < texture_data->m_texture.m_slices.size();
|
||||||
for (u32 level_index = 0; level_index < static_cast<u32>(slice.m_levels.size());
|
slice_index++)
|
||||||
++level_index)
|
|
||||||
{
|
{
|
||||||
auto& level = slice.m_levels[level_index];
|
auto& slice = texture_data->m_texture.m_slices[slice_index];
|
||||||
texture_asset->m_texture->Load(level_index, level.width, level.height,
|
for (u32 level_index = 0; level_index < static_cast<u32>(slice.m_levels.size());
|
||||||
level.row_length, level.data.data(), level.data.size(),
|
++level_index)
|
||||||
static_cast<u32>(slice_index));
|
{
|
||||||
|
auto& level = slice.m_levels[level_index];
|
||||||
|
texture_asset->m_texture->Load(level_index, level.width, level.height,
|
||||||
|
level.row_length, level.data.data(),
|
||||||
|
level.data.size(), static_cast<u32>(slice_index));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue