mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 10:40:11 +01:00
tgsi: added debugging code to catch divide by zero
This commit is contained in:
parent
9ca6cf0f54
commit
f8d824e09a
1 changed files with 12 additions and 0 deletions
|
|
@ -264,6 +264,12 @@ static void
|
|||
micro_rcp(union tgsi_exec_channel *dst,
|
||||
const union tgsi_exec_channel *src)
|
||||
{
|
||||
#if 0 /* for debugging */
|
||||
assert(src->f[0] != 0.0f);
|
||||
assert(src->f[1] != 0.0f);
|
||||
assert(src->f[2] != 0.0f);
|
||||
assert(src->f[3] != 0.0f);
|
||||
#endif
|
||||
dst->f[0] = 1.0f / src->f[0];
|
||||
dst->f[1] = 1.0f / src->f[1];
|
||||
dst->f[2] = 1.0f / src->f[2];
|
||||
|
|
@ -284,6 +290,12 @@ static void
|
|||
micro_rsq(union tgsi_exec_channel *dst,
|
||||
const union tgsi_exec_channel *src)
|
||||
{
|
||||
#if 0 /* for debugging */
|
||||
assert(src->f[0] != 0.0f);
|
||||
assert(src->f[1] != 0.0f);
|
||||
assert(src->f[2] != 0.0f);
|
||||
assert(src->f[3] != 0.0f);
|
||||
#endif
|
||||
dst->f[0] = 1.0f / sqrtf(fabsf(src->f[0]));
|
||||
dst->f[1] = 1.0f / sqrtf(fabsf(src->f[1]));
|
||||
dst->f[2] = 1.0f / sqrtf(fabsf(src->f[2]));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue