KhronosGroup / OpenGL-Registry

OpenGL, OpenGL ES, and OpenGL ES-SC API and Extension Registry
677 stars 274 forks source link

EXT_texture_shared_exponent spec incorrect? #583

Closed greggman closed 1 year ago

greggman commented 1 year ago

According to the spec here

The components red_s, green_s, blue_s, and exp_shared values (see section 3.8.1) are treated as unsigned integers and are converted to red, green, blue as follows:

  red   = red_s   * 2^(exp_shared - B)
  green = green_s * 2^(exp_shared - B)
  blue  = blue_s  * 2^(exp_shared - B)"

I think that's supposed to be

  red   = red_s   * 2^(exp_shared - B - N)
  green = green_s * 2^(exp_shared - B - N)
  blue  = blue_s  * 2^(exp_shared - B - N)"

otherwise the math doesn't seem to work out

pdaniell-nv commented 1 year ago

I think you're correct that it's wrong in the extension spec. It appears to be correct in the latest core specs. It appears to have been fixed in OpenGL 4.3. Often fixes like this to core specs are not reflected back to the original extension spec, as is the case here. If you would like to see this fixed in the extension spec please feel free to make a PR.

FWIW the internal bug that generated the spec fix is https://www.khronos.org/members/login/bugzilla/show_bug.cgi?id=9486.