VideoCommon: update custom pipeline to use a a texture's sampler if the texture is in use

This commit is contained in:
iwubcode 2024-05-31 23:19:51 -05:00
parent 46a89936ae
commit 11c37de695

View File

@ -306,7 +306,7 @@ void CustomPipeline::UpdatePixelData(
if (texture_asset->m_texture)
{
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
{
@ -336,6 +336,8 @@ void CustomPipeline::UpdatePixelData(
first_slice.m_levels[0].format, 0, texture_type);
texture_asset->m_texture = g_gfx->CreateTexture(
texture_config, fmt::format("Custom shader texture '{}'", property.m_code_name));
if (texture_asset->m_texture)
{
for (std::size_t slice_index = 0; slice_index < texture_data->m_texture.m_slices.size();
slice_index++)
{
@ -345,8 +347,9 @@ void CustomPipeline::UpdatePixelData(
{
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));
level.row_length, level.data.data(),
level.data.size(), static_cast<u32>(slice_index));
}
}
}
}