Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GK104+ SUSTP image format enums #19

Open
imirkin opened this issue Jun 6, 2016 · 4 comments
Open

GK104+ SUSTP image format enums #19

imirkin opened this issue Jun 6, 2016 · 4 comments

Comments

@imirkin
Copy link
Contributor

imirkin commented Jun 6, 2016

We have a bunch of them documented already:

https://github.com/envytools/envytools/blob/master/rnndb/g80_defs.xml#L276

I'm missing especially BGRA8_UNORM, but others would be nice to have too. (I could work it out myself with guess-and-check, but it's a bit labor-intensive, so if you could just provide the list, that'd be really convenient.)

These format enums are used at least with SM30 and SM35 formatted surface store (SUSTP) operations, but also most likely SM50 SUSTP as well.

@markkilgard
Copy link

You are missing:

  1. hex 0x47 (71 decimal) is your BGRA8_UNORM
  2. hex 0x3B (59 decimal) is your A8_UNORM

I believe that's all you are missing. I hope this helps.

@imirkin
Copy link
Contributor Author

imirkin commented Jul 7, 2016

Hm, surprising that you don't also have values for things like RGB565/RGBA4/RGB5A1 and their BGR friends, as all of those have RT formats (https://github.com/envytools/envytools/blob/master/rnndb/g80_defs.xml#L198). On SM20, you could literally plug a RT format enum into the image binding.

[By the way, recent RE work on SM50 indicates that SM50 just takes a TIC reference and uses its format, so these are only for SM30 and SM35. But you probably already knew this.]

@markkilgard
Copy link

surprising that you don't also have values for things like RGB565/RGBA4/RGB5A1 and their BGR

There are values for some of these formats such as RGB565, but those not listed are "unsupported" formats for the SUSTP instruction.

Writes to any surface formats marked "unsupported" are dropped silently.

Examples of unsupported formats are formats with forced one or zero components, RGB5 or R5G6B5 formats, 32-bit unorm formats, alpha formats, red-alpha formats, and sRGB formats.

@imirkin
Copy link
Contributor Author

imirkin commented Jul 16, 2016

After some experimentation, it appears that BGRA8_UNORM is actually 0x11 (only tested on GK208/SM35 thus far). Which coincidentally happens to be 0x47 >> 2. Perhaps the bottom 2 bits in your tables mean something else? Or did the other values match up properly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants