Merge branch 'master' into autoconf2
[mesa.git] / docs / MESA_packed_depth_stencil.spec
1 Name
2
3 MESA_packed_depth_stencil
4
5 Name Strings
6
7 GL_MESA_packed_depth_stencil
8
9 Contact
10
11 Keith Whitwell, VA Linux Systems Inc. (keithw 'at' valinux.com)
12 Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com)
13
14 Status
15
16 Obsolete.
17
18 Version
19
20 $Id: MESA_packed_depth_stencil.spec,v 1.2 2003/09/19 14:58:21 brianp Exp $
21
22 Number
23
24 ???
25
26 Dependencies
27
28 EXT_abgr affects the definition of this extension
29 SGIS_texture4D affects the definition of this extension
30 EXT_cmyka affects the definition of this extension
31 ARB_packed_pixels affects the definition of this extension
32
33 Overview
34
35 Provides a mechanism for DrawPixels and ReadPixels to efficiently
36 transfer depth and stencil image data. Specifically, we defined new
37 packed pixel formats and types which pack both stencil and depth
38 into one value.
39
40 Issues:
41
42 1. Is this the right way to distinguish between 24/8 and 8/24
43 pixel formats? Should we instead provide both:
44
45 GL_DEPTH_STENCIL_MESA
46 GL_STENCIL_DEPTH_MESA
47
48 And perhaps just use GL_UNSIGNED_INT, GL_UNSIGNED_SHORT ?
49
50 2. If not, is it correct to use _REV to indicate that stencil
51 preceeds depth in the 1_15 and 8_24 formats?
52
53 3. Do we really want the GL_UNSIGNED_SHORT formats?
54
55
56 New Procedures and Functions
57
58 None.
59
60 New Tokens
61
62 Accepted by the <format> parameter of ReadPixels and DrawPixels:
63
64 GL_DEPTH_STENCIL_MESA 0x8750
65
66 Accepted by the <type> parameter of ReadPixels and DrawPixels:
67
68 GL_UNSIGNED_INT_24_8_MESA 0x8751
69 GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
70 GL_UNSIGNED_SHORT_15_1_MESA 0x8753
71 GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
72
73 Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
74
75 None
76
77 Additions to Chapter 3 of the 1.1 Specification (Rasterization)
78
79 One entry is added to table 3.5 (DrawPixels and ReadPixels formats).
80 The new table is:
81
82 Target
83 Format Name Buffer Element Meaning and Order
84 ----------- ------ -------------------------
85 COLOR_INDEX Color Color index
86 STENCIL_INDEX Stencil Stencil index
87 DEPTH_COMPONENT Depth Depth component
88 RED Color R component
89 GREEN Color G component
90 BLUE Color B component
91 ALPHA Color A component
92 RGB Color R, G, B components
93 RGBA Color R, G, B, A components
94 BGRA Color B, G, R, A components
95 ABGR_EXT Color A, B, G, R components
96 CMYK_EXT Color Cyan, Magenta, Yellow, Black components
97 CMYKA_EXT Color Cyan, Magenta, Yellow, Black, A components
98 LUMINANCE Color Luminance component
99 LUMINANCE_ALPHA Color Luminance, A components
100 DEPTH_STENCIL Depth, Depth component, stencil index.
101 Stencil
102
103 Table 3.5: DrawPixels and ReadPixels formats. The third column
104 gives a description of and the number and order of elements in a
105 group.
106
107 Add to the description of packed pixel formats:
108
109 <type> Parameter Data of Matching
110 Token Name Type Elements Pixel Formats
111 ---------------- ---- -------- -------------
112
113 UNSIGNED_BYTE_3_3_2 ubyte 3 RGB
114 UNSIGNED_BYTE_2_3_3_REV ubyte 3 RGB
115 UNSIGNED_SHORT_5_6_5 ushort 3 RGB
116 UNSIGNED_SHORT_5_6_5_REV ushort 3 RGB
117 UNSIGNED_SHORT_4_4_4_4 ushort 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
118 UNSIGNED_SHORT_4_4_4_4_REV ushort 4 RGBA,BGRA
119 UNSIGNED_SHORT_5_5_5_1 ushort 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
120 UNSIGNED_SHORT_1_5_5_5_REV ushort 4 RGBA,BGRA
121 UNSIGNED_INT_8_8_8_8 uint 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
122 UNSIGNED_INT_8_8_8_8_REV uint 4 RGBA,BGRA
123 UNSIGNED_INT_10_10_10_2 uint 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
124 UNSIGNED_INT_2_10_10_10_REV uint 4 RGBA,BGRA
125 UNSIGNED_SHORT_15_1_MESA ushort 2 DEPTH_STENCIL_MESA
126 UNSIGNED_SHORT_1_15_REV_MESA ushort 2 DEPTH_STENCIL_MESA
127 UNSIGNED_SHORT_24_8_MESA ushort 2 DEPTH_STENCIL_MESA
128 UNSIGNED_SHORT_8_24_REV_MESA ushort 2 DEPTH_STENCIL_MESA
129
130 UNSIGNED_INT_8_24:
131
132 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
133 +-----------------------+-----------------------------------------------------------------------+
134 | | |
135 +-----------------------+-----------------------------------------------------------------------+
136
137 first second
138 element element
139
140
141 UNSIGNED_INT_24_8:
142
143 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
144 +----------------------------------------------------------------------+------------------------+
145 | | |
146 +----------------------------------------------------------------------+------------------------+
147
148 first second
149 element element
150
151 UNSIGNED_SHORT_15_1:
152
153 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
154 +-----------------------------------------------------------+---+
155 | | |
156 +-----------------------------------------------------------+---+
157
158 first second
159 element element
160
161
162 UNSIGNED_SHORT_1_15_REV:
163
164 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
165 +---+-----------------------------------------------------------+
166 | | |
167 +---+-----------------------------------------------------------+
168
169 second first
170 element element
171
172 The assignment of elements to fields in the packed pixel is as
173 described in the table below:
174
175 First Second Third Fourth
176 Format Element Element Element Element
177 ------ ------- ------- ------- -------
178 RGB red green blue
179 RGBA red green blue alpha
180 BGRA blue green red alpha
181 ABGR_EXT alpha blue green red
182 CMYK_EXT cyan magenta yellow black
183 DEPTH_STENCIL_MESA depth stencil
184
185 Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
186 and the Frame Buffer)
187
188 The new format is added to the discussion of Obtaining Pixels from the
189 Framebuffer. It should read " If the <format> is one of RED, GREEN,
190 BLUE, ALPHA, RGB, RGBA, ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, and
191 the GL is in color index mode, then the color index is obtained."
192
193 The new format is added to the discussion of Index Lookup. It should
194 read "If <format> is one of RED, GREEN, BLUE, ALPHA, RGB, RGBA,
195 ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, then the index is used to
196 reference 4 tables of color components: PIXEL_MAP_I_TO_R,
197 PIXEL_MAP_I_TO_G, PIXEL_MAP_I_TO_B, and PIXEL_MAP_I_TO_A."
198
199
200 Additions to Chapter 5 of the 1.1 Specification (Special Functions)
201
202 None
203
204 Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
205
206 None
207
208 Additions to the GLX Specification
209
210 None
211
212 GLX Protocol
213
214 TBD
215
216 Errors
217
218 None
219
220 New State
221
222 None
223
224 Revision History
225
226 Version 1.0 - 23 Sep 2000
227 Keith's original version.
228
229 Version 1.1 - 3 Nov 2000
230 Brian's edits, assigned values to new enums.
231