Originally posted by kbios
View Post
Announcement
Collapse
No announcement yet.
S3TC => r600{c,g}
Collapse
X
-
Originally posted by nanonyme View PostAs far as I've understood only works with r300g, not on r600g. And that's because the stuff has been RE'd on r300g. Not part of the docco deliveries.
Texture format is represented by 6 bits (SQ_TEX_RESOURCE_WORD1_0 aka R_038004_RESOURCE0_WORD1, bits 31-26)
Of those 64 values, 48 are used for regular texture formats.
Thus, 15 values are not defined.
There are 5 S3TC formats, and a bunch of other texture compression formats.
My guess is that a simple test program drawing some triangles with compressed textures and a temporary method to submit any value as a format will allow to find the correct value for various supported texture compression formats assuming there are no side effects and/or other registers/fields don't change meaning in the face of a compressed texture.
Or AMD can just release the information.
Comment
-
http://lxnt.info/stuff/radeon/dxtn-upload-r600.png
Literally second attempt at guessing format codes succeeded.
On the above image you can see Nvidia compressed texture demo (suitably patched to compile and run undex X/Mesa), rendering a quad with a DXT1_RGBA-compressed texture loaded from a DDS file.
Seems like DXTn format codes are 0x49-0x52. This needs more thorough verification though.
RV770 0x1002:0x9440
ubuntu lucid x86
2.6.36-020636rc6-generic from the mainline ppa
libdrm and mesa - todays git
mesa diff: http://lxnt.info/stuff/radeon/dxtn-discovery.diff
Comment
-
There's always the piglit tests
Originally posted by lxnt View PostMy guess is that a simple test program drawing some triangles with compressed textures and a temporary method to submit any value as a format will allow to find the correct value for various supported texture compression formats assuming there are no side effects and/or other registers/fields don't change meaning in the face of a compressed texture.
Comment
-
I have tried your patch with my RV790...
Originally posted by lxnt View PostLiterally second attempt at guessing format codes succeeded.Code:$ ./s3tc-teximage PIPE_FORMAT_DXT5_RGBA->R600_DXT5_RGBA, 0xffffffff EE r600_texture.c/r600_translate_texformat:731 - Unable to handle texformat 14 PIPE_FORMAT_UYVY EE r600_texture.c/r600_translate_texformat:731 - Unable to handle texformat 15 PIPE_FORMAT_YUYV PIGLIT: {'result': 'skip' } $ ./s3tc-texsubimage PIPE_FORMAT_DXT5_RGBA->R600_DXT5_RGBA, 0xffffffff EE r600_texture.c/r600_translate_texformat:731 - Unable to handle texformat 14 PIPE_FORMAT_UYVY EE r600_texture.c/r600_translate_texformat:731 - Unable to handle texformat 15 PIPE_FORMAT_YUYV PIGLIT: {'result': 'skip' }
Comment
-
Originally posted by chrisr View PostThose two piglit tests are giving the following results:Code::fail:
Please look at the screenshot, the command line I used to run the demo set three (of four) environment variables.
Currently I belive the following values are correct:
Code:R600_DXT1_RGB=49 R600_DXT1_RGBA=50 R600_DXT3_RGBA=51 R600_DXT5_RGBA=52
However, both s3tc-related piglit tests fail as of now. They create a compressed texture, not load compressed data from file, and I'm still digging how mesa+gallium handle the former.
What worked was uploading precompressed data.
(UYVY and YUYV messages are not related to s3tc/dxtn)
Comment
-
Originally posted by lxnt View PostI know. Sigh.
Please look at the screenshot, the command line I used to run the demo set three (of four) environment variables.
Currently I belive the following values are correct:
Code:R600_DXT1_RGB=49 R600_DXT1_RGBA=50 R600_DXT3_RGBA=51 R600_DXT5_RGBA=52
However, both s3tc-related piglit tests fail as of now. They create a compressed texture, not load compressed data from file, and I'm still digging how mesa+gallium handle the former.
What worked was uploading precompressed data.
(UYVY and YUYV messages are not related to s3tc/dxtn)
there is tex compession tests in mesa demos
Comment
-
Originally posted by nanonyme View PostGallium can load an external s3tc library on demand if it's available. The major legal issues are hopefully on user's end. r600g will assumably sooner or later have a similar stance to s3tc as r300g. Of these I'm fairly sure. I'd give it a whack myself if I a bit less vague idea of how it works.
Just add a repo, update and install Gallium and s3tc packages. That's all.
Comment
-
Comment