Difference between revisions of "NV2A/Pixel Combiner"
From xboxdevwiki
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | The NV2A implements [https://www. | + | The NV2A implements at least parts of the following OpenGL extensions: |
− | + | ||
− | https://www.khronos.org/registry/OpenGL/extensions/NV/ | + | * [https://www.khronos.org/registry/OpenGL/extensions/NV/NV_texture_shader.txt NV_texture_shader] |
− | https://www. | + | * [https://www.khronos.org/registry/OpenGL/extensions/NV/NV_texture_shader2.txt NV_texture_shader2] |
− | https://www. | + | * [https://www.khronos.org/registry/OpenGL/extensions/NV/NV_texture_shader3.txt NV_texture_shader3]{{citation needed}} |
+ | * [https://www.opengl.org/registry/specs/NV/register_combiners.txt NV_register_combiners] | ||
+ | * [https://www.opengl.org/registry/specs/NV/register_combiners2.txt NV_register_combiners2] | ||
+ | |||
== Data types == | == Data types == | ||
Line 11: | Line 14: | ||
{| class="wikitable" | {| class="wikitable" | ||
− | ! floating-point !! 8-bit fixed-point !! 9-bit fixed-point !! 16 bit fixed-point | + | ! floating-point !! 8-bit fixed-point !! 9-bit fixed-point !! 16-bit fixed-point |
|- | |- | ||
| 1.0 || n/a || 255 || n/a | | 1.0 || n/a || 255 || n/a | ||
Line 25: | Line 28: | ||
| -1.00392... || n/a || -256 || n/a | | -1.00392... || n/a || -256 || n/a | ||
|} | |} | ||
+ | |||
+ | This means: | ||
+ | |||
+ | * 8-bit fixed-point: [-128, 127] → [-128/128, 127/128] → [-1.0, 0.99218...] | ||
+ | * 9-bit fixed-point: [-256, 255] → [-256/255, 255/255] → [-1.00392..., 1.0] | ||
+ | * 16-bit fixed-point: [-32768, 32767] → [-32768/32768, 32767/32768] → [-1.0, 0.99996...] | ||
+ | |||
+ | It is not known if the NV2A really implements these 3 datatypes. | ||
+ | It is also not yet known how exactly conversion or negation of these types would work. | ||
== Texturing modes == | == Texturing modes == | ||
Line 31: | Line 43: | ||
!ID | !ID | ||
!Name | !Name | ||
+ | !D3D name | ||
!GL Name | !GL Name | ||
!Stage 1 | !Stage 1 | ||
Line 39: | Line 52: | ||
|- | |- | ||
|0x00 | |0x00 | ||
− | |PS_TEXTUREMODES_NONE | + | |PS_TEXTUREMODES_NONE |
+ | | | ||
|NONE | |NONE | ||
|{{yes}} | |{{yes}} | ||
Line 48: | Line 62: | ||
|- | |- | ||
|0x01 | |0x01 | ||
− | |PS_TEXTUREMODES_PROJECT2D | + | |PS_TEXTUREMODES_PROJECT2D |
+ | |tex | ||
|TEXTURE_2D | |TEXTURE_2D | ||
|{{yes}} | |{{yes}} | ||
Line 58: | Line 73: | ||
|0x02 | |0x02 | ||
|PS_TEXTUREMODES_PROJECT3D | |PS_TEXTUREMODES_PROJECT3D | ||
+ | |tex | ||
|TEXTURE_3D | |TEXTURE_3D | ||
|{{yes}} | |{{yes}} | ||
Line 67: | Line 83: | ||
|0x03 | |0x03 | ||
|PS_TEXTUREMODES_CUBEMAP | |PS_TEXTUREMODES_CUBEMAP | ||
+ | |tex | ||
|TEXTURE_CUBE_MAP_ARB | |TEXTURE_CUBE_MAP_ARB | ||
|{{yes}} | |{{yes}} | ||
Line 75: | Line 92: | ||
|- | |- | ||
|0x04 | |0x04 | ||
− | |PS_TEXTUREMODES_PASSTHRU | + | |PS_TEXTUREMODES_PASSTHRU |
+ | |texcoord | ||
|PASS_THROUGH_NV | |PASS_THROUGH_NV | ||
|{{yes}} | |{{yes}} | ||
Line 84: | Line 102: | ||
|- | |- | ||
|0x05 | |0x05 | ||
− | |PS_TEXTUREMODES_CLIPPLANE | + | |PS_TEXTUREMODES_CLIPPLANE |
+ | |texkill | ||
|CULL_FRAGMENT_NV | |CULL_FRAGMENT_NV | ||
|{{yes}} | |{{yes}} | ||
Line 93: | Line 112: | ||
|- | |- | ||
|0x06 | |0x06 | ||
− | |PS_TEXTUREMODES_BUMPENVMAP | + | |PS_TEXTUREMODES_BUMPENVMAP |
+ | |texbem | ||
|OFFSET_TEXTURE_2D_NV | |OFFSET_TEXTURE_2D_NV | ||
|{{no}} | |{{no}} | ||
Line 102: | Line 122: | ||
|- | |- | ||
|0x07 | |0x07 | ||
− | |PS_TEXTUREMODES_BUMPENVMAP_LUM | + | |PS_TEXTUREMODES_BUMPENVMAP_LUM |
+ | |texbeml | ||
|OFFSET_TEXTURE_2D_SCALE_NV | |OFFSET_TEXTURE_2D_SCALE_NV | ||
|{{no}} | |{{no}} | ||
Line 111: | Line 132: | ||
|- | |- | ||
|0x08 | |0x08 | ||
− | |PS_TEXTUREMODES_BRDF | + | |PS_TEXTUREMODES_BRDF |
+ | |texbrdf | ||
| | | | ||
|{{no}} | |{{no}} | ||
Line 120: | Line 142: | ||
|- | |- | ||
|0x09 | |0x09 | ||
− | |PS_TEXTUREMODES_DOT_ST | + | |PS_TEXTUREMODES_DOT_ST |
+ | |texm3x2tex?{{citation needed}} | ||
|DOT_PRODUCT_NV{{citation needed}} | |DOT_PRODUCT_NV{{citation needed}} | ||
|{{no}} | |{{no}} | ||
Line 129: | Line 152: | ||
|- | |- | ||
|0x0A | |0x0A | ||
− | |PS_TEXTUREMODES_DOT_ZW | + | |PS_TEXTUREMODES_DOT_ZW |
+ | |texm3x2tex?{{citation needed}} | ||
|DOT_PRODUCT_NV{{citation needed}} | |DOT_PRODUCT_NV{{citation needed}} | ||
|{{no}} | |{{no}} | ||
Line 139: | Line 163: | ||
|0x0B | |0x0B | ||
|PS_TEXTUREMODES_DOT_RFLCT_DIFF | |PS_TEXTUREMODES_DOT_RFLCT_DIFF | ||
+ | |texm3x3diff | ||
|DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV{{citation needed}} | |DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV{{citation needed}} | ||
|{{no}} | |{{no}} | ||
Line 148: | Line 173: | ||
|0x0C | |0x0C | ||
|PS_TEXTUREMODES_DOT_RFLCT_SPEC | |PS_TEXTUREMODES_DOT_RFLCT_SPEC | ||
+ | |texm3x3spec | ||
|DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV{{citation needed}} | |DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV{{citation needed}} | ||
|{{no}} | |{{no}} | ||
Line 157: | Line 183: | ||
|0x0D | |0x0D | ||
|PS_TEXTUREMODES_DOT_STR_3D | |PS_TEXTUREMODES_DOT_STR_3D | ||
+ | |texm3x3tex | ||
|DOT_PRODUCT_TEXTURE_3D_NV | |DOT_PRODUCT_TEXTURE_3D_NV | ||
|{{no}} | |{{no}} | ||
Line 166: | Line 193: | ||
|0x0E | |0x0E | ||
|PS_TEXTUREMODES_DOT_STR_CUBE | |PS_TEXTUREMODES_DOT_STR_CUBE | ||
+ | |texm3x3vspec | ||
|DOT_PRODUCT_REFLECT_CUBE_MAP_NV | |DOT_PRODUCT_REFLECT_CUBE_MAP_NV | ||
|{{no}} | |{{no}} | ||
Line 174: | Line 202: | ||
|- | |- | ||
|0x0F | |0x0F | ||
− | |PS_TEXTUREMODES_DPNDNT_AR | + | |PS_TEXTUREMODES_DPNDNT_AR |
+ | |texreg2ar | ||
|DEPENDENT_AR_TEXTURE_2D_NV | |DEPENDENT_AR_TEXTURE_2D_NV | ||
|{{no}} | |{{no}} | ||
Line 183: | Line 212: | ||
|- | |- | ||
|0x10 | |0x10 | ||
− | |PS_TEXTUREMODES_DPNDNT_GB | + | |PS_TEXTUREMODES_DPNDNT_GB |
+ | |texreg2gb | ||
|DEPENDENT_GB_TEXTURE_2D_NV | |DEPENDENT_GB_TEXTURE_2D_NV | ||
|{{no}} | |{{no}} | ||
Line 193: | Line 223: | ||
|0x11 | |0x11 | ||
|PS_TEXTUREMODES_DOTPRODUCT | |PS_TEXTUREMODES_DOTPRODUCT | ||
+ | |texm3x3pad<br>texm3x2pad | ||
|DOT_PRODUCT_NV | |DOT_PRODUCT_NV | ||
|{{no}} | |{{no}} | ||
Line 202: | Line 233: | ||
|0x12 | |0x12 | ||
|PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST | |PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST | ||
+ | |texm3x3spec | ||
|DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV | |DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV | ||
|{{no}} | |{{no}} | ||
Line 209: | Line 241: | ||
| | | | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Debugging == | == Debugging == | ||
Line 224: | Line 250: | ||
* http://developer.download.nvidia.com/assets/gamedev/docs/GDC2K1_DX8_Pixel_Shaders.pdf | * http://developer.download.nvidia.com/assets/gamedev/docs/GDC2K1_DX8_Pixel_Shaders.pdf | ||
* http://developer.download.nvidia.com/assets/gamedev/docs/ProgrammableTextureBlending.pdf | * http://developer.download.nvidia.com/assets/gamedev/docs/ProgrammableTextureBlending.pdf | ||
+ | |||
+ | [[Category:NV2A]] |
Revision as of 15:58, 29 December 2018
The NV2A implements at least parts of the following OpenGL extensions:
- NV_texture_shader
- NV_texture_shader2
- NV_texture_shader3[citation needed]
- NV_register_combiners
- NV_register_combiners2
Data types
NV_texture_shader suggests that: "The 8-bit and 16-bit signed fixed-point types are used for signed internal texture formats, while the 9-bit signed fixed-point type is used for register combiners computations." Here is a table from the GL extension:
floating-point | 8-bit fixed-point | 9-bit fixed-point | 16-bit fixed-point |
---|---|---|---|
1.0 | n/a | 255 | n/a |
0.99996... | n/a | n/a | 32767 |
0.99218... | 127 | n/a | n/a |
0.0 | 0 | 0 | 0 |
-1.0 | -128 | -255 | -32768 |
-1.00392... | n/a | -256 | n/a |
This means:
- 8-bit fixed-point: [-128, 127] → [-128/128, 127/128] → [-1.0, 0.99218...]
- 9-bit fixed-point: [-256, 255] → [-256/255, 255/255] → [-1.00392..., 1.0]
- 16-bit fixed-point: [-32768, 32767] → [-32768/32768, 32767/32768] → [-1.0, 0.99996...]
It is not known if the NV2A really implements these 3 datatypes. It is also not yet known how exactly conversion or negation of these types would work.
Texturing modes
ID | Name | D3D name | GL Name | Stage 1 | Stage 2 | Stage 3 | Stage 4 | Notes |
---|---|---|---|---|---|---|---|---|
0x00 | PS_TEXTUREMODES_NONE | NONE | ✔ | ✔ | ✔ | ✔ | ||
0x01 | PS_TEXTUREMODES_PROJECT2D | tex | TEXTURE_2D | ✔ | ✔ | ✔ | ✔ | |
0x02 | PS_TEXTUREMODES_PROJECT3D | tex | TEXTURE_3D | ✔ | ✔ | ✔ | ✔ | |
0x03 | PS_TEXTUREMODES_CUBEMAP | tex | TEXTURE_CUBE_MAP_ARB | ✔ | ✔ | ✔ | ✔ | |
0x04 | PS_TEXTUREMODES_PASSTHRU | texcoord | PASS_THROUGH_NV | ✔ | ✔ | ✔ | ✔ | |
0x05 | PS_TEXTUREMODES_CLIPPLANE | texkill | CULL_FRAGMENT_NV | ✔ | ✔ | ✔ | ✔ | |
0x06 | PS_TEXTUREMODES_BUMPENVMAP | texbem | OFFSET_TEXTURE_2D_NV | ✗ | ✔ | ✔ | ✔ | |
0x07 | PS_TEXTUREMODES_BUMPENVMAP_LUM | texbeml | OFFSET_TEXTURE_2D_SCALE_NV | ✗ | ✔ | ✔ | ✔ | |
0x08 | PS_TEXTUREMODES_BRDF | texbrdf | ✗ | ✗ | ✔ | ✔ | ||
0x09 | PS_TEXTUREMODES_DOT_ST | texm3x2tex?[citation needed] | DOT_PRODUCT_NV[citation needed] | ✗ | ✗ | ✔ | ✔ | |
0x0A | PS_TEXTUREMODES_DOT_ZW | texm3x2tex?[citation needed] | DOT_PRODUCT_NV[citation needed] | ✗ | ✗ | ✔ | ✔ | |
0x0B | PS_TEXTUREMODES_DOT_RFLCT_DIFF | texm3x3diff | DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV[citation needed] | ✗ | ✗ | ✔ | ✗ | |
0x0C | PS_TEXTUREMODES_DOT_RFLCT_SPEC | texm3x3spec | DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV[citation needed] | ✗ | ✗ | ✗ | ✔ | |
0x0D | PS_TEXTUREMODES_DOT_STR_3D | texm3x3tex | DOT_PRODUCT_TEXTURE_3D_NV | ✗ | ✗ | ✗ | ✔ | |
0x0E | PS_TEXTUREMODES_DOT_STR_CUBE | texm3x3vspec | DOT_PRODUCT_REFLECT_CUBE_MAP_NV | ✗ | ✗ | ✗ | ✔ | |
0x0F | PS_TEXTUREMODES_DPNDNT_AR | texreg2ar | DEPENDENT_AR_TEXTURE_2D_NV | ✗ | ✔ | ✔ | ✔ | |
0x10 | PS_TEXTUREMODES_DPNDNT_GB | texreg2gb | DEPENDENT_GB_TEXTURE_2D_NV | ✗ | ✔ | ✔ | ✔ | |
0x11 | PS_TEXTUREMODES_DOTPRODUCT | texm3x3pad texm3x2pad |
DOT_PRODUCT_NV | ✗ | ✔ | ✔ | ✗ | |
0x12 | PS_TEXTUREMODES_DOT_RFLCT_SPEC_CONST | texm3x3spec | DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV | ✗ | ✗ | ✗ | ✔ |
Debugging
PIX from the Microsoft XDK provides great debugging capabilities.