We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 8 - rendertarget fix and ARB_color_buffer_float.
Summary: rendertarget fix and ARB_color_buffer_float.
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: All All
: P2 API change
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-03 11:45 UTC by Ryan C. Gordon
Modified: 2006-02-03 02:49 UTC (History)
0 users

See Also:


Attachments
rendertarget, color_buffer_float patch (11.95 KB, patch)
2006-01-03 11:46 UTC, Ryan C. Gordon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan C. Gordon 2006-01-03 11:45:26 UTC
Date: Mon, 16 May 2005 17:23:38 +0800
From: Eric Vidal <evidal@ateneo.edu>
To: sdl@libsdl.org
Subject: [SDL] [PATCH] Another take at SDL 1.3 rendertarget bug +
 ARB_color_buffer_float support

Hello all!

I've attached a patch to SDL 1.3 CVS and I'm requesting your comments.

This patch:

(1) Takes care of robustness issue with attributes on render target 
creation.  Previously the parameters will be messed up if the array is 
not specified in the requested order, and fails to get the remaining 
attributes if SDL_GL_RED_SIZE is specified prematurely.

Jonathan Thambidurai's patch addresses this but requires the attributes 
to contain two terminating zero's at the end of the attrib array.  I 
relaxed this restriction by semi-intelligently detecting whether the 
zero corresponded to a SDL_GL_RED_SIZE value.

Note that for this to work, the attributes have to be specified in the 
enum order (however not all attributes have to be there).  As Jonathan 
pointed out, the very nature of the array being passed to 
SDL_GL_CreateRenderTarget is problematic (and is potentially a buffer 
overflow issue as well).  Maybe the attribute passing should be 
redesigned before it is too late?

(2) Adds support for the GL_ARB_color_buffer_float extension, which 
allows floating-point color buffers to be used.  Currently this 
extension only works on pbuffer render targets, and only on Windows and X11.

Jonathan's previous patch included support for the NV_float_buffer 
extension, and he recommended that it be scrapped once the ARB version 
is commonplace.  To avoid conflicts with code previously written to his 
patch (and also to be consistent with the other enum names), I renamed 
the attribute from SDL_GL_FLOATINGPOINT to SDL_GL_FLOATBUFFER.

NOTE:  As of this writing nVidia has not yet released official drivers 
for this ARB extension.  The beta drivers contain it, but only on 
Windows.  That means I haven't tested if the X11 patch works properly 
(but I've seen it to fail properly ;) ).  Also, if anyone has ATI 
hardware around, please check if the patch works as is on your hardware!

I've also attached a very simple program to test the float buffer 
functionality.	This may be included in the test/ directory for future 
SDL releases, if the maintainers so wish.  :)

Much thanks to Jonathan for all the help, if it isn't obvious by now.  :)

-- 
Eric Vidal
Lecturer / Graduate Research Assistant, DISCS
Ateneo de Manila University
http://aegis.ateneo.net/evidal/
Comment 1 Ryan C. Gordon 2006-01-03 11:46:16 UTC
Created attachment 6 [details]
rendertarget, color_buffer_float patch
Comment 2 Ryan C. Gordon 2006-01-05 02:33:45 UTC
(Changed severity to "API change" for a bunch of bugs.)

--ryan.

Comment 3 Ryan C. Gordon 2006-01-27 11:23:01 UTC
Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

Comment 4 Sam Lantinga 2006-02-03 02:49:27 UTC
This has been merged into bug #129, which is the holding pen for the rendertarget support.