From: Steinar H. Gunderson Date: Sun, 19 Jan 2014 19:42:22 +0000 (+0100) Subject: Store GL_FLOAT FlatInputs as fp32, not fp16. X-Git-Tag: 1.0~79 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=68fd0c4ec98ed00d3ddeb87cfd809372a8b01e4b;hp=a9bd8dc1e30b82bc99a445f80df09488b4f9d1f4 Store GL_FLOAT FlatInputs as fp32, not fp16. There are two primary reasons for this: - GL_FLOAT FlatInput is primarily used for tests, and even more importantly, mostly accuracy tests. ATI's drivers appear to round off fp32 -> fp16 wrong (truncate instead of round), which breaks some of these tests. - In case someone _would_ use GL_FLOAT inputs, they'd probably be updated every frame anyway, so the fp32 -> fp16 conversion step (probably on CPU) will negate any performance benefits by fp16 sampling anyway. --- diff --git a/flat_input.cpp b/flat_input.cpp index 28380f4..cf53034 100644 --- a/flat_input.cpp +++ b/flat_input.cpp @@ -39,7 +39,7 @@ void FlatInput::finalize() // Translate the input format to OpenGL's enums. GLenum internal_format; if (type == GL_FLOAT) { - internal_format = GL_RGBA16F_ARB; + internal_format = GL_RGBA32F_ARB; } else if (output_linear_gamma) { assert(type == GL_UNSIGNED_BYTE); internal_format = GL_SRGB8_ALPHA8;