14642e01fSmrg/*
24642e01fSmrg * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
34642e01fSmrg * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
44642e01fSmrg *
54642e01fSmrg * Permission is hereby granted, free of charge, to any person obtaining a
64642e01fSmrg * copy of this software and associated documentation files (the "Software"),
74642e01fSmrg * to deal in the Software without restriction, including without limitation
84642e01fSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
94642e01fSmrg * and/or sell copies of the Software, and to permit persons to whom the
104642e01fSmrg * Software is furnished to do so, subject to the following conditions:
114642e01fSmrg *
124642e01fSmrg * The above copyright notice including the dates of first publication and
134642e01fSmrg * either this permission notice or a reference to
144642e01fSmrg * http://oss.sgi.com/projects/FreeB/
154642e01fSmrg * shall be included in all copies or substantial portions of the Software.
164642e01fSmrg *
174642e01fSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
184642e01fSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
194642e01fSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
204642e01fSmrg * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
214642e01fSmrg * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
224642e01fSmrg * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
234642e01fSmrg * SOFTWARE.
244642e01fSmrg *
254642e01fSmrg * Except as contained in this notice, the name of Silicon Graphics, Inc.
264642e01fSmrg * shall not be used in advertising or otherwise to promote the sale, use or
274642e01fSmrg * other dealings in this Software without prior written authorization from
284642e01fSmrg * Silicon Graphics, Inc.
294642e01fSmrg */
304642e01fSmrg
314642e01fSmrg#ifdef HAVE_DIX_CONFIG_H
324642e01fSmrg#include <dix-config.h>
334642e01fSmrg#endif
344642e01fSmrg
354642e01fSmrg#include "glxserver.h"
364642e01fSmrg#include "unpack.h"
374642e01fSmrg#include "indirect_dispatch.h"
384642e01fSmrg
3935c4bbdfSmrgvoid
4035c4bbdfSmrg__glXDisp_SeparableFilter2D(GLbyte * pc)
414642e01fSmrg{
4235c4bbdfSmrg    __GLXdispatchConvolutionFilterHeader *hdr =
4335c4bbdfSmrg        (__GLXdispatchConvolutionFilterHeader *) pc;
444642e01fSmrg    GLint hdrlen, image1len;
454642e01fSmrg
464642e01fSmrg    hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE);
474642e01fSmrg
4835c4bbdfSmrg    glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
4935c4bbdfSmrg    glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
5035c4bbdfSmrg    glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
5135c4bbdfSmrg    glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
5235c4bbdfSmrg    glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
5335c4bbdfSmrg    glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
544642e01fSmrg
554642e01fSmrg    /* XXX check this usage - internal code called
5635c4bbdfSmrg     ** a version without the packing parameters
5735c4bbdfSmrg     */
584642e01fSmrg    image1len = __glXImageSize(hdr->format, hdr->type, 0, hdr->width, 1, 1,
5935c4bbdfSmrg                               0, hdr->rowLength, 0, hdr->skipRows,
6035c4bbdfSmrg                               hdr->alignment);
614642e01fSmrg    image1len = __GLX_PAD(image1len);
624642e01fSmrg
6335c4bbdfSmrg    glSeparableFilter2D(hdr->target, hdr->internalformat, hdr->width,
6435c4bbdfSmrg                        hdr->height, hdr->format, hdr->type,
6535c4bbdfSmrg                        ((GLubyte *) hdr + hdrlen),
6635c4bbdfSmrg                        ((GLubyte *) hdr + hdrlen + image1len));
674642e01fSmrg}
68