GPU_offscreen: Add option for high bit depth.

This way we can render in HDR and read the real pixel values.
This commit is contained in:
2018-01-03 13:15:32 +01:00
parent 6b2989ae75
commit c79216d77d
9 changed files with 21 additions and 8 deletions

View File

@@ -650,7 +650,7 @@ struct GPUOffScreen {
GPUTexture *depth;
};
GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, char err_out[256])
GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, bool high_bitdepth, char err_out[256])
{
GPUOffScreen *ofs;
@@ -683,7 +683,12 @@ GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, char err_
return NULL;
}
ofs->color = GPU_texture_create_2D_multisample(width, height, NULL, samples, err_out);
if (high_bitdepth) {
ofs->color = GPU_texture_create_2D_custom_multisample(width, height, 4, GPU_RGBA16F, NULL, samples, err_out);
}
else {
ofs->color = GPU_texture_create_2D_multisample(width, height, NULL, samples, err_out);
}
if (!ofs->color) {
GPU_offscreen_free(ofs);
return NULL;