Merge branch 'hdr-colclip-32bits'

This commit is contained in:
Gregory Hainaut 2015-08-04 21:55:40 +02:00
commit 36554c3375
3 changed files with 7 additions and 1 deletions

View File

@ -964,7 +964,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
}
if (ps_sel.hdr) {
hdr_rt = dev->CreateTexture(rtsize.x, rtsize.y, GL_RGBA16F);
hdr_rt = dev->CreateTexture(rtsize.x, rtsize.y, GL_RGBA32F);
dev->CopyRectConv(rt, hdr_rt, ComputeBoundingBox(rtscale, rtsize), false);

View File

@ -600,6 +600,9 @@ void ps_main()
#if PS_HDR == 1
// Use negative value to avoid overflow of the texture (in accumulation mode)
// Note: code were initially done for an Half-Float texture. Due to overflow
// the texture was upgraded to a full float. Maybe this code is useless now!
// Good testcase is castlevania
if (any(greaterThan(C.rgb, vec3(128.0f)))) {
C.rgb = (C.rgb - 256.0f);
}

View File

@ -1475,6 +1475,9 @@ static const char* tfx_fs_all_glsl =
"\n"
"#if PS_HDR == 1\n"
" // Use negative value to avoid overflow of the texture (in accumulation mode)\n"
" // Note: code were initially done for an Half-Float texture. Due to overflow\n"
" // the texture was upgraded to a full float. Maybe this code is useless now!\n"
" // Good testcase is castlevania\n"
" if (any(greaterThan(C.rgb, vec3(128.0f)))) {\n"
" C.rgb = (C.rgb - 256.0f);\n"
" }\n"