| 1492 | <p>The address of image's pixel is stored in VADDR registers. Number of used registers and |
| 1493 | data type depends on the instruction type and image type. Following table describes |
| 1494 | what component's of address are stored in VADDR registers for what image types.</p> |
| 1495 | <table> |
| 1496 | <thead> |
| 1497 | <tr> |
| 1498 | <th>Image type</th> |
| 1499 | <th>Component 0</th> |
| 1500 | <th>Component 1</th> |
| 1501 | <th>Component 2</th> |
| 1502 | </tr> |
| 1503 | </thead> |
| 1504 | <tbody> |
| 1505 | <tr> |
| 1506 | <td>1D</td> |
| 1507 | <td>X</td> |
| 1508 | <td>--</td> |
| 1509 | <td>--</td> |
| 1510 | </tr> |
| 1511 | <tr> |
| 1512 | <td>1D array</td> |
| 1513 | <td>X</td> |
| 1514 | <td>slice (UINT)</td> |
| 1515 | <td>--</td> |
| 1516 | </tr> |
| 1517 | <tr> |
| 1518 | <td>2D</td> |
| 1519 | <td>X</td> |
| 1520 | <td>Y</td> |
| 1521 | <td>--</td> |
| 1522 | </tr> |
| 1523 | <tr> |
| 1524 | <td>2D interlaced</td> |
| 1525 | <td>X</td> |
| 1526 | <td>Y</td> |
| 1527 | <td>field</td> |
| 1528 | </tr> |
| 1529 | <tr> |
| 1530 | <td>2D array</td> |
| 1531 | <td>X</td> |
| 1532 | <td>Y</td> |
| 1533 | <td>slice (UINT)</td> |
| 1534 | </tr> |
| 1535 | <tr> |
| 1536 | <td>3D</td> |
| 1537 | <td>X</td> |
| 1538 | <td>Y</td> |
| 1539 | <td>Z</td> |
| 1540 | </tr> |
| 1541 | <tr> |
| 1542 | <td>2D Cube</td> |
| 1543 | <td>X</td> |
| 1544 | <td>Y</td> |
| 1545 | <td>face id (FLOAT)</td> |
| 1546 | </tr> |
| 1547 | </tbody> |
| 1548 | </table> |
| 1549 | <p>The X, Y and Z coordinate's type depends on instruction type. The IMAGE_SAMPLE_* and |
| 1550 | IMAGE_GATHER4_* accepts floating point values at place of these components. Other |
| 1551 | instructions accepts unsigned integer values for X, Y and Z components.</p> |
| 1552 | <p>The layout of the address is in form:</p> |
| 1553 | <p>{ offset } { bias } { z-compare } { derivative } { body }</p> |
| 1554 | <p>The body is image address components (X, Y, Z). Other components are used for:</p> |
| 1555 | <ul> |
| 1556 | <li>offset - for IMAGE_<em>_O</em> instructions. One dword contains three 6-bit signed offsets for |
| 1557 | each coordinate (X ,Y, Z) in 0-5 bits (X), 8-13 bits (Y) and 16-21 bits (Z).</li> |
| 1558 | <li>bias - for IMAGE_<em>_B</em> instructions. One single floating point value.</li> |
| 1559 | <li>z-compare - for IMAGE_<em>_C</em> instructions. One dword.</li> |
| 1560 | <li>derivatives - for IMAGE_<em>_D</em> instructions. User supplied derivatives that will be used |
| 1561 | to calculate LOD. The layout of the derivatives:</li> |
| 1562 | </ul> |
| 1563 | <table> |
| 1564 | <thead> |
| 1565 | <tr> |
| 1566 | <th>Image dimensions</th> |
| 1567 | <th>Comp. 0</th> |
| 1568 | <th>Comp. 1</th> |
| 1569 | <th>Comp. 2</th> |
| 1570 | <th>Comp. 3</th> |
| 1571 | <th>Comp. 4</th> |
| 1572 | <th>Comp. 5</th> |
| 1573 | </tr> |
| 1574 | </thead> |
| 1575 | <tbody> |
| 1576 | <tr> |
| 1577 | <td>1</td> |
| 1578 | <td>DX/DH</td> |
| 1579 | <td>DX/DV</td> |
| 1580 | <td>--</td> |
| 1581 | <td>--</td> |
| 1582 | <td>--</td> |
| 1583 | <td>--</td> |
| 1584 | </tr> |
| 1585 | <tr> |
| 1586 | <td>2</td> |
| 1587 | <td>DX/DH</td> |
| 1588 | <td>DY/DH</td> |
| 1589 | <td>DX/DV</td> |
| 1590 | <td>DY/DV</td> |
| 1591 | <td>--</td> |
| 1592 | <td>--</td> |
| 1593 | </tr> |
| 1594 | <tr> |
| 1595 | <td>3</td> |
| 1596 | <td>DX/DH</td> |
| 1597 | <td>DY/DH</td> |
| 1598 | <td>DZ/DH</td> |
| 1599 | <td>DX/DV</td> |
| 1600 | <td>DY/DV</td> |
| 1601 | <td>DZ/DV</td> |
| 1602 | </tr> |
| 1603 | </tbody> |
| 1604 | </table> |
| 1605 | <p>About accuracy: Threshold of coordinates for image's sampling are 1/256 of distance |
| 1606 | between pixels.</p> |
| 1607 | <p>The sampling of the mipmaps requires normalized coordinates.</p> |