|
|
#1 | |
|
Registered User
Join Date: Jan 2012
Posts: 3
|
Using: OpenGL 4.2, GLSL #version 420, GeForce GT 430, driver 295.20, Linux 64 bit
precision loss occur then converting double precision float to integer or integer to double precision float only 24 most significant bits are kept. This give precision loss: (unsigned integer to double) Code:
uint uvalue;
double dvalue;
dvalue = double(uvalue);
(double to unsigned integer) Code:
uint uvalue;
double dvalue;
uvalue = uint(dvalue);
(unsigned integer to double) Code:
uint uvalue;
double dvalue;
dvalue = double(uvalue&0xFFFF0000U) + double(uvalue&0x0000FFFFU);
(double to unsigned integer) Code:
uint uvalue;
double dvalue;
dvalue = floor(dvalue);
uvalue = (uint(floor(dvalue / 65536.0lf))<<16U) | uint(mod(dvalue, 65536.0lf));
Is this a driver bug or normal behaviour? (like an int to float to double or double to float to int conversion) thanks |
|
|
|
|
|
|
#2 | |
|
NVIDIA Corporation
Join Date: Sep 2007
Posts: 254
|
Hi glUser,
Thanks for the bug report; can you please attach a minimal testcase that demonstrates the issue so that I can take a closer look? Thanks, - Pierre-Loup |
|
|
|
|
![]() |
| Thread Tools | |
|
|