aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--X11/extensions/XI.h11
-rw-r--r--X11/extensions/XI2.h82
-rw-r--r--X11/extensions/XI2proto.h59
-rw-r--r--apps/xwininfo/dsimple.c38
-rw-r--r--apps/xwininfo/xwininfo.c101
-rw-r--r--fontconfig/doc/Makefile.am2
-rw-r--r--libXau/AuLock.c2
-rw-r--r--mesalib/src/glsl/ast_to_hir.cpp13
-rw-r--r--mesalib/src/glsl/builtin_variables.h220
-rw-r--r--mesalib/src/mesa/main/mipmap.c76
-rw-r--r--mesalib/src/mesa/main/mipmap.h9
-rw-r--r--mesalib/src/mesa/main/mtypes.h28
-rw-r--r--mesalib/src/mesa/main/texcompress_fxt1.c6
-rw-r--r--mesalib/src/mesa/main/texcompress_rgtc.c12
-rw-r--r--mesalib/src/mesa/main/texcompress_s3tc.c12
-rw-r--r--mesalib/src/mesa/main/texstore.c533
-rw-r--r--mesalib/src/mesa/main/texstore.h7
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_drawpixels.c4
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c110
-rw-r--r--mesalib/src/mesa/state_tracker/st_texture.c1
-rw-r--r--mesalib/src/mesa/state_tracker/st_texture.h7
-rw-r--r--mesalib/src/mesa/swrast/s_texfetch.c325
-rw-r--r--packages.txt2
-rw-r--r--xorg-server/xkeyboard-config/symbols/keypad24
-rw-r--r--xorg-server/xkeyboard-config/symbols/srvr_ctrl32
-rw-r--r--xorg-server/xkeyboard-config/symbols/terminate2
26 files changed, 966 insertions, 752 deletions
diff --git a/X11/extensions/XI.h b/X11/extensions/XI.h
index 7b443997c..378b34a16 100644
--- a/X11/extensions/XI.h
+++ b/X11/extensions/XI.h
@@ -135,17 +135,6 @@ SOFTWARE.
#define XI_FOOTMOUSE "FOOTMOUSE"
#define XI_JOYSTICK "JOYSTICK"
-/* Indices into the versions[] array (XExtInt.c). Used as a index to
- * retrieve the minimum version of XI from _XiCheckExtInit */
-#define Dont_Check 0
-#define XInput_Initial_Release 1
-#define XInput_Add_XDeviceBell 2
-#define XInput_Add_XSetDeviceValuators 3
-#define XInput_Add_XChangeDeviceControl 4
-#define XInput_Add_DevicePresenceNotify 5
-#define XInput_Add_DeviceProperties 6
-/* DO NOT ADD TO HERE -> XI2 */
-
#define XI_Absent 0
#define XI_Present 1
diff --git a/X11/extensions/XI2.h b/X11/extensions/XI2.h
index 3c39946f5..2514d5529 100644
--- a/X11/extensions/XI2.h
+++ b/X11/extensions/XI2.h
@@ -25,23 +25,36 @@
#ifndef _XI2_H_
#define _XI2_H_
-/* Indices into the versions[] array (XExtInt.c). Used as a index to
- * retrieve the minimum version of XI from _XiCheckExtInit.
- * For indices 0 to 6 see XI.h */
-#ifndef Dont_Check /* defined in XI.h */
-#define Dont_Check 0
+#warning "XI 2.1 is not stable yet."
+#warning "Applications relying on this header will break as the protocol sees updates."
+#ifndef XINPUT2_1_USE_UNSTABLE_PROTOCOL
+#error "Define XINPUT2_1_USE_UNSTABLE_PROTOCOL to disable this error"
+#endif
+#warning "XI 2.2 is not stable yet."
+#warning "Applications relying on this header will break as the protocol sees updates."
+#ifndef XINPUT2_2_USE_UNSTABLE_PROTOCOL
+#error "Define XINPUT2_2_USE_UNSTABLE_PROTOCOL to disable this error"
#endif
#define XInput_2_0 7
-
+/* DO NOT ADD TO THIS LIST. These are libXi-specific defines.
+ See commit libXi-1.4.2-21-ge8531dd */
#define XI_2_Major 2
-#define XI_2_Minor 0
+#define XI_2_Minor 2
/* Property event flags */
#define XIPropertyDeleted 0
#define XIPropertyCreated 1
#define XIPropertyModified 2
+/* Property modes */
+#define XIPropModeReplace 0
+#define XIPropModePrepend 1
+#define XIPropModeAppend 2
+
+/* Special property type used for XIGetProperty */
+#define XIAnyPropertyType 0L
+
/* Enter/Leave and Focus In/Out modes */
#define XINotifyNormal 0
#define XINotifyGrab 1
@@ -60,11 +73,28 @@
#define XINotifyPointerRoot 6
#define XINotifyDetailNone 7
+/* Grab modes */
+#define XIGrabModeSync 0
+#define XIGrabModeAsync 1
+#define XIGrabModeTouch 2
+
+/* Grab reply status codes */
+#define XIGrabSuccess 0
+#define XIAlreadyGrabbed 1
+#define XIGrabInvalidTime 2
+#define XIGrabNotViewable 3
+#define XIGrabFrozen 4
+
+/* Grab owner events values */
+#define XIOwnerEvents True
+#define XINoOwnerEvents False
+
/* Passive grab types */
#define XIGrabtypeButton 0
#define XIGrabtypeKeycode 1
#define XIGrabtypeEnter 2
#define XIGrabtypeFocusIn 3
+#define XIGrabtypeTouchBegin 4
/* Passive grab modifier */
#define XIAnyModifier (1U << 31)
@@ -78,6 +108,8 @@
#define XIAsyncPairedDevice 3
#define XIAsyncPair 4
#define XISyncPair 5
+#define XIAcceptTouch 6
+#define XIRejectTouch 7
/* DeviceChangedEvent change reasons */
#define XISlaveSwitch 1
@@ -113,15 +145,33 @@
#define XISlaveKeyboard 4
#define XIFloatingSlave 5
-/* Device classes */
+/* Device classes: classes that are not identical to Xi 1.x classes must be
+ * numbered starting from 8. */
#define XIKeyClass 0
#define XIButtonClass 1
#define XIValuatorClass 2
+#define XIScrollClass 3
+#define XITouchClass 8
+
+/* Scroll class types */
+#define XIScrollTypeVertical 1
+#define XIScrollTypeHorizontal 2
+
+/* Scroll class flags */
+#define XIScrollFlagNoEmulation (1 << 0)
+#define XIScrollFlagPreferred (1 << 1)
/* Device event flags (common) */
/* Device event flags (key events only) */
#define XIKeyRepeat (1 << 16)
/* Device event flags (pointer events only) */
+#define XIPointerEmulated (1 << 16)
+/* Device event flags (touch events only) */
+#define XITouchPendingEnd (1 << 16)
+
+/* Touch modes */
+#define XIDirectTouch 1
+#define XIDependentTouch 2
/* XI2 event mask macros */
#define XISetMask(ptr, event) (((unsigned char*)(ptr))[(event)>>3] |= (1 << ((event) & 7)))
@@ -151,7 +201,14 @@
#define XI_RawButtonPress 15
#define XI_RawButtonRelease 16
#define XI_RawMotion 17
-#define XI_LASTEVENT XI_RawMotion
+#define XI_TouchBegin 18 /* XI 2.1 */
+#define XI_TouchEnd 19
+#define XI_TouchOwnership 20
+#define XI_TouchUpdate 21
+#define XI_RawTouchBegin 22
+#define XI_RawTouchEnd 23
+#define XI_RawTouchUpdate 24
+#define XI_LASTEVENT XI_RawTouchUpdate
/* NOTE: XI2LASTEVENT in xserver/include/inputstr.h must be the same value
* as XI_LASTEVENT if the server is supposed to handle masks etc. for this
* type of event. */
@@ -177,5 +234,12 @@
#define XI_RawButtonPressMask (1 << XI_RawButtonPress)
#define XI_RawButtonReleaseMask (1 << XI_RawButtonRelease)
#define XI_RawMotionMask (1 << XI_RawMotion)
+#define XI_TouchBeginMask (1 << XI_TouchBegin)
+#define XI_TouchEndMask (1 << XI_TouchEnd)
+#define XI_TouchOwnershipChangedMask (1 << XI_TouchOwnershipChanged)
+#define XI_TouchUpdateMask (1 << XI_TouchUpdate)
+#define XI_RawTouchBeginMask (1 << XI_RawTouchBegin)
+#define XI_RawTouchEndMask (1 << XI_RawTouchEnd)
+#define XI_RawTouchUpdateMask (1 << XI_RawTouchUpdate)
#endif /* _XI2_H_ */
diff --git a/X11/extensions/XI2proto.h b/X11/extensions/XI2proto.h
index 84574a56c..9e2c63c85 100644
--- a/X11/extensions/XI2proto.h
+++ b/X11/extensions/XI2proto.h
@@ -188,6 +188,32 @@ typedef struct {
uint16_t pad2;
} xXIValuatorInfo;
+/***
+ * Denotes a scroll valuator on a device.
+ * One XIScrollInfo describes exactly one scroll valuator that must have a
+ * XIValuatorInfo struct.
+ */
+typedef struct {
+ uint16_t type; /**< Always ValuatorClass */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t sourceid; /**< source device for this class */
+ uint16_t number; /**< Valuator number */
+ uint16_t scroll_type; /**< ::XIScrollTypeVertical, ::XIScrollTypeHorizontal */
+ uint16_t pad0;
+ uint32_t flags; /**< ::XIScrollFlagEmulate, ::XIScrollFlagPreferred */
+ FP3232 increment; /**< Increment for one unit of scrolling */
+} xXIScrollInfo;
+
+/**
+ * Denotes multitouch capability on a device.
+ */
+typedef struct {
+ uint16_t type; /**< Always TouchClass */
+ uint16_t length; /**< Length in 4 byte units */
+ uint16_t sourceid; /**< source device for this class */
+ uint8_t mode; /**< DirectTouch or DependentTouch */
+ uint8_t num_touches; /**< Maximum number of touches (0==unlimited) */
+} xXITouchInfo;
/**
* Used to select for events on a given window.
@@ -621,8 +647,10 @@ typedef struct {
uint16_t deviceid;
uint8_t mode;
uint8_t pad;
+ uint32_t touch_id; /**< Since XI 2.2 */
+ Window grab_window; /**< Since XI 2.2 */
} xXIAllowEventsReq;
-#define sz_xXIAllowEventsReq 12
+#define sz_xXIAllowEventsReq 20 /**< Was 12 before XI 2.2 */
/**
@@ -857,7 +885,31 @@ typedef struct
} xXIDeviceChangedEvent;
/**
- * Default input event for pointer or keyboard input.
+ * The owner of a touch stream has passed on ownership to another client.
+ */
+typedef struct
+{
+ uint8_t type; /**< Always GenericEvent */
+ uint8_t extension; /**< XI extension offset */
+ uint16_t sequenceNumber;
+ uint32_t length; /**< Length in 4 byte units */
+ uint16_t evtype; /**< XI_TouchOwnership */
+ uint16_t deviceid; /**< Device that has changed */
+ Time time;
+ uint32_t touchid;
+ Window root;
+ Window event;
+ Window child;
+/* └──────── 32 byte boundary ────────┘ */
+ uint16_t sourceid; /**< Source of the new classes */
+ uint16_t pad0;
+ uint32_t flags;
+ uint32_t pad1;
+ uint32_t pad2;
+} xXITouchOwnershipEvent;
+
+/**
+ * Default input event for pointer, keyboard or touch input.
*/
typedef struct
{
@@ -884,6 +936,7 @@ typedef struct
uint32_t flags; /**< ::XIKeyRepeat */
xXIModifierInfo mods;
xXIGroupInfo group;
+ uint32_t active_touches; /**< Number of touches on source device (XI 2.1 only) */
} xXIDeviceEvent;
@@ -902,7 +955,7 @@ typedef struct
uint16_t deviceid;
Time time;
uint32_t detail;
- uint16_t pad0;
+ uint16_t sourceid; /**< The source device (XI 2.1) */
uint16_t valuators_len; /**< Length of trailing valuator
mask in 4 byte units */
uint32_t flags; /**< ::XIKeyRepeat */
diff --git a/apps/xwininfo/dsimple.c b/apps/xwininfo/dsimple.c
index 5f98c5675..e6d320ed7 100644
--- a/apps/xwininfo/dsimple.c
+++ b/apps/xwininfo/dsimple.c
@@ -441,92 +441,92 @@ Print_X_Error (
switch (err->error_code)
{
case XCB_REQUEST:
- snprintf (buffer, sizeof(buffer), ": Bad Request");
+ snprintf (buffer, sizeof(buffer), "Bad Request");
break;
case XCB_VALUE:
snprintf (buffer, sizeof(buffer),
- ": Bad Value: 0x%x", err->resource_id);
+ "Bad Value: 0x%x", err->resource_id);
break;
case XCB_WINDOW:
snprintf (buffer, sizeof(buffer),
- ": Bad Window: 0x%x", err->resource_id);
+ "Bad Window: 0x%x", err->resource_id);
break;
case XCB_PIXMAP:
snprintf (buffer, sizeof(buffer),
- ": Bad Pixmap: 0x%x", err->resource_id);
+ "Bad Pixmap: 0x%x", err->resource_id);
break;
case XCB_ATOM:
snprintf (buffer, sizeof(buffer),
- ": Bad Atom: 0x%x", err->resource_id);
+ "Bad Atom: 0x%x", err->resource_id);
break;
case XCB_CURSOR:
snprintf (buffer, sizeof(buffer),
- ": Bad Cursor: 0x%x", err->resource_id);
+ "Bad Cursor: 0x%x", err->resource_id);
break;
case XCB_FONT:
snprintf (buffer, sizeof(buffer),
- ": Bad Font: 0x%x", err->resource_id);
+ "Bad Font: 0x%x", err->resource_id);
break;
case XCB_MATCH:
- snprintf (buffer, sizeof(buffer), ": Bad Match");
+ snprintf (buffer, sizeof(buffer), "Bad Match");
break;
case XCB_DRAWABLE:
snprintf (buffer, sizeof(buffer),
- ": Bad Drawable: 0x%x", err->resource_id);
+ "Bad Drawable: 0x%x", err->resource_id);
break;
case XCB_ACCESS:
- snprintf (buffer, sizeof(buffer), ": Access Denied");
+ snprintf (buffer, sizeof(buffer), "Access Denied");
break;
case XCB_ALLOC:
snprintf (buffer, sizeof(buffer),
- ": Server Memory Allocation Failure");
+ "Server Memory Allocation Failure");
break;
case XCB_COLORMAP:
snprintf (buffer, sizeof(buffer),
- ": Bad Color: 0x%x", err->resource_id);
+ "Bad Color: 0x%x", err->resource_id);
break;
case XCB_G_CONTEXT:
snprintf (buffer, sizeof(buffer),
- ": Bad GC: 0x%x", err->resource_id);
+ "Bad GC: 0x%x", err->resource_id);
break;
case XCB_ID_CHOICE:
snprintf (buffer, sizeof(buffer),
- ": Bad XID: 0x%x", err->resource_id);
+ "Bad XID: 0x%x", err->resource_id);
break;
case XCB_NAME:
snprintf (buffer, sizeof(buffer),
- ": Bad Name");
+ "Bad Name");
break;
case XCB_LENGTH:
snprintf (buffer, sizeof(buffer),
- ": Bad Request Length");
+ "Bad Request Length");
break;
case XCB_IMPLEMENTATION:
snprintf (buffer, sizeof(buffer),
- ": Server Implementation Failure");
+ "Server Implementation Failure");
break;
default:
- snprintf (buffer, sizeof(buffer), ": Unknown error");
+ snprintf (buffer, sizeof(buffer), "Unknown error");
break;
}
- fprintf (stderr, "X Error: %d%s\n", err->error_code, buffer);
+ fprintf (stderr, "X Error: %d: %s\n", err->error_code, buffer);
}
fprintf (stderr, " Request Major code: %d\n", err->major_code);
diff --git a/apps/xwininfo/xwininfo.c b/apps/xwininfo/xwininfo.c
index ef8c72016..f1126e6c0 100644
--- a/apps/xwininfo/xwininfo.c
+++ b/apps/xwininfo/xwininfo.c
@@ -245,14 +245,14 @@ static void Display_Window_Shape (xcb_window_t);
static void Display_WM_Info (struct wininfo *);
static void wininfo_wipe (struct wininfo *);
-static const char *window_id_format = "0x%lx";
+static Bool window_id_format_dec = False;
#ifdef HAVE_ICONV
static iconv_t iconv_from_utf8;
#endif
static const char *user_encoding;
static void print_utf8 (const char *, char *, size_t, const char *);
-static void print_friendly_name (const char *, const char *, const char *);
+static char *get_friendly_name (const char *, const char *);
static xcb_connection_t *dpy;
static xcb_screen_t *screen;
@@ -420,6 +420,19 @@ bscale (int b)
return (nscale (b, bp, bmm, bbuf, sizeof(bbuf)));
}
+static const char *
+window_id_str (xcb_window_t id)
+{
+ static char str[20];
+
+ if (window_id_format_dec)
+ snprintf (str, sizeof(str), "%u", id);
+ else
+ snprintf (str, sizeof(str), "0x%x", id);
+
+ return str;
+}
+
/* end of pixel to inch, metric converter */
int
@@ -472,7 +485,7 @@ main (int argc, char **argv)
continue;
}
if (!strcmp (argv[i], "-int")) {
- window_id_format = "%ld";
+ window_id_format_dec = True;
continue;
}
if (!strcmp (argv[i], "-children")) {
@@ -576,13 +589,10 @@ main (int argc, char **argv)
w->geometry = xcb_get_geometry_reply(dpy, gg_cookie, &err);
if (!w->geometry) {
- char badid[20];
-
if (err)
Print_X_Error (dpy, err);
- snprintf (badid, sizeof(badid), window_id_format, window);
- Fatal_Error ("No such window with id %s.", badid);
+ Fatal_Error ("No such window with id %s.", window_id_str (window));
}
}
@@ -794,7 +804,7 @@ Display_Window_Id (struct wininfo *w, Bool newline_wanted)
unsigned int wm_name_len = 0;
xcb_atom_t wm_name_encoding = XCB_NONE;
- printf (window_id_format, w->window); /* print id # in hex/dec */
+ printf ("%s", window_id_str (w->window));
if (!w->window) {
printf (" (none)");
@@ -1624,6 +1634,20 @@ wm_hints_reply (xcb_connection_t *dpy, xcb_get_property_cookie_t cookie,
#endif
static void
+Display_Atom_Name (xcb_atom_t atom, const char *prefix)
+{
+ const char *atom_name = Get_Atom_Name (dpy, atom);
+
+ if (atom_name) {
+ char *friendly_name = get_friendly_name (atom_name, prefix);
+ printf (" %s\n", friendly_name);
+ free (friendly_name);
+ } else {
+ printf (" (unresolvable ATOM 0x%x)\n", atom);
+ }
+}
+
+static void
Display_WM_Info (struct wininfo *w)
{
xcb_icccm_wm_hints_t wmhints;
@@ -1687,17 +1711,8 @@ Display_WM_Info (struct wininfo *w)
if (atom_count > 0) {
printf (" Window type:\n");
- for (i = 0; i < atom_count; i++) {
- const char *atom_name = Get_Atom_Name (dpy, atoms[i]);
-
- if (atom_name) {
- print_friendly_name (" %s\n", atom_name,
- "_NET_WM_WINDOW_TYPE_");
- } else {
- printf (" (unresolvable ATOM 0x%x)\n",
- atoms[i]);
- }
- }
+ for (i = 0; i < atom_count; i++)
+ Display_Atom_Name (atoms[i], "_NET_WM_WINDOW_TYPE_");
}
}
free (prop);
@@ -1711,17 +1726,8 @@ Display_WM_Info (struct wininfo *w)
if (atom_count > 0) {
printf (" Window state:\n");
- for (i = 0; i < atom_count; i++) {
- const char *atom_name = Get_Atom_Name (dpy, atoms[i]);
-
- if (atom_name) {
- print_friendly_name (" %s\n", atom_name,
- "_NET_WM_STATE_");
- } else {
- printf (" (unresolvable ATOM 0x%x)\n",
- atoms[i]);
- }
- }
+ for (i = 0; i < atom_count; i++)
+ Display_Atom_Name (atoms[i], "_NET_WM_STATE_");
}
}
free (prop);
@@ -1936,14 +1942,14 @@ print_utf8 (const char *prefix, char *u8str, size_t length, const char *suffix)
/*
* Takes a string such as an atom name, strips the prefix, converts
* underscores to spaces, lowercases all but the first letter of each word,
- * and prints it.
+ * and returns it. The returned string should be freed by the caller.
*/
-static void
-print_friendly_name (const char *format, const char *string,
- const char *prefix)
+static char *
+get_friendly_name (const char *string, const char *prefix)
{
const char *name_start = string;
char *lowered_name, *n;
+ Bool first = True;
int prefix_len = strlen (prefix);
if (strncmp (name_start, prefix, prefix_len) == 0) {
@@ -1951,22 +1957,19 @@ print_friendly_name (const char *format, const char *string,
}
lowered_name = strdup (name_start);
- if (lowered_name) {
- Bool first = True;
-
- for (n = lowered_name ; *n != 0 ; n++) {
- if (*n == '_') {
- *n = ' ';
- first = True;
- } else if (first) {
- first = False;
- } else {
- *n = tolower(*n);
- }
+ if (lowered_name == NULL)
+ Fatal_Error ("Failed to allocate memory in get_friendly_name");
+
+ for (n = lowered_name ; *n != 0 ; n++) {
+ if (*n == '_') {
+ *n = ' ';
+ first = True;
+ } else if (first) {
+ first = False;
+ } else {
+ *n = tolower(*n);
}
- name_start = lowered_name;
}
- printf (format, name_start);
- free (lowered_name);
+ return lowered_name;
}
diff --git a/fontconfig/doc/Makefile.am b/fontconfig/doc/Makefile.am
index 8d7d5c8ba..a29ba2fff 100644
--- a/fontconfig/doc/Makefile.am
+++ b/fontconfig/doc/Makefile.am
@@ -102,7 +102,7 @@ if CROSS_COMPILING
.fncs.sgml:
@echo Warning: cannot rebuild $@ when cross-compiling
else
-.fncs.sgml:
+.fncs.sgml: ./edit-sgml$(EXEEXT)
$(RM) $@
./edit-sgml$(EXEEXT) $(FNCS_TMPL) < '$<' > $*.sgml
endif
diff --git a/libXau/AuLock.c b/libXau/AuLock.c
index 1eab79ae4..a816b2454 100644
--- a/libXau/AuLock.c
+++ b/libXau/AuLock.c
@@ -81,7 +81,7 @@ long dead)
if (creat_fd == -1) {
creat_fd = open (creat_name, O_WRONLY | O_CREAT | O_EXCL, 0600);
if (creat_fd == -1) {
- if (errno != EACCES)
+ if (errno != EACCES && errno != EEXIST)
return LOCK_ERROR;
} else
(void) close (creat_fd);
diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp
index 91a223160..4f8a5482b 100644
--- a/mesalib/src/glsl/ast_to_hir.cpp
+++ b/mesalib/src/glsl/ast_to_hir.cpp
@@ -2803,6 +2803,19 @@ ast_declarator_list::hir(exec_list *instructions,
_mesa_glsl_error(& loc, state,
"identifier `%s' uses reserved `gl_' prefix",
decl->identifier);
+ else if (state->language_version >= 130 &&
+ strstr(decl->identifier, "__")) {
+ /* From page 14 (page 20 of the PDF) of the GLSL 1.10
+ * spec:
+ *
+ * "In addition, all identifiers containing two
+ * consecutive underscores (__) are reserved as
+ * possible future keywords."
+ */
+ _mesa_glsl_error(& loc, state,
+ "identifier `%s' uses reserved `__' string",
+ decl->identifier);
+ }
/* Add the variable to the symbol table. Note that the initializer's
* IR was already processed earlier (though it hasn't been emitted
diff --git a/mesalib/src/glsl/builtin_variables.h b/mesalib/src/glsl/builtin_variables.h
index f3531a370..d25bbf42a 100644
--- a/mesalib/src/glsl/builtin_variables.h
+++ b/mesalib/src/glsl/builtin_variables.h
@@ -1,110 +1,110 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include "main/core.h" /* for slot numbers */
-
-struct builtin_variable {
- enum ir_variable_mode mode;
- int slot;
- const char *type;
- const char *name;
-};
-
-static const builtin_variable builtin_core_vs_variables[] = {
- { ir_var_out, VERT_RESULT_HPOS, "vec4", "gl_Position" },
- { ir_var_out, VERT_RESULT_PSIZ, "float", "gl_PointSize" },
-};
-
-static const builtin_variable builtin_core_fs_variables[] = {
- { ir_var_in, FRAG_ATTRIB_WPOS, "vec4", "gl_FragCoord" },
- { ir_var_in, FRAG_ATTRIB_FACE, "bool", "gl_FrontFacing" },
- { ir_var_out, FRAG_RESULT_COLOR, "vec4", "gl_FragColor" },
-};
-
-static const builtin_variable builtin_100ES_fs_variables[] = {
- { ir_var_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" },
-};
-
-static const builtin_variable builtin_110_fs_variables[] = {
- { ir_var_out, FRAG_RESULT_DEPTH, "float", "gl_FragDepth" },
-};
-
-static const builtin_variable builtin_110_deprecated_fs_variables[] = {
- { ir_var_in, FRAG_ATTRIB_COL0, "vec4", "gl_Color" },
- { ir_var_in, FRAG_ATTRIB_COL1, "vec4", "gl_SecondaryColor" },
- { ir_var_in, FRAG_ATTRIB_FOGC, "float", "gl_FogFragCoord" },
-};
-
-static const builtin_variable builtin_110_deprecated_vs_variables[] = {
- { ir_var_in, VERT_ATTRIB_POS, "vec4", "gl_Vertex" },
- { ir_var_in, VERT_ATTRIB_NORMAL, "vec3", "gl_Normal" },
- { ir_var_in, VERT_ATTRIB_COLOR0, "vec4", "gl_Color" },
- { ir_var_in, VERT_ATTRIB_COLOR1, "vec4", "gl_SecondaryColor" },
- { ir_var_in, VERT_ATTRIB_TEX0, "vec4", "gl_MultiTexCoord0" },
- { ir_var_in, VERT_ATTRIB_TEX1, "vec4", "gl_MultiTexCoord1" },
- { ir_var_in, VERT_ATTRIB_TEX2, "vec4", "gl_MultiTexCoord2" },
- { ir_var_in, VERT_ATTRIB_TEX3, "vec4", "gl_MultiTexCoord3" },
- { ir_var_in, VERT_ATTRIB_TEX4, "vec4", "gl_MultiTexCoord4" },
- { ir_var_in, VERT_ATTRIB_TEX5, "vec4", "gl_MultiTexCoord5" },
- { ir_var_in, VERT_ATTRIB_TEX6, "vec4", "gl_MultiTexCoord6" },
- { ir_var_in, VERT_ATTRIB_TEX7, "vec4", "gl_MultiTexCoord7" },
- { ir_var_in, VERT_ATTRIB_FOG, "float", "gl_FogCoord" },
- { ir_var_out, VERT_RESULT_HPOS, "vec4", "gl_ClipVertex" },
- { ir_var_out, VERT_RESULT_COL0, "vec4", "gl_FrontColor" },
- { ir_var_out, VERT_RESULT_BFC0, "vec4", "gl_BackColor" },
- { ir_var_out, VERT_RESULT_COL1, "vec4", "gl_FrontSecondaryColor" },
- { ir_var_out, VERT_RESULT_BFC1, "vec4", "gl_BackSecondaryColor" },
- { ir_var_out, VERT_RESULT_FOGC, "float", "gl_FogFragCoord" },
-};
-
-static const builtin_variable builtin_120_fs_variables[] = {
- { ir_var_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" },
-};
-
-static const builtin_variable builtin_130_vs_variables[] = {
- { ir_var_in, -1, "int", "gl_VertexID" },
-};
-
-static const builtin_variable builtin_110_deprecated_uniforms[] = {
- { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrix" },
- { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrix" },
- { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrix" },
- { ir_var_uniform, -1, "mat3", "gl_NormalMatrix" },
- { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixInverse" },
- { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixInverse" },
- { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixInverse" },
- { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixTranspose" },
- { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixTranspose" },
- { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixTranspose" },
- { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixInverseTranspose" },
- { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixInverseTranspose" },
- { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixInverseTranspose" },
- { ir_var_uniform, -1, "float", "gl_NormalScale" },
- { ir_var_uniform, -1, "gl_LightModelParameters", "gl_LightModel"},
-
- /* Mesa-internal ATI_envmap_bumpmap state. */
- { ir_var_uniform, -1, "vec2", "gl_MESABumpRotMatrix0"},
- { ir_var_uniform, -1, "vec2", "gl_MESABumpRotMatrix1"},
- { ir_var_uniform, -1, "vec4", "gl_MESAFogParamsOptimized"},
-};
-
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "main/core.h" /* for slot numbers */
+
+struct builtin_variable {
+ enum ir_variable_mode mode;
+ int slot;
+ const char *type;
+ const char *name;
+};
+
+static const builtin_variable builtin_core_vs_variables[] = {
+ { ir_var_out, VERT_RESULT_HPOS, "vec4", "gl_Position" },
+ { ir_var_out, VERT_RESULT_PSIZ, "float", "gl_PointSize" },
+};
+
+static const builtin_variable builtin_core_fs_variables[] = {
+ { ir_var_in, FRAG_ATTRIB_WPOS, "vec4", "gl_FragCoord" },
+ { ir_var_in, FRAG_ATTRIB_FACE, "bool", "gl_FrontFacing" },
+ { ir_var_out, FRAG_RESULT_COLOR, "vec4", "gl_FragColor" },
+};
+
+static const builtin_variable builtin_100ES_fs_variables[] = {
+ { ir_var_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" },
+};
+
+static const builtin_variable builtin_110_fs_variables[] = {
+ { ir_var_out, FRAG_RESULT_DEPTH, "float", "gl_FragDepth" },
+};
+
+static const builtin_variable builtin_110_deprecated_fs_variables[] = {
+ { ir_var_in, FRAG_ATTRIB_COL0, "vec4", "gl_Color" },
+ { ir_var_in, FRAG_ATTRIB_COL1, "vec4", "gl_SecondaryColor" },
+ { ir_var_in, FRAG_ATTRIB_FOGC, "float", "gl_FogFragCoord" },
+};
+
+static const builtin_variable builtin_110_deprecated_vs_variables[] = {
+ { ir_var_in, VERT_ATTRIB_POS, "vec4", "gl_Vertex" },
+ { ir_var_in, VERT_ATTRIB_NORMAL, "vec3", "gl_Normal" },
+ { ir_var_in, VERT_ATTRIB_COLOR0, "vec4", "gl_Color" },
+ { ir_var_in, VERT_ATTRIB_COLOR1, "vec4", "gl_SecondaryColor" },
+ { ir_var_in, VERT_ATTRIB_TEX0, "vec4", "gl_MultiTexCoord0" },
+ { ir_var_in, VERT_ATTRIB_TEX1, "vec4", "gl_MultiTexCoord1" },
+ { ir_var_in, VERT_ATTRIB_TEX2, "vec4", "gl_MultiTexCoord2" },
+ { ir_var_in, VERT_ATTRIB_TEX3, "vec4", "gl_MultiTexCoord3" },
+ { ir_var_in, VERT_ATTRIB_TEX4, "vec4", "gl_MultiTexCoord4" },
+ { ir_var_in, VERT_ATTRIB_TEX5, "vec4", "gl_MultiTexCoord5" },
+ { ir_var_in, VERT_ATTRIB_TEX6, "vec4", "gl_MultiTexCoord6" },
+ { ir_var_in, VERT_ATTRIB_TEX7, "vec4", "gl_MultiTexCoord7" },
+ { ir_var_in, VERT_ATTRIB_FOG, "float", "gl_FogCoord" },
+ { ir_var_out, VERT_RESULT_CLIP_VERTEX, "vec4", "gl_ClipVertex" },
+ { ir_var_out, VERT_RESULT_COL0, "vec4", "gl_FrontColor" },
+ { ir_var_out, VERT_RESULT_BFC0, "vec4", "gl_BackColor" },
+ { ir_var_out, VERT_RESULT_COL1, "vec4", "gl_FrontSecondaryColor" },
+ { ir_var_out, VERT_RESULT_BFC1, "vec4", "gl_BackSecondaryColor" },
+ { ir_var_out, VERT_RESULT_FOGC, "float", "gl_FogFragCoord" },
+};
+
+static const builtin_variable builtin_120_fs_variables[] = {
+ { ir_var_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" },
+};
+
+static const builtin_variable builtin_130_vs_variables[] = {
+ { ir_var_in, -1, "int", "gl_VertexID" },
+};
+
+static const builtin_variable builtin_110_deprecated_uniforms[] = {
+ { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrix" },
+ { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrix" },
+ { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrix" },
+ { ir_var_uniform, -1, "mat3", "gl_NormalMatrix" },
+ { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixInverse" },
+ { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixInverse" },
+ { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixInverse" },
+ { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixTranspose" },
+ { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixTranspose" },
+ { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixTranspose" },
+ { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixInverseTranspose" },
+ { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixInverseTranspose" },
+ { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixInverseTranspose" },
+ { ir_var_uniform, -1, "float", "gl_NormalScale" },
+ { ir_var_uniform, -1, "gl_LightModelParameters", "gl_LightModel"},
+
+ /* Mesa-internal ATI_envmap_bumpmap state. */
+ { ir_var_uniform, -1, "vec2", "gl_MESABumpRotMatrix0"},
+ { ir_var_uniform, -1, "vec2", "gl_MESABumpRotMatrix1"},
+ { ir_var_uniform, -1, "vec4", "gl_MESAFogParamsOptimized"},
+};
+
diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c
index c2f922674..f04a98b03 100644
--- a/mesalib/src/mesa/main/mipmap.c
+++ b/mesalib/src/mesa/main/mipmap.c
@@ -1816,7 +1816,6 @@ generate_mipmap_uncompressed(struct gl_context *ctx, GLenum target,
_mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight,
dstDepth, border, srcImage->InternalFormat,
srcImage->TexFormat);
- dstImage->DriverData = NULL;
/* Alloc storage for new texture image */
if (!ctx->Driver.AllocTextureImageBuffer(ctx, dstImage,
@@ -2049,78 +2048,3 @@ _mesa_generate_mipmap(struct gl_context *ctx, GLenum target,
generate_mipmap_uncompressed(ctx, target, texObj, srcImage, maxLevel);
}
}
-
-
-/**
- * Helper function for drivers which need to rescale texture images to
- * certain aspect ratios.
- * Nearest filtering only (for broken hardware that can't support
- * all aspect ratios). This can be made a lot faster, but I don't
- * really care enough...
- */
-void
-_mesa_rescale_teximage2d(GLuint bytesPerPixel,
- GLuint srcStrideInPixels,
- GLuint dstRowStride,
- GLint srcWidth, GLint srcHeight,
- GLint dstWidth, GLint dstHeight,
- const GLvoid *srcImage, GLvoid *dstImage)
-{
- GLint row, col;
-
-#define INNER_LOOP( TYPE, HOP, WOP ) \
- for ( row = 0 ; row < dstHeight ; row++ ) { \
- GLint srcRow = row HOP hScale; \
- for ( col = 0 ; col < dstWidth ; col++ ) { \
- GLint srcCol = col WOP wScale; \
- dst[col] = src[srcRow * srcStrideInPixels + srcCol]; \
- } \
- dst = (TYPE *) ((GLubyte *) dst + dstRowStride); \
- } \
-
-#define RESCALE_IMAGE( TYPE ) \
-do { \
- const TYPE *src = (const TYPE *)srcImage; \
- TYPE *dst = (TYPE *)dstImage; \
- \
- if ( srcHeight < dstHeight ) { \
- const GLint hScale = dstHeight / srcHeight; \
- if ( srcWidth < dstWidth ) { \
- const GLint wScale = dstWidth / srcWidth; \
- INNER_LOOP( TYPE, /, / ); \
- } \
- else { \
- const GLint wScale = srcWidth / dstWidth; \
- INNER_LOOP( TYPE, /, * ); \
- } \
- } \
- else { \
- const GLint hScale = srcHeight / dstHeight; \
- if ( srcWidth < dstWidth ) { \
- const GLint wScale = dstWidth / srcWidth; \
- INNER_LOOP( TYPE, *, / ); \
- } \
- else { \
- const GLint wScale = srcWidth / dstWidth; \
- INNER_LOOP( TYPE, *, * ); \
- } \
- } \
-} while (0)
-
- switch ( bytesPerPixel ) {
- case 4:
- RESCALE_IMAGE( GLuint );
- break;
-
- case 2:
- RESCALE_IMAGE( GLushort );
- break;
-
- case 1:
- RESCALE_IMAGE( GLubyte );
- break;
- default:
- _mesa_problem(NULL,"unexpected bytes/pixel in _mesa_rescale_teximage2d");
- }
-}
-
diff --git a/mesalib/src/mesa/main/mipmap.h b/mesalib/src/mesa/main/mipmap.h
index 8b7cd7d5a..1fb9146a1 100644
--- a/mesalib/src/mesa/main/mipmap.h
+++ b/mesalib/src/mesa/main/mipmap.h
@@ -46,13 +46,4 @@ _mesa_generate_mipmap(struct gl_context *ctx, GLenum target,
struct gl_texture_object *texObj);
-extern void
-_mesa_rescale_teximage2d(GLuint bytesPerPixel,
- GLuint srcStrideInPixels,
- GLuint dstRowStride,
- GLint srcWidth, GLint srcHeight,
- GLint dstWidth, GLint dstHeight,
- const GLvoid *srcImage, GLvoid *dstImage);
-
-
#endif /* MIPMAP_H */
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index 67db4df8f..c97c0bf80 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -73,10 +73,7 @@ struct _mesa_HashTable;
struct gl_attrib_node;
struct gl_list_extensions;
struct gl_meta_state;
-struct gl_pixelstore_attrib;
struct gl_program_cache;
-struct gl_texture_format;
-struct gl_texture_image;
struct gl_texture_object;
struct gl_context;
struct st_context;
@@ -214,9 +211,10 @@ typedef enum
VERT_RESULT_BFC0 = 13,
VERT_RESULT_BFC1 = 14,
VERT_RESULT_EDGE = 15,
- VERT_RESULT_CLIP_DIST0 = 16,
- VERT_RESULT_CLIP_DIST1 = 17,
- VERT_RESULT_VAR0 = 18, /**< shader varying */
+ VERT_RESULT_CLIP_VERTEX = 16,
+ VERT_RESULT_CLIP_DIST0 = 17,
+ VERT_RESULT_CLIP_DIST1 = 18,
+ VERT_RESULT_VAR0 = 19, /**< shader varying */
VERT_RESULT_MAX = (VERT_RESULT_VAR0 + MAX_VARYING)
} gl_vert_result;
@@ -1268,13 +1266,6 @@ struct gl_texture_image
GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to
each 2D slice in 'Data', in texels */
GLvoid *Data; /**< Image data, accessed via FetchTexel() */
-
- /**
- * \name For device driver:
- */
- /*@{*/
- void *DriverData; /**< Arbitrary device driver data */
- /*@}*/
};
@@ -1492,13 +1483,20 @@ struct gl_texture_attrib
/**
+ * Data structure representing a single clip plane (e.g. one of the elements
+ * of the ctx->Transform.EyeUserPlane or ctx->Transform._ClipUserPlane array).
+ */
+typedef GLfloat gl_clip_plane[4];
+
+
+/**
* Transformation attribute group (GL_TRANSFORM_BIT).
*/
struct gl_transform_attrib
{
GLenum MatrixMode; /**< Matrix mode */
- GLfloat EyeUserPlane[MAX_CLIP_PLANES][4]; /**< User clip planes */
- GLfloat _ClipUserPlane[MAX_CLIP_PLANES][4]; /**< derived */
+ gl_clip_plane EyeUserPlane[MAX_CLIP_PLANES]; /**< User clip planes */
+ gl_clip_plane _ClipUserPlane[MAX_CLIP_PLANES]; /**< derived */
GLbitfield ClipPlanesEnabled; /**< on/off bitmask */
GLboolean Normalize; /**< Normalize all normals? */
GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */
diff --git a/mesalib/src/mesa/main/texcompress_fxt1.c b/mesalib/src/mesa/main/texcompress_fxt1.c
index 0437cfcc1..b6d8ae016 100644
--- a/mesalib/src/mesa/main/texcompress_fxt1.c
+++ b/mesalib/src/mesa/main/texcompress_fxt1.c
@@ -72,7 +72,6 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS)
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset == 0);
(void) dstZoffset;
- (void) dstImageOffsets;
if (srcFormat != GL_RGB ||
srcType != GL_UNSIGNED_BYTE ||
@@ -99,7 +98,7 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS)
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
dstFormat,
- texWidth, (GLubyte *) dstAddr);
+ texWidth, dstSlices[0]);
fxt1_encode(srcWidth, srcHeight, 3, pixels, srcRowStride,
dst, dstRowStride);
@@ -128,7 +127,6 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS)
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset == 0);
(void) dstZoffset;
- (void) dstImageOffsets;
if (srcFormat != GL_RGBA ||
srcType != GL_UNSIGNED_BYTE ||
@@ -155,7 +153,7 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS)
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
dstFormat,
- texWidth, (GLubyte *) dstAddr);
+ texWidth, dstSlices[0]);
fxt1_encode(srcWidth, srcHeight, 4, pixels, srcRowStride,
dst, dstRowStride);
diff --git a/mesalib/src/mesa/main/texcompress_rgtc.c b/mesalib/src/mesa/main/texcompress_rgtc.c
index 398f61290..b03cd28b8 100644
--- a/mesalib/src/mesa/main/texcompress_rgtc.c
+++ b/mesalib/src/mesa/main/texcompress_rgtc.c
@@ -106,7 +106,6 @@ _mesa_texstore_red_rgtc1(TEXSTORE_PARAMS)
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
(void) dstZoffset;
- (void) dstImageOffsets;
tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
@@ -120,7 +119,7 @@ _mesa_texstore_red_rgtc1(TEXSTORE_PARAMS)
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
dstFormat,
- texWidth, (GLubyte *) dstAddr);
+ texWidth, dstSlices[0]);
blkaddr = dst;
dstRowDiff = dstRowStride >= (srcWidth * 2) ? dstRowStride - (((srcWidth + 3) & ~3) * 2) : 0;
@@ -162,7 +161,6 @@ _mesa_texstore_signed_red_rgtc1(TEXSTORE_PARAMS)
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
(void) dstZoffset;
- (void) dstImageOffsets;
tempImage = _mesa_make_temp_float_image(ctx, dims,
baseInternalFormat,
@@ -175,7 +173,7 @@ _mesa_texstore_signed_red_rgtc1(TEXSTORE_PARAMS)
dst = (GLbyte *)_mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
dstFormat,
- texWidth, (GLubyte *) dstAddr);
+ texWidth, dstSlices[0]);
blkaddr = dst;
dstRowDiff = dstRowStride >= (srcWidth * 2) ? dstRowStride - (((srcWidth + 3) & ~3) * 2) : 0;
@@ -218,7 +216,6 @@ _mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS)
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
(void) dstZoffset;
- (void) dstImageOffsets;
tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
@@ -231,7 +228,7 @@ _mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS)
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
dstFormat,
- texWidth, (GLubyte *) dstAddr);
+ texWidth, dstSlices[0]);
blkaddr = dst;
dstRowDiff = dstRowStride >= (srcWidth * 4) ? dstRowStride - (((srcWidth + 3) & ~3) * 4) : 0;
@@ -280,7 +277,6 @@ _mesa_texstore_signed_rg_rgtc2(TEXSTORE_PARAMS)
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
(void) dstZoffset;
- (void) dstImageOffsets;
tempImage = _mesa_make_temp_float_image(ctx, dims,
baseInternalFormat,
@@ -293,7 +289,7 @@ _mesa_texstore_signed_rg_rgtc2(TEXSTORE_PARAMS)
dst = (GLbyte *)_mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
dstFormat,
- texWidth, (GLubyte *) dstAddr);
+ texWidth, dstSlices[0]);
blkaddr = dst;
dstRowDiff = dstRowStride >= (srcWidth * 4) ? dstRowStride - (((srcWidth + 3) & ~3) * 4) : 0;
diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c
index 8c6b1dfad..b180c80f0 100644
--- a/mesalib/src/mesa/main/texcompress_s3tc.c
+++ b/mesalib/src/mesa/main/texcompress_s3tc.c
@@ -174,7 +174,6 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
(void) dstZoffset;
- (void) dstImageOffsets;
if (srcFormat != GL_RGB ||
srcType != GL_UNSIGNED_BYTE ||
@@ -198,7 +197,7 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
dstFormat,
- texWidth, (GLubyte *) dstAddr);
+ texWidth, dstSlices[0]);
if (ext_tx_compress_dxtn) {
(*ext_tx_compress_dxtn)(3, srcWidth, srcHeight, pixels,
@@ -233,7 +232,6 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
(void) dstZoffset;
- (void) dstImageOffsets;
if (srcFormat != GL_RGBA ||
srcType != GL_UNSIGNED_BYTE ||
@@ -257,7 +255,7 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
dstFormat,
- texWidth, (GLubyte *) dstAddr);
+ texWidth, dstSlices[0]);
if (ext_tx_compress_dxtn) {
(*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
@@ -291,7 +289,6 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
(void) dstZoffset;
- (void) dstImageOffsets;
if (srcFormat != GL_RGBA ||
srcType != GL_UNSIGNED_BYTE ||
@@ -314,7 +311,7 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
dstFormat,
- texWidth, (GLubyte *) dstAddr);
+ texWidth, dstSlices[0]);
if (ext_tx_compress_dxtn) {
(*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
@@ -348,7 +345,6 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
(void) dstZoffset;
- (void) dstImageOffsets;
if (srcFormat != GL_RGBA ||
srcType != GL_UNSIGNED_BYTE ||
@@ -371,7 +367,7 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
dstFormat,
- texWidth, (GLubyte *) dstAddr);
+ texWidth, dstSlices[0]);
if (ext_tx_compress_dxtn) {
(*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c
index d70cb8ac7..cc9fbc020 100644
--- a/mesalib/src/mesa/main/texstore.c
+++ b/mesalib/src/mesa/main/texstore.c
@@ -850,10 +850,9 @@ _mesa_swizzle_ubyte_image(struct gl_context *ctx,
const GLubyte *rgba2dst,
GLuint dstComponents,
- GLvoid *dstAddr,
GLint dstXoffset, GLint dstYoffset, GLint dstZoffset,
GLint dstRowStride,
- const GLuint *dstImageOffsets,
+ GLubyte **dstSlices,
GLint srcWidth, GLint srcHeight, GLint srcDepth,
const GLvoid *srcAddr,
@@ -896,7 +895,7 @@ _mesa_swizzle_ubyte_image(struct gl_context *ctx,
srcRowStride == srcWidth * srcComponents &&
dimensions < 3) {
/* 1 and 2D images only */
- GLubyte *dstImage = (GLubyte *) dstAddr
+ GLubyte *dstImage = dstSlices[0]
+ dstYoffset * dstRowStride
+ dstXoffset * dstComponents;
swizzle_copy(dstImage, dstComponents, srcImage, srcComponents, map,
@@ -906,8 +905,7 @@ _mesa_swizzle_ubyte_image(struct gl_context *ctx,
GLint img, row;
for (img = 0; img < srcDepth; img++) {
const GLubyte *srcRow = srcImage;
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * dstComponents
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * dstComponents;
for (row = 0; row < srcHeight; row++) {
@@ -930,10 +928,9 @@ static void
memcpy_texture(struct gl_context *ctx,
GLuint dimensions,
gl_format dstFormat,
- GLvoid *dstAddr,
GLint dstXoffset, GLint dstYoffset, GLint dstZoffset,
GLint dstRowStride,
- const GLuint *dstImageOffsets,
+ GLubyte **dstSlices,
GLint srcWidth, GLint srcHeight, GLint srcDepth,
GLenum srcFormat, GLenum srcType,
const GLvoid *srcAddr,
@@ -948,54 +945,35 @@ memcpy_texture(struct gl_context *ctx,
const GLuint texelBytes = _mesa_get_format_bytes(dstFormat);
const GLint bytesPerRow = srcWidth * texelBytes;
-#if 0
- /* XXX update/re-enable for dstImageOffsets array */
- const GLint bytesPerImage = srcHeight * bytesPerRow;
- const GLint bytesPerTexture = srcDepth * bytesPerImage;
- GLubyte *dstImage = (GLubyte *) dstAddr
- + dstZoffset * dstImageStride
- + dstYoffset * dstRowStride
- + dstXoffset * texelBytes;
-
if (dstRowStride == srcRowStride &&
- dstRowStride == bytesPerRow &&
- ((dstImageStride == srcImageStride &&
- dstImageStride == bytesPerImage) ||
- (srcDepth == 1))) {
- /* one big memcpy */
- ctx->Driver.TextureMemCpy(dstImage, srcImage, bytesPerTexture);
+ dstRowStride == bytesPerRow) {
+ /* memcpy image by image */
+ GLint img;
+ for (img = 0; img < srcDepth; img++) {
+ GLubyte *dstImage = dstSlices[dstZoffset + img]
+ + dstYoffset * dstRowStride
+ + dstXoffset * texelBytes;
+ ctx->Driver.TextureMemCpy(dstImage, srcImage,
+ bytesPerRow * srcHeight);
+ srcImage += srcImageStride;
+ }
}
- else
- {
+ else {
+ /* memcpy row by row */
GLint img, row;
for (img = 0; img < srcDepth; img++) {
const GLubyte *srcRow = srcImage;
- GLubyte *dstRow = dstImage;
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ + dstYoffset * dstRowStride
+ + dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
ctx->Driver.TextureMemCpy(dstRow, srcRow, bytesPerRow);
dstRow += dstRowStride;
srcRow += srcRowStride;
}
srcImage += srcImageStride;
- dstImage += dstImageStride;
}
}
-#endif
-
- GLint img, row;
- for (img = 0; img < srcDepth; img++) {
- const GLubyte *srcRow = srcImage;
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
- + dstYoffset * dstRowStride
- + dstXoffset * texelBytes;
- for (row = 0; row < srcHeight; row++) {
- ctx->Driver.TextureMemCpy(dstRow, srcRow, bytesPerRow);
- dstRow += dstRowStride;
- srcRow += srcRowStride;
- }
- srcImage += srcImageStride;
- }
}
@@ -1022,9 +1000,8 @@ _mesa_texstore_z32(TEXSTORE_PARAMS)
srcType == dstType) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -1032,8 +1009,7 @@ _mesa_texstore_z32(TEXSTORE_PARAMS)
/* general path */
GLint img, row;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1066,8 +1042,7 @@ _mesa_texstore_x8_z24(TEXSTORE_PARAMS)
/* general path */
GLint img, row;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1100,8 +1075,7 @@ _mesa_texstore_z24_x8(TEXSTORE_PARAMS)
/* general path */
GLint img, row;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1142,9 +1116,8 @@ _mesa_texstore_z16(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_SHORT) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -1152,8 +1125,7 @@ _mesa_texstore_z16(TEXSTORE_PARAMS)
/* general path */
GLint img, row;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1192,9 +1164,8 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_SHORT_5_6_5) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -1210,7 +1181,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
const GLubyte *src = (const GLubyte *)
_mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight,
srcFormat, srcType, 0, 0, 0);
- GLubyte *dst = (GLubyte *) dstAddr
+ GLubyte *dst = dstSlices[0]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
GLint row, col;
@@ -1247,8 +1218,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1303,9 +1273,8 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian))) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -1319,9 +1288,8 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian))) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -1355,8 +1323,8 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
srcType,
baseInternalFormat,
dstmap, 4,
- dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
+ dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcAddr,
srcPacking);
}
@@ -1373,8 +1341,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1429,9 +1396,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_INT_8_8_8_8_REV)) {
/* simple memcpy path (little endian) */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -1445,9 +1411,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_INT_8_8_8_8)) {
/* simple memcpy path (big endian) */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -1465,8 +1430,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
_mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking,
srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0);
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1501,8 +1465,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
_mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking,
srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0);
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1554,9 +1517,9 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
srcType,
baseInternalFormat,
dstmap, 4,
- dstAddr, dstXoffset, dstYoffset, dstZoffset,
+ dstXoffset, dstYoffset, dstZoffset,
dstRowStride,
- dstImageOffsets,
+ dstSlices,
srcWidth, srcHeight, srcDepth, srcAddr,
srcPacking);
}
@@ -1573,8 +1536,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1633,9 +1595,8 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
littleEndian) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -1650,8 +1611,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
_mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking,
srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0);
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1684,8 +1644,8 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
srcType,
baseInternalFormat,
dstmap, 3,
- dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
+ dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcAddr,
srcPacking);
}
@@ -1702,8 +1662,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1759,9 +1718,8 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS)
littleEndian) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -1776,8 +1734,7 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS)
_mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking,
srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0);
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1810,8 +1767,8 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS)
srcType,
baseInternalFormat,
dstmap, 3,
- dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
+ dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcAddr,
srcPacking);
}
@@ -1828,8 +1785,7 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1866,9 +1822,8 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -1885,8 +1840,7 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1934,9 +1888,8 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_SHORT_5_5_5_1) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -1953,8 +1906,7 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -1992,9 +1944,8 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2011,8 +1962,7 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2061,9 +2011,8 @@ _mesa_texstore_argb2101010(TEXSTORE_PARAMS)
baseInternalFormat == GL_RGBA) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2081,8 +2030,7 @@ _mesa_texstore_argb2101010(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
if (baseInternalFormat == GL_RGBA) {
@@ -2149,8 +2097,7 @@ _mesa_texstore_unorm44(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2197,9 +2144,8 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS)
littleEndian) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2242,8 +2188,8 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS)
srcType,
baseInternalFormat,
dstmap, 2,
- dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
+ dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcAddr,
srcPacking);
}
@@ -2260,8 +2206,7 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2319,9 +2264,8 @@ _mesa_texstore_unorm1616(TEXSTORE_PARAMS)
littleEndian) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2339,8 +2283,7 @@ _mesa_texstore_unorm1616(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2396,9 +2339,8 @@ _mesa_texstore_unorm16(TEXSTORE_PARAMS)
littleEndian) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2416,8 +2358,7 @@ _mesa_texstore_unorm16(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2454,9 +2395,8 @@ _mesa_texstore_rgba_16(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_SHORT) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2474,8 +2414,7 @@ _mesa_texstore_rgba_16(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2519,9 +2458,8 @@ _mesa_texstore_signed_rgba_16(TEXSTORE_PARAMS)
srcType == GL_SHORT) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2545,8 +2483,7 @@ _mesa_texstore_signed_rgba_16(TEXSTORE_PARAMS)
* 3 or 4 components/pixel here.
*/
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2597,9 +2534,8 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS)
srcFormat == GL_RGB && srcType == GL_UNSIGNED_BYTE_3_3_2) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2616,8 +2552,7 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2657,9 +2592,8 @@ _mesa_texstore_unorm8(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_BYTE) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2686,8 +2620,8 @@ _mesa_texstore_unorm8(TEXSTORE_PARAMS)
srcType,
baseInternalFormat,
dstmap, 1,
- dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
+ dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcAddr,
srcPacking);
}
@@ -2704,8 +2638,7 @@ _mesa_texstore_unorm8(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2745,9 +2678,8 @@ _mesa_texstore_ycbcr(TEXSTORE_PARAMS)
/* always just memcpy since no pixel transfer ops apply */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
@@ -2759,8 +2691,7 @@ _mesa_texstore_ycbcr(TEXSTORE_PARAMS)
!littleEndian) {
GLint img, row;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2789,9 +2720,8 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS)
littleEndian) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2816,8 +2746,8 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS)
GL_UNSIGNED_BYTE, /* hack */
GL_LUMINANCE_ALPHA, /* hack */
dstmap, 2,
- dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
+ dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcAddr,
srcPacking);
}
@@ -2849,7 +2779,7 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS)
}
src = tempImage;
- dst = (GLbyte *) dstAddr
+ dst = (GLbyte *) dstSlices[0]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2884,9 +2814,8 @@ _mesa_texstore_snorm8(TEXSTORE_PARAMS)
srcType == GL_BYTE) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2904,8 +2833,7 @@ _mesa_texstore_snorm8(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLbyte *dstRow = (GLbyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLbyte *dstRow = (GLbyte *) dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -2943,9 +2871,8 @@ _mesa_texstore_snorm88(TEXSTORE_PARAMS)
littleEndian) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -2963,8 +2890,7 @@ _mesa_texstore_snorm88(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLbyte *dstRow = (GLbyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLbyte *dstRow = (GLbyte *) dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -3004,9 +2930,8 @@ _mesa_texstore_snorm16(TEXSTORE_PARAMS)
littleEndian) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3024,8 +2949,7 @@ _mesa_texstore_snorm16(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -3066,9 +2990,8 @@ _mesa_texstore_snorm1616(TEXSTORE_PARAMS)
littleEndian) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3086,8 +3009,7 @@ _mesa_texstore_snorm1616(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -3136,8 +3058,7 @@ _mesa_texstore_signed_rgbx8888(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLbyte *dstRow = (GLbyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLbyte *dstRow = (GLbyte *) dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -3183,9 +3104,8 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS)
(srcFormat == GL_ABGR_EXT && srcType == GL_BYTE && littleEndian))) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3197,9 +3117,8 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS)
(srcFormat == GL_ABGR_EXT && srcType == GL_BYTE && !littleEndian))) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3217,8 +3136,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLbyte *dstRow = (GLbyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLbyte *dstRow = (GLbyte *) dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -3274,9 +3192,8 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
!srcPacking->SwapBytes) {
/* simple path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3284,10 +3201,9 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
srcFormat == GL_STENCIL_INDEX) {
/* In case we only upload depth we need to preserve the stencil */
for (img = 0; img < srcDepth; img++) {
- GLuint *dstRow = (GLuint *) dstAddr
- + dstImageOffsets[dstZoffset + img]
- + dstYoffset * dstRowStride / sizeof(GLuint)
- + dstXoffset;
+ GLuint *dstRow = (GLuint *) (dstSlices[dstZoffset + img]
+ + dstYoffset * dstRowStride
+ + dstXoffset * 4);
const GLubyte *src
= (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr,
srcWidth, srcHeight,
@@ -3357,10 +3273,9 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_INT_24_8_EXT);
for (img = 0; img < srcDepth; img++) {
- GLuint *dstRow = (GLuint *) dstAddr
- + dstImageOffsets[dstZoffset + img]
- + dstYoffset * dstRowStride / sizeof(GLuint)
- + dstXoffset;
+ GLuint *dstRow = (GLuint *) (dstSlices[dstZoffset + img]
+ + dstYoffset * dstRowStride
+ + dstXoffset * 4);
const GLubyte *src
= (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr,
srcWidth, srcHeight,
@@ -3426,9 +3341,8 @@ _mesa_texstore_s8(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_BYTE) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3438,8 +3352,7 @@ _mesa_texstore_s8(TEXSTORE_PARAMS)
GLint img, row;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img]
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride / sizeof(GLuint)
+ dstXoffset;
const GLubyte *src
@@ -3513,9 +3426,8 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS)
srcType == GL_FLOAT) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3535,8 +3447,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS)
return GL_FALSE;
bytesPerRow = srcWidth * components * sizeof(GLfloat);
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -3588,9 +3499,8 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS)
srcType == GL_HALF_FLOAT_ARB) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3608,8 +3518,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -3661,9 +3570,8 @@ _mesa_texstore_rgba_int8(TEXSTORE_PARAMS)
srcType == GL_BYTE) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3680,8 +3588,7 @@ _mesa_texstore_rgba_int8(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -3733,9 +3640,8 @@ _mesa_texstore_rgba_int16(TEXSTORE_PARAMS)
srcType == GL_SHORT) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3752,8 +3658,7 @@ _mesa_texstore_rgba_int16(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -3805,9 +3710,8 @@ _mesa_texstore_rgba_int32(TEXSTORE_PARAMS)
srcType == GL_INT) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3824,8 +3728,7 @@ _mesa_texstore_rgba_int32(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -3877,9 +3780,8 @@ _mesa_texstore_rgba_uint8(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_BYTE) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3894,8 +3796,7 @@ _mesa_texstore_rgba_uint8(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -3947,9 +3848,8 @@ _mesa_texstore_rgba_uint16(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_SHORT) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -3964,8 +3864,7 @@ _mesa_texstore_rgba_uint16(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -4017,9 +3916,8 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_INT) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -4034,8 +3932,7 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * texelBytes
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
@@ -4070,9 +3967,9 @@ _mesa_texstore_srgb8(TEXSTORE_PARAMS)
newDstFormat = MESA_FORMAT_RGB888;
k = _mesa_texstore_rgb888(ctx, dims, baseInternalFormat,
- newDstFormat, dstAddr,
+ newDstFormat,
dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType,
srcAddr, srcPacking);
@@ -4091,9 +3988,9 @@ _mesa_texstore_srgba8(TEXSTORE_PARAMS)
/* reuse normal rgba texstore code */
newDstFormat = MESA_FORMAT_RGBA8888;
k = _mesa_texstore_rgba8888(ctx, dims, baseInternalFormat,
- newDstFormat, dstAddr,
+ newDstFormat,
dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType,
srcAddr, srcPacking);
@@ -4113,9 +4010,9 @@ _mesa_texstore_sargb8(TEXSTORE_PARAMS)
newDstFormat = MESA_FORMAT_ARGB8888;
k = _mesa_texstore_argb8888(ctx, dims, baseInternalFormat,
- newDstFormat, dstAddr,
+ newDstFormat,
dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType,
srcAddr, srcPacking);
@@ -4135,12 +4032,12 @@ _mesa_texstore_sl8(TEXSTORE_PARAMS)
/* _mesa_textore_a8 handles luminance8 too */
k = _mesa_texstore_unorm8(ctx, dims, baseInternalFormat,
- newDstFormat, dstAddr,
- dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
- srcWidth, srcHeight, srcDepth,
- srcFormat, srcType,
- srcAddr, srcPacking);
+ newDstFormat,
+ dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
+ srcWidth, srcHeight, srcDepth,
+ srcFormat, srcType,
+ srcAddr, srcPacking);
return k;
}
@@ -4157,9 +4054,9 @@ _mesa_texstore_sla8(TEXSTORE_PARAMS)
newDstFormat = MESA_FORMAT_AL88;
k = _mesa_texstore_unorm88(ctx, dims, baseInternalFormat,
- newDstFormat, dstAddr,
+ newDstFormat,
dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType,
srcAddr, srcPacking);
@@ -4191,9 +4088,8 @@ _mesa_texstore_rgb9_e5(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_INT_5_9_9_9_REV) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -4211,8 +4107,7 @@ _mesa_texstore_rgb9_e5(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * 4
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * 4;
for (row = 0; row < srcHeight; row++) {
@@ -4244,9 +4139,8 @@ _mesa_texstore_r11_g11_b10f(TEXSTORE_PARAMS)
srcType == GL_UNSIGNED_INT_10F_11F_11F_REV) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -4264,8 +4158,7 @@ _mesa_texstore_r11_g11_b10f(TEXSTORE_PARAMS)
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
- GLubyte *dstRow = (GLubyte *) dstAddr
- + dstImageOffsets[dstZoffset + img] * 4
+ GLubyte *dstRow = dstSlices[dstZoffset + img]
+ dstYoffset * dstRowStride
+ dstXoffset * 4;
for (row = 0; row < srcHeight; row++) {
@@ -4300,9 +4193,8 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
!srcPacking->SwapBytes) {
/* simple path */
memcpy_texture(ctx, dims,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride,
- dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth, srcFormat, srcType,
srcAddr, srcPacking);
}
@@ -4315,10 +4207,9 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
/* In case we only upload depth we need to preserve the stencil */
for (img = 0; img < srcDepth; img++) {
- uint64_t *dstRow = (uint64_t *) dstAddr
- + dstImageOffsets[dstZoffset + img]
- + dstYoffset * dstRowStride / sizeof(uint64_t)
- + dstXoffset;
+ uint64_t *dstRow = (uint64_t *) (dstSlices[dstZoffset + img]
+ + dstYoffset * dstRowStride
+ + dstXoffset * 8);
const uint64_t *src
= (const uint64_t *) _mesa_image_address(dims, srcPacking, srcAddr,
srcWidth, srcHeight,
@@ -4356,9 +4247,8 @@ _mesa_texstore_null(TEXSTORE_PARAMS)
(void) ctx; (void) dims;
(void) baseInternalFormat;
(void) dstFormat;
- (void) dstAddr;
(void) dstXoffset; (void) dstYoffset; (void) dstZoffset;
- (void) dstRowStride; (void) dstImageOffsets;
+ (void) dstRowStride; (void) dstSlices,
(void) srcWidth; (void) srcHeight; (void) srcDepth;
(void) srcFormat; (void) srcType;
(void) srcAddr;
@@ -4563,8 +4453,8 @@ _mesa_texstore(TEXSTORE_PARAMS)
storeImage = _mesa_get_texstore_func(dstFormat);
success = storeImage(ctx, dims, baseInternalFormat,
- dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
- dstRowStride, dstImageOffsets,
+ dstFormat, dstXoffset, dstYoffset, dstZoffset,
+ dstRowStride, dstSlices,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr, srcPacking);
return success;
@@ -4603,7 +4493,6 @@ _mesa_store_teximage1d(struct gl_context *ctx, GLenum target, GLint level,
struct gl_texture_image *texImage)
{
const GLbitfield rwMode = get_read_write_mode(format, texImage->TexFormat);
- const GLuint zeroImageOffset = 0;
GLubyte *dstMap;
GLint dstRowStride;
GLboolean success;
@@ -4634,10 +4523,9 @@ _mesa_store_teximage1d(struct gl_context *ctx, GLenum target, GLint level,
success = _mesa_texstore(ctx, 1, texImage->_BaseFormat,
texImage->TexFormat,
- dstMap,
0, 0, 0, /* dstX/Y/Zoffset */
0, /* dstRowStride */
- &zeroImageOffset,
+ &dstMap,
width, 1, 1,
format, type, pixels, packing);
@@ -4666,7 +4554,6 @@ _mesa_store_teximage2d(struct gl_context *ctx, GLenum target, GLint level,
struct gl_texture_image *texImage)
{
const GLbitfield rwMode = get_read_write_mode(format, texImage->TexFormat);
- const GLuint zeroImageOffset = 0;
GLubyte *dstMap;
GLint dstRowStride;
GLboolean success;
@@ -4705,10 +4592,9 @@ _mesa_store_teximage2d(struct gl_context *ctx, GLenum target, GLint level,
assert(dstMap);
success = _mesa_texstore(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat,
- dstMap,
0, 0, 0, /* dstX/Y/Zoffset */
dstRowStride,
- &zeroImageOffset,
+ &dstMap,
width, 1, 1,
format, type, pixels, packing);
ctx->Driver.UnmapTextureImage(ctx, texImage, y);
@@ -4727,10 +4613,9 @@ _mesa_store_teximage2d(struct gl_context *ctx, GLenum target, GLint level,
assert(dstMap);
success = _mesa_texstore(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat,
- dstMap,
0, 0, 0, /* dstX/Y/Zoffset */
dstRowStride,
- &zeroImageOffset,
+ &dstMap,
width, height, 1,
format, type, pixels, packing);
@@ -4762,9 +4647,7 @@ _mesa_store_teximage3d(struct gl_context *ctx, GLenum target, GLint level,
GLboolean success;
GLint slice;
GLubyte **sliceMaps;
- GLuint *dstImageOffsets;
GLint dstRowStride;
- GLuint texelSize = _mesa_get_format_bytes(texImage->TexFormat);
(void) border;
@@ -4791,7 +4674,6 @@ _mesa_store_teximage3d(struct gl_context *ctx, GLenum target, GLint level,
}
sliceMaps = (GLubyte **) malloc(depth * sizeof(GLubyte *));
- dstImageOffsets = (GLuint *) malloc(depth * sizeof(GLuint));
/* Map dest texture buffer slices */
for (slice = 0; slice < depth; slice++) {
@@ -4800,17 +4682,12 @@ _mesa_store_teximage3d(struct gl_context *ctx, GLenum target, GLint level,
rwMode,
&sliceMaps[slice], &dstRowStride);
}
- /* Compute image slice offsets */
- for (slice = 0; slice < depth; slice++) {
- dstImageOffsets[slice] = (sliceMaps[slice] - sliceMaps[0]) / texelSize;
- }
success = _mesa_texstore(ctx, 3, texImage->_BaseFormat,
texImage->TexFormat,
- sliceMaps[0],
0, 0, 0, /* dstX/Y/Zoffset */
dstRowStride,
- dstImageOffsets,
+ sliceMaps,
width, height, depth,
format, type, pixels, packing);
@@ -4825,7 +4702,6 @@ _mesa_store_teximage3d(struct gl_context *ctx, GLenum target, GLint level,
_mesa_unmap_teximage_pbo(ctx, packing);
free(sliceMaps);
- free(dstImageOffsets);
}
@@ -4844,7 +4720,6 @@ _mesa_store_texsubimage1d(struct gl_context *ctx, GLenum target, GLint level,
struct gl_texture_image *texImage)
{
const GLbitfield rwMode = get_read_write_mode(format, texImage->TexFormat);
- const GLuint zeroImageOffset = 0;
GLubyte *dstMap;
GLint dstRowStride;
GLboolean success;
@@ -4863,10 +4738,9 @@ _mesa_store_texsubimage1d(struct gl_context *ctx, GLenum target, GLint level,
success = _mesa_texstore(ctx, 1, texImage->_BaseFormat,
texImage->TexFormat,
- dstMap,
0, 0, 0, /* dstX/Y/Zoffset */
dstRowStride,
- &zeroImageOffset,
+ &dstMap,
width, 1, 1,
format, type, pixels, packing);
@@ -4894,7 +4768,6 @@ _mesa_store_texsubimage2d(struct gl_context *ctx, GLenum target, GLint level,
struct gl_texture_image *texImage)
{
const GLbitfield rwMode = get_read_write_mode(format, texImage->TexFormat);
- const GLuint zeroImageOffset = 0;
GLubyte *dstMap;
GLint dstRowStride;
GLboolean success;
@@ -4913,10 +4786,9 @@ _mesa_store_texsubimage2d(struct gl_context *ctx, GLenum target, GLint level,
success = _mesa_texstore(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat,
- dstMap,
0, 0, 0, /* dstX/Y/Zoffset */
dstRowStride,
- &zeroImageOffset,
+ &dstMap,
width, height, 1,
format, type, pixels, packing);
@@ -4946,9 +4818,7 @@ _mesa_store_texsubimage3d(struct gl_context *ctx, GLenum target, GLint level,
GLboolean success;
GLint slice;
GLubyte **sliceMaps;
- GLuint *dstImageOffsets;
GLint dstRowStride;
- GLuint texelSize = _mesa_get_format_bytes(texImage->TexFormat);
/* get pointer to src pixels (may be in a pbo which we'll map here) */
pixels = _mesa_validate_pbo_teximage(ctx, 3, width, height, depth, format,
@@ -4957,29 +4827,21 @@ _mesa_store_texsubimage3d(struct gl_context *ctx, GLenum target, GLint level,
if (!pixels)
return;
- sliceMaps = (GLubyte **) malloc((zoffset + depth) * sizeof(GLubyte *));
- dstImageOffsets = (GLuint *) malloc((zoffset + depth) * sizeof(GLuint));
+ sliceMaps = (GLubyte **) malloc(depth * sizeof(GLubyte *));
/* Map dest texture buffer slices */
for (slice = 0; slice < depth; slice++) {
ctx->Driver.MapTextureImage(ctx, texImage, zoffset + slice,
xoffset, yoffset, width, height,
rwMode,
- &sliceMaps[zoffset + slice], &dstRowStride);
- }
-
- /* Compute image slice offsets */
- for (slice = 0; slice < depth; slice++) {
- dstImageOffsets[slice] =
- (sliceMaps[zoffset + slice] - sliceMaps[zoffset]) / texelSize;
+ &sliceMaps[slice], &dstRowStride);
}
success = _mesa_texstore(ctx, 3, texImage->_BaseFormat,
texImage->TexFormat,
- sliceMaps[zoffset],
- 0, 0, 0, /* dstX/Y/Zoffset */
+ 0, 0, 0,
dstRowStride,
- dstImageOffsets,
+ sliceMaps,
width, height, depth,
format, type, pixels, packing);
@@ -4994,7 +4856,6 @@ _mesa_store_texsubimage3d(struct gl_context *ctx, GLenum target, GLint level,
_mesa_unmap_teximage_pbo(ctx, packing);
free(sliceMaps);
- free(dstImageOffsets);
}
diff --git a/mesalib/src/mesa/main/texstore.h b/mesalib/src/mesa/main/texstore.h
index 24a254ac4..f956b0436 100644
--- a/mesalib/src/mesa/main/texstore.h
+++ b/mesalib/src/mesa/main/texstore.h
@@ -45,10 +45,9 @@
* \param dims either 1 or 2 or 3
* \param baseInternalFormat user-specified base internal format
* \param dstFormat destination Mesa texture format
- * \param dstAddr destination image address
* \param dstX/Y/Zoffset destination x/y/z offset (ala TexSubImage), in texels
* \param dstRowStride destination image row stride, in bytes
- * \param dstImageOffsets offset of each 2D slice within 3D texture, in texels
+ * \param dstSlices array of addresses of image slices (for 3D, array texture)
* \param srcWidth/Height/Depth source image size, in pixels
* \param srcFormat incoming image format
* \param srcType incoming image data type
@@ -59,9 +58,9 @@
struct gl_context *ctx, GLuint dims, \
GLenum baseInternalFormat, \
gl_format dstFormat, \
- GLvoid *dstAddr, \
GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \
- GLint dstRowStride, const GLuint *dstImageOffsets, \
+ GLint dstRowStride, \
+ GLubyte **dstSlices, \
GLint srcWidth, GLint srcHeight, GLint srcDepth, \
GLenum srcFormat, GLenum srcType, \
const GLvoid *srcAddr, \
diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
index 390c51869..74e87f0e4 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -494,7 +494,6 @@ make_texture(struct st_context *st,
{
struct pipe_transfer *transfer;
- static const GLuint dstImageOffsets = 0;
GLboolean success;
GLubyte *dest;
const GLbitfield imageTransferStateSave = ctx->_ImageTransferState;
@@ -517,10 +516,9 @@ make_texture(struct st_context *st,
success = _mesa_texstore(ctx, 2, /* dims */
baseInternalFormat, /* baseInternalFormat */
mformat, /* gl_format */
- dest, /* dest */
0, 0, 0, /* dstX/Y/Zoffset */
transfer->stride, /* dstRowStride, bytes */
- &dstImageOffsets, /* dstImageOffsets */
+ &dest, /* destSlices */
width, height, 1, /* size */
format, type, /* src format/type */
pixels, /* data source */
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index 76bf78bbf..169e235ac 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -162,9 +162,9 @@ st_FreeTextureImageBuffer(struct gl_context * ctx, struct gl_texture_image *texI
pipe_resource_reference(&stImage->pt, NULL);
}
- if (texImage->Data) {
- _mesa_align_free(texImage->Data);
- texImage->Data = NULL;
+ if (stImage->TexData) {
+ _mesa_align_free(stImage->TexData);
+ stImage->TexData = NULL;
}
}
@@ -482,7 +482,7 @@ st_AllocTextureImageBuffer(struct gl_context *ctx,
assert(width > 0);
assert(height > 0);
assert(depth > 0);
- assert(!texImage->Data);
+ assert(!stImage->TexData);
assert(!stImage->pt); /* xxx this might be wrong */
/* Look if the parent texture object has space for this image */
@@ -604,6 +604,7 @@ st_TexImage(struct gl_context * ctx,
GLuint dstRowStride = 0;
struct gl_pixelstore_attrib unpackNB;
enum pipe_transfer_usage transfer_usage = 0;
+ GLubyte *dstMap;
DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(target), level, width, height, depth, border);
@@ -650,10 +651,10 @@ st_TexImage(struct gl_context * ctx,
*/
if (stImage->pt) {
pipe_resource_reference(&stImage->pt, NULL);
- assert(!texImage->Data);
+ assert(!stImage->TexData);
}
- else if (texImage->Data) {
- _mesa_align_free(texImage->Data);
+ else if (stImage->TexData) {
+ _mesa_align_free(stImage->TexData);
}
/*
@@ -744,8 +745,8 @@ st_TexImage(struct gl_context * ctx,
else
transfer_usage = PIPE_TRANSFER_WRITE;
- texImage->Data = st_texture_image_map(st, stImage, 0,
- transfer_usage, 0, 0, width, height);
+ dstMap = st_texture_image_map(st, stImage, 0,
+ transfer_usage, 0, 0, width, height);
if(stImage->transfer)
dstRowStride = stImage->transfer->stride;
}
@@ -755,10 +756,11 @@ st_TexImage(struct gl_context * ctx,
width, height, depth);
dstRowStride = _mesa_format_row_stride(texImage->TexFormat, width);
- texImage->Data = _mesa_align_malloc(imageSize, 16);
+ stImage->TexData = _mesa_align_malloc(imageSize, 16);
+ dstMap = stImage->TexData;
}
- if (!texImage->Data) {
+ if (!dstMap) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
return;
}
@@ -771,16 +773,16 @@ st_TexImage(struct gl_context * ctx,
DBG("Upload image %dx%dx%d row_len %x pitch %x\n",
width, height, depth, width, dstRowStride);
- /* Copy user texture image into the texture buffer.
+ /* Copy user texture image into the mapped texture buffer.
*/
if (compressed_src) {
const GLuint srcRowStride =
_mesa_format_row_stride(texImage->TexFormat, width);
if (dstRowStride == srcRowStride) {
- memcpy(texImage->Data, pixels, imageSize);
+ memcpy(dstMap, pixels, imageSize);
}
else {
- char *dst = texImage->Data;
+ GLubyte *dst = dstMap;
const char *src = pixels;
GLuint i, bw, bh, lines;
_mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
@@ -803,10 +805,9 @@ st_TexImage(struct gl_context * ctx,
if (!_mesa_texstore(ctx, dims,
texImage->_BaseFormat,
texImage->TexFormat,
- texImage->Data,
0, 0, 0, /* dstX/Y/Zoffset */
dstRowStride,
- texImage->ImageOffsets,
+ (GLubyte **) &dstMap, /* dstSlice */
width, height, 1,
format, type, src, unpack)) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
@@ -816,9 +817,9 @@ st_TexImage(struct gl_context * ctx,
/* unmap this slice */
st_texture_image_unmap(st, stImage);
/* map next slice of 3D texture */
- texImage->Data = st_texture_image_map(st, stImage, i + 1,
- transfer_usage, 0, 0,
- width, height);
+ dstMap = st_texture_image_map(st, stImage, i + 1,
+ transfer_usage, 0, 0,
+ width, height);
src += srcImageStride;
}
}
@@ -827,9 +828,8 @@ st_TexImage(struct gl_context * ctx,
done:
_mesa_unmap_teximage_pbo(ctx, unpack);
- if (stImage->pt && texImage->Data) {
+ if (stImage->pt && stImage->transfer) {
st_texture_image_unmap(st, stImage);
- texImage->Data = NULL;
}
}
@@ -1018,7 +1018,7 @@ st_GetTexImage(struct gl_context * ctx,
if (stImage->pt && util_format_is_s3tc(stImage->pt->format)) {
/* Need to decompress the texture.
* We'll do this by rendering a textured quad (which is hopefully
- * faster than using the fallback code in texcompress.c.
+ * faster than using the fallback code in texcompress.c).
* Note that we only expect RGBA formats (no Z/depth formats).
*/
decompress_with_blit(ctx, format, type, pixels, texImage);
@@ -1047,6 +1047,7 @@ st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level,
const GLubyte *src;
/* init to silence warning only: */
enum pipe_transfer_usage transfer_usage = PIPE_TRANSFER_WRITE;
+ GLubyte *dstMap;
DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(target),
@@ -1074,13 +1075,13 @@ st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level,
else
transfer_usage = PIPE_TRANSFER_WRITE;
- texImage->Data = st_texture_image_map(st, stImage, zoffset,
- transfer_usage,
- xoffset, yoffset,
- width, height);
+ dstMap = st_texture_image_map(st, stImage, zoffset,
+ transfer_usage,
+ xoffset, yoffset,
+ width, height);
}
- if (!texImage->Data) {
+ if (!dstMap) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
goto done;
}
@@ -1091,10 +1092,9 @@ st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level,
for (i = 0; i < depth; i++) {
if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat,
texImage->TexFormat,
- texImage->Data,
0, 0, 0,
dstRowStride,
- texImage->ImageOffsets,
+ (GLubyte **) &dstMap,
width, height, 1,
format, type, src, packing)) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
@@ -1104,11 +1104,11 @@ st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level,
/* unmap this slice */
st_texture_image_unmap(st, stImage);
/* map next slice of 3D texture */
- texImage->Data = st_texture_image_map(st, stImage,
- zoffset + i + 1,
- transfer_usage,
- xoffset, yoffset,
- width, height);
+ dstMap = st_texture_image_map(st, stImage,
+ zoffset + i + 1,
+ transfer_usage,
+ xoffset, yoffset,
+ width, height);
src += srcImageStride;
}
}
@@ -1116,9 +1116,8 @@ st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level,
done:
_mesa_unmap_teximage_pbo(ctx, packing);
- if (stImage->pt && texImage->Data) {
+ if (stImage->pt && stImage->transfer) {
st_texture_image_unmap(st, stImage);
- texImage->Data = NULL;
}
}
@@ -1194,14 +1193,15 @@ st_CompressedTexSubImage2D(struct gl_context *ctx, GLenum target, GLint level,
int dstBlockStride;
int y;
enum pipe_format pformat;
+ GLubyte *dstMap;
if (stImage->pt) {
pformat = stImage->pt->format;
- texImage->Data = st_texture_image_map(st, stImage, 0,
- PIPE_TRANSFER_WRITE,
- xoffset, yoffset,
- width, height);
+ dstMap = st_texture_image_map(st, stImage, 0,
+ PIPE_TRANSFER_WRITE,
+ xoffset, yoffset,
+ width, height);
srcBlockStride = util_format_get_stride(pformat, width);
dstBlockStride = stImage->transfer->stride;
@@ -1212,7 +1212,7 @@ st_CompressedTexSubImage2D(struct gl_context *ctx, GLenum target, GLint level,
return;
}
- if (!texImage->Data) {
+ if (!dstMap) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage");
return;
}
@@ -1223,13 +1223,12 @@ st_CompressedTexSubImage2D(struct gl_context *ctx, GLenum target, GLint level,
for (y = 0; y < height; y += util_format_get_blockheight(pformat)) {
/* don't need to adjust for xoffset and yoffset as st_texture_image_map does that */
const char *src = (const char*)data + srcBlockStride * util_format_get_nblocksy(pformat, y);
- char *dst = (char*)texImage->Data + dstBlockStride * util_format_get_nblocksy(pformat, y);
+ char *dst = (char *) dstMap + dstBlockStride * util_format_get_nblocksy(pformat, y);
memcpy(dst, src, util_format_get_stride(pformat, width));
}
- if (stImage->pt) {
+ if (stImage->pt && stImage->transfer) {
st_texture_image_unmap(st, stImage);
- texImage->Data = NULL;
}
}
@@ -1356,10 +1355,9 @@ fallback_copy_texsubimage(struct gl_context *ctx, GLenum target, GLint level,
_mesa_texstore(ctx, dims,
texImage->_BaseFormat,
texImage->TexFormat,
- texDest,
0, 0, 0,
dstRowStride,
- texImage->ImageOffsets,
+ (GLubyte **) &texDest,
width, height, 1,
GL_RGBA, GL_FLOAT, tempSrc, /* src */
&unpack);
@@ -1686,19 +1684,21 @@ copy_image_data_to_texture(struct st_context *st,
pipe_resource_reference(&stImage->pt, NULL);
}
- else if (stImage->base.Data) {
+ else if (stImage->TexData) {
+ /* Copy from malloc'd memory */
+ /* XXX this should be re-examined/tested with a compressed format */
+ GLuint blockSize = util_format_get_blocksize(stObj->pt->format);
+ GLuint srcRowStride = stImage->base.Width * blockSize;
+ GLuint srcSliceStride = stImage->base.Height * srcRowStride;
st_texture_image_data(st,
stObj->pt,
stImage->base.Face,
dstLevel,
- stImage->base.Data,
- stImage->base.RowStride *
- util_format_get_blocksize(stObj->pt->format),
- stImage->base.RowStride *
- stImage->base.Height *
- util_format_get_blocksize(stObj->pt->format));
- _mesa_align_free(stImage->base.Data);
- stImage->base.Data = NULL;
+ stImage->TexData,
+ srcRowStride,
+ srcSliceStride);
+ _mesa_align_free(stImage->TexData);
+ stImage->TexData = NULL;
}
pipe_resource_reference(&stImage->pt, stObj->pt);
diff --git a/mesalib/src/mesa/state_tracker/st_texture.c b/mesalib/src/mesa/state_tracker/st_texture.c
index c18268829..ca8106b52 100644
--- a/mesalib/src/mesa/state_tracker/st_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_texture.c
@@ -241,6 +241,7 @@ st_texture_image_unmap(struct st_context *st,
pipe_transfer_unmap(pipe, stImage->transfer);
pipe->transfer_destroy(pipe, stImage->transfer);
+ stImage->transfer = NULL;
}
diff --git a/mesalib/src/mesa/state_tracker/st_texture.h b/mesalib/src/mesa/state_tracker/st_texture.h
index dd3bc7310..3d2a6369c 100644
--- a/mesalib/src/mesa/state_tracker/st_texture.h
+++ b/mesalib/src/mesa/state_tracker/st_texture.h
@@ -45,8 +45,13 @@ struct st_texture_image
{
struct gl_texture_image base;
+ /** Used to store texture data that doesn't fit in the patent
+ * object's mipmap buffer.
+ */
+ GLubyte *TexData;
+
/* If stImage->pt != NULL, image data is stored here.
- * Else if stImage->base.Data != NULL, image is stored there.
+ * Else if stImage->TexData != NULL, image is stored there.
* Else there is no image data.
*/
struct pipe_resource *pt;
diff --git a/mesalib/src/mesa/swrast/s_texfetch.c b/mesalib/src/mesa/swrast/s_texfetch.c
index 73b5af319..7573abda6 100644
--- a/mesalib/src/mesa/swrast/s_texfetch.c
+++ b/mesalib/src/mesa/swrast/s_texfetch.c
@@ -656,6 +656,226 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
store_texel_rg_f16
},
+ {
+ MESA_FORMAT_ALPHA_UINT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_ALPHA_UINT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_ALPHA_UINT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_ALPHA_INT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_ALPHA_INT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_ALPHA_INT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+
+ {
+ MESA_FORMAT_INTENSITY_UINT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_INTENSITY_UINT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_INTENSITY_UINT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_INTENSITY_INT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_INTENSITY_INT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_INTENSITY_INT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+
+ {
+ MESA_FORMAT_LUMINANCE_UINT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_LUMINANCE_UINT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_LUMINANCE_UINT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_LUMINANCE_INT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_LUMINANCE_INT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_LUMINANCE_INT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_UINT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_UINT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_UINT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_INT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_INT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_INT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+
+ {
+ MESA_FORMAT_R_INT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_RG_INT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
+ {
+ MESA_FORMAT_RGB_INT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+
/* non-normalized, signed int */
{
MESA_FORMAT_RGBA_INT8,
@@ -665,6 +885,27 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
store_texel_rgba_int8
},
{
+ MESA_FORMAT_R_INT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
+ MESA_FORMAT_RG_INT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
+ MESA_FORMAT_RGB_INT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
MESA_FORMAT_RGBA_INT16,
fetch_texel_1d_rgba_int16,
fetch_texel_2d_rgba_int16,
@@ -672,6 +913,27 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
store_texel_rgba_int16
},
{
+ MESA_FORMAT_R_INT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
+ MESA_FORMAT_RG_INT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
+ MESA_FORMAT_RGB_INT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
MESA_FORMAT_RGBA_INT32,
fetch_texel_1d_rgba_int32,
fetch_texel_2d_rgba_int32,
@@ -681,6 +943,27 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
/* non-normalized, unsigned int */
{
+ MESA_FORMAT_R_UINT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
+ MESA_FORMAT_RG_UINT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
+ MESA_FORMAT_RGB_UINT8,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
MESA_FORMAT_RGBA_UINT8,
fetch_texel_1d_rgba_uint8,
fetch_texel_2d_rgba_uint8,
@@ -688,6 +971,27 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
store_texel_rgba_uint8
},
{
+ MESA_FORMAT_R_UINT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
+ MESA_FORMAT_RG_UINT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
+ MESA_FORMAT_RGB_UINT16,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
MESA_FORMAT_RGBA_UINT16,
fetch_texel_1d_rgba_uint16,
fetch_texel_2d_rgba_uint16,
@@ -695,6 +999,27 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
store_texel_rgba_uint16
},
{
+ MESA_FORMAT_R_UINT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
+ MESA_FORMAT_RG_UINT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
+ MESA_FORMAT_RGB_UINT32,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ {
MESA_FORMAT_RGBA_UINT32,
fetch_texel_1d_rgba_uint32,
fetch_texel_2d_rgba_uint32,
diff --git a/packages.txt b/packages.txt
index a2fea7677..a7d2410a8 100644
--- a/packages.txt
+++ b/packages.txt
@@ -46,7 +46,7 @@ fontconfig git version
fontsproto-2.1.1
freetype-2.4.6
glproto git version
-inputproto-2.0.2
+inputproto-2.1.99.1
kbproto-1.0.5
libX11 git version
libXau git version
diff --git a/xorg-server/xkeyboard-config/symbols/keypad b/xorg-server/xkeyboard-config/symbols/keypad
index e85aaacbd..1bab39181 100644
--- a/xorg-server/xkeyboard-config/symbols/keypad
+++ b/xorg-server/xkeyboard-config/symbols/keypad
@@ -84,19 +84,19 @@ xkb_symbols "x11" {
// Ungrab cancels server/keyboard/pointer grabs
key <KPDV> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Divide, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Ungrab ]
+ symbols[Group1]= [ KP_Divide, KP_Divide, KP_Divide, KP_Divide, XF86_Ungrab ]
};
// ClsGrb kills whichever client has a grab in effect
key <KPMU> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Multiply, VoidSymbol, VoidSymbol, VoidSymbol, XF86_ClearGrab ]
+ symbols[Group1]= [ KP_Multiply, KP_Multiply, KP_Multiply, KP_Multiply, XF86_ClearGrab ]
};
// -VMode switches to the previous video mode
key <KPSU> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Subtract, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Prev_VMode ]
+ symbols[Group1]= [ KP_Subtract, KP_Subtract, KP_Subtract, KP_Subtract, XF86_Prev_VMode ]
};
key <KP7> { [ KP_Home, KP_7 ] };
@@ -106,7 +106,7 @@ xkb_symbols "x11" {
// +VMode switches to the next video mode
key <KPAD> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Add, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Next_VMode ]
+ symbols[Group1]= [ KP_Add, KP_Add, KP_Add, KP_Add, XF86_Next_VMode ]
};
key <KP4> { [ KP_Left, KP_4 ] };
@@ -242,11 +242,11 @@ xkb_symbols "legacymath" {
key.type[Group1]="CTRL+ALT" ;
- key <KPDV> { [ KP_Divide, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Ungrab ] }; // / <XF86_Ungrab>
- key <KPMU> { [ KP_Multiply, VoidSymbol, VoidSymbol, VoidSymbol, XF86_ClearGrab ] }; // * <XF86_ClearGrab>
- key <KPSU> { [ KP_Subtract, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Prev_VMode ] }; // - <XF86_Prev_VMode>
+ key <KPDV> { [ KP_Divide, KP_Divide, KP_Divide, KP_Divide, XF86_Ungrab ] }; // / <XF86_Ungrab>
+ key <KPMU> { [ KP_Multiply, KP_Multiply, KP_Multiply, KP_Multiply, XF86_ClearGrab ] }; // * <XF86_ClearGrab>
+ key <KPSU> { [ KP_Subtract, KP_Subtract, KP_Subtract, KP_Subtract, XF86_Prev_VMode ] }; // - <XF86_Prev_VMode>
- key <KPAD> { [ KP_Add, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Next_VMode ] }; // + <XF86_Next_VMode>
+ key <KPAD> { [ KP_Add, KP_Add, KP_Add, KP_Add, XF86_Next_VMode ] }; // + <XF86_Next_VMode>
};
@@ -602,7 +602,7 @@ xkb_symbols "numoperdecsep" {
// ClsGrb kills whichever client has a grab in effect
key <KOMU> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Multiply, VoidSymbol, VoidSymbol, VoidSymbol, XF86_ClearGrab ]
+ symbols[Group1]= [ KP_Multiply, KP_Multiply, KP_Multiply, KP_Multiply, XF86_ClearGrab ]
};
key <KO4> { [ KP_4 ] };
@@ -611,7 +611,7 @@ xkb_symbols "numoperdecsep" {
// -VMode switches to the previous video mode
key <KOSU> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Subtract, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Prev_VMode ]
+ symbols[Group1]= [ KP_Subtract, KP_Subtract, KP_Subtract, KP_Subtract, XF86_Prev_VMode ]
};
key <KO1> { [ KP_1 ] };
@@ -620,7 +620,7 @@ xkb_symbols "numoperdecsep" {
// +VMode switches to the next video mode
key <KOAD> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Add, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Next_VMode ]
+ symbols[Group1]= [ KP_Add, KP_Add, KP_Add, KP_Add, XF86_Next_VMode ]
};
key <KO0> { [ KP_0 ] };
@@ -628,6 +628,6 @@ xkb_symbols "numoperdecsep" {
// Ungrab cancels server/keyboard/pointer grabs
key <KODV> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Divide, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Ungrab ]
+ symbols[Group1]= [ KP_Divide, KP_Divide, KP_Divide, KP_Divide, XF86_Ungrab ]
};
};
diff --git a/xorg-server/xkeyboard-config/symbols/srvr_ctrl b/xorg-server/xkeyboard-config/symbols/srvr_ctrl
index 7d47d66a3..73b5af2de 100644
--- a/xorg-server/xkeyboard-config/symbols/srvr_ctrl
+++ b/xorg-server/xkeyboard-config/symbols/srvr_ctrl
@@ -12,25 +12,25 @@ xkb_symbols "stdkeypad" {
// Ungrab cancels server/keyboard/pointer grabs
key <KPDV> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Divide, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Ungrab ]
+ symbols[Group1]= [ KP_Divide, KP_Divide, KP_Divide, KP_Divide, XF86_Ungrab ]
};
// ClsGrb kills whichever client has a grab in effect
key <KPMU> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Multiply, VoidSymbol, VoidSymbol, VoidSymbol, XF86_ClearGrab ]
+ symbols[Group1]= [ KP_Multiply, KP_Multiply, KP_Multiply, KP_Multiply, XF86_ClearGrab ]
};
// -VMode switches to the previous video mode
key <KPSU> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Subtract, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Prev_VMode ]
+ symbols[Group1]= [ KP_Subtract, KP_Subtract, KP_Subtract, KP_Subtract, XF86_Prev_VMode ]
};
// +VMode switches to the next video mode
key <KPAD> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Add, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Next_VMode]
+ symbols[Group1]= [ KP_Add, KP_Add, KP_Add, KP_Add, XF86_Next_VMode]
};
};
@@ -40,62 +40,62 @@ xkb_symbols "fkey2vt" {
key <FK01> {
type="CTRL+ALT",
- symbols[Group1]= [ F1, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_1 ]
+ symbols[Group1]= [ F1, F1, F1, F1, XF86_Switch_VT_1 ]
};
key <FK02> {
type="CTRL+ALT",
- symbols[Group1]= [ F2, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_2 ]
+ symbols[Group1]= [ F2, F2, F2, F2, XF86_Switch_VT_2 ]
};
key <FK03> {
type="CTRL+ALT",
- symbols[Group1]= [ F3, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_3 ]
+ symbols[Group1]= [ F3, F3, F3, F3, XF86_Switch_VT_3 ]
};
key <FK04> {
type="CTRL+ALT",
- symbols[Group1]= [ F4, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_4 ]
+ symbols[Group1]= [ F4, F4, F4, F4, XF86_Switch_VT_4 ]
};
key <FK05> {
type="CTRL+ALT",
- symbols[Group1]= [ F5, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_5 ]
+ symbols[Group1]= [ F5, F5, F5, F5, XF86_Switch_VT_5 ]
};
key <FK06> {
type="CTRL+ALT",
- symbols[Group1]= [ F6, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_6 ]
+ symbols[Group1]= [ F6, F6, F6, F6, XF86_Switch_VT_6 ]
};
key <FK07> {
type="CTRL+ALT",
- symbols[Group1]= [ F7, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_7 ]
+ symbols[Group1]= [ F7, F7, F7, F7, XF86_Switch_VT_7 ]
};
key <FK08> {
type="CTRL+ALT",
- symbols[Group1]= [ F8, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_8 ]
+ symbols[Group1]= [ F8, F8, F8, F8, XF86_Switch_VT_8 ]
};
key <FK09> {
type="CTRL+ALT",
- symbols[Group1]= [ F9, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_9 ]
+ symbols[Group1]= [ F9, F9, F9, F9, XF86_Switch_VT_9 ]
};
key <FK10> {
type="CTRL+ALT",
- symbols[Group1]= [ F10, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_10 ]
+ symbols[Group1]= [ F10, F10, F10, F10, XF86_Switch_VT_10 ]
};
key <FK11> {
type="CTRL+ALT",
- symbols[Group1]= [ F11, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_11 ]
+ symbols[Group1]= [ F11, F11, F11, F11, XF86_Switch_VT_11 ]
};
key <FK12> {
type="CTRL+ALT",
- symbols[Group1]= [ F12, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Switch_VT_12 ]
+ symbols[Group1]= [ F12, F12, F12, F12, XF86_Switch_VT_12 ]
};
};
diff --git a/xorg-server/xkeyboard-config/symbols/terminate b/xorg-server/xkeyboard-config/symbols/terminate
index 96dd6e8f2..c74220bc7 100644
--- a/xorg-server/xkeyboard-config/symbols/terminate
+++ b/xorg-server/xkeyboard-config/symbols/terminate
@@ -2,6 +2,6 @@ partial default modifier_keys
xkb_symbols "ctrl_alt_bksp" {
key <BKSP> {
type="CTRL+ALT",
- symbols[Group1] = [ NoSymbol, VoidSymbol, VoidSymbol, VoidSymbol, Terminate_Server ]
+ symbols[Group1] = [ NoSymbol, NoSymbol, NoSymbol, NoSymbol, Terminate_Server ]
};
};