mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 11:40:14 +02:00
Fix BC6H GPU compressor handling of negative pixel values (#328)
This commit is contained in:
parent
a4df1415f8
commit
93182cac68
@ -173,6 +173,7 @@ void TryModeG10CS(uint GI : SV_GroupIndex, uint3 groupID : SV_GroupID)
|
||||
if (threadInBlock < 16)
|
||||
{
|
||||
shared_temp[GI].pixel = g_Input.Load(uint3(base_x + threadInBlock % 4, base_y + threadInBlock / 4, 0)).rgb;
|
||||
shared_temp[GI].pixel = max(shared_temp[GI].pixel, float3(0,0,0));
|
||||
uint3 pixel_h = float2half(shared_temp[GI].pixel);
|
||||
shared_temp[GI].pixel_hr = half2float(pixel_h);
|
||||
shared_temp[GI].pixel_lum = dot(shared_temp[GI].pixel_hr, RGB2LUM);
|
||||
@ -379,6 +380,7 @@ void TryModeLE10CS(uint GI : SV_GroupIndex, uint3 groupID : SV_GroupID)
|
||||
if (threadInBlock < 16)
|
||||
{
|
||||
shared_temp[GI].pixel = g_Input.Load(uint3(base_x + threadInBlock % 4, base_y + threadInBlock / 4, 0)).rgb;
|
||||
shared_temp[GI].pixel = max(shared_temp[GI].pixel, float3(0,0,0));
|
||||
uint3 pixel_h = float2half(shared_temp[GI].pixel);
|
||||
shared_temp[GI].pixel_hr = half2float(pixel_h);
|
||||
shared_temp[GI].pixel_lum = dot(shared_temp[GI].pixel_hr, RGB2LUM);
|
||||
@ -603,6 +605,7 @@ void EncodeBlockCS(uint GI : SV_GroupIndex, uint3 groupID : SV_GroupID)
|
||||
if (threadInBlock < 16)
|
||||
{
|
||||
shared_temp[GI].pixel = g_Input.Load(uint3(base_x + threadInBlock % 4, base_y + threadInBlock / 4, 0)).rgb;
|
||||
shared_temp[GI].pixel = max(shared_temp[GI].pixel, float3(0,0,0));
|
||||
shared_temp[GI].pixel_lum = dot(shared_temp[GI].pixel, RGB2LUM);
|
||||
uint3 pixel_h = float2half(shared_temp[GI].pixel);
|
||||
shared_temp[GI].pixel_ph = start_quantize(pixel_h);
|
||||
|
Loading…
x
Reference in New Issue
Block a user