Hi all,
I am looking for comments, contributions, and criticisms for the extension I am drawing up. Once complete I will run it by nVidia, ATI, and 3D Labs to see if they are interested in implementing an EXT version. This extension gives us some of what will be available in the hardware designed for DX10, but I have tried to keep the impact minimal. (The ARB hates huge API changes, and rightly so.)
Without further ado:
Name
RAY_virtual_textures
Name Strings
GL_RAY_virtual_textures
Contact
Samuel Vincent (raystonn 'at' hotmail.com)
Status
XXX - Not complete yet!!!
Version
Last Modified Date: February 22, 2006
Author Revision: 0.1
Number
Dependencies
OpenGL 1.3 is required.
The extension is written against the OpenGL 2.0 Specification.
Overview
When this extension is advertised, the OpenGL implementation virtualizes
all texture units and memory under its management. This has the effect
of: a) allowing the presentation and use of much more memory in a single
rendering pass, including textures with no dimensional limits, b) allowing
more efficient management of high-speed cache memory present on many
graphics adapters, and c) allowing the use of more textures during a
single rendering pass than there are texture units on the underlying
implementation's hardware.
System memory, GPU-based memory (when present), and the operating system's
swap file (when present) will all be used to hold data that may be used
at any time. This means that a much larger working set will be possible.
Performance may be adversely affected if an application uses too much data
in a single rendering pass, causing some of it to be loaded from a virtual
memory swap file for example, but unused data should have nearly no
performance impact. One benefit of having this potentially-unused data
available is that it allows the GPU and its shader programs to decide
which data to use on the fly when the data set may not entirely fit in the
high-speed cache memory. This gives unprecedented flexibility. Large
textures well beyond the capabilities of current hardware may be used,
with the portions of the texture that are needed being paged into high-
speed cache when it is available. The only limit to the size of a texture
would be due to the exhaustion of the operating system's virtual memory
space.
The implementation will be free to manage memory at a finer granularity.
It will have the ability to keep only a portion of a texture in high-speed
cache memory rather than being forced to keep it either fully in or fully
out of the cache. More space is thus freed to cache other data. A system
of organizing memory into pages that are managed independently will allow
textures of unlimited size, bounded only by the availability of operating
system virtual memory.
Texture units will now be virtualized as well, allowing an application to
reference a nearly unlimited number of textures in a single pass. The
implementation can map these virtual texture units to real texture unit
hardware as needed, but the application will remain unaware of the
mapping. This allows an application to make many more textures available
and allow a shader to choose which it will use on the fly.
This virtualization will allow shaders to choose the data most appropriate
for the situation. As shaders get more complex, the application itself is
less able to determine in advance which data will be required. It is
important that the application be able to offer the entire data set and
allow the shader to choose at runtime. This is an important step toward
allowing increased complexity of shader programs.
IP Status
No known IP claims.
Issues
* Effects on other extensions and core components of OpenGL must be detailed
in this specification.
New Procedures and Functions
As the GL_TEXTURE0 family of constants cannot be extended indefinately,
their use will be discouraged. In place of this, all functions that take
these constants will have another version that takes a uint indicating the
virtual texture unit number. The old constants will still work when used
with the old functions. For example, GL_TEXTURE0 used with the old
functions will reference the same virtual texture unit as 0 used with the
new functions.
void glActiveTextureu(uint texture);
void glClientActiveTextureu(uint texture);
void glMultiTexCoordu1d(uint target, double s);
void glMultiTexCoordu1dv(uint target, const double *v);
void glMultiTexCoordu1f(uint target, float s);
void glMultiTexCoordu1fv(uint target, const float *v);
void glMultiTexCoordu1i(uint target, int s);
void glMultiTexCoordu1iv(uint target, const int *v);
void glMultiTexCoordu1s(uint target, short s);
void glMultiTexCoordu1sv(uint target, const short *v);
void glMultiTexCoordu2d(uint target, double s, double t);
void glMultiTexCoordu2dv(uint target, const double *v);
void glMultiTexCoordu2f(uint target, float s, float t);
void glMultiTexCoordu2fv(uint target, const float *v);
void glMultiTexCoordu2i(uint target, int s, int t);
void glMultiTexCoordu2iv(uint target, const int *v);
void glMultiTexCoordu2s(uint target, short s, short t);
void glMultiTexCoordu2sv(uint target, const short *v);
void glMultiTexCoordu3d(uint target, double s, double t, double r);
void glMultiTexCoordu3dv(uint target, const double *v);
void glMultiTexCoordu3f(uint target, float s, float t, float r);
void glMultiTexCoordu3fv(uint target, const float *v);
void glMultiTexCoordu3i(uint target, int s, int t, int r);
void glMultiTexCoordu3iv(uint target, const int *v);
void glMultiTexCoordu3s(uint target, short s, short t, short r);
void glMultiTexCoordu3sv(uint target, const short *v);
void glMultiTexCoordu4d(uint target, double s,double t,double r,double q);
void glMultiTexCoordu4dv(uint target, const double *v);
void glMultiTexCoordu4f(uint target, float s, float t, float r, float q);
void glMultiTexCoordu4fv(uint target, const float *v);
void glMultiTexCoordu4i(uint target, int s, int t, int r, int q);
void glMultiTexCoordu4iv(uint target, const int *v);
void glMultiTexCoordu4s(uint target, short s, short t, short r, short q);
void glMultiTexCoordu4sv(uint target, const short *v);
The only difference between all of these new functions and the existing
ones (without the 'u' in the function name) is the first argument. It is
now a uint which gives the texture unit number directly, without use of an
enum. Texture units are virtualized, and thus there is no upper limit on
their number beyond that of the maximum value of the uint data type.
Revision History, 2006/02/22
* Revision 0.1 - Initial revision