aboutsummaryrefslogtreecommitdiffstats
path: root/docs/specs/OLD/MESA_packed_depth_stencil.spec
blob: 112b730ecc24f3917f4ddc3e776bb020ae9b22df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
Name

    MESA_packed_depth_stencil

Name Strings

    GL_MESA_packed_depth_stencil

Contact

    Keith Whitwell, VA Linux Systems Inc. (keithw 'at' valinux.com)
    Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com)

Status

    Obsolete.

Version


Number

    ???

Dependencies

    EXT_abgr affects the definition of this extension
    SGIS_texture4D affects the definition of this extension
    EXT_cmyka affects the definition of this extension
    ARB_packed_pixels affects the definition of this extension

Overview
	
    Provides a mechanism for DrawPixels and ReadPixels to efficiently
    transfer depth and stencil image data.  Specifically, we defined new
    packed pixel formats and types which pack both stencil and depth
    into one value.

Issues:

    1. Is this the right way to distinguish between 24/8 and 8/24
       pixel formats?  Should we instead provide both:
	
       GL_DEPTH_STENCIL_MESA
       GL_STENCIL_DEPTH_MESA

       And perhaps just use GL_UNSIGNED_INT, GL_UNSIGNED_SHORT ?

    2. If not, is it correct to use _REV to indicate that stencil
       preceeds depth in the 1_15 and 8_24 formats?

    3. Do we really want the GL_UNSIGNED_SHORT formats?  

	
New Procedures and Functions

    None.

New Tokens
    
    Accepted by the <format> parameter of ReadPixels and DrawPixels:

	GL_DEPTH_STENCIL_MESA		0x8750

    Accepted by the <type> parameter of ReadPixels and DrawPixels:

	GL_UNSIGNED_INT_24_8_MESA	0x8751
	GL_UNSIGNED_INT_8_24_REV_MESA	0x8752
	GL_UNSIGNED_SHORT_15_1_MESA	0x8753
	GL_UNSIGNED_SHORT_1_15_REV_MESA	0x8754

Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)

    None

Additions to Chapter 3 of the 1.1 Specification (Rasterization)

    One entry is added to table 3.5 (DrawPixels and ReadPixels formats).
    The new table is:

			Target
	Format Name	Buffer	Element Meaning and Order
	-----------	------	-------------------------
	COLOR_INDEX	Color	Color index
	STENCIL_INDEX	Stencil Stencil index
	DEPTH_COMPONENT Depth	Depth component
	RED		Color	R component
	GREEN		Color	G component
	BLUE		Color	B component
	ALPHA		Color	A component
	RGB		Color	R, G, B components
	RGBA		Color	R, G, B, A components
	BGRA	        Color   B, G, R, A components
	ABGR_EXT	Color	A, B, G, R components
	CMYK_EXT	Color	Cyan, Magenta, Yellow, Black components
	CMYKA_EXT	Color	Cyan, Magenta, Yellow, Black, A components
	LUMINANCE	Color	Luminance component
	LUMINANCE_ALPHA Color	Luminance, A components
	DEPTH_STENCIL   Depth,  Depth component, stencil index.
			Stencil

	Table 3.5: DrawPixels and ReadPixels formats.  The third column
	gives a description of and the number and order of elements in a
	group.

    Add to the description of packed pixel formats:

	<type> Parameter		Data	of	  Matching
	Token Name			Type	Elements  Pixel Formats
	----------------		----	--------  -------------

	UNSIGNED_BYTE_3_3_2	      ubyte   3	      RGB
	UNSIGNED_BYTE_2_3_3_REV       ubyte   3	      RGB
	UNSIGNED_SHORT_5_6_5	      ushort  3	      RGB
	UNSIGNED_SHORT_5_6_5_REV      ushort  3	      RGB
	UNSIGNED_SHORT_4_4_4_4	      ushort  4	      RGBA,BGRA,ABGR_EXT,CMYK_EXT
	UNSIGNED_SHORT_4_4_4_4_REV    ushort  4	      RGBA,BGRA
	UNSIGNED_SHORT_5_5_5_1	      ushort  4	      RGBA,BGRA,ABGR_EXT,CMYK_EXT
	UNSIGNED_SHORT_1_5_5_5_REV    ushort  4	      RGBA,BGRA
	UNSIGNED_INT_8_8_8_8	      uint    4	      RGBA,BGRA,ABGR_EXT,CMYK_EXT
	UNSIGNED_INT_8_8_8_8_REV      uint    4	      RGBA,BGRA
	UNSIGNED_INT_10_10_10_2       uint    4	      RGBA,BGRA,ABGR_EXT,CMYK_EXT
	UNSIGNED_INT_2_10_10_10_REV   uint    4	      RGBA,BGRA
	UNSIGNED_SHORT_15_1_MESA      ushort  2       DEPTH_STENCIL_MESA
	UNSIGNED_SHORT_1_15_REV_MESA  ushort  2       DEPTH_STENCIL_MESA
	UNSIGNED_SHORT_24_8_MESA      ushort  2       DEPTH_STENCIL_MESA
	UNSIGNED_SHORT_8_24_REV_MESA  ushort  2       DEPTH_STENCIL_MESA

	UNSIGNED_INT_8_24:

	     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
	    +-----------------------+-----------------------------------------------------------------------+
	    |			    |			     			    			    |
	    +-----------------------+-----------------------------------------------------------------------+

		    first					second		    
		    element					element		    


	UNSIGNED_INT_24_8:

	     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
	    +----------------------------------------------------------------------+------------------------+
	    |			    			     			   | 			    |
	    +----------------------------------------------------------------------+------------------------+

		    first								  second		    
		    element								  element		    

	UNSIGNED_SHORT_15_1:

	      15  14  13  12  11  10  9   8   7   6   5   4   3   2   1   0
	    +-----------------------------------------------------------+---+
	    |					    			|   |
	    +-----------------------------------------------------------+---+

	    		first						second	
			element						element	


	UNSIGNED_SHORT_1_15_REV:

	      15  14  13  12  11  10  9   8   7   6   5   4   3   2   1   0
	    +---+-----------------------------------------------------------+
	    |	|		     					    |
	    +---+-----------------------------------------------------------+

	    second		    first
	    element		    element

    The assignment of elements to fields in the packed pixel is as
    described in the table below:

			   First       Second	Third	    Fourth
	Format		   Element     Element	Element     Element
	------		   -------     -------	-------     -------
	RGB		   red	       green	blue
	RGBA		   red	       green	blue	    alpha
	BGRA		   blue	       green	red	    alpha
	ABGR_EXT	   alpha       blue	green	    red
	CMYK_EXT	   cyan	       magenta	yellow	    black
	DEPTH_STENCIL_MESA depth       stencil

Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
and the Frame Buffer)

    The new format is added to the discussion of Obtaining Pixels from the
    Framebuffer.  It should read " If the <format> is one of RED, GREEN,
    BLUE, ALPHA, RGB, RGBA, ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, and
    the GL is in color index mode, then the color index is obtained."

    The new format is added to the discussion of Index Lookup.  It should
    read "If <format> is one of RED, GREEN, BLUE, ALPHA, RGB, RGBA,
    ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, then the index is used to
    reference 4 tables of color components: PIXEL_MAP_I_TO_R,
    PIXEL_MAP_I_TO_G, PIXEL_MAP_I_TO_B, and PIXEL_MAP_I_TO_A."


Additions to Chapter 5 of the 1.1 Specification (Special Functions)

    None

Additions to Chapter 6 of the 1.1 Specification (State and State Requests)

    None

Additions to the GLX Specification

    None

GLX Protocol

    TBD

Errors

    None

New State

    None

Revision History

    Version 1.0 - 23 Sep 2000
        Keith's original version.

    Version 1.1 - 3 Nov 2000
        Brian's edits, assigned values to new enums.