1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * (C) Copyright IBM Corporation 2004
3bf215546Sopenharmony_ci * All Rights Reserved.
4bf215546Sopenharmony_ci *
5bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
6bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
7bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
8bf215546Sopenharmony_ci * on the rights to use, copy, modify, merge, publish, distribute, sub
9bf215546Sopenharmony_ci * license, and/or sell copies of the Software, and to permit persons to whom
10bf215546Sopenharmony_ci * the Software is furnished to do so, subject to the following conditions:
11bf215546Sopenharmony_ci *
12bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next
13bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
14bf215546Sopenharmony_ci * Software.
15bf215546Sopenharmony_ci *
16bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
19bf215546Sopenharmony_ci * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
20bf215546Sopenharmony_ci * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21bf215546Sopenharmony_ci * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22bf215546Sopenharmony_ci * USE OR OTHER DEALINGS IN THE SOFTWARE.
23bf215546Sopenharmony_ci */
24bf215546Sopenharmony_ci
25bf215546Sopenharmony_ci/**
26bf215546Sopenharmony_ci * \file glx_texture_compression.c
27bf215546Sopenharmony_ci * Contains the routines required to implement GLX protocol for
28bf215546Sopenharmony_ci * ARB_texture_compression and related extensions.
29bf215546Sopenharmony_ci *
30bf215546Sopenharmony_ci * \sa http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_compression.txt
31bf215546Sopenharmony_ci *
32bf215546Sopenharmony_ci * \author Ian Romanick <idr@us.ibm.com>
33bf215546Sopenharmony_ci */
34bf215546Sopenharmony_ci
35bf215546Sopenharmony_ci#include "packrender.h"
36bf215546Sopenharmony_ci#include "packsingle.h"
37bf215546Sopenharmony_ci#include "indirect.h"
38bf215546Sopenharmony_ci
39bf215546Sopenharmony_ci#include <assert.h>
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_ci
42bf215546Sopenharmony_civoid
43bf215546Sopenharmony_ci__indirect_glGetCompressedTexImage(GLenum target, GLint level,
44bf215546Sopenharmony_ci                                      GLvoid * img)
45bf215546Sopenharmony_ci{
46bf215546Sopenharmony_ci   __GLX_SINGLE_DECLARE_VARIABLES();
47bf215546Sopenharmony_ci   xGLXGetTexImageReply reply;
48bf215546Sopenharmony_ci   size_t image_bytes;
49bf215546Sopenharmony_ci
50bf215546Sopenharmony_ci   __GLX_SINGLE_LOAD_VARIABLES();
51bf215546Sopenharmony_ci   __GLX_SINGLE_BEGIN(X_GLsop_GetCompressedTexImage, 8);
52bf215546Sopenharmony_ci   __GLX_SINGLE_PUT_LONG(0, target);
53bf215546Sopenharmony_ci   __GLX_SINGLE_PUT_LONG(4, level);
54bf215546Sopenharmony_ci   __GLX_SINGLE_READ_XREPLY();
55bf215546Sopenharmony_ci
56bf215546Sopenharmony_ci   image_bytes = reply.width;
57bf215546Sopenharmony_ci   assert(image_bytes <= ((4 * reply.length) - 0));
58bf215546Sopenharmony_ci   assert(image_bytes >= ((4 * reply.length) - 3));
59bf215546Sopenharmony_ci
60bf215546Sopenharmony_ci   if (image_bytes != 0) {
61bf215546Sopenharmony_ci      _XRead(dpy, (char *) img, image_bytes);
62bf215546Sopenharmony_ci      if (image_bytes < (4 * reply.length)) {
63bf215546Sopenharmony_ci         _XEatData(dpy, (4 * reply.length) - image_bytes);
64bf215546Sopenharmony_ci      }
65bf215546Sopenharmony_ci   }
66bf215546Sopenharmony_ci
67bf215546Sopenharmony_ci   __GLX_SINGLE_END();
68bf215546Sopenharmony_ci}
69bf215546Sopenharmony_ci
70bf215546Sopenharmony_ci
71bf215546Sopenharmony_ci/**
72bf215546Sopenharmony_ci * Internal function used for \c glCompressedTexImage1D and
73bf215546Sopenharmony_ci * \c glCompressedTexImage2D.
74bf215546Sopenharmony_ci */
75bf215546Sopenharmony_cistatic void
76bf215546Sopenharmony_ciCompressedTexImage1D2D(GLenum target, GLint level,
77bf215546Sopenharmony_ci                       GLenum internal_format,
78bf215546Sopenharmony_ci                       GLsizei width, GLsizei height,
79bf215546Sopenharmony_ci                       GLint border, GLsizei image_size,
80bf215546Sopenharmony_ci                       const GLvoid * data, CARD32 rop)
81bf215546Sopenharmony_ci{
82bf215546Sopenharmony_ci   __GLX_DECLARE_VARIABLES();
83bf215546Sopenharmony_ci
84bf215546Sopenharmony_ci   __GLX_LOAD_VARIABLES();
85bf215546Sopenharmony_ci   if (gc->currentDpy == NULL) {
86bf215546Sopenharmony_ci      return;
87bf215546Sopenharmony_ci   }
88bf215546Sopenharmony_ci
89bf215546Sopenharmony_ci   if ((target == GL_PROXY_TEXTURE_1D)
90bf215546Sopenharmony_ci       || (target == GL_PROXY_TEXTURE_2D)
91bf215546Sopenharmony_ci       || (target == GL_PROXY_TEXTURE_CUBE_MAP)) {
92bf215546Sopenharmony_ci      compsize = 0;
93bf215546Sopenharmony_ci   }
94bf215546Sopenharmony_ci   else {
95bf215546Sopenharmony_ci      compsize = image_size;
96bf215546Sopenharmony_ci   }
97bf215546Sopenharmony_ci
98bf215546Sopenharmony_ci   cmdlen = __GLX_PAD(__GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE + compsize);
99bf215546Sopenharmony_ci   if (cmdlen <= gc->maxSmallRenderCommandSize) {
100bf215546Sopenharmony_ci      __GLX_BEGIN_VARIABLE(rop, cmdlen);
101bf215546Sopenharmony_ci      __GLX_PUT_LONG(4, target);
102bf215546Sopenharmony_ci      __GLX_PUT_LONG(8, level);
103bf215546Sopenharmony_ci      __GLX_PUT_LONG(12, internal_format);
104bf215546Sopenharmony_ci      __GLX_PUT_LONG(16, width);
105bf215546Sopenharmony_ci      __GLX_PUT_LONG(20, height);
106bf215546Sopenharmony_ci      __GLX_PUT_LONG(24, border);
107bf215546Sopenharmony_ci      __GLX_PUT_LONG(28, image_size);
108bf215546Sopenharmony_ci      if (compsize != 0) {
109bf215546Sopenharmony_ci         __GLX_PUT_CHAR_ARRAY(__GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE,
110bf215546Sopenharmony_ci                              data, image_size);
111bf215546Sopenharmony_ci      }
112bf215546Sopenharmony_ci      __GLX_END(cmdlen);
113bf215546Sopenharmony_ci   }
114bf215546Sopenharmony_ci   else {
115bf215546Sopenharmony_ci      assert(compsize != 0);
116bf215546Sopenharmony_ci
117bf215546Sopenharmony_ci      __GLX_BEGIN_VARIABLE_LARGE(rop, cmdlen + 4);
118bf215546Sopenharmony_ci      __GLX_PUT_LONG(8, target);
119bf215546Sopenharmony_ci      __GLX_PUT_LONG(12, level);
120bf215546Sopenharmony_ci      __GLX_PUT_LONG(16, internal_format);
121bf215546Sopenharmony_ci      __GLX_PUT_LONG(20, width);
122bf215546Sopenharmony_ci      __GLX_PUT_LONG(24, height);
123bf215546Sopenharmony_ci      __GLX_PUT_LONG(28, border);
124bf215546Sopenharmony_ci      __GLX_PUT_LONG(32, image_size);
125bf215546Sopenharmony_ci      __glXSendLargeCommand(gc, gc->pc,
126bf215546Sopenharmony_ci                            __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE + 4,
127bf215546Sopenharmony_ci                            data, image_size);
128bf215546Sopenharmony_ci   }
129bf215546Sopenharmony_ci}
130bf215546Sopenharmony_ci
131bf215546Sopenharmony_ci
132bf215546Sopenharmony_ci/**
133bf215546Sopenharmony_ci * Internal function used for \c glCompressedTexSubImage1D and
134bf215546Sopenharmony_ci * \c glCompressedTexSubImage2D.
135bf215546Sopenharmony_ci */
136bf215546Sopenharmony_cistatic void
137bf215546Sopenharmony_ciCompressedTexSubImage1D2D(GLenum target, GLint level,
138bf215546Sopenharmony_ci                          GLsizei xoffset, GLsizei yoffset,
139bf215546Sopenharmony_ci                          GLsizei width, GLsizei height,
140bf215546Sopenharmony_ci                          GLenum format, GLsizei image_size,
141bf215546Sopenharmony_ci                          const GLvoid * data, CARD32 rop)
142bf215546Sopenharmony_ci{
143bf215546Sopenharmony_ci   __GLX_DECLARE_VARIABLES();
144bf215546Sopenharmony_ci
145bf215546Sopenharmony_ci   __GLX_LOAD_VARIABLES();
146bf215546Sopenharmony_ci   if (gc->currentDpy == NULL) {
147bf215546Sopenharmony_ci      return;
148bf215546Sopenharmony_ci   }
149bf215546Sopenharmony_ci
150bf215546Sopenharmony_ci   if (target == GL_PROXY_TEXTURE_3D) {
151bf215546Sopenharmony_ci      compsize = 0;
152bf215546Sopenharmony_ci   }
153bf215546Sopenharmony_ci   else {
154bf215546Sopenharmony_ci      compsize = image_size;
155bf215546Sopenharmony_ci   }
156bf215546Sopenharmony_ci
157bf215546Sopenharmony_ci   cmdlen = __GLX_PAD(__GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE + compsize);
158bf215546Sopenharmony_ci   if (cmdlen <= gc->maxSmallRenderCommandSize) {
159bf215546Sopenharmony_ci      __GLX_BEGIN_VARIABLE(rop, cmdlen);
160bf215546Sopenharmony_ci      __GLX_PUT_LONG(4, target);
161bf215546Sopenharmony_ci      __GLX_PUT_LONG(8, level);
162bf215546Sopenharmony_ci      __GLX_PUT_LONG(12, xoffset);
163bf215546Sopenharmony_ci      __GLX_PUT_LONG(16, yoffset);
164bf215546Sopenharmony_ci      __GLX_PUT_LONG(20, width);
165bf215546Sopenharmony_ci      __GLX_PUT_LONG(24, height);
166bf215546Sopenharmony_ci      __GLX_PUT_LONG(28, format);
167bf215546Sopenharmony_ci      __GLX_PUT_LONG(32, image_size);
168bf215546Sopenharmony_ci      if (compsize != 0) {
169bf215546Sopenharmony_ci         __GLX_PUT_CHAR_ARRAY(__GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE,
170bf215546Sopenharmony_ci                              data, image_size);
171bf215546Sopenharmony_ci      }
172bf215546Sopenharmony_ci      __GLX_END(cmdlen);
173bf215546Sopenharmony_ci   }
174bf215546Sopenharmony_ci   else {
175bf215546Sopenharmony_ci      assert(compsize != 0);
176bf215546Sopenharmony_ci
177bf215546Sopenharmony_ci      __GLX_BEGIN_VARIABLE_LARGE(rop, cmdlen + 4);
178bf215546Sopenharmony_ci      __GLX_PUT_LONG(8, target);
179bf215546Sopenharmony_ci      __GLX_PUT_LONG(12, level);
180bf215546Sopenharmony_ci      __GLX_PUT_LONG(16, xoffset);
181bf215546Sopenharmony_ci      __GLX_PUT_LONG(20, yoffset);
182bf215546Sopenharmony_ci      __GLX_PUT_LONG(24, width);
183bf215546Sopenharmony_ci      __GLX_PUT_LONG(28, height);
184bf215546Sopenharmony_ci      __GLX_PUT_LONG(32, format);
185bf215546Sopenharmony_ci      __GLX_PUT_LONG(36, image_size);
186bf215546Sopenharmony_ci      __glXSendLargeCommand(gc, gc->pc,
187bf215546Sopenharmony_ci                            __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE + 4,
188bf215546Sopenharmony_ci                            data, image_size);
189bf215546Sopenharmony_ci   }
190bf215546Sopenharmony_ci}
191bf215546Sopenharmony_ci
192bf215546Sopenharmony_ci
193bf215546Sopenharmony_civoid
194bf215546Sopenharmony_ci__indirect_glCompressedTexImage1D(GLenum target, GLint level,
195bf215546Sopenharmony_ci                                     GLenum internal_format, GLsizei width,
196bf215546Sopenharmony_ci                                     GLint border, GLsizei image_size,
197bf215546Sopenharmony_ci                                     const GLvoid * data)
198bf215546Sopenharmony_ci{
199bf215546Sopenharmony_ci   CompressedTexImage1D2D(target, level, internal_format, width, 0,
200bf215546Sopenharmony_ci                          border, image_size, data,
201bf215546Sopenharmony_ci                          X_GLrop_CompressedTexImage1D);
202bf215546Sopenharmony_ci}
203bf215546Sopenharmony_ci
204bf215546Sopenharmony_ci
205bf215546Sopenharmony_civoid
206bf215546Sopenharmony_ci__indirect_glCompressedTexImage2D(GLenum target, GLint level,
207bf215546Sopenharmony_ci                                     GLenum internal_format,
208bf215546Sopenharmony_ci                                     GLsizei width, GLsizei height,
209bf215546Sopenharmony_ci                                     GLint border, GLsizei image_size,
210bf215546Sopenharmony_ci                                     const GLvoid * data)
211bf215546Sopenharmony_ci{
212bf215546Sopenharmony_ci   CompressedTexImage1D2D(target, level, internal_format, width, height,
213bf215546Sopenharmony_ci                          border, image_size, data,
214bf215546Sopenharmony_ci                          X_GLrop_CompressedTexImage2D);
215bf215546Sopenharmony_ci}
216bf215546Sopenharmony_ci
217bf215546Sopenharmony_ci
218bf215546Sopenharmony_civoid
219bf215546Sopenharmony_ci__indirect_glCompressedTexImage3D(GLenum target, GLint level,
220bf215546Sopenharmony_ci                                     GLenum internal_format,
221bf215546Sopenharmony_ci                                     GLsizei width, GLsizei height,
222bf215546Sopenharmony_ci                                     GLsizei depth, GLint border,
223bf215546Sopenharmony_ci                                     GLsizei image_size, const GLvoid * data)
224bf215546Sopenharmony_ci{
225bf215546Sopenharmony_ci   __GLX_DECLARE_VARIABLES();
226bf215546Sopenharmony_ci
227bf215546Sopenharmony_ci   __GLX_LOAD_VARIABLES();
228bf215546Sopenharmony_ci   if (gc->currentDpy == NULL) {
229bf215546Sopenharmony_ci      return;
230bf215546Sopenharmony_ci   }
231bf215546Sopenharmony_ci
232bf215546Sopenharmony_ci   cmdlen = __GLX_PAD(__GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE + image_size);
233bf215546Sopenharmony_ci   if (cmdlen <= gc->maxSmallRenderCommandSize) {
234bf215546Sopenharmony_ci      __GLX_BEGIN_VARIABLE(X_GLrop_CompressedTexImage3D, cmdlen);
235bf215546Sopenharmony_ci      __GLX_PUT_LONG(4, target);
236bf215546Sopenharmony_ci      __GLX_PUT_LONG(8, level);
237bf215546Sopenharmony_ci      __GLX_PUT_LONG(12, internal_format);
238bf215546Sopenharmony_ci      __GLX_PUT_LONG(16, width);
239bf215546Sopenharmony_ci      __GLX_PUT_LONG(20, height);
240bf215546Sopenharmony_ci      __GLX_PUT_LONG(24, depth);
241bf215546Sopenharmony_ci      __GLX_PUT_LONG(28, border);
242bf215546Sopenharmony_ci      __GLX_PUT_LONG(32, image_size);
243bf215546Sopenharmony_ci      if (image_size != 0) {
244bf215546Sopenharmony_ci         __GLX_PUT_CHAR_ARRAY(__GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE,
245bf215546Sopenharmony_ci                              data, image_size);
246bf215546Sopenharmony_ci      }
247bf215546Sopenharmony_ci      __GLX_END(cmdlen);
248bf215546Sopenharmony_ci   }
249bf215546Sopenharmony_ci   else {
250bf215546Sopenharmony_ci      __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_CompressedTexImage3D, cmdlen + 4);
251bf215546Sopenharmony_ci      __GLX_PUT_LONG(8, target);
252bf215546Sopenharmony_ci      __GLX_PUT_LONG(12, level);
253bf215546Sopenharmony_ci      __GLX_PUT_LONG(16, internal_format);
254bf215546Sopenharmony_ci      __GLX_PUT_LONG(20, width);
255bf215546Sopenharmony_ci      __GLX_PUT_LONG(24, height);
256bf215546Sopenharmony_ci      __GLX_PUT_LONG(28, depth);
257bf215546Sopenharmony_ci      __GLX_PUT_LONG(32, border);
258bf215546Sopenharmony_ci      __GLX_PUT_LONG(36, image_size);
259bf215546Sopenharmony_ci      __glXSendLargeCommand(gc, gc->pc,
260bf215546Sopenharmony_ci                            __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE + 4,
261bf215546Sopenharmony_ci                            data, image_size);
262bf215546Sopenharmony_ci   }
263bf215546Sopenharmony_ci}
264bf215546Sopenharmony_ci
265bf215546Sopenharmony_ci
266bf215546Sopenharmony_civoid
267bf215546Sopenharmony_ci__indirect_glCompressedTexSubImage1D(GLenum target, GLint level,
268bf215546Sopenharmony_ci                                        GLint xoffset,
269bf215546Sopenharmony_ci                                        GLsizei width,
270bf215546Sopenharmony_ci                                        GLenum format, GLsizei image_size,
271bf215546Sopenharmony_ci                                        const GLvoid * data)
272bf215546Sopenharmony_ci{
273bf215546Sopenharmony_ci   CompressedTexSubImage1D2D(target, level, xoffset, 0, width, 0,
274bf215546Sopenharmony_ci                             format, image_size, data,
275bf215546Sopenharmony_ci                             X_GLrop_CompressedTexSubImage1D);
276bf215546Sopenharmony_ci}
277bf215546Sopenharmony_ci
278bf215546Sopenharmony_ci
279bf215546Sopenharmony_civoid
280bf215546Sopenharmony_ci__indirect_glCompressedTexSubImage2D(GLenum target, GLint level,
281bf215546Sopenharmony_ci                                        GLint xoffset, GLint yoffset,
282bf215546Sopenharmony_ci                                        GLsizei width, GLsizei height,
283bf215546Sopenharmony_ci                                        GLenum format, GLsizei image_size,
284bf215546Sopenharmony_ci                                        const GLvoid * data)
285bf215546Sopenharmony_ci{
286bf215546Sopenharmony_ci   CompressedTexSubImage1D2D(target, level, xoffset, yoffset, width, height,
287bf215546Sopenharmony_ci                             format, image_size, data,
288bf215546Sopenharmony_ci                             X_GLrop_CompressedTexSubImage2D);
289bf215546Sopenharmony_ci}
290bf215546Sopenharmony_ci
291bf215546Sopenharmony_ci
292bf215546Sopenharmony_civoid
293bf215546Sopenharmony_ci__indirect_glCompressedTexSubImage3D(GLenum target, GLint level,
294bf215546Sopenharmony_ci                                        GLint xoffset, GLint yoffset,
295bf215546Sopenharmony_ci                                        GLint zoffset, GLsizei width,
296bf215546Sopenharmony_ci                                        GLsizei height, GLsizei depth,
297bf215546Sopenharmony_ci                                        GLenum format, GLsizei image_size,
298bf215546Sopenharmony_ci                                        const GLvoid * data)
299bf215546Sopenharmony_ci{
300bf215546Sopenharmony_ci   __GLX_DECLARE_VARIABLES();
301bf215546Sopenharmony_ci
302bf215546Sopenharmony_ci   __GLX_LOAD_VARIABLES();
303bf215546Sopenharmony_ci   if (gc->currentDpy == NULL) {
304bf215546Sopenharmony_ci      return;
305bf215546Sopenharmony_ci   }
306bf215546Sopenharmony_ci
307bf215546Sopenharmony_ci   cmdlen = __GLX_PAD(__GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE
308bf215546Sopenharmony_ci                      + image_size);
309bf215546Sopenharmony_ci   if (cmdlen <= gc->maxSmallRenderCommandSize) {
310bf215546Sopenharmony_ci      __GLX_BEGIN_VARIABLE(X_GLrop_CompressedTexSubImage3D, cmdlen);
311bf215546Sopenharmony_ci      __GLX_PUT_LONG(4, target);
312bf215546Sopenharmony_ci      __GLX_PUT_LONG(8, level);
313bf215546Sopenharmony_ci      __GLX_PUT_LONG(12, xoffset);
314bf215546Sopenharmony_ci      __GLX_PUT_LONG(16, yoffset);
315bf215546Sopenharmony_ci      __GLX_PUT_LONG(20, zoffset);
316bf215546Sopenharmony_ci      __GLX_PUT_LONG(24, width);
317bf215546Sopenharmony_ci      __GLX_PUT_LONG(28, height);
318bf215546Sopenharmony_ci      __GLX_PUT_LONG(32, depth);
319bf215546Sopenharmony_ci      __GLX_PUT_LONG(36, format);
320bf215546Sopenharmony_ci      __GLX_PUT_LONG(40, image_size);
321bf215546Sopenharmony_ci      if (image_size != 0) {
322bf215546Sopenharmony_ci         __GLX_PUT_CHAR_ARRAY(__GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE,
323bf215546Sopenharmony_ci                              data, image_size);
324bf215546Sopenharmony_ci      }
325bf215546Sopenharmony_ci      __GLX_END(cmdlen);
326bf215546Sopenharmony_ci   }
327bf215546Sopenharmony_ci   else {
328bf215546Sopenharmony_ci      __GLX_BEGIN_VARIABLE_LARGE(X_GLrop_CompressedTexSubImage3D, cmdlen + 4);
329bf215546Sopenharmony_ci      __GLX_PUT_LONG(8, target);
330bf215546Sopenharmony_ci      __GLX_PUT_LONG(12, level);
331bf215546Sopenharmony_ci      __GLX_PUT_LONG(16, xoffset);
332bf215546Sopenharmony_ci      __GLX_PUT_LONG(20, yoffset);
333bf215546Sopenharmony_ci      __GLX_PUT_LONG(24, zoffset);
334bf215546Sopenharmony_ci      __GLX_PUT_LONG(28, width);
335bf215546Sopenharmony_ci      __GLX_PUT_LONG(32, height);
336bf215546Sopenharmony_ci      __GLX_PUT_LONG(36, depth);
337bf215546Sopenharmony_ci      __GLX_PUT_LONG(40, format);
338bf215546Sopenharmony_ci      __GLX_PUT_LONG(44, image_size);
339bf215546Sopenharmony_ci      __glXSendLargeCommand(gc, gc->pc,
340bf215546Sopenharmony_ci                            __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE + 4,
341bf215546Sopenharmony_ci                            data, image_size);
342bf215546Sopenharmony_ci   }
343bf215546Sopenharmony_ci}
344