mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-10-12 02:09:17 +00:00
gl/vk: Correctly halve the invocation count when shrinking F32 to F16
This commit is contained in:
@@ -144,12 +144,13 @@ namespace gl
|
||||
" uint out_offset = out_ptr >> 2;\n"
|
||||
" uvec4 tmp;\n";
|
||||
|
||||
work_kernel =
|
||||
" if (index >= block_length)\n"
|
||||
" return;\n";
|
||||
|
||||
if constexpr (sizeof(From) == 4)
|
||||
{
|
||||
// NOTE: We're halving the block size for output
|
||||
work_kernel =
|
||||
" if ((index * 2) >= block_length)\n"
|
||||
" return;\n";
|
||||
|
||||
static_assert(sizeof(To) == 2);
|
||||
declare_f16_contraction();
|
||||
|
||||
@@ -177,6 +178,10 @@ namespace gl
|
||||
}
|
||||
else
|
||||
{
|
||||
work_kernel =
|
||||
" if (index >= block_length)\n"
|
||||
" return;\n";
|
||||
|
||||
static_assert(sizeof(To) == 4);
|
||||
declare_f16_expansion();
|
||||
|
||||
|
||||
@@ -283,12 +283,13 @@ namespace vk
|
||||
" uint out_offset = params[0].z >> 2;\n"
|
||||
" uvec4 tmp;\n";
|
||||
|
||||
work_kernel =
|
||||
" if (index >= block_length)\n"
|
||||
" return;\n";
|
||||
|
||||
if constexpr (sizeof(From) == 4)
|
||||
{
|
||||
// NOTE: We're halving the data on output, so our index is 2x as large
|
||||
work_kernel =
|
||||
" if ((index * 2) >= block_length)\n"
|
||||
" return;\n";
|
||||
|
||||
static_assert(sizeof(To) == 2);
|
||||
declare_f16_contraction();
|
||||
|
||||
@@ -316,6 +317,10 @@ namespace vk
|
||||
}
|
||||
else
|
||||
{
|
||||
work_kernel =
|
||||
" if (index >= block_length)\n"
|
||||
" return;\n";
|
||||
|
||||
static_assert(sizeof(To) == 4);
|
||||
declare_f16_expansion();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user