Skip to content

Commit

Permalink
Fixed rounding bug
Browse files Browse the repository at this point in the history
  • Loading branch information
elasota committed Mar 14, 2018
1 parent 2184f4a commit 43f48f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DirectXTex/Shaders/BC7EncodeCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ uint4 quantize_p( uint4 color, uint uPrec, uint P )

float4 reranged_color = float4(color) * max_quantized / float(max_color);

return (uint4(clamp(round(reranged_color + 0.5), 0.0, max_quantized)) << 1) | P;
return (uint4(clamp(round(reranged_color), 0.0, max_quantized)) << 1) | P;
}
#else

Expand Down

0 comments on commit 43f48f6

Please sign in to comment.