gallium: add PIPE_TEXTURE_RECT target
[mesa.git] / src / gallium / docs / source / resources.rst
1 Resources
2 =========
3
4 Resources represent objects that hold data: textures and buffers.
5
6 They are mostly modelled after the resources in Direct3D 10/11, but with a
7 different transfer/update mechanism, and more features for OpenGL support.
8
9 Resource targets
10 ----------------
11
12 Resource targets determine the type of a resource.
13
14 Note that drivers may not actually have the restrictions listed regarding
15 coordinate normalization and wrap modes, and in fact efficient OpenCL
16 support will probably require drivers that don't have any of them, which
17 will probably be advertised with an appropriate cap.
18
19 TODO: document all targets. Note that both 3D and cube have restrictions
20 that depend on the hardware generation.
21
22 TODO: can buffers have a non-R8 format?
23
24 PIPE_TEXTURE_RECT
25 ^^^^^^^^^^^^^^^^^
26 2D surface with OpenGL GL_TEXTURE_RECTANGLE semantics.
27
28 depth must be 1
29 - last_level must be 0
30 - Must use unnormalized coordinates
31 - Must use a clamp wrap mode
32
33 PIPE_TEXTURE_2D
34 ^^^^^^^^^^^^^^^
35 2D surface accessed with normalized coordinates.
36
37 - If PIPE_CAP_NPOT_TEXTURES is not supported,
38 width and height must be powers of two
39 - Mipmaps can be used
40 - Must use normalized coordinates
41 - No special restrictions on wrap modes