Skip to content

Commit

Permalink
vk: Fix fconvert job issues
Browse files Browse the repository at this point in the history
- Fix compilation bug caused by typo
- Invert to/from for consistent declarations
- Fix dst_swap when From == 2
  • Loading branch information
kd-11 committed Sep 7, 2020
1 parent 220e86b commit 85dd1b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions rpcs3/Emu/RSX/VK/VKCompute.h
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ namespace vk
}
};

template<typename To, typename From, bool _SwapSrc = false, bool _SwapDst = false>
template<typename From, typename To, bool _SwapSrc = false, bool _SwapDst = false>
struct cs_fconvert_task : cs_shuffle_base
{
u32 m_ssbo_length = 0;
Expand Down Expand Up @@ -629,7 +629,7 @@ namespace vk
" uint out_offset = params[0].z >> 2;\n"
" uvec4 tmp;\n";

work_kernel +=
work_kernel =
" if (index >= block_length)\n"
" return;\n";

Expand All @@ -651,7 +651,7 @@ namespace vk
}

// Convert
work_kernel += " tmp.z = pack_e4m12_pack16(tmp);\n";
work_kernel += " tmp.z = pack_e4m12_pack16(tmp.xy);\n";

if constexpr (_SwapDst)
{
Expand Down Expand Up @@ -681,7 +681,7 @@ namespace vk

if constexpr (_SwapDst)
{
work_kernel += " tmp.yz = bswap_u16(tmp.yz);\n";
work_kernel += " tmp.yz = bswap_u32(tmp.yz);\n";
}

work_kernel +=
Expand Down
6 changes: 3 additions & 3 deletions rpcs3/Emu/RSX/VK/VKTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ namespace vk
// 3. Do conversion with byteswap [D32->D16F]
if (!swap_bytes) [[likely]]
{
auto job = vk::get_compute_task<vk::cs_fconvert_task<u16, u32>>();
auto job = vk::get_compute_task<vk::cs_fconvert_task<f32, f16>>();
job->run(cmd, dst, z32_offset, packed32_length, data_offset);
}
else
{
auto job = vk::get_compute_task<vk::cs_fconvert_task<u16, u32, false, true>>();
auto job = vk::get_compute_task<vk::cs_fconvert_task<f32, f16, false, true>>();
job->run(cmd, dst, z32_offset, packed32_length, data_offset);
}

Expand Down Expand Up @@ -237,7 +237,7 @@ namespace vk
VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT);

// 2. Do conversion with byteswap [D16F->D32F]
auto job = vk::get_compute_task<vk::cs_fconvert_task<u32, u16>>();
auto job = vk::get_compute_task<vk::cs_fconvert_task<f16, f32>>();
job->run(cmd, src, data_offset, packed16_length, z32_offset);

// 4. Post-compute barrier
Expand Down

0 comments on commit 85dd1b4

Please sign in to comment.