[Nouveau] Status of s3tc patent in respect to open-source drivers and workarounds
Ian Romanick
idr at freedesktop.org
Mon Mar 29 11:05:50 PDT 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
SpliFF wrote:
> On 03/29/10 17:06, Ian Romanick wrote:
>> SpliFF wrote:
>>> So to clarify, you're saying a partial implementation (decoder only)
>>> isn't an option at all? If you expose an extension it must be complete?
>> See the documentation for glGetCompressedTexImage.
>
> That does not appear to imply a run-time encoder. It seems to imply the
> data is already compressed - which could (and really should) be done
> prior to distribution (via the nvidia tools for example). The
> documentation does quite clearly state that the application should
> verify the texture really was compressed so you're only going to run
> into issues when the programmer made assumptions about the supported
> hardware. Not saying that's impossible, just that that's the
> programmers' responsibility, not the drivers.
>
> Runtime compression is actually performed by glTexImage2D with its
> internalFormat set to a supported *_S3TC_* value, however the 2.1 spec says:
>
> "If no corresponding internal format is available, or the GL can not
> compress that image for any reason, the internal format is instead
> replaced with a corresponding base internal format."
I hate to admit it, but I think you are correct. Issue 10 in the
GL_ARB_texture_compression, the first two bullets in particular, seems
to support this.
(10) Should functionality be provided to allow applications to save
compressed images to disk and reuse them in subsequent runs without
programming to specific formats? If so, how?
RESOLVED: Yes. This can be done without knowledge of specific
compression formats in the following manner:
* Call TexImage with an uncompressed image and a generic
compressed internal format. The texture image will be
compressed by the GL, if possible.
* Call GetTexLevelParameteriv with a <value> of
TEXTURE_COMPRESSED_ARB to determine if the GL was able to
store the image in compressed form.
* Call GetTexLevelParameteriv with a <value> of
TEXTURE_INTERNAL_FORMAT to determine the specific compressed
image format in which the image is stored.
* Call GetTexLevelParameteriv with a <value> of
TEXTURE_COMPRESSED_IMAGE_SIZE_ARB to determine the size (in
ubytes) of the compressed image that will be returned by the
GL. Allocate a buffer of at least this size.
* Call GetCompressedTexImageARB. The GL will write the
compressed texture image into the allocated buffer.
* Save the returned compressed image to disk, along with the
associated width, height, depth, border parameters and the
returned values of TEXTURE_COMPRESSED_IMAGE_SIZE_ARB and
TEXTURE_INTERNAL_FORMAT.
* Load the compressed image and its parameters, and call
CompressedTexImage_[123]DARB to use the compressed image. The
value of TEXTURE_INTERNAL_FORMAT should be used as
<internalFormat> and the value of
TEXTURE_COMPRESSED_IMAGE_SIZE_ARB should be used as
<imageSize>.
The saved images will be valid as long as they are used on a
device supporting the returned <internalFormat> parameter. If the
saved images are used on a device that does not support the
compressed internal format, an INVALID_ENUM error would be
generated by the call to CompressedTexImage_[123]D because of the
unknown format.
Note also that to reliably determine if the GL will compress an
image without actually compressing it, an application need only
define a proxy texture image and query TEXTURE_COMPRESSED_ARB as
above.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkuw6/wACgkQX1gOwKyEAw9cWQCfViC2igK2W7DvhtcDj8pXVd0F
wJsAoJ0q1Pgp1sy6HVy9H9ihg/ms9oVR
=OgUh
-----END PGP SIGNATURE-----
More information about the Nouveau
mailing list