summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2010-04-10 16:05:54 +0100
committerKeith Whitwell <keithw@vmware.com>2010-04-10 16:05:54 +0100
commit287c94ea4987033f9c99a2f91c5750c9083504ca (patch)
treea3c1d20522d0ba4a259a5c83e2126affd7aba83c /src/gallium/auxiliary/util
parente7f1e5ca648d6c96d056d3ae8eab65e98f47f311 (diff)
Squashed commit of the following:
commit 0189cb2fde9f5d7326fd4bfbc2e52db4cce73b3e Author: Keith Whitwell <keithw@vmware.com> Date: Sat Apr 10 12:48:43 2010 +0100 gallium: don't use generic get_transfer func for textures It doesn't know and can't fill in the stride value. commit 65bc6f88fd9ce8ff90175b250e580bef2739ea35 Author: Chia-I Wu <olv@lunarg.com> Date: Sat Apr 10 13:49:34 2010 +0800 i915g: Initialize screen surface function. commit eb56e64986790aa2fa35534ce652b78656b0c3c5 Merge: f8b0a7f e7f1e5c Author: Keith Whitwell <keithw@vmware.com> Date: Sat Apr 10 00:38:43 2010 +0100 Merge commit 'origin/master' into gallium-resources Conflicts: src/gallium/drivers/r300/r300_texture.c commit f8b0a7f6a3a98fd36ce90a81073ec8c8f09b684c Merge: a3c9980 f43c679 Author: Keith Whitwell <keithw@vmware.com> Date: Sat Apr 10 00:35:09 2010 +0100 Merge commit 'origin/master' into gallium-resources Conflicts: src/gallium/drivers/r300/r300_texture.c commit a3c99807de37dc2c072f1d75ed3a11da333bc9a1 Author: unknown <michal@.(none)> Date: Fri Apr 9 18:51:39 2010 +0200 scons: Add missing sources. commit 927cec79cedb457efa9e6f335727cfcb8e4908e2 Author: Roland Scheidegger <sroland@vmware.com> Date: Fri Apr 9 18:07:56 2010 +0200 gallium: fix another compile warning after merge. Hmpf. commit 52953cd7b0e51deafecb812bdc40f9e45f9ac62a Author: Roland Scheidegger <sroland@vmware.com> Date: Fri Apr 9 18:02:11 2010 +0200 gallium: fix comment commit 7c8763aa6cfc74adf1ea49c2bab25ca17b32575f Author: unknown <michal@.(none)> Date: Fri Apr 9 18:05:20 2010 +0200 util: Fix type cast. commit 9d0086411a104b7cc9297aac0d1f82853118d7bf Author: unknown <michal@.(none)> Date: Fri Apr 9 18:04:33 2010 +0200 libgl-gdi: Use proper unwrap functions for resources. commit 251a5cdd18ba31c690ef61f133dfc65cd4a45cf8 Author: Roland Scheidegger <sroland@vmware.com> Date: Fri Apr 9 17:51:23 2010 +0200 gallium: more comments fixup commit 8f3f9d5e1e9c0de98a3dfb19e81250d2c32ee4e9 Author: Roland Scheidegger <sroland@vmware.com> Date: Fri Apr 9 17:48:18 2010 +0200 gallium: another fix after merge commit 41f00a32ee5be91512c048bacb89ede0e04bc08d Author: Roland Scheidegger <sroland@vmware.com> Date: Fri Apr 9 17:44:30 2010 +0200 gallium: more pipe_texture/resource fixes after merge commit faf53328d1154c51d8a59513f2bfcae62272b0bf Author: Roland Scheidegger <sroland@vmware.com> Date: Fri Apr 9 17:44:24 2010 +0200 gallium: fix comments for changed USAGE flags commit fdcb17bea4b0798d316b56deea69832f41142adf Author: Roland Scheidegger <sroland@vmware.com> Date: Fri Apr 9 16:40:07 2010 +0200 gallium/pb: pb uses PB_USAGE_ flags, not PIPE_TRANSFER_ (same value anyway) commit c95f7278ecc6db417ec1053279f2a8172c47aee9 Author: Keith Whitwell <keithw@vmware.com> Date: Fri Apr 9 13:44:35 2010 +0100 llvmpipe: fix merge glitches commit 28f8b8683175149a381be5eff263d4c20568bce7 Author: Keith Whitwell <keithw@vmware.com> Date: Fri Apr 9 13:41:39 2010 +0100 r300g: update after merge for pipe_resources commit 248c93cbc066ba6e3fadd94c5fcf3bdbb373d8fd Author: Keith Whitwell <keithw@vmware.com> Date: Fri Apr 9 13:41:20 2010 +0100 st/mesa: fix old pipe_texture usages commit a563b1c5c2cb57b3ef28a3654d9b477460d13ced Author: Keith Whitwell <keithw@vmware.com> Date: Fri Apr 9 13:40:56 2010 +0100 r300g: remove unused variable commit 734500131d828c9dfd68c5fa26b3e6b07e086d2d Author: Keith Whitwell <keithw@vmware.com> Date: Fri Apr 9 13:40:36 2010 +0100 nv50: fix compiler warning commit efd402e13037e5c3e29759fa5b1c754c6d65d0e2 Merge: fec8a1d 5452615 Author: Keith Whitwell <keithw@vmware.com> Date: Fri Apr 9 13:33:57 2010 +0100 Merge commit 'origin/master' into gallium-resources Conflicts: src/gallium/drivers/cell/ppu/cell_screen.c src/gallium/drivers/cell/ppu/cell_texture.c src/gallium/drivers/llvmpipe/lp_screen.c src/gallium/drivers/r300/r300_context.c src/gallium/drivers/r300/r300_render.c src/gallium/drivers/r300/r300_screen.c src/gallium/drivers/r300/r300_state.c src/gallium/drivers/r300/r300_texture.c src/gallium/drivers/r300/r300_transfer.c src/gallium/state_trackers/egl/common/egl_g3d.h src/gallium/state_trackers/egl/kms/native_kms.c src/gallium/state_trackers/egl/x11/native_dri2.c src/gallium/state_trackers/egl/x11/native_ximage.c commit fec8a1db13fac04ef56f6ece799d1f20aa3011db Author: Marek Olšák <maraeo@gmail.com> Date: Sat Apr 3 07:58:34 2010 +0200 util: fix assertion failures in pipe_buffer_flush_mapped_range commit 1ff3984c2edce9927744f3cce3e7b07778990170 Author: Roland Scheidegger <sroland@vmware.com> Date: Thu Apr 8 17:44:54 2010 +0200 docs: fix transfer_map description commit 20bf14be8ac6438cb1afa38212e306fc06a5ed40 Author: Keith Whitwell <keithw@vmware.com> Date: Thu Apr 8 14:39:13 2010 +0100 util: fix up several uses of pipe_map_buffer_range This function used to return a pointer to where the start of the actual buffer would have been, even though only the requested range is being mapped. In the resources change, the function was modified to use a transfer internally, and started returning the pointer to the beginning of the transfer, ie the mapped range. Some users of the function were changed to reflect this new behaviour, some were not. Since then the function has reverted to its original behaviour, matching master. This change restores some of the users of the map_buffer_range helper to expect the old/original behaviour. commit 33179a86058b68b518f40971030db337dc26fe6e Author: Keith Whitwell <keithw@vmware.com> Date: Thu Apr 8 14:38:54 2010 +0100 mesa/st: fix up several uses of pipe_map_buffer_range This function used to return a pointer to where the start of the actual buffer would have been, even though only the requested range is being mapped. In the resources change, the function was modified to use a transfer internally, and started returning the pointer to the beginning of the transfer, ie the mapped range. Some users of the function were changed to reflect this new behaviour, some were not. Since then the function has reverted to its original behaviour, matching master. This change restores some of the users of the map_buffer_range helper to expect the old/original behaviour. commit 3f5363d4dc9d7ad48467ae82d58d5f3d9bd10698 Author: Keith Whitwell <keithw@vmware.com> Date: Wed Apr 7 17:26:52 2010 +0100 util: map_range and flush_range have offsets relative to start of buffer commit 7eb1bfb97a790c73188d6b616d54fb3849e69b1e Author: Keith Whitwell <keithw@vmware.com> Date: Wed Apr 7 17:26:08 2010 +0100 nv50: fix compiler warning commit d040daff0642dd791ac38e9b353dc251b03fc873 Author: Keith Whitwell <keithw@vmware.com> Date: Wed Apr 7 17:25:58 2010 +0100 nvfx: fix compiler warning commit 49ec01dffb8e99ab3ff8f856287db7b4df3efed6 Author: Chia-I Wu <olv@lunarg.com> Date: Mon Apr 5 11:58:53 2010 +0800 mesa/es: Fixes for gallium-resources. commit 47c87ada452be45766928a01b6d69da63e3a5f5e Author: Marek Olšák <maraeo@gmail.com> Date: Sat Apr 3 05:19:20 2010 +0200 r300g: fix transfers for textures created from winsys handles commit 5f2701fddaef9c18d85c049311c2819c49cc1ae0 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Sat Apr 3 03:52:38 2010 +0200 nouveau: don't use the staging usage Maybe it could make sense, but for now dynamic is enough. None of these avoid uncached reads from GART on AGP cards. commit 0db20fa49e008f35911007fa7ed9be1d678a2161 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Sat Apr 3 03:27:19 2010 +0200 i965: add brw_resource.c to Makefile commit b94f3e7389cbd1b6465de3c04e8059ce73f1ea1f Author: Luca Barbieri <luca@luca-barbieri.com> Date: Sat Apr 3 01:48:33 2010 +0200 nouveau: fix for gallium-resources commit a01ff99a19986e6beb7903431e60a074945b09bc Author: Roland Scheidegger <sroland@vmware.com> Date: Thu Apr 1 19:26:35 2010 +0200 gallium: fix missing includes commit 26aeded562ce947a6deeb867fe22bf8daf7b1a1a Author: Roland Scheidegger <sroland@vmware.com> Date: Thu Apr 1 19:19:18 2010 +0200 gallium: remove video interface and related stuff These interfaces weren't quite was needed, and building disabled for a while. Some code actually build since some branch merge, and were now not fully converted to gallium-resources. See http://www.mail-archive.com/mesa3d-dev@lists.sourceforge.net/msg09619.html for a discussion of this. Video related work is done in origin/pipe-video branch. commit c64285aea45997a276fb141d7badc8a04f617c7c Author: Roland Scheidegger <sroland@vmware.com> Date: Thu Apr 1 18:45:54 2010 +0200 python: fixes for resource changes doesn't look quite ok yet, but sort of compiles. commit 03d4d5a41f5cf158a358fd705c695e1c987a328f Author: Roland Scheidegger <sroland@vmware.com> Date: Thu Apr 1 18:34:46 2010 +0200 gallium: s/u_box_orgin_2d/u_box_origin_2d commit 2444f023142bcaf7bd310b44794580f273254408 Author: Marek Olšák <maraeo@gmail.com> Date: Thu Apr 1 03:26:50 2010 +0200 r300g: fix segfault when the transfers functions are used Still broken. commit 6f09bf4066ab651b323c131bb07978e700519805 Author: Roland Scheidegger <sroland@vmware.com> Date: Thu Apr 1 00:05:12 2010 +0200 r300g: compile fixes commit 76711ff40d2092f9ef03d452de7458c4e76d9246 Author: Roland Scheidegger <sroland@vmware.com> Date: Thu Apr 1 00:04:47 2010 +0200 nvfx: more compile fixes commit c5d2e90c9cc119447a447dc04a4bce4ab91fc671 Author: Roland Scheidegger <sroland@vmware.com> Date: Wed Mar 31 23:18:50 2010 +0200 gallium: more mostly merge fallout fixes... commit fbc3722696790857f4adc936190406e74dffd969 Merge: 86d9225 d97f696 Author: Roland Scheidegger <sroland@vmware.com> Date: Wed Mar 31 22:09:35 2010 +0200 Merge commit 'origin/master' into gallium-resources Conflicts: src/gallium/drivers/cell/ppu/cell_screen.c src/gallium/drivers/i915/i915_buffer.c src/gallium/drivers/i915/i915_context.h src/gallium/drivers/i915/i915_resource_texture.c src/gallium/drivers/i915/i915_screen.c src/gallium/drivers/i915/i915_state_emit.c src/gallium/drivers/i965/brw_resource_texture.c src/gallium/drivers/llvmpipe/lp_screen.c src/gallium/drivers/llvmpipe/lp_setup.c src/gallium/drivers/nvfx/nv30_fragtex.c src/gallium/drivers/nvfx/nv40_fragtex.c src/gallium/drivers/nvfx/nvfx_miptree.c src/gallium/drivers/nvfx/nvfx_screen.c src/gallium/drivers/nvfx/nvfx_transfer.c src/gallium/drivers/r300/r300_state.c src/gallium/drivers/svga/svga_screen_texture.c src/gallium/state_trackers/dri/common/dri_drawable.c src/gallium/state_trackers/dri/common/dri_screen.c src/gallium/state_trackers/dri/common/dri_st_api.h src/gallium/state_trackers/dri/drm/dri1.c src/gallium/state_trackers/dri/drm/dri1.h src/gallium/state_trackers/dri/drm/dri2.c src/gallium/state_trackers/python/st_device.c src/gallium/state_trackers/python/st_sample.c src/mesa/state_tracker/st_cb_clear.c src/mesa/state_tracker/st_cb_drawpixels.c src/mesa/state_tracker/st_cb_readpixels.c src/mesa/state_tracker/st_cb_texture.c src/mesa/state_tracker/st_extensions.c commit 86d9225d19d194eebbbe95b059695697c3307d15 Author: Roland Scheidegger <sroland@vmware.com> Date: Wed Mar 31 19:06:06 2010 +0200 gallium: more fixes for bind changes commit a215ef0606347e34669a580ec8df93ede7e46399 Author: Roland Scheidegger <sroland@vmware.com> Date: Wed Mar 31 18:48:36 2010 +0200 gallium/docs: some updates for bind changes commit c6c7e6746cbc7af59f7972719ed76f43e8ac16fc Author: Roland Scheidegger <sroland@vmware.com> Date: Tue Mar 30 20:24:26 2010 +0200 gallium: more bind change compile fixes commit a83fa1504b78180524a5eb454ae186741a27cdf8 Author: Roland Scheidegger <sroland@vmware.com> Date: Tue Mar 30 17:37:13 2010 +0200 compile fixes commit 30dc8afcd243d6a160571bac5f06d773e54a4196 Author: Roland Scheidegger <sroland@vmware.com> Date: Tue Mar 30 16:56:28 2010 +0200 fix some merge issues commit 30aa617fee11fe50c0a9c2f33fcd120a474f5e34 Merge: 1dde609 3a830bc Author: Roland Scheidegger <sroland@vmware.com> Date: Tue Mar 30 16:09:45 2010 +0200 Merge commit 'origin/gallium-buffer-usage-cleanup' into gallium-resources Conflicts: src/gallium/drivers/nouveau/nouveau_screen.c src/gallium/drivers/nvfx/nvfx_transfer.c src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c commit 1dde609ad6c9d2dfa0a5f7167f3c5bcf023b7c4d Author: Roland Scheidegger <sroland@vmware.com> Date: Wed Mar 24 02:35:00 2010 +0100 docs: some updates for pipe_resource commit f236f9660d31b936f54b64ae07e569f8637067bd Author: Luca Barbieri <luca@luca-barbieri.com> Date: Wed Mar 24 01:31:28 2010 +0100 nvfx: fix for gallium-resources It seems to work with basic applications but almost surely needs more work. In particular, it probably shouldn't use PIPE_BUFFER_USAGE_* flags and should use PIPE_TRANSFER_* in several places. Also, we probably don't want the vtable indirect calls and that ought to be replaced with something better instead. commit 5a136ad7b63768cb9a753eff8686c44592e62325 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Wed Mar 24 01:31:19 2010 +0100 nv50: fix build in gallium-resources Not actually tested. Also needs next patch tee to actually build, this is just the nv50 part split from the rest. commit 3a830bc4a3f0f60c925b9434845a6bcad9a913c5 Author: Keith Whitwell <keithw@vmware.com> Date: Tue Mar 23 14:00:52 2010 -0700 st/egl: fix up for binding flags commit c6a80dc32ef17bc972d4137ce7444ebed4d28ebb Author: Keith Whitwell <keithw@vmware.com> Date: Tue Mar 23 13:52:15 2010 -0700 r300: restore 4k alignment for oqbo buffers commit e75a8d5ea9e0ffcf67bc858e08937e10b4fc74ba Author: Keith Whitwell <keithw@vmware.com> Date: Tue Mar 23 13:00:07 2010 -0700 gallium: bind flags commit 1f5b509543a7f399835fd9edf27c18e1643fab7d Author: Roland Scheidegger <sroland@vmware.com> Date: Tue Mar 23 19:32:21 2010 +0100 i965g: scons compile fixes commit 2c385f8f905ec794d9119c05c6293e0b1b9b565a Author: Roland Scheidegger <sroland@vmware.com> Date: Tue Mar 23 19:20:33 2010 +0100 nouveau: drm compile fix commit b285086ebd5132b47c340897c4622cc9fbd286cb Author: Roland Scheidegger <sroland@vmware.com> Date: Tue Mar 23 18:36:19 2010 +0100 r300g: pipe_resource compile fixes bring back mistakenly deleted radeon_buffer.h plus some more commit 7810606f423ef2f51f0a14b919640c2fd2c931aa Author: Michal Krol <michal@vmware.com> Date: Tue Mar 23 16:21:03 2010 +0100 softpipe: Map GS constants, too. commit 366f1176fb89d2b1978da6cfe60000b76bbc7338 Author: Roland Scheidegger <sroland@vmware.com> Date: Tue Mar 23 15:51:52 2010 +0100 failover: update for pipe_resources commit 615f44d70d293704ed821bc0b21fcfe6e363895d Author: Roland Scheidegger <sroland@vmware.com> Date: Tue Mar 23 15:51:02 2010 +0100 identity: remove double is_resource_reference assignment commit 7008586020395905ddfff333d02b3893de369796 Author: Roland Scheidegger <sroland@vmware.com> Date: Tue Mar 23 15:50:32 2010 +0100 trace: compile fix commit 058c5697bda4c9cf7b49d26ee27a34586544efaa Merge: dd7ba13 b33fd3c Author: Keith Whitwell <keithw@vmware.com> Date: Tue Mar 23 06:40:39 2010 -0700 Merge commit 'origin/gallium-resources' into gallium-buffer-usage-cleanup Conflicts: src/gallium/state_trackers/vega/api_filters.c src/mesa/state_tracker/st_cb_drawpixels.c commit b33fd3ce3daf2921a895367d0ed3fd9c718a8575 Author: Michal Krol <michal@vmware.com> Date: Mon Mar 22 21:03:26 2010 +0100 gallium: Usage parameter of get_transfer/transfer_inline_write is a bitfield. commit 9c1162d9d656062a490a529997def3f674cc61fc Author: Michal Krol <michal@vmware.com> Date: Mon Mar 22 20:50:49 2010 +0100 scons: Update file lists after gallium-resources changes. commit af9793ab9e5386b150d6b25c0d1978fdc67172e4 Author: Michal Krol <michal@vmware.com> Date: Mon Mar 22 20:04:39 2010 +0100 gallium: Do not use `template` for formal parameter names. commit dc2e12d714c444af9ff1acdd5a7e91408b116c99 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 22:41:34 2010 +0000 ws/nouveau: remove pipe_texture reference commit b94c72329f1be85887d40d49b0586979da469d77 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 22:40:41 2010 +0000 ws/xlib: remove pipe_buffer reference in comment commit 0a2af3eeae7de1d1cb433f0a2c35136b115f9920 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 22:39:34 2010 +0000 st/vega: clean up reference to pipe_texture commit 437ce98daae46be5d532fbb04c7cbf4a503c1623 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 22:39:02 2010 +0000 st/python: begin conversion to pipe_resources, much more to do commit 1b02e1ee3e5e87774f0c9e5f0e1898b7f8de1b16 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 22:29:34 2010 +0000 st/xorg: update for pipe_resources commit eb39977fe7a1d9f0c3f4f2d4303a93c2c613cc3b Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 22:23:51 2010 +0000 st/dri: update for pipe_resources commit e447aeff597a4d8c0f5de25854c14c99f2cc138c Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 22:23:36 2010 +0000 st/egl: update for pipe_resources commit e4cc48da8fdbd7d521257a6d7cd10e6fc5aa1a65 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 22:08:44 2010 +0000 r300: drop use of R300 DONT SYNC flag commit 129a83ab4d32e44ded5faea3f86ae5e1e62cddb6 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 22:08:17 2010 +0000 pipebuffer: use transfer flag commit 575b35ee6b683d77095ef21c573c1de207107e79 Merge: f29ac73 9fc6c8b Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 22:03:25 2010 +0000 Merge commit 'origin/master' into gallium-resources Conflicts: src/gallium/drivers/llvmpipe/lp_texture.c src/gallium/drivers/r300/r300_context.c src/gallium/drivers/r300/r300_texture.c src/gallium/winsys/drm/radeon/core/radeon_buffer.h commit f29ac73f3f626d5779a627b7fa6fecdb60a35aab Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 18:37:25 2010 +0000 cell: attempt to convert to pipe_resources Can't even compile test this driver. commit 484b1947f4af81bab60b41f21c3c23ea6f67488c Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 17:25:50 2010 +0000 nvfx: restore usage of pipe_winsys The interface that cannot be killed... commit ac76ac6eb30f4f9aa9f5733d60358b357925953a Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 17:25:10 2010 +0000 nv50: fix warning commit 9683f4423449fa5acf6c019c571223650473bd82 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 17:14:31 2010 +0000 util: restore u_simple_screen, nouveau still relies on it commit 961cbcb62232689c959965384c6aa9b8eca697c1 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 16:51:54 2010 +0000 nouveau: convert nvfx and nv50 to pipe_resources Compile tested only. This was a deeper change than I was hoping for, due to the layering of the pipe_texture implementation in each driver on top of a shared pipe_buffer implementation in the shared code. Have modified the shared code to act as a set of convenience routines operating on nouveau_bo objects. Each driver now uses the u_resource_vtbl technique to split the implementation of pipe_resources between the existing miptree code for textures and a new, minimal buffer implementation in each driver. Eventually these should be combined, not least because APIs are now allowing things like binding buffer resources as textures and render targets. commit 18ba74016db13b23282f5033ee37b628a12ee566 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 10:02:54 2010 +0000 r300: fix compilation after merge Also build r300 by default. commit eb9c0175c8e4baca3fcb0b8364f83ceba9d74e0d Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 09:59:49 2010 +0000 st/vega: fix up after merge commit ea8dd1d4ae7b58c9315c3491046ef3852ddd3377 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 09:59:44 2010 +0000 aux: remove unused piperesource helpers commit be7af29d3ad1a10409b0ea689d882cf30a4e1d62 Merge: d22c2c6 12deb9e Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 21 09:54:53 2010 +0000 Merge commit 'origin/master' into gallium-resources Conflicts: src/gallium/auxiliary/cso_cache/cso_context.c src/gallium/auxiliary/cso_cache/cso_context.h src/gallium/drivers/r300/r300_context.c src/gallium/drivers/r300/r300_render.c src/gallium/drivers/r300/r300_state.c src/gallium/drivers/r300/r300_state_derived.c src/gallium/state_trackers/vega/api_filters.c src/gallium/state_trackers/vega/image.c src/gallium/state_trackers/vega/image.h src/gallium/state_trackers/vega/mask.c src/gallium/state_trackers/vega/mask.h src/gallium/state_trackers/vega/paint.c src/gallium/state_trackers/vega/paint.h src/gallium/state_trackers/vega/renderer.c src/gallium/state_trackers/vega/renderer.h src/gallium/state_trackers/vega/shader.c src/gallium/state_trackers/vega/vg_context.h src/gallium/state_trackers/vega/vg_tracker.c src/mesa/state_tracker/st_manager.c commit d22c2c6cb23a063e3334a165d0c5c3d73f05d234 Author: Keith Whitwell <keithw@vmware.com> Date: Sat Mar 20 11:48:54 2010 +0000 drm/r300: update for r300g pipe_resources conversion Remove old files that related to pipe_buffers but weren't being built. Hopefully this is correct. commit f07b2c836958bee5796899123eca4ed05ac6242b Author: Keith Whitwell <keithw@vmware.com> Date: Sat Mar 20 11:47:03 2010 +0000 r300: convert to pipe_resources Do a very shallow conversion - basically keeping the existing buffer and texture code intact and using a vtbl struct inside our resource struct to select between the two implementations. The buffer and texture treatments could be further merged without much effort, but try to keep the existing code working at this point. commit feca9c3ca62daaf0d8745370106d4e3b22340c49 Author: Keith Whitwell <keithw@vmware.com> Date: Thu Mar 18 06:00:34 2010 +0000 gallium: update new merges to pipe_resource commit 1cad983eac77a0c5333e6a3ce92b90ac87407714 Author: Keith Whitwell <keithw@vmware.com> Date: Thu Mar 18 06:00:19 2010 +0000 drm/sw: update new merges to pipe_resource commit 191d39490ed792c569f98d42cf05891b264f71f8 Author: Keith Whitwell <keithw@vmware.com> Date: Thu Mar 18 06:00:01 2010 +0000 vg: update new merges to pipe_resource commit b727c59bc44812ad503d9390505c92b738a5b8b0 Author: Keith Whitwell <keithw@vmware.com> Date: Thu Mar 18 05:59:38 2010 +0000 llvmpipe: update new merges to pipe_resource commit 5f4b64b37fdcd70162c382b2ebbd494bef751dbd Author: Keith Whitwell <keithw@vmware.com> Date: Thu Mar 18 05:59:23 2010 +0000 brw: pipe_resource fixes commit d4aca209f531f1b65bf706ce1e5fc0375b587eb6 Author: Keith Whitwell <keithw@vmware.com> Date: Thu Mar 18 05:59:06 2010 +0000 util: update new merges to pipe_resource commit cf6bef0afee10763c78509a3d17e9a6e49bcd3c8 Merge: 1997231 6de8e56 Author: Keith Whitwell <keithw@vmware.com> Date: Thu Mar 18 05:38:50 2010 +0000 Merge commit 'origin/master' into gallium-resources commit 1997231916144485c3c4a36f53eda39fce460272 Merge: ad88ac7 e1ee3ea Author: Keith Whitwell <keithw@vmware.com> Date: Wed Mar 17 08:46:38 2010 +0000 Merge commit 'origin/master' into gallium-resources Conflicts: src/gallium/auxiliary/Makefile src/gallium/auxiliary/util/u_blit.c src/gallium/auxiliary/util/u_blit.h src/gallium/auxiliary/util/u_gen_mipmap.c src/gallium/auxiliary/util/u_gen_mipmap.h src/mesa/state_tracker/st_cb_texture.c src/mesa/state_tracker/st_gen_mipmap.c commit ad88ac79034a91670940276e722bdd398d5c9023 Merge: 77bc770 8cdfd12 Author: Keith Whitwell <keithw@vmware.com> Date: Tue Mar 16 09:13:07 2010 +0000 Merge branch 'gallium-sampler-view' into gallium-resources Conflicts: src/gallium/auxiliary/cso_cache/cso_context.c src/gallium/auxiliary/util/u_blit.c src/gallium/drivers/llvmpipe/lp_texture.c src/gallium/drivers/softpipe/sp_texture.c src/mesa/state_tracker/st_cb_fbo.c src/mesa/state_tracker/st_framebuffer.c src/mesa/state_tracker/st_texture.c commit 77bc770c991ea025c82eaa4e0e2390efd825d96d Author: Keith Whitwell <keithw@vmware.com> Date: Mon Mar 15 22:21:48 2010 +0000 util: missing file commit f83c91db8ae63a3c3a34ff21492427a5663fb760 Merge: c1d4774 42910eb Author: Keith Whitwell <keithw@vmware.com> Date: Mon Mar 15 09:48:58 2010 +0000 Merge commit 'origin/gallium-sampler-view' into gallium-resources Conflicts: src/gallium/drivers/nv40/nv40_transfer.c src/gallium/drivers/nvfx/nvfx_transfer.c src/gallium/drivers/trace/tr_drm.c commit dd7ba1378fc50710667724d30d6d4cf1125ad61e Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 23:54:36 2010 +0000 gallium: start a cleanup of buffer_usage Remove fairly meaningless CPU/GPU READ/WRITE flags and replace with proper usages. commit c1d4774187189f4af8ff421b210824f3d53ceefb Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 23:05:45 2010 +0000 llvmpipe: don't FREE userbuffer data commit 9bfa07afe179f8060e7beefb754a29c4d9c6e349 Merge: 65757a1 08cddfe Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 22:54:51 2010 +0000 Merge commit 'origin/master' into gallium-resources Conflicts: src/gallium/drivers/llvmpipe/lp_rast.c src/gallium/drivers/llvmpipe/lp_scene.c src/gallium/drivers/llvmpipe/lp_texture.c src/gallium/drivers/llvmpipe/lp_texture.h src/gallium/drivers/softpipe/sp_texture.c src/gallium/drivers/svga/svga_screen_texture.c commit 65757a143f8e3fcd7afbc1ff92db44a823edf46c Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 22:41:17 2010 +0000 svga: build fixes commit 2f5435220501d4b3050cab2bb1dce6174cd13ff6 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 22:39:25 2010 +0000 gallivm: build fix commit 42642ec0984107d82b740711f2debbf38457a06e Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 22:38:33 2010 +0000 llvmpipe: convert to pipe_resources commit 7bbcb21e20cb545ef8dd5fc61d67ed931c69e813 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 22:19:30 2010 +0000 gallivm: convert to pipe_resources commit 88ae0d04610ca52649b42e32141a52af6d5a739b Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 21:01:22 2010 +0000 configs: build svga commit 0e112bc69828e65085ebfaef895ecd78fe53f1c4 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 21:01:17 2010 +0000 gallium: restore PIPE_BUFFER_USAGE_CUSTOM commit 102aca688b95c976b7178b84092fba7d041ff9d2 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 21:00:41 2010 +0000 util: more transfer helpers commit a79f6a4a0836fc64c07f9aeec21d914474fe3649 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 20:59:36 2010 +0000 svga: convert to use pipe_resrource As with others so far, a fairly shallow conversion. commit 087fb54492fa5e3baf040c5efbf7dacd98a8849b Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 18:38:08 2010 +0000 brw: fix function name commit cfc9dd707d16e06fd23b6926da3a6e2269f31dc8 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 18:19:06 2010 +0000 gallium: enable brw compile commit 8a5b86d76bdd3c7de63322423f59940a4dc2ee25 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 18:18:50 2010 +0000 brw: compiles with pipe_resource commit 563ca458b548c41ca4dca559354c16ca1a80d009 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 18:18:42 2010 +0000 i915: hook up userbuffer create commit b5095b48247b6020e36cc942ac145c3fccbe9a19 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 17:20:51 2010 +0000 i915: use helpers for is_resource_referenced commit d5392bdc6d70002acf9c5bac0fde14ba405c4d84 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 17:20:38 2010 +0000 util: helpers for is_resource_referenced commit 2f3492a5aefbb2e745f6700d8e910ebb5cbb98cf Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 17:08:50 2010 +0000 i915: remove buffer.c again commit 1373a35b65fcc25ec6cdfea2703bbb3417de2c6d Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 17:08:34 2010 +0000 i915: add new files to scons commit 0251612d70e57fe38e10e75915b394631d224f2c Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 16:38:29 2010 +0000 i915: compiling with pipe_resources commit 9a0235864252929a8eedd44dbd2fe30fe54c531d Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 13:51:16 2010 +0000 gallium: remove inline_read transfer commit a6ba315e25793e0c228d3a4ae2f8201634dc9ff0 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 13:50:32 2010 +0000 trace: get running Some dumping will be incorrect or disabled, but it runs without crashing commit 2133f1d90aa919662a8420a0cf3b4557e6ec1afd Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 13:49:42 2010 +0000 gallium: remove the inline_read transfer There aren't enough users of this to justify it. commit bccaf1fa30881f6b4fb189a9b74fc7af79c3b481 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 12:30:37 2010 +0000 identity: hook up inline transfer operations commit e4c152a344f2f53c842b810724a2ae7cb4554f58 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 12:21:54 2010 +0000 gallium: build trace and identity commit 0b5a311db78852fa9fd021e17b5968a1e0436b49 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 12:21:36 2010 +0000 gallium: add more of the transfer state to pipe_transfer Not really sure if recording all the arguments to the create_{transfer,texture,surface,etc} functions in the result of those calls is a great idea, but it seems we're fairly dependent on it throughout the code. commit a23985c26eafe76b0a7dacc892e50cb589f211fe Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 12:19:46 2010 +0000 identity: compiles with pipe_resources commit d0d630944304c208f6dade6ef8836763ee2bc7b4 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 12:13:02 2010 +0000 trace: compiles with pipe_resources commit a4451ea459cc8bfc915fe6aed2891b90854b6c9d Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 11:39:50 2010 +0000 softpipe: give userbuffers a format other than NONE Most mesa demos working commit 32bb1bd4ba29884a4ecfa11c8441d33dfceabcef Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 11:39:21 2010 +0000 util: correct argument order in pipe_buffer_map commit 7e2696c06445282feb781047277b260308760a33 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 11:32:55 2010 +0000 softpipe: transfer flush commit a0543b13c042e3c1142522d9d136f16fd4cabf78 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 11:32:13 2010 +0000 util: noop implementation of transfer_flush_region commit ce418533be752dbeb164e7ff82a99483048e482b Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 11:26:07 2010 +0000 gallium: softpipe runs gears with pipe_resources commit bfda4f2eb34498e4b7f3c608d30fccff6bb9651b Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 11:25:48 2010 +0000 util: get clip_tile working again commit f5ef219c3bed62b6a0da842e675fae16268e0fbe Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 09:43:20 2010 +0000 softpipe: use u_transfer helpers commit 072957aab25affecf0702e925310e46c694a5ee4 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 09:42:46 2010 +0000 util: helpers for inline transfers commit 9c45561fb0d7a52400093bcb2ce5f727fafd7777 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 09:42:25 2010 +0000 util: fix typo calculating transfer box commit f3e98fd47f36804d019a684d49ff230df3ab0cf5 Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 09:25:46 2010 +0000 st/vega: convert to pipe_resource commit d1b7b00afc944f6499c83d676c7642115d62a62c Author: Keith Whitwell <keithw@vmware.com> Date: Sun Mar 14 08:37:56 2010 +0000 gallium: begin converting drivers to pipe_resource Work in progress... commit 51c25117f5d6da1926a2be5ecc66677952a8abf0 Author: Keith Whitwell <keithw@vmware.com> Date: Sat Mar 13 20:16:27 2010 +0000 gallium: work in progress on layering resources on top of old textures Helper code in an aux module to avoid rewriting all the drivers. commit fb6764d3ce95c55aa78af2f1c8cbb17b79ce1ba2 Author: Keith Whitwell <keithw@vmware.com> Date: Sat Mar 13 19:19:09 2010 +0000 heaps of wip commit ee6b3bc730fcdaf8da3646d62f04578ec06d36a1 Author: Keith Whitwell <keithw@vmware.com> Date: Sat Mar 13 16:38:02 2010 +0000 wip2 commit 1830880212445189fe267d615075239ed17c7cc0 Merge: 90b4045 47bfbd4 Author: Keith Whitwell <keithw@vmware.com> Date: Sat Mar 13 15:14:03 2010 +0000 Merge branch 'gallium-sampler-view' into gallium-resources Conflicts: src/gallium/include/pipe/p_context.h src/mesa/state_tracker/st_atom_texture.c src/mesa/state_tracker/st_cb_bitmap.c src/mesa/state_tracker/st_cb_drawpixels.c src/mesa/state_tracker/st_cb_texture.c src/mesa/state_tracker/st_context.c src/mesa/state_tracker/st_context.h src/mesa/state_tracker/st_texture.h commit 90b4045fbc0a093fcd04efba7e045ec259c490b8 Author: Keith Whitwell <keithw@vmware.com> Date: Sat Mar 13 14:52:43 2010 +0000 wip
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_blit.c33
-rw-r--r--src/gallium/auxiliary/util/u_blit.h2
-rw-r--r--src/gallium/auxiliary/util/u_blitter.c29
-rw-r--r--src/gallium/auxiliary/util/u_box.h73
-rw-r--r--src/gallium/auxiliary/util/u_debug.c37
-rw-r--r--src/gallium/auxiliary/util/u_debug.h4
-rw-r--r--src/gallium/auxiliary/util/u_draw_quad.c106
-rw-r--r--src/gallium/auxiliary/util/u_draw_quad.h4
-rw-r--r--src/gallium/auxiliary/util/u_dump.h2
-rw-r--r--src/gallium/auxiliary/util/u_dump_state.c19
-rw-r--r--src/gallium/auxiliary/util/u_gen_mipmap.c69
-rw-r--r--src/gallium/auxiliary/util/u_gen_mipmap.h2
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h292
-rw-r--r--src/gallium/auxiliary/util/u_rect.c102
-rw-r--r--src/gallium/auxiliary/util/u_resource.c97
-rw-r--r--src/gallium/auxiliary/util/u_sampler.c6
-rw-r--r--src/gallium/auxiliary/util/u_sampler.h4
-rw-r--r--src/gallium/auxiliary/util/u_simple_screen.c137
-rw-r--r--src/gallium/auxiliary/util/u_simple_screen.h23
-rw-r--r--src/gallium/auxiliary/util/u_surface.c23
-rw-r--r--src/gallium/auxiliary/util/u_surface.h6
-rw-r--r--src/gallium/auxiliary/util/u_tile.c32
-rw-r--r--src/gallium/auxiliary/util/u_tile.h18
-rw-r--r--src/gallium/auxiliary/util/u_timed_winsys.c312
-rw-r--r--src/gallium/auxiliary/util/u_timed_winsys.h41
-rw-r--r--src/gallium/auxiliary/util/u_transfer.c110
-rw-r--r--src/gallium/auxiliary/util/u_transfer.h145
-rw-r--r--src/gallium/auxiliary/util/u_upload_mgr.c75
-rw-r--r--src/gallium/auxiliary/util/u_upload_mgr.h10
29 files changed, 904 insertions, 909 deletions
diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c
index cd95f85b63..7850f81e58 100644
--- a/src/gallium/auxiliary/util/u_blit.c
+++ b/src/gallium/auxiliary/util/u_blit.c
@@ -69,7 +69,7 @@ struct blit_state
void *vs;
void *fs[TGSI_WRITEMASK_XYZW + 1];
- struct pipe_buffer *vbuf; /**< quad vertices */
+ struct pipe_resource *vbuf; /**< quad vertices */
unsigned vbuf_slot;
float vertices[4][2][4]; /**< vertex/texcoords for quad */
@@ -167,7 +167,7 @@ util_destroy_blit(struct blit_state *ctx)
if (ctx->fs[i])
pipe->delete_fs_state(pipe, ctx->fs[i]);
- pipe_buffer_reference(&ctx->vbuf, NULL);
+ pipe_resource_reference(&ctx->vbuf, NULL);
FREE(ctx);
}
@@ -186,8 +186,7 @@ get_next_slot( struct blit_state *ctx )
if (!ctx->vbuf) {
ctx->vbuf = pipe_buffer_create(ctx->pipe->screen,
- 32,
- PIPE_BUFFER_USAGE_VERTEX,
+ PIPE_BIND_VERTEX_BUFFER,
max_slots * sizeof ctx->vertices);
}
@@ -236,7 +235,7 @@ setup_vertex_data_tex(struct blit_state *ctx,
offset = get_next_slot( ctx );
- pipe_buffer_write_nooverlap(ctx->pipe->screen, ctx->vbuf,
+ pipe_buffer_write_nooverlap(ctx->pipe, ctx->vbuf,
offset, sizeof(ctx->vertices), ctx->vertices);
return offset;
@@ -304,9 +303,9 @@ util_blit_pixels_writemask(struct blit_state *ctx,
filter == PIPE_TEX_MIPFILTER_LINEAR);
assert(screen->is_format_supported(screen, src->format, PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0));
+ PIPE_BIND_SAMPLER_VIEW, 0));
assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_RENDER_TARGET, 0));
+ PIPE_BIND_RENDER_TARGET, 0));
/* do the regions overlap? */
overlap = util_same_surface(src, dst) &&
@@ -335,7 +334,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
}
assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_RENDER_TARGET, 0));
+ PIPE_BIND_RENDER_TARGET, 0));
/* Create a temporary texture when src and dest alias or when src
* is anything other than a single-level 2d texture.
@@ -346,8 +345,8 @@ util_blit_pixels_writemask(struct blit_state *ctx,
src->texture->target != PIPE_TEXTURE_2D ||
src->texture->last_level != 0)
{
- struct pipe_texture texTemp;
- struct pipe_texture *tex;
+ struct pipe_resource texTemp;
+ struct pipe_resource *tex;
struct pipe_sampler_view sv_templ;
struct pipe_surface *texSurf;
const int srcLeft = MIN2(srcX0, srcX1);
@@ -376,7 +375,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
texTemp.height0 = srcH;
texTemp.depth0 = 1;
- tex = screen->texture_create(screen, &texTemp);
+ tex = screen->resource_create(screen, &texTemp);
if (!tex)
return;
@@ -384,12 +383,12 @@ util_blit_pixels_writemask(struct blit_state *ctx,
sampler_view = ctx->pipe->create_sampler_view(ctx->pipe, tex, &sv_templ);
if (!sampler_view) {
- pipe_texture_reference(&tex, NULL);
+ pipe_resource_reference(&tex, NULL);
return;
}
texSurf = screen->get_tex_surface(screen, tex, 0, 0, 0,
- PIPE_BUFFER_USAGE_GPU_WRITE);
+ PIPE_BIND_BLIT_DESTINATION);
/* load temp texture */
if (pipe->surface_copy) {
@@ -412,7 +411,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
t0 = 0.0f;
t1 = 1.0f;
- pipe_texture_reference(&tex, NULL);
+ pipe_resource_reference(&tex, NULL);
}
else {
pipe_sampler_view_reference(&sampler_view, src_sampler_view);
@@ -540,7 +539,7 @@ util_blit_pixels(struct blit_state *ctx,
*/
void util_blit_flush( struct blit_state *ctx )
{
- pipe_buffer_reference(&ctx->vbuf, NULL);
+ pipe_resource_reference(&ctx->vbuf, NULL);
ctx->vbuf_slot = 0;
}
@@ -566,7 +565,7 @@ util_blit_pixels_tex(struct blit_state *ctx,
struct pipe_framebuffer_state fb;
float s0, t0, s1, t1;
unsigned offset;
- struct pipe_texture *tex = src_sampler_view->texture;
+ struct pipe_resource *tex = src_sampler_view->texture;
assert(filter == PIPE_TEX_MIPFILTER_NEAREST ||
filter == PIPE_TEX_MIPFILTER_LINEAR);
@@ -582,7 +581,7 @@ util_blit_pixels_tex(struct blit_state *ctx,
assert(ctx->pipe->screen->is_format_supported(ctx->pipe->screen, dst->format,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_RENDER_TARGET,
+ PIPE_BIND_RENDER_TARGET,
0));
/* save state (restored below) */
diff --git a/src/gallium/auxiliary/util/u_blit.h b/src/gallium/auxiliary/util/u_blit.h
index 1ebe65b455..464ff9aace 100644
--- a/src/gallium/auxiliary/util/u_blit.h
+++ b/src/gallium/auxiliary/util/u_blit.h
@@ -37,7 +37,7 @@ extern "C" {
struct pipe_context;
struct pipe_surface;
-struct pipe_texture;
+struct pipe_resource;
struct cso_context;
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index 1692987e8e..104cbf7f6c 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -56,7 +56,7 @@ struct blitter_context_priv
struct blitter_context blitter;
struct pipe_context *pipe; /**< pipe context */
- struct pipe_buffer *vbuf; /**< quad */
+ struct pipe_resource *vbuf; /**< quad */
float vertices[4][2][4]; /**< {pos, color} or {pos, texcoord} */
@@ -215,8 +215,7 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe)
/* create the vertex buffer */
ctx->vbuf = pipe_buffer_create(ctx->pipe->screen,
- 32,
- PIPE_BUFFER_USAGE_VERTEX,
+ PIPE_BIND_VERTEX_BUFFER,
sizeof(ctx->vertices));
return &ctx->blitter;
@@ -259,7 +258,7 @@ void util_blitter_destroy(struct blitter_context *blitter)
pipe_sampler_view_reference(&ctx->sampler_view, NULL);
}
- pipe_buffer_reference(&ctx->vbuf, NULL);
+ pipe_resource_reference(&ctx->vbuf, NULL);
FREE(ctx);
}
@@ -451,7 +450,7 @@ static void blitter_draw_quad(struct blitter_context_priv *ctx)
struct pipe_context *pipe = ctx->pipe;
/* write vertices and draw them */
- pipe_buffer_write(pipe->screen, ctx->vbuf,
+ pipe_buffer_write(pipe, ctx->vbuf,
0, sizeof(ctx->vertices), ctx->vertices);
util_draw_vertex_buffer(pipe, ctx->vbuf, 0, PIPE_PRIM_TRIANGLE_FAN,
@@ -714,8 +713,8 @@ static void util_blitter_overlap_copy(struct blitter_context *blitter,
struct pipe_context *pipe = ctx->pipe;
struct pipe_screen *screen = pipe->screen;
- struct pipe_texture texTemp;
- struct pipe_texture *texture;
+ struct pipe_resource texTemp;
+ struct pipe_resource *texture;
struct pipe_surface *tex_surf;
/* check whether the states are properly saved */
@@ -729,13 +728,13 @@ static void util_blitter_overlap_copy(struct blitter_context *blitter,
texTemp.height0 = height;
texTemp.depth0 = 1;
- texture = screen->texture_create(screen, &texTemp);
+ texture = screen->resource_create(screen, &texTemp);
if (!texture)
return;
tex_surf = screen->get_tex_surface(screen, texture, 0, 0, 0,
- PIPE_BUFFER_USAGE_GPU_READ |
- PIPE_BUFFER_USAGE_GPU_WRITE);
+ PIPE_BIND_BLIT_SOURCE |
+ PIPE_BIND_BLIT_DESTINATION);
/* blit from the src to the temp */
util_blitter_do_copy(blitter, tex_surf, 0, 0,
@@ -747,7 +746,7 @@ static void util_blitter_overlap_copy(struct blitter_context *blitter,
width, height,
FALSE);
pipe_surface_reference(&tex_surf, NULL);
- pipe_texture_reference(&texture, NULL);
+ pipe_resource_reference(&texture, NULL);
blitter_restore_CSOs(ctx);
}
@@ -781,8 +780,8 @@ void util_blitter_copy(struct blitter_context *blitter,
is_depth = util_format_get_component_bits(src->format, UTIL_FORMAT_COLORSPACE_ZS, 0) != 0;
is_stencil = util_format_get_component_bits(src->format, UTIL_FORMAT_COLORSPACE_ZS, 1) != 0;
- dst_tex_usage = is_depth || is_stencil ? PIPE_TEXTURE_USAGE_DEPTH_STENCIL :
- PIPE_TEXTURE_USAGE_RENDER_TARGET;
+ dst_tex_usage = is_depth || is_stencil ? PIPE_BIND_DEPTH_STENCIL :
+ PIPE_BIND_RENDER_TARGET;
/* check if we can sample from and render to the surfaces */
/* (assuming copying a stencil buffer is not possible) */
@@ -790,7 +789,7 @@ void util_blitter_copy(struct blitter_context *blitter,
!screen->is_format_supported(screen, dst->format, dst->texture->target,
dst_tex_usage, 0) ||
!screen->is_format_supported(screen, src->format, src->texture->target,
- PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+ PIPE_BIND_SAMPLER_VIEW, 0)) {
util_surface_copy(pipe, FALSE, dst, dstx, dsty, src, srcx, srcy,
width, height);
return;
@@ -827,7 +826,7 @@ void util_blitter_fill(struct blitter_context *blitter,
/* check if we can render to the surface */
if (util_format_is_depth_or_stencil(dst->format) || /* unlikely, but you never know */
!screen->is_format_supported(screen, dst->format, dst->texture->target,
- PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {
+ PIPE_BIND_RENDER_TARGET, 0)) {
util_surface_fill(pipe, dst, dstx, dsty, width, height, value);
return;
}
diff --git a/src/gallium/auxiliary/util/u_box.h b/src/gallium/auxiliary/util/u_box.h
new file mode 100644
index 0000000000..919967b55a
--- /dev/null
+++ b/src/gallium/auxiliary/util/u_box.h
@@ -0,0 +1,73 @@
+#ifndef UTIL_BOX_INLINES_H
+#define UTIL_BOX_INLINES_H
+
+#include "pipe/p_state.h"
+
+static INLINE
+void u_box_1d( unsigned x,
+ unsigned w,
+ struct pipe_box *box )
+{
+ box->x = x;
+ box->y = 0;
+ box->z = 0;
+ box->width = w;
+ box->height = 1;
+ box->depth = 1;
+}
+
+static INLINE
+void u_box_2d( unsigned x,
+ unsigned y,
+ unsigned w,
+ unsigned h,
+ struct pipe_box *box )
+{
+ box->x = x;
+ box->y = y;
+ box->z = 0;
+ box->width = w;
+ box->height = h;
+ box->depth = 1;
+}
+
+static INLINE
+void u_box_origin_2d( unsigned w,
+ unsigned h,
+ struct pipe_box *box )
+{
+ box->x = 0;
+ box->y = 0;
+ box->z = 0;
+ box->width = w;
+ box->height = h;
+ box->depth = 1;
+}
+
+static INLINE
+void u_box_2d_zslice( unsigned x,
+ unsigned y,
+ unsigned z,
+ unsigned w,
+ unsigned h,
+ struct pipe_box *box )
+{
+ box->x = x;
+ box->y = y;
+ box->z = z;
+ box->width = w;
+ box->height = h;
+ box->depth = 1;
+}
+
+static INLINE
+struct pipe_subresource u_subresource( unsigned face,
+ unsigned level )
+{
+ struct pipe_subresource subresource;
+ subresource.face = face;
+ subresource.level = level;
+ return subresource;
+}
+
+#endif
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index e997cfa8a3..dd044973f9 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -425,7 +425,7 @@ void debug_dump_surface(struct pipe_context *pipe,
const char *prefix,
struct pipe_surface *surface)
{
- struct pipe_texture *texture;
+ struct pipe_resource *texture;
struct pipe_transfer *transfer;
void *data;
@@ -440,7 +440,7 @@ void debug_dump_surface(struct pipe_context *pipe,
*/
texture = surface->texture;
- transfer = pipe->get_tex_transfer(pipe, texture, surface->face,
+ transfer = pipe_get_transfer(pipe, texture, surface->face,
surface->level, surface->zslice,
PIPE_TRANSFER_READ, 0, 0, surface->width,
surface->height);
@@ -452,20 +452,20 @@ void debug_dump_surface(struct pipe_context *pipe,
debug_dump_image(prefix,
texture->format,
util_format_get_blocksize(texture->format),
- util_format_get_nblocksx(texture->format, transfer->width),
- util_format_get_nblocksy(texture->format, transfer->height),
+ util_format_get_nblocksx(texture->format, surface->width),
+ util_format_get_nblocksy(texture->format, surface->height),
transfer->stride,
data);
pipe->transfer_unmap(pipe, transfer);
error:
- pipe->tex_transfer_destroy(pipe, transfer);
+ pipe->transfer_destroy(pipe, transfer);
}
void debug_dump_texture(struct pipe_context *pipe,
const char *prefix,
- struct pipe_texture *texture)
+ struct pipe_resource *texture)
{
struct pipe_surface *surface;
struct pipe_screen *screen;
@@ -477,7 +477,7 @@ void debug_dump_texture(struct pipe_context *pipe,
/* XXX for now, just dump image for face=0, level=0 */
surface = screen->get_tex_surface(screen, texture, 0, 0, 0,
- PIPE_TEXTURE_USAGE_SAMPLER);
+ PIPE_BIND_SAMPLER_VIEW);
if (surface) {
debug_dump_surface(pipe, prefix, surface);
screen->tex_surface_destroy(surface);
@@ -523,16 +523,16 @@ debug_dump_surface_bmp(struct pipe_context *pipe,
{
#ifndef PIPE_SUBSYSTEM_WINDOWS_MINIPORT
struct pipe_transfer *transfer;
- struct pipe_texture *texture = surface->texture;
+ struct pipe_resource *texture = surface->texture;
- transfer = pipe->get_tex_transfer(pipe, texture, surface->face,
- surface->level, surface->zslice,
- PIPE_TRANSFER_READ, 0, 0, surface->width,
- surface->height);
+ transfer = pipe_get_transfer(pipe, texture, surface->face,
+ surface->level, surface->zslice,
+ PIPE_TRANSFER_READ, 0, 0, surface->width,
+ surface->height);
debug_dump_transfer_bmp(pipe, filename, transfer);
- pipe->tex_transfer_destroy(pipe, transfer);
+ pipe->transfer_destroy(pipe, transfer);
#endif
}
@@ -547,17 +547,20 @@ debug_dump_transfer_bmp(struct pipe_context *pipe,
if (!transfer)
goto error1;
- rgba = MALLOC(transfer->width*transfer->height*4*sizeof(float));
+ rgba = MALLOC(transfer->box.width *
+ transfer->box.height *
+ transfer->box.depth *
+ 4*sizeof(float));
if(!rgba)
goto error1;
pipe_get_tile_rgba(pipe, transfer, 0, 0,
- transfer->width, transfer->height,
+ transfer->box.width, transfer->box.height,
rgba);
debug_dump_float_rgba_bmp(filename,
- transfer->width, transfer->height,
- rgba, transfer->width);
+ transfer->box.width, transfer->box.height,
+ rgba, transfer->box.width);
FREE(rgba);
error1:
diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h
index 98addeb372..b6d0b508e3 100644
--- a/src/gallium/auxiliary/util/u_debug.h
+++ b/src/gallium/auxiliary/util/u_debug.h
@@ -315,7 +315,7 @@ debug_memory_end(unsigned long beginning);
struct pipe_context;
struct pipe_surface;
struct pipe_transfer;
-struct pipe_texture;
+struct pipe_resource;
void debug_dump_image(const char *prefix,
unsigned format, unsigned cpp,
@@ -327,7 +327,7 @@ void debug_dump_surface(struct pipe_context *pipe,
struct pipe_surface *surface);
void debug_dump_texture(struct pipe_context *pipe,
const char *prefix,
- struct pipe_texture *texture);
+ struct pipe_resource *texture);
void debug_dump_surface_bmp(struct pipe_context *pipe,
const char *filename,
struct pipe_surface *surface);
diff --git a/src/gallium/auxiliary/util/u_draw_quad.c b/src/gallium/auxiliary/util/u_draw_quad.c
index 8c194102bf..b37b48b5ae 100644
--- a/src/gallium/auxiliary/util/u_draw_quad.c
+++ b/src/gallium/auxiliary/util/u_draw_quad.c
@@ -30,6 +30,7 @@
#include "pipe/p_defines.h"
#include "util/u_inlines.h"
#include "util/u_draw_quad.h"
+#include "util/u_memory.h"
/**
@@ -38,7 +39,7 @@
*/
void
util_draw_vertex_buffer(struct pipe_context *pipe,
- struct pipe_buffer *vbuf,
+ struct pipe_resource *vbuf,
uint offset,
uint prim_type,
uint num_verts,
@@ -66,60 +67,63 @@ util_draw_vertex_buffer(struct pipe_context *pipe,
/**
* Draw screen-aligned textured quad.
- * Note: this function allocs/destroys a vertex buffer and isn't especially
- * efficient.
+ * Note: this isn't especially efficient.
*/
void
util_draw_texquad(struct pipe_context *pipe,
float x0, float y0, float x1, float y1, float z)
{
- struct pipe_buffer *vbuf;
- uint numAttribs = 2, vertexBytes, i, j;
-
- vertexBytes = 4 * (4 * numAttribs * sizeof(float));
-
- /* XXX create one-time */
- vbuf = pipe_buffer_create(pipe->screen, 32,
- PIPE_BUFFER_USAGE_VERTEX, vertexBytes);
- if (vbuf) {
- float *v = (float *) pipe_buffer_map(pipe->screen, vbuf,
- PIPE_BUFFER_USAGE_CPU_WRITE);
- if (v) {
- /*
- * Load vertex buffer
- */
- for (i = j = 0; i < 4; i++) {
- v[j + 2] = z; /* z */
- v[j + 3] = 1.0; /* w */
- v[j + 6] = 0.0; /* r */
- v[j + 7] = 1.0; /* q */
- j += 8;
- }
-
- v[0] = x0;
- v[1] = y0;
- v[4] = 0.0; /*s*/
- v[5] = 0.0; /*t*/
-
- v[8] = x1;
- v[9] = y0;
- v[12] = 1.0;
- v[13] = 0.0;
-
- v[16] = x1;
- v[17] = y1;
- v[20] = 1.0;
- v[21] = 1.0;
-
- v[24] = x0;
- v[25] = y1;
- v[28] = 0.0;
- v[29] = 1.0;
-
- pipe_buffer_unmap(pipe->screen, vbuf);
- util_draw_vertex_buffer(pipe, vbuf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, 2);
- }
-
- pipe_buffer_reference(&vbuf, NULL);
+ uint numAttribs = 2, i, j;
+ uint vertexBytes = 4 * (4 * numAttribs * sizeof(float));
+ struct pipe_resource *vbuf = NULL;
+ uint *v = NULL;
+
+ v = MALLOC(vertexBytes);
+ if (v == NULL)
+ goto out;
+
+ /*
+ * Load vertex buffer
+ */
+ for (i = j = 0; i < 4; i++) {
+ v[j + 2] = z; /* z */
+ v[j + 3] = 1.0; /* w */
+ v[j + 6] = 0.0; /* r */
+ v[j + 7] = 1.0; /* q */
+ j += 8;
}
+
+ v[0] = x0;
+ v[1] = y0;
+ v[4] = 0.0; /*s*/
+ v[5] = 0.0; /*t*/
+
+ v[8] = x1;
+ v[9] = y0;
+ v[12] = 1.0;
+ v[13] = 0.0;
+
+ v[16] = x1;
+ v[17] = y1;
+ v[20] = 1.0;
+ v[21] = 1.0;
+
+ v[24] = x0;
+ v[25] = y1;
+ v[28] = 0.0;
+ v[29] = 1.0;
+
+ vbuf = pipe_user_buffer_create(pipe->screen, v, vertexBytes,
+ PIPE_BIND_VERTEX_BUFFER);
+ if (!vbuf)
+ goto out;
+
+ util_draw_vertex_buffer(pipe, vbuf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, 2);
+
+out:
+ if (vbuf)
+ pipe_resource_reference(&vbuf, NULL);
+
+ if (v)
+ FREE(v);
}
diff --git a/src/gallium/auxiliary/util/u_draw_quad.h b/src/gallium/auxiliary/util/u_draw_quad.h
index 00d3f5b715..42eb184428 100644
--- a/src/gallium/auxiliary/util/u_draw_quad.h
+++ b/src/gallium/auxiliary/util/u_draw_quad.h
@@ -33,11 +33,11 @@
extern "C" {
#endif
-struct pipe_buffer;
+struct pipe_resource;
extern void
util_draw_vertex_buffer(struct pipe_context *pipe,
- struct pipe_buffer *vbuf, uint offset,
+ struct pipe_resource *vbuf, uint offset,
uint num_attribs, uint num_verts, uint prim_type);
diff --git a/src/gallium/auxiliary/util/u_dump.h b/src/gallium/auxiliary/util/u_dump.h
index 379f18ef38..bdc73ac47d 100644
--- a/src/gallium/auxiliary/util/u_dump.h
+++ b/src/gallium/auxiliary/util/u_dump.h
@@ -92,7 +92,7 @@ util_dump_tex_filter(unsigned value, boolean shortened);
void
util_dump_template(struct os_stream *stream,
- const struct pipe_texture *templat);
+ const struct pipe_resource *templat);
void
util_dump_rasterizer_state(struct os_stream *stream,
diff --git a/src/gallium/auxiliary/util/u_dump_state.c b/src/gallium/auxiliary/util/u_dump_state.c
index 52cf3ef4ce..79fd38ef5c 100644
--- a/src/gallium/auxiliary/util/u_dump_state.c
+++ b/src/gallium/auxiliary/util/u_dump_state.c
@@ -255,14 +255,14 @@ util_dump_enum_func(struct os_stream *stream, unsigned value)
void
-util_dump_template(struct os_stream *stream, const struct pipe_texture *templat)
+util_dump_template(struct os_stream *stream, const struct pipe_resource *templat)
{
if(!templat) {
util_dump_null(stream);
return;
}
- util_dump_struct_begin(stream, "pipe_texture");
+ util_dump_struct_begin(stream, "pipe_resource");
util_dump_member(stream, int, templat, target);
util_dump_member(stream, format, templat, format);
@@ -280,7 +280,9 @@ util_dump_template(struct os_stream *stream, const struct pipe_texture *templat)
util_dump_member_end(stream);
util_dump_member(stream, uint, templat, last_level);
- util_dump_member(stream, uint, templat, tex_usage);
+ util_dump_member(stream, uint, templat, _usage);
+ util_dump_member(stream, uint, templat, bind);
+ util_dump_member(stream, uint, templat, flags);
util_dump_struct_end(stream);
}
@@ -653,16 +655,13 @@ util_dump_transfer(struct os_stream *stream, const struct pipe_transfer *state)
util_dump_struct_begin(stream, "pipe_transfer");
- util_dump_member(stream, uint, state, width);
- util_dump_member(stream, uint, state, height);
+ util_dump_member(stream, ptr, state, resource);
+// util_dump_member(stream, uint, state, box);
util_dump_member(stream, uint, state, stride);
- util_dump_member(stream, uint, state, usage);
+ util_dump_member(stream, uint, state, slice_stride);
- util_dump_member(stream, ptr, state, texture);
- util_dump_member(stream, uint, state, face);
- util_dump_member(stream, uint, state, level);
- util_dump_member(stream, uint, state, zslice);
+// util_dump_member(stream, ptr, state, data);
util_dump_struct_end(stream);
}
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c
index 509d38754f..eee6030ddc 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.c
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
@@ -67,7 +67,7 @@ struct gen_mipmap_state
void *vs;
void *fs2d, *fsCube;
- struct pipe_buffer *vbuf; /**< quad vertices */
+ struct pipe_resource *vbuf; /**< quad vertices */
unsigned vbuf_slot;
float vertices[4][2][4]; /**< vertex/texcoords for quad */
@@ -1116,7 +1116,7 @@ reduce_3d(enum pipe_format pformat,
static void
make_1d_mipmap(struct gen_mipmap_state *ctx,
- struct pipe_texture *pt,
+ struct pipe_resource *pt,
uint face, uint baseLevel, uint lastLevel)
{
struct pipe_context *pipe = ctx->pipe;
@@ -1128,11 +1128,11 @@ make_1d_mipmap(struct gen_mipmap_state *ctx,
struct pipe_transfer *srcTrans, *dstTrans;
void *srcMap, *dstMap;
- srcTrans = pipe->get_tex_transfer(pipe, pt, face, srcLevel, zslice,
+ srcTrans = pipe_get_transfer(pipe, pt, face, srcLevel, zslice,
PIPE_TRANSFER_READ, 0, 0,
u_minify(pt->width0, srcLevel),
u_minify(pt->height0, srcLevel));
- dstTrans = pipe->get_tex_transfer(pipe, pt, face, dstLevel, zslice,
+ dstTrans = pipe_get_transfer(pipe, pt, face, dstLevel, zslice,
PIPE_TRANSFER_WRITE, 0, 0,
u_minify(pt->width0, dstLevel),
u_minify(pt->height0, dstLevel));
@@ -1141,21 +1141,21 @@ make_1d_mipmap(struct gen_mipmap_state *ctx,
dstMap = (ubyte *) pipe->transfer_map(pipe, dstTrans);
reduce_1d(pt->format,
- srcTrans->width, srcMap,
- dstTrans->width, dstMap);
+ srcTrans->box.width, srcMap,
+ dstTrans->box.width, dstMap);
pipe->transfer_unmap(pipe, srcTrans);
pipe->transfer_unmap(pipe, dstTrans);
- pipe->tex_transfer_destroy(pipe, srcTrans);
- pipe->tex_transfer_destroy(pipe, dstTrans);
+ pipe->transfer_destroy(pipe, srcTrans);
+ pipe->transfer_destroy(pipe, dstTrans);
}
}
static void
make_2d_mipmap(struct gen_mipmap_state *ctx,
- struct pipe_texture *pt,
+ struct pipe_resource *pt,
uint face, uint baseLevel, uint lastLevel)
{
struct pipe_context *pipe = ctx->pipe;
@@ -1170,36 +1170,36 @@ make_2d_mipmap(struct gen_mipmap_state *ctx,
struct pipe_transfer *srcTrans, *dstTrans;
ubyte *srcMap, *dstMap;
- srcTrans = pipe->get_tex_transfer(pipe, pt, face, srcLevel, zslice,
- PIPE_TRANSFER_READ, 0, 0,
- u_minify(pt->width0, srcLevel),
- u_minify(pt->height0, srcLevel));
- dstTrans = pipe->get_tex_transfer(pipe, pt, face, dstLevel, zslice,
- PIPE_TRANSFER_WRITE, 0, 0,
- u_minify(pt->width0, dstLevel),
- u_minify(pt->height0, dstLevel));
+ srcTrans = pipe_get_transfer(pipe, pt, face, srcLevel, zslice,
+ PIPE_TRANSFER_READ, 0, 0,
+ u_minify(pt->width0, srcLevel),
+ u_minify(pt->height0, srcLevel));
+ dstTrans = pipe_get_transfer(pipe, pt, face, dstLevel, zslice,
+ PIPE_TRANSFER_WRITE, 0, 0,
+ u_minify(pt->width0, dstLevel),
+ u_minify(pt->height0, dstLevel));
srcMap = (ubyte *) pipe->transfer_map(pipe, srcTrans);
dstMap = (ubyte *) pipe->transfer_map(pipe, dstTrans);
reduce_2d(pt->format,
- srcTrans->width, srcTrans->height,
+ srcTrans->box.width, srcTrans->box.height,
srcTrans->stride, srcMap,
- dstTrans->width, dstTrans->height,
+ dstTrans->box.width, dstTrans->box.height,
dstTrans->stride, dstMap);
pipe->transfer_unmap(pipe, srcTrans);
pipe->transfer_unmap(pipe, dstTrans);
- pipe->tex_transfer_destroy(pipe, srcTrans);
- pipe->tex_transfer_destroy(pipe, dstTrans);
+ pipe->transfer_destroy(pipe, srcTrans);
+ pipe->transfer_destroy(pipe, dstTrans);
}
}
static void
make_3d_mipmap(struct gen_mipmap_state *ctx,
- struct pipe_texture *pt,
+ struct pipe_resource *pt,
uint face, uint baseLevel, uint lastLevel)
{
#if 0
@@ -1215,11 +1215,11 @@ make_3d_mipmap(struct gen_mipmap_state *ctx,
struct pipe_transfer *srcTrans, *dstTrans;
ubyte *srcMap, *dstMap;
- srcTrans = pipe->get_tex_transfer(pipe, pt, face, srcLevel, zslice,
+ srcTrans = pipe->get_transfer(pipe, pt, face, srcLevel, zslice,
PIPE_TRANSFER_READ, 0, 0,
u_minify(pt->width0, srcLevel),
u_minify(pt->height0, srcLevel));
- dstTrans = pipe->get_tex_transfer(pipe, pt, face, dstLevel, zslice,
+ dstTrans = pipe->get_transfer(pipe, pt, face, dstLevel, zslice,
PIPE_TRANSFER_WRITE, 0, 0,
u_minify(pt->width0, dstLevel),
u_minify(pt->height0, dstLevel));
@@ -1236,8 +1236,8 @@ make_3d_mipmap(struct gen_mipmap_state *ctx,
pipe->transfer_unmap(pipe, srcTrans);
pipe->transfer_unmap(pipe, dstTrans);
- pipe->tex_transfer_destroy(pipe, srcTrans);
- pipe->tex_transfer_destroy(pipe, dstTrans);
+ pipe->transfer_destroy(pipe, srcTrans);
+ pipe->transfer_destroy(pipe, dstTrans);
}
#else
(void) reduce_3d;
@@ -1247,7 +1247,7 @@ make_3d_mipmap(struct gen_mipmap_state *ctx,
static void
fallback_gen_mipmap(struct gen_mipmap_state *ctx,
- struct pipe_texture *pt,
+ struct pipe_resource *pt,
uint face, uint baseLevel, uint lastLevel)
{
switch (pt->target) {
@@ -1358,8 +1358,7 @@ get_next_slot(struct gen_mipmap_state *ctx)
if (!ctx->vbuf) {
ctx->vbuf = pipe_buffer_create(ctx->pipe->screen,
- 32,
- PIPE_BUFFER_USAGE_VERTEX,
+ PIPE_BIND_VERTEX_BUFFER,
max_slots * sizeof ctx->vertices);
}
@@ -1420,7 +1419,7 @@ set_vertex_data(struct gen_mipmap_state *ctx,
offset = get_next_slot( ctx );
- pipe_buffer_write_nooverlap(ctx->pipe->screen, ctx->vbuf,
+ pipe_buffer_write_nooverlap(ctx->pipe, ctx->vbuf,
offset, sizeof(ctx->vertices), ctx->vertices);
return offset;
@@ -1440,7 +1439,7 @@ util_destroy_gen_mipmap(struct gen_mipmap_state *ctx)
pipe->delete_fs_state(pipe, ctx->fs2d);
pipe->delete_fs_state(pipe, ctx->fsCube);
- pipe_buffer_reference(&ctx->vbuf, NULL);
+ pipe_resource_reference(&ctx->vbuf, NULL);
FREE(ctx);
}
@@ -1452,7 +1451,7 @@ util_destroy_gen_mipmap(struct gen_mipmap_state *ctx)
*/
void util_gen_mipmap_flush( struct gen_mipmap_state *ctx )
{
- pipe_buffer_reference(&ctx->vbuf, NULL);
+ pipe_resource_reference(&ctx->vbuf, NULL);
ctx->vbuf_slot = 0;
}
@@ -1476,7 +1475,7 @@ util_gen_mipmap(struct gen_mipmap_state *ctx,
struct pipe_context *pipe = ctx->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_framebuffer_state fb;
- struct pipe_texture *pt = psv->texture;
+ struct pipe_resource *pt = psv->texture;
void *fs = (pt->target == PIPE_TEXTURE_CUBE) ? ctx->fsCube : ctx->fs2d;
uint dstLevel;
uint zslice = 0;
@@ -1495,7 +1494,7 @@ util_gen_mipmap(struct gen_mipmap_state *ctx,
/* check if we can render in the texture's format */
if (!screen->is_format_supported(screen, psv->format, PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {
+ PIPE_BIND_RENDER_TARGET, 0)) {
fallback_gen_mipmap(ctx, pt, face, baseLevel, lastLevel);
return;
}
@@ -1541,7 +1540,7 @@ util_gen_mipmap(struct gen_mipmap_state *ctx,
struct pipe_surface *surf =
screen->get_tex_surface(screen, pt, face, dstLevel, zslice,
- PIPE_BUFFER_USAGE_GPU_WRITE);
+ PIPE_BIND_RENDER_TARGET);
/*
* Setup framebuffer / dest surface
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.h b/src/gallium/auxiliary/util/u_gen_mipmap.h
index 35ac9daeaa..a7502b9982 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.h
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.h
@@ -37,7 +37,7 @@ extern "C" {
struct pipe_context;
-struct pipe_texture;
+struct pipe_resource;
struct cso_context;
struct gen_mipmap_state;
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index e22ab188e1..c2f4f05990 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -34,6 +34,7 @@
#include "pipe/p_screen.h"
#include "util/u_debug.h"
#include "util/u_atomic.h"
+#include "util/u_box.h"
#ifdef __cplusplus
@@ -87,18 +88,6 @@ pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference)
return destroy;
}
-static INLINE void
-pipe_buffer_reference(struct pipe_buffer **ptr, struct pipe_buffer *buf)
-{
- struct pipe_buffer *old_buf;
-
- assert(ptr);
- old_buf = *ptr;
-
- if (pipe_reference(&(*ptr)->reference, &buf->reference))
- old_buf->screen->buffer_destroy(old_buf);
- *ptr = buf;
-}
static INLINE void
pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
@@ -110,16 +99,18 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
*ptr = surf;
}
+
static INLINE void
-pipe_texture_reference(struct pipe_texture **ptr, struct pipe_texture *tex)
+pipe_resource_reference(struct pipe_resource **ptr, struct pipe_resource *tex)
{
- struct pipe_texture *old_tex = *ptr;
+ struct pipe_resource *old_tex = *ptr;
if (pipe_reference(&(*ptr)->reference, &tex->reference))
- old_tex->screen->texture_destroy(old_tex);
+ old_tex->screen->resource_destroy(old_tex->screen, old_tex);
*ptr = tex;
}
+
static INLINE void
pipe_sampler_view_reference(struct pipe_sampler_view **ptr, struct pipe_sampler_view *view)
{
@@ -135,91 +126,135 @@ pipe_sampler_view_reference(struct pipe_sampler_view **ptr, struct pipe_sampler_
* Convenience wrappers for screen buffer functions.
*/
-static INLINE struct pipe_buffer *
+static INLINE struct pipe_resource *
pipe_buffer_create( struct pipe_screen *screen,
- unsigned alignment, unsigned usage, unsigned size )
+ unsigned bind,
+ unsigned size )
{
- return screen->buffer_create(screen, alignment, usage, size);
+ struct pipe_resource buffer;
+ memset(&buffer, 0, sizeof buffer);
+ buffer.target = PIPE_BUFFER;
+ buffer.format = PIPE_FORMAT_R8_UNORM; /* want TYPELESS or similar */
+ buffer.bind = bind;
+ buffer._usage = PIPE_USAGE_DEFAULT;
+ buffer.flags = 0;
+ buffer.width0 = size;
+ buffer.height0 = 1;
+ buffer.depth0 = 1;
+ return screen->resource_create(screen, &buffer);
}
-static INLINE struct pipe_buffer *
-pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size )
+
+static INLINE struct pipe_resource *
+pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size,
+ unsigned usage )
{
- return screen->user_buffer_create(screen, ptr, size);
+ return screen->user_buffer_create(screen, ptr, size, usage);
}
static INLINE void *
-pipe_buffer_map(struct pipe_screen *screen,
- struct pipe_buffer *buf,
- unsigned usage)
+pipe_buffer_map_range(struct pipe_context *pipe,
+ struct pipe_resource *buffer,
+ unsigned offset,
+ unsigned length,
+ unsigned usage,
+ struct pipe_transfer **transfer)
{
- if(screen->buffer_map_range) {
- unsigned offset = 0;
- unsigned length = buf->size;
- return screen->buffer_map_range(screen, buf, offset, length, usage);
+ struct pipe_box box;
+ void *map;
+
+ assert(offset < buffer->width0);
+ assert(offset + length <= buffer->width0);
+ assert(length);
+
+ u_box_1d(offset, length, &box);
+
+ *transfer = pipe->get_transfer( pipe,
+ buffer,
+ u_subresource(0, 0),
+ usage,
+ &box);
+
+ if (*transfer == NULL)
+ return NULL;
+
+ map = pipe->transfer_map( pipe, *transfer );
+ if (map == NULL) {
+ pipe->transfer_destroy( pipe, *transfer );
+ return NULL;
}
- else
- return screen->buffer_map(screen, buf, usage);
+
+ /* Match old screen->buffer_map_range() behaviour, return pointer
+ * to where the beginning of the buffer would be:
+ */
+ return (void *)((char *)map - offset);
}
-static INLINE void
-pipe_buffer_unmap(struct pipe_screen *screen,
- struct pipe_buffer *buf)
+
+static INLINE void *
+pipe_buffer_map(struct pipe_context *pipe,
+ struct pipe_resource *buffer,
+ unsigned usage,
+ struct pipe_transfer **transfer)
{
- screen->buffer_unmap(screen, buf);
+ return pipe_buffer_map_range(pipe, buffer, 0, buffer->width0, usage, transfer);
}
-static INLINE void *
-pipe_buffer_map_range(struct pipe_screen *screen,
- struct pipe_buffer *buf,
- unsigned offset,
- unsigned length,
- unsigned usage)
+
+static INLINE void
+pipe_buffer_unmap(struct pipe_context *pipe,
+ struct pipe_resource *buf,
+ struct pipe_transfer *transfer)
{
- assert(offset < buf->size);
- assert(offset + length <= buf->size);
- assert(length);
- if(screen->buffer_map_range)
- return screen->buffer_map_range(screen, buf, offset, length, usage);
- else
- return screen->buffer_map(screen, buf, usage);
+ if (transfer) {
+ pipe->transfer_unmap(pipe, transfer);
+ pipe->transfer_destroy(pipe, transfer);
+ }
}
static INLINE void
-pipe_buffer_flush_mapped_range(struct pipe_screen *screen,
- struct pipe_buffer *buf,
+pipe_buffer_flush_mapped_range(struct pipe_context *pipe,
+ struct pipe_transfer *transfer,
unsigned offset,
unsigned length)
{
- assert(offset < buf->size);
- assert(offset + length <= buf->size);
+ struct pipe_box box;
+ int transfer_offset;
+
assert(length);
- if(screen->buffer_flush_mapped_range)
- screen->buffer_flush_mapped_range(screen, buf, offset, length);
+ assert(transfer->box.x <= offset);
+ assert(offset + length <= transfer->box.x + transfer->box.width);
+
+ /* Match old screen->buffer_flush_mapped_range() behaviour, where
+ * offset parameter is relative to the start of the buffer, not the
+ * mapped range.
+ */
+ transfer_offset = offset - transfer->box.x;
+
+ u_box_1d(transfer_offset, length, &box);
+
+ pipe->transfer_flush_region(pipe, transfer, &box);
}
static INLINE void
-pipe_buffer_write(struct pipe_screen *screen,
- struct pipe_buffer *buf,
- unsigned offset, unsigned size,
+pipe_buffer_write(struct pipe_context *pipe,
+ struct pipe_resource *buf,
+ unsigned offset,
+ unsigned size,
const void *data)
{
- void *map;
-
- assert(offset < buf->size);
- assert(offset + size <= buf->size);
- assert(size);
-
- map = pipe_buffer_map_range(screen, buf, offset, size,
- PIPE_BUFFER_USAGE_CPU_WRITE |
- PIPE_BUFFER_USAGE_FLUSH_EXPLICIT |
- PIPE_BUFFER_USAGE_DISCARD);
- assert(map);
- if(map) {
- memcpy((uint8_t *)map + offset, data, size);
- pipe_buffer_flush_mapped_range(screen, buf, offset, size);
- pipe_buffer_unmap(screen, buf);
- }
+ struct pipe_box box;
+
+ u_box_1d(offset, size, &box);
+
+ pipe->transfer_inline_write( pipe,
+ buf,
+ u_subresource(0,0),
+ PIPE_TRANSFER_WRITE,
+ &box,
+ data,
+ size,
+ 0);
}
/**
@@ -229,86 +264,87 @@ pipe_buffer_write(struct pipe_screen *screen,
* been written before.
*/
static INLINE void
-pipe_buffer_write_nooverlap(struct pipe_screen *screen,
- struct pipe_buffer *buf,
+pipe_buffer_write_nooverlap(struct pipe_context *pipe,
+ struct pipe_resource *buf,
unsigned offset, unsigned size,
const void *data)
{
- void *map;
-
- assert(offset < buf->size);
- assert(offset + size <= buf->size);
- assert(size);
-
- map = pipe_buffer_map_range(screen, buf, offset, size,
- PIPE_BUFFER_USAGE_CPU_WRITE |
- PIPE_BUFFER_USAGE_FLUSH_EXPLICIT |
- PIPE_BUFFER_USAGE_DISCARD |
- PIPE_BUFFER_USAGE_UNSYNCHRONIZED);
- assert(map);
- if(map) {
- memcpy((uint8_t *)map + offset, data, size);
- pipe_buffer_flush_mapped_range(screen, buf, offset, size);
- pipe_buffer_unmap(screen, buf);
- }
+ struct pipe_box box;
+
+ u_box_1d(offset, size, &box);
+
+ pipe->transfer_inline_write(pipe,
+ buf,
+ u_subresource(0,0),
+ (PIPE_TRANSFER_WRITE |
+ PIPE_TRANSFER_NOOVERWRITE),
+ &box,
+ data,
+ 0, 0);
}
static INLINE void
-pipe_buffer_read(struct pipe_screen *screen,
- struct pipe_buffer *buf,
- unsigned offset, unsigned size,
+pipe_buffer_read(struct pipe_context *pipe,
+ struct pipe_resource *buf,
+ unsigned offset,
+ unsigned size,
void *data)
{
- void *map;
-
- assert(offset < buf->size);
- assert(offset + size <= buf->size);
- assert(size);
-
- map = pipe_buffer_map_range(screen, buf, offset, size, PIPE_BUFFER_USAGE_CPU_READ);
- assert(map);
- if(map) {
- memcpy(data, (const uint8_t *)map + offset, size);
- pipe_buffer_unmap(screen, buf);
- }
+ struct pipe_transfer *src_transfer;
+ ubyte *map;
+
+ map = (ubyte *) pipe_buffer_map_range(pipe,
+ buf,
+ offset, size,
+ PIPE_TRANSFER_READ,
+ &src_transfer);
+
+ if (map)
+ memcpy(data, map + offset, size);
+
+ pipe_buffer_unmap(pipe, buf, src_transfer);
+}
+
+static INLINE struct pipe_transfer *
+pipe_get_transfer( struct pipe_context *context,
+ struct pipe_resource *resource,
+ unsigned face, unsigned level,
+ unsigned zslice,
+ enum pipe_transfer_usage usage,
+ unsigned x, unsigned y,
+ unsigned w, unsigned h)
+{
+ struct pipe_box box;
+ u_box_2d_zslice( x, y, zslice, w, h, &box );
+ return context->get_transfer( context,
+ resource,
+ u_subresource(face, level),
+ usage,
+ &box );
}
static INLINE void *
pipe_transfer_map( struct pipe_context *context,
- struct pipe_transfer *transf )
+ struct pipe_transfer *transfer )
{
- return context->transfer_map(context, transf);
+ return context->transfer_map( context, transfer );
}
static INLINE void
pipe_transfer_unmap( struct pipe_context *context,
- struct pipe_transfer *transf )
+ struct pipe_transfer *transfer )
{
- context->transfer_unmap(context, transf);
+ context->transfer_unmap( context, transfer );
}
+
static INLINE void
-pipe_transfer_destroy( struct pipe_context *context,
- struct pipe_transfer *transfer )
+pipe_transfer_destroy( struct pipe_context *context,
+ struct pipe_transfer *transfer )
{
- context->tex_transfer_destroy(context, transfer);
+ context->transfer_destroy(context, transfer);
}
-static INLINE unsigned
-pipe_transfer_buffer_flags( struct pipe_transfer *transf )
-{
- switch (transf->usage & PIPE_TRANSFER_READ_WRITE) {
- case PIPE_TRANSFER_READ_WRITE:
- return PIPE_BUFFER_USAGE_CPU_READ | PIPE_BUFFER_USAGE_CPU_WRITE;
- case PIPE_TRANSFER_READ:
- return PIPE_BUFFER_USAGE_CPU_READ;
- case PIPE_TRANSFER_WRITE:
- return PIPE_BUFFER_USAGE_CPU_WRITE;
- default:
- debug_assert(0);
- return 0;
- }
-}
#ifdef __cplusplus
}
diff --git a/src/gallium/auxiliary/util/u_rect.c b/src/gallium/auxiliary/util/u_rect.c
index e73797f1b7..098cdfd58b 100644
--- a/src/gallium/auxiliary/util/u_rect.c
+++ b/src/gallium/auxiliary/util/u_rect.c
@@ -35,6 +35,7 @@
#include "pipe/p_context.h"
#include "pipe/p_screen.h"
#include "util/u_format.h"
+#include "util/u_inlines.h"
#include "util/u_rect.h"
@@ -181,21 +182,21 @@ util_surface_copy(struct pipe_context *pipe,
src_format = src->texture->format;
dst_format = dst->texture->format;
- src_trans = pipe->get_tex_transfer(pipe,
- src->texture,
- src->face,
- src->level,
- src->zslice,
- PIPE_TRANSFER_READ,
- src_x, src_y, w, h);
-
- dst_trans = pipe->get_tex_transfer(pipe,
- dst->texture,
- dst->face,
- dst->level,
- dst->zslice,
- PIPE_TRANSFER_WRITE,
- dst_x, dst_y, w, h);
+ src_trans = pipe_get_transfer(pipe,
+ src->texture,
+ src->face,
+ src->level,
+ src->zslice,
+ PIPE_TRANSFER_READ,
+ src_x, src_y, w, h);
+
+ dst_trans = pipe_get_transfer(pipe,
+ dst->texture,
+ dst->face,
+ dst->level,
+ dst->zslice,
+ PIPE_TRANSFER_WRITE,
+ dst_x, dst_y, w, h);
assert(util_format_get_blocksize(dst_format) == util_format_get_blocksize(src_format));
assert(util_format_get_blockwidth(dst_format) == util_format_get_blockwidth(src_format));
@@ -223,8 +224,8 @@ util_surface_copy(struct pipe_context *pipe,
pipe->transfer_unmap(pipe, src_trans);
pipe->transfer_unmap(pipe, dst_trans);
- pipe->tex_transfer_destroy(pipe, src_trans);
- pipe->tex_transfer_destroy(pipe, dst_trans);
+ pipe->transfer_destroy(pipe, src_trans);
+ pipe->transfer_destroy(pipe, dst_trans);
}
@@ -248,13 +249,13 @@ util_surface_fill(struct pipe_context *pipe,
assert(dst->texture);
if (!dst->texture)
return;
- dst_trans = pipe->get_tex_transfer(pipe,
- dst->texture,
- dst->face,
- dst->level,
- dst->zslice,
- PIPE_TRANSFER_WRITE,
- dstx, dsty, width, height);
+ dst_trans = pipe_get_transfer(pipe,
+ dst->texture,
+ dst->face,
+ dst->level,
+ dst->zslice,
+ PIPE_TRANSFER_WRITE,
+ dstx, dsty, width, height);
dst_map = pipe->transfer_map(pipe, dst_trans);
@@ -263,37 +264,38 @@ util_surface_fill(struct pipe_context *pipe,
if (dst_map) {
assert(dst_trans->stride > 0);
- switch (util_format_get_blocksize(dst_trans->texture->format)) {
+ switch (util_format_get_blocksize(dst->texture->format)) {
case 1:
case 2:
case 4:
- util_fill_rect(dst_map, dst_trans->texture->format, dst_trans->stride,
+ util_fill_rect(dst_map, dst->texture->format,
+ dst_trans->stride,
0, 0, width, height, value);
break;
case 8:
- {
- /* expand the 4-byte clear value to an 8-byte value */
- ushort *row = (ushort *) dst_map;
- ushort val0 = UBYTE_TO_USHORT((value >> 0) & 0xff);
- ushort val1 = UBYTE_TO_USHORT((value >> 8) & 0xff);
- ushort val2 = UBYTE_TO_USHORT((value >> 16) & 0xff);
- ushort val3 = UBYTE_TO_USHORT((value >> 24) & 0xff);
- unsigned i, j;
- val0 = (val0 << 8) | val0;
- val1 = (val1 << 8) | val1;
- val2 = (val2 << 8) | val2;
- val3 = (val3 << 8) | val3;
- for (i = 0; i < height; i++) {
- for (j = 0; j < width; j++) {
- row[j*4+0] = val0;
- row[j*4+1] = val1;
- row[j*4+2] = val2;
- row[j*4+3] = val3;
- }
- row += dst_trans->stride/2;
- }
- }
- break;
+ {
+ /* expand the 4-byte clear value to an 8-byte value */
+ ushort *row = (ushort *) dst_map;
+ ushort val0 = UBYTE_TO_USHORT((value >> 0) & 0xff);
+ ushort val1 = UBYTE_TO_USHORT((value >> 8) & 0xff);
+ ushort val2 = UBYTE_TO_USHORT((value >> 16) & 0xff);
+ ushort val3 = UBYTE_TO_USHORT((value >> 24) & 0xff);
+ unsigned i, j;
+ val0 = (val0 << 8) | val0;
+ val1 = (val1 << 8) | val1;
+ val2 = (val2 << 8) | val2;
+ val3 = (val3 << 8) | val3;
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < width; j++) {
+ row[j*4+0] = val0;
+ row[j*4+1] = val1;
+ row[j*4+2] = val2;
+ row[j*4+3] = val3;
+ }
+ row += dst_trans->stride/2;
+ }
+ }
+ break;
default:
assert(0);
break;
@@ -301,5 +303,5 @@ util_surface_fill(struct pipe_context *pipe,
}
pipe->transfer_unmap(pipe, dst_trans);
- pipe->tex_transfer_destroy(pipe, dst_trans);
+ pipe->transfer_destroy(pipe, dst_trans);
}
diff --git a/src/gallium/auxiliary/util/u_resource.c b/src/gallium/auxiliary/util/u_resource.c
new file mode 100644
index 0000000000..c37a68bc42
--- /dev/null
+++ b/src/gallium/auxiliary/util/u_resource.c
@@ -0,0 +1,97 @@
+
+
+#include "util/u_inlines.h"
+#include "util/u_memory.h"
+#include "util/u_transfer.h"
+
+static INLINE struct u_resource *
+u_resource( struct pipe_resource *res )
+{
+ return (struct u_resource *)res;
+}
+
+boolean u_resource_get_handle_vtbl(struct pipe_screen *screen,
+ struct pipe_resource *resource,
+ struct winsys_handle *handle)
+{
+ struct u_resource *ur = u_resource(resource);
+ return ur->vtbl->resource_get_handle(screen, resource, handle);
+}
+
+void u_resource_destroy_vtbl(struct pipe_screen *screen,
+ struct pipe_resource *resource)
+{
+ struct u_resource *ur = u_resource(resource);
+ ur->vtbl->resource_destroy(screen, resource);
+}
+
+unsigned u_is_resource_referenced_vtbl( struct pipe_context *pipe,
+ struct pipe_resource *resource,
+ unsigned face, unsigned level)
+{
+ struct u_resource *ur = u_resource(resource);
+ return ur->vtbl->is_resource_referenced(pipe, resource, face, level);
+}
+
+struct pipe_transfer *u_get_transfer_vtbl(struct pipe_context *context,
+ struct pipe_resource *resource,
+ struct pipe_subresource sr,
+ enum pipe_transfer_usage usage,
+ const struct pipe_box *box)
+{
+ struct u_resource *ur = u_resource(resource);
+ return ur->vtbl->get_transfer(context, resource, sr, usage, box);
+}
+
+void u_transfer_destroy_vtbl(struct pipe_context *pipe,
+ struct pipe_transfer *transfer)
+{
+ struct u_resource *ur = u_resource(transfer->resource);
+ ur->vtbl->transfer_destroy(pipe, transfer);
+}
+
+void *u_transfer_map_vtbl( struct pipe_context *pipe,
+ struct pipe_transfer *transfer )
+{
+ struct u_resource *ur = u_resource(transfer->resource);
+ return ur->vtbl->transfer_map(pipe, transfer);
+}
+
+void u_transfer_flush_region_vtbl( struct pipe_context *pipe,
+ struct pipe_transfer *transfer,
+ const struct pipe_box *box)
+{
+ struct u_resource *ur = u_resource(transfer->resource);
+ ur->vtbl->transfer_flush_region(pipe, transfer, box);
+}
+
+void u_transfer_unmap_vtbl( struct pipe_context *pipe,
+ struct pipe_transfer *transfer )
+{
+ struct u_resource *ur = u_resource(transfer->resource);
+ ur->vtbl->transfer_unmap(pipe, transfer);
+}
+
+void u_transfer_inline_write_vtbl( struct pipe_context *pipe,
+ struct pipe_resource *resource,
+ struct pipe_subresource sr,
+ unsigned usage,
+ const struct pipe_box *box,
+ const void *data,
+ unsigned stride,
+ unsigned slice_stride)
+{
+ struct u_resource *ur = u_resource(resource);
+ ur->vtbl->transfer_inline_write(pipe,
+ resource,
+ sr,
+ usage,
+ box,
+ data,
+ stride,
+ slice_stride);
+}
+
+
+
+
diff --git a/src/gallium/auxiliary/util/u_sampler.c b/src/gallium/auxiliary/util/u_sampler.c
index 4d8f861ce4..e77f562ea2 100644
--- a/src/gallium/auxiliary/util/u_sampler.c
+++ b/src/gallium/auxiliary/util/u_sampler.c
@@ -32,7 +32,7 @@
static void
default_template(struct pipe_sampler_view *view,
- const struct pipe_texture *texture,
+ const struct pipe_resource *texture,
enum pipe_format format,
unsigned expand_green_blue)
{
@@ -77,7 +77,7 @@ default_template(struct pipe_sampler_view *view,
void
u_sampler_view_default_template(struct pipe_sampler_view *view,
- const struct pipe_texture *texture,
+ const struct pipe_resource *texture,
enum pipe_format format)
{
/* Expand to (0, 0, 0, 1) */
@@ -89,7 +89,7 @@ u_sampler_view_default_template(struct pipe_sampler_view *view,
void
u_sampler_view_default_dx9_template(struct pipe_sampler_view *view,
- const struct pipe_texture *texture,
+ const struct pipe_resource *texture,
enum pipe_format format)
{
/* Expand to (1, 1, 1, 1) */
diff --git a/src/gallium/auxiliary/util/u_sampler.h b/src/gallium/auxiliary/util/u_sampler.h
index bdd061c851..f3dad7417e 100644
--- a/src/gallium/auxiliary/util/u_sampler.h
+++ b/src/gallium/auxiliary/util/u_sampler.h
@@ -41,12 +41,12 @@ extern "C" {
void
u_sampler_view_default_template(struct pipe_sampler_view *view,
- const struct pipe_texture *texture,
+ const struct pipe_resource *texture,
enum pipe_format format);
void
u_sampler_view_default_dx9_template(struct pipe_sampler_view *view,
- const struct pipe_texture *texture,
+ const struct pipe_resource *texture,
enum pipe_format format);
diff --git a/src/gallium/auxiliary/util/u_simple_screen.c b/src/gallium/auxiliary/util/u_simple_screen.c
deleted file mode 100644
index 9203cb6580..0000000000
--- a/src/gallium/auxiliary/util/u_simple_screen.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * 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, sub license, 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 NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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 "u_simple_screen.h"
-
-#include "pipe/p_screen.h"
-#include "pipe/p_state.h"
-#include "util/u_simple_screen.h"
-
-
-static struct pipe_buffer *
-pass_buffer_create(struct pipe_screen *screen,
- unsigned alignment,
- unsigned usage,
- unsigned size)
-{
- struct pipe_buffer *buffer =
- screen->winsys->buffer_create(screen->winsys, alignment, usage, size);
-
- buffer->screen = screen;
-
- return buffer;
-}
-
-static struct pipe_buffer *
-pass_user_buffer_create(struct pipe_screen *screen,
- void *ptr,
- unsigned bytes)
-{
- struct pipe_buffer *buffer =
- screen->winsys->user_buffer_create(screen->winsys, ptr, bytes);
-
- buffer->screen = screen;
-
- return buffer;
-}
-
-
-
-static void *
-pass_buffer_map(struct pipe_screen *screen,
- struct pipe_buffer *buf,
- unsigned usage)
-{
- return screen->winsys->buffer_map(screen->winsys, buf, usage);
-}
-
-static void
-pass_buffer_unmap(struct pipe_screen *screen,
- struct pipe_buffer *buf)
-{
- screen->winsys->buffer_unmap(screen->winsys, buf);
-}
-
-static void
-pass_buffer_destroy(struct pipe_buffer *buf)
-{
- buf->screen->winsys->buffer_destroy(buf);
-}
-
-
-static void
-pass_flush_frontbuffer(struct pipe_screen *screen,
- struct pipe_surface *surf,
- void *context_private)
-{
- screen->winsys->flush_frontbuffer(screen->winsys, surf, context_private);
-}
-
-static void
-pass_fence_reference(struct pipe_screen *screen,
- struct pipe_fence_handle **ptr,
- struct pipe_fence_handle *fence)
-{
- screen->winsys->fence_reference(screen->winsys, ptr, fence);
-}
-
-static int
-pass_fence_signalled(struct pipe_screen *screen,
- struct pipe_fence_handle *fence,
- unsigned flag)
-{
- return screen->winsys->fence_signalled(screen->winsys, fence, flag);
-}
-
-static int
-pass_fence_finish(struct pipe_screen *screen,
- struct pipe_fence_handle *fence,
- unsigned flag)
-{
- return screen->winsys->fence_finish(screen->winsys, fence, flag);
-}
-
-void
-u_simple_screen_init(struct pipe_screen *screen)
-{
- screen->buffer_create = pass_buffer_create;
- screen->user_buffer_create = pass_user_buffer_create;
-
- screen->buffer_map = pass_buffer_map;
- screen->buffer_unmap = pass_buffer_unmap;
- screen->buffer_destroy = pass_buffer_destroy;
- screen->flush_frontbuffer = pass_flush_frontbuffer;
- screen->fence_reference = pass_fence_reference;
- screen->fence_signalled = pass_fence_signalled;
- screen->fence_finish = pass_fence_finish;
-}
-
-const char *
-u_simple_screen_winsys_name(struct pipe_screen *screen)
-{
- return screen->winsys->get_name(screen->winsys);
-}
diff --git a/src/gallium/auxiliary/util/u_simple_screen.h b/src/gallium/auxiliary/util/u_simple_screen.h
index bb3f5ba102..de6325fe2a 100644
--- a/src/gallium/auxiliary/util/u_simple_screen.h
+++ b/src/gallium/auxiliary/util/u_simple_screen.h
@@ -33,7 +33,7 @@
struct pipe_screen;
struct pipe_fence_handle;
struct pipe_surface;
-struct pipe_buffer;
+struct pipe_resource;
/**
* Gallium3D drivers are (meant to be!) independent of both GL and the
@@ -73,14 +73,13 @@ struct pipe_winsys
* window systems must then implement that interface (rather than the
* other way around...).
*
- * usage is a bitmask of PIPE_BUFFER_USAGE_PIXEL/VERTEX/INDEX/CONSTANT. This
- * usage argument is only an optimization hint, not a guarantee, therefore
- * proper behavior must be observed in all circumstances.
+ * usage is a bitmask of PIPE_BIND_*.
+ * All possible usages must be present.
*
* alignment indicates the client's alignment requirements, eg for
* SSE instructions.
*/
- struct pipe_buffer *(*buffer_create)( struct pipe_winsys *ws,
+ struct pipe_resource *(*buffer_create)( struct pipe_winsys *ws,
unsigned alignment,
unsigned usage,
unsigned size );
@@ -106,7 +105,7 @@ struct pipe_winsys
* Note that ptr may be accessed at any time upto the time when the
* buffer is destroyed, so the data must not be freed before then.
*/
- struct pipe_buffer *(*user_buffer_create)(struct pipe_winsys *ws,
+ struct pipe_resource *(*user_buffer_create)(struct pipe_winsys *ws,
void *ptr,
unsigned bytes);
@@ -117,11 +116,11 @@ struct pipe_winsys
* display targets) must be allocated with special characteristics, memory
* pools, or obtained directly from the windowing system.
*
- * This callback is invoked by the pipe_screenwhen creating a texture marked
- * with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag to get the underlying
+ * This callback is invoked by the pipe_screen when creating a texture marked
+ * with the PIPE_BIND_DISPLAY_TARGET flag to get the underlying
* buffer storage.
*/
- struct pipe_buffer *(*surface_buffer_create)(struct pipe_winsys *ws,
+ struct pipe_resource *(*surface_buffer_create)(struct pipe_winsys *ws,
unsigned width, unsigned height,
enum pipe_format format,
unsigned usage,
@@ -134,13 +133,13 @@ struct pipe_winsys
* flags is bitmask of PIPE_BUFFER_USAGE_CPU_READ/WRITE flags.
*/
void *(*buffer_map)( struct pipe_winsys *ws,
- struct pipe_buffer *buf,
+ struct pipe_resource *buf,
unsigned usage );
void (*buffer_unmap)( struct pipe_winsys *ws,
- struct pipe_buffer *buf );
+ struct pipe_resource *buf );
- void (*buffer_destroy)( struct pipe_buffer *buf );
+ void (*buffer_destroy)( struct pipe_resource *buf );
/** Set ptr = fence, with reference counting */
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index 33306bbc2a..42440d0d67 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -50,7 +50,8 @@
boolean
util_create_rgba_surface(struct pipe_screen *screen,
uint width, uint height,
- struct pipe_texture **textureOut,
+ uint bind,
+ struct pipe_resource **textureOut,
struct pipe_surface **surfaceOut)
{
static const enum pipe_format rgbaFormats[] = {
@@ -60,15 +61,14 @@ util_create_rgba_surface(struct pipe_screen *screen,
PIPE_FORMAT_NONE
};
const uint target = PIPE_TEXTURE_2D;
- const uint usage = PIPE_TEXTURE_USAGE_RENDER_TARGET;
enum pipe_format format = PIPE_FORMAT_NONE;
- struct pipe_texture templ;
+ struct pipe_resource templ;
uint i;
/* Choose surface format */
for (i = 0; rgbaFormats[i]; i++) {
if (screen->is_format_supported(screen, rgbaFormats[i],
- target, usage, 0)) {
+ target, bind, 0)) {
format = rgbaFormats[i];
break;
}
@@ -84,16 +84,19 @@ util_create_rgba_surface(struct pipe_screen *screen,
templ.width0 = width;
templ.height0 = height;
templ.depth0 = 1;
- templ.tex_usage = usage;
+ templ.bind = bind;
- *textureOut = screen->texture_create(screen, &templ);
+ *textureOut = screen->resource_create(screen, &templ);
if (!*textureOut)
return FALSE;
/* create surface / view into texture */
- *surfaceOut = screen->get_tex_surface(screen, *textureOut, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE);
+ *surfaceOut = screen->get_tex_surface(screen,
+ *textureOut,
+ 0, 0, 0,
+ bind);
if (!*surfaceOut) {
- pipe_texture_reference(textureOut, NULL);
+ pipe_resource_reference(textureOut, NULL);
return FALSE;
}
@@ -105,11 +108,11 @@ util_create_rgba_surface(struct pipe_screen *screen,
* Release the surface and texture from util_create_rgba_surface().
*/
void
-util_destroy_rgba_surface(struct pipe_texture *texture,
+util_destroy_rgba_surface(struct pipe_resource *texture,
struct pipe_surface *surface)
{
pipe_surface_reference(&surface, NULL);
- pipe_texture_reference(&texture, NULL);
+ pipe_resource_reference(&texture, NULL);
}
diff --git a/src/gallium/auxiliary/util/u_surface.h b/src/gallium/auxiliary/util/u_surface.h
index 3c60df2c3e..119fcd4ce8 100644
--- a/src/gallium/auxiliary/util/u_surface.h
+++ b/src/gallium/auxiliary/util/u_surface.h
@@ -52,13 +52,13 @@ util_same_surface(const struct pipe_surface *s1, const struct pipe_surface *s2)
extern boolean
util_create_rgba_surface(struct pipe_screen *screen,
- uint width, uint height,
- struct pipe_texture **textureOut,
+ uint width, uint height, uint bind,
+ struct pipe_resource **textureOut,
struct pipe_surface **surfaceOut);
extern void
-util_destroy_rgba_surface(struct pipe_texture *texture,
+util_destroy_rgba_surface(struct pipe_resource *texture,
struct pipe_surface *surface);
diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c
index 88a1424dff..fe327c302b 100644
--- a/src/gallium/auxiliary/util/u_tile.c
+++ b/src/gallium/auxiliary/util/u_tile.c
@@ -53,9 +53,9 @@ pipe_get_tile_raw(struct pipe_context *pipe,
const void *src;
if (dst_stride == 0)
- dst_stride = util_format_get_stride(pt->texture->format, w);
+ dst_stride = util_format_get_stride(pt->resource->format, w);
- if (pipe_clip_tile(x, y, &w, &h, pt))
+ if (u_clip_tile(x, y, &w, &h, &pt->box))
return;
src = pipe->transfer_map(pipe, pt);
@@ -63,7 +63,7 @@ pipe_get_tile_raw(struct pipe_context *pipe,
if(!src)
return;
- util_copy_rect(dst, pt->texture->format, dst_stride, 0, 0, w, h, src, pt->stride, x, y);
+ util_copy_rect(dst, pt->resource->format, dst_stride, 0, 0, w, h, src, pt->stride, x, y);
pipe->transfer_unmap(pipe, pt);
}
@@ -79,12 +79,12 @@ pipe_put_tile_raw(struct pipe_context *pipe,
const void *src, int src_stride)
{
void *dst;
- enum pipe_format format = pt->texture->format;
+ enum pipe_format format = pt->resource->format;
if (src_stride == 0)
src_stride = util_format_get_stride(format, w);
- if (pipe_clip_tile(x, y, &w, &h, pt))
+ if (u_clip_tile(x, y, &w, &h, &pt->box))
return;
dst = pipe->transfer_map(pipe, pt);
@@ -285,9 +285,9 @@ pipe_get_tile_rgba(struct pipe_context *pipe,
{
unsigned dst_stride = w * 4;
void *packed;
- enum pipe_format format = pt->texture->format;
+ enum pipe_format format = pt->resource->format;
- if (pipe_clip_tile(x, y, &w, &h, pt))
+ if (u_clip_tile(x, y, &w, &h, &pt->box))
return;
packed = MALLOC(util_format_get_nblocks(format, w, h) * util_format_get_blocksize(format));
@@ -325,7 +325,7 @@ pipe_get_tile_swizzle(struct pipe_context *pipe,
uint iy;
float rgba01[6];
- if (pipe_clip_tile(x, y, &w, &h, pt)) {
+ if (u_clip_tile(x, y, &w, &h, &pt->box)) {
return;
}
@@ -383,9 +383,9 @@ pipe_put_tile_rgba(struct pipe_context *pipe,
{
unsigned src_stride = w * 4;
void *packed;
- enum pipe_format format = pt->texture->format;
+ enum pipe_format format = pt->resource->format;
- if (pipe_clip_tile(x, y, &w, &h, pt))
+ if (u_clip_tile(x, y, &w, &h, &pt->box))
return;
packed = MALLOC(util_format_get_nblocks(format, w, h) * util_format_get_blocksize(format));
@@ -434,9 +434,9 @@ pipe_get_tile_z(struct pipe_context *pipe,
ubyte *map;
uint *pDest = z;
uint i, j;
- enum pipe_format format = pt->texture->format;
+ enum pipe_format format = pt->resource->format;
- if (pipe_clip_tile(x, y, &w, &h, pt))
+ if (u_clip_tile(x, y, &w, &h, &pt->box))
return;
map = (ubyte *)pipe->transfer_map(pipe, pt);
@@ -519,9 +519,9 @@ pipe_put_tile_z(struct pipe_context *pipe,
const uint *ptrc = zSrc;
ubyte *map;
uint i, j;
- enum pipe_format format = pt->texture->format;
+ enum pipe_format format = pt->resource->format;
- if (pipe_clip_tile(x, y, &w, &h, pt))
+ if (u_clip_tile(x, y, &w, &h, &pt->box))
return;
map = (ubyte *)pipe->transfer_map(pipe, pt);
@@ -544,7 +544,7 @@ pipe_put_tile_z(struct pipe_context *pipe,
case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
{
uint *pDest = (uint *) (map + y * pt->stride + x*4);
- assert((pt->usage & PIPE_TRANSFER_READ_WRITE) == PIPE_TRANSFER_READ_WRITE);
+ //assert((pt->usage & PIPE_TRANSFER_READ_WRITE) == PIPE_TRANSFER_READ_WRITE);
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
/* convert 32-bit Z to 24-bit Z, preserve stencil */
@@ -571,7 +571,7 @@ pipe_put_tile_z(struct pipe_context *pipe,
case PIPE_FORMAT_S8_USCALED_Z24_UNORM:
{
uint *pDest = (uint *) (map + y * pt->stride + x*4);
- assert((pt->usage & PIPE_TRANSFER_READ_WRITE) == PIPE_TRANSFER_READ_WRITE);
+ //assert((pt->usage & PIPE_TRANSFER_READ_WRITE) == PIPE_TRANSFER_READ_WRITE);
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
/* convert 32-bit Z to 24-bit Z, preserve stencil */
diff --git a/src/gallium/auxiliary/util/u_tile.h b/src/gallium/auxiliary/util/u_tile.h
index 1d8ce7d8cb..986eee0743 100644
--- a/src/gallium/auxiliary/util/u_tile.h
+++ b/src/gallium/auxiliary/util/u_tile.h
@@ -32,22 +32,24 @@
struct pipe_transfer;
-
/**
* Clip tile against transfer dims.
+ *
+ * XXX: this only clips width and height!
+ *
* \return TRUE if tile is totally clipped, FALSE otherwise
*/
static INLINE boolean
-pipe_clip_tile(uint x, uint y, uint *w, uint *h, const struct pipe_transfer *pt)
+u_clip_tile(uint x, uint y, uint *w, uint *h, const struct pipe_box *box)
{
- if (x >= pt->width)
+ if (x >= box->width)
return TRUE;
- if (y >= pt->height)
+ if (y >= box->height)
return TRUE;
- if (x + *w > pt->width)
- *w = pt->width - x;
- if (y + *h > pt->height)
- *h = pt->height - y;
+ if (x + *w > box->width)
+ *w = box->width - x;
+ if (y + *h > box->height)
+ *h = box->height - y;
return FALSE;
}
diff --git a/src/gallium/auxiliary/util/u_timed_winsys.c b/src/gallium/auxiliary/util/u_timed_winsys.c
deleted file mode 100644
index d88298bc14..0000000000
--- a/src/gallium/auxiliary/util/u_timed_winsys.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
- * All Rights Reserved.
- *
- * 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- *
- **************************************************************************/
-/*
- * Authors: Keith Whitwell <keithw-at-tungstengraphics-dot-com>
- */
-
-#include "pipe/p_state.h"
-#include "util/u_simple_screen.h"
-#include "u_timed_winsys.h"
-#include "util/u_memory.h"
-#include "os/os_time.h"
-
-
-struct timed_winsys {
- struct pipe_winsys base;
- struct pipe_winsys *backend;
- uint64_t last_dump;
- struct {
- const char *name_key;
- double total;
- unsigned calls;
- } funcs[13];
-};
-
-
-static struct timed_winsys *timed_winsys( struct pipe_winsys *winsys )
-{
- return (struct timed_winsys *)winsys;
-}
-
-
-static void time_display( struct pipe_winsys *winsys )
-{
- struct timed_winsys *tws = timed_winsys(winsys);
- unsigned i;
- double overall = 0;
-
- for (i = 0; i < Elements(tws->funcs); i++) {
- if (tws->funcs[i].name_key) {
- debug_printf("*** %-25s %5.3fms (%d calls, avg %.3fms)\n",
- tws->funcs[i].name_key,
- tws->funcs[i].total,
- tws->funcs[i].calls,
- tws->funcs[i].total / tws->funcs[i].calls);
- overall += tws->funcs[i].total;
- tws->funcs[i].calls = 0;
- tws->funcs[i].total = 0;
- }
- }
-
- debug_printf("*** %-25s %5.3fms\n",
- "OVERALL WINSYS",
- overall);
-}
-
-static void time_finish( struct pipe_winsys *winsys,
- long long startval,
- unsigned idx,
- const char *name )
-{
- struct timed_winsys *tws = timed_winsys(winsys);
- int64_t endval = os_time_get();
- double elapsed = (endval - startval)/1000.0;
-
- if (endval - startval > 1000LL)
- debug_printf("*** %s %.3f\n", name, elapsed );
-
- assert( tws->funcs[idx].name_key == name ||
- tws->funcs[idx].name_key == NULL);
-
- tws->funcs[idx].name_key = name;
- tws->funcs[idx].total += elapsed;
- tws->funcs[idx].calls++;
-
- if (endval - tws->last_dump > 10LL * 1000LL * 1000LL) {
- time_display( winsys );
- tws->last_dump = endval;
- }
-}
-
-
-/* Pipe has no concept of pools, but the psb driver passes a flag that
- * can be mapped onto pools in the backend.
- */
-static struct pipe_buffer *
-timed_buffer_create(struct pipe_winsys *winsys,
- unsigned alignment,
- unsigned usage,
- unsigned size )
-{
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- int64_t start = os_time_get();
-
- struct pipe_buffer *buf =
- backend->buffer_create( backend, alignment, usage, size );
-
- time_finish(winsys, start, 0, __FUNCTION__);
-
- return buf;
-}
-
-
-
-
-static struct pipe_buffer *
-timed_user_buffer_create(struct pipe_winsys *winsys,
- void *data,
- unsigned bytes)
-{
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- int64_t start = os_time_get();
-
- struct pipe_buffer *buf = backend->user_buffer_create( backend, data, bytes );
-
- time_finish(winsys, start, 1, __FUNCTION__);
-
- return buf;
-}
-
-
-static void *
-timed_buffer_map(struct pipe_winsys *winsys,
- struct pipe_buffer *buf,
- unsigned flags)
-{
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- int64_t start = os_time_get();
-
- void *map = backend->buffer_map( backend, buf, flags );
-
- time_finish(winsys, start, 2, __FUNCTION__);
-
- return map;
-}
-
-
-static void
-timed_buffer_unmap(struct pipe_winsys *winsys,
- struct pipe_buffer *buf)
-{
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- int64_t start = os_time_get();
-
- backend->buffer_unmap( backend, buf );
-
- time_finish(winsys, start, 3, __FUNCTION__);
-}
-
-
-static void
-timed_buffer_destroy(struct pipe_buffer *buf)
-{
- struct pipe_winsys *winsys = buf->screen->winsys;
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- int64_t start = os_time_get();
-
- backend->buffer_destroy( buf );
-
- time_finish(winsys, start, 4, __FUNCTION__);
-}
-
-
-static void
-timed_flush_frontbuffer( struct pipe_winsys *winsys,
- struct pipe_surface *surf,
- void *context_private)
-{
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- int64_t start = os_time_get();
-
- backend->flush_frontbuffer( backend, surf, context_private );
-
- time_finish(winsys, start, 5, __FUNCTION__);
-}
-
-
-
-
-static struct pipe_buffer *
-timed_surface_buffer_create(struct pipe_winsys *winsys,
- unsigned width, unsigned height,
- enum pipe_format format,
- unsigned usage,
- unsigned tex_usage,
- unsigned *stride)
-{
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- int64_t start = os_time_get();
-
- struct pipe_buffer *ret = backend->surface_buffer_create( backend, width, height,
- format, usage, tex_usage, stride );
-
- time_finish(winsys, start, 7, __FUNCTION__);
-
- return ret;
-}
-
-
-static const char *
-timed_get_name( struct pipe_winsys *winsys )
-{
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- int64_t start = os_time_get();
-
- const char *ret = backend->get_name( backend );
-
- time_finish(winsys, start, 9, __FUNCTION__);
-
- return ret;
-}
-
-static void
-timed_fence_reference(struct pipe_winsys *winsys,
- struct pipe_fence_handle **ptr,
- struct pipe_fence_handle *fence)
-{
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- int64_t start = os_time_get();
-
- backend->fence_reference( backend, ptr, fence );
-
- time_finish(winsys, start, 10, __FUNCTION__);
-}
-
-
-static int
-timed_fence_signalled( struct pipe_winsys *winsys,
- struct pipe_fence_handle *fence,
- unsigned flag )
-{
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- int64_t start = os_time_get();
-
- int ret = backend->fence_signalled( backend, fence, flag );
-
- time_finish(winsys, start, 11, __FUNCTION__);
-
- return ret;
-}
-
-static int
-timed_fence_finish( struct pipe_winsys *winsys,
- struct pipe_fence_handle *fence,
- unsigned flag )
-{
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- int64_t start = os_time_get();
-
- int ret = backend->fence_finish( backend, fence, flag );
-
- time_finish(winsys, start, 12, __FUNCTION__);
-
- return ret;
-}
-
-static void
-timed_winsys_destroy( struct pipe_winsys *winsys )
-{
- struct pipe_winsys *backend = timed_winsys(winsys)->backend;
- backend->destroy( backend );
- FREE(winsys);
-}
-
-
-
-struct pipe_winsys *u_timed_winsys_create( struct pipe_winsys *backend )
-{
- struct timed_winsys *ws = CALLOC_STRUCT(timed_winsys);
-
- ws->base.user_buffer_create = timed_user_buffer_create;
- ws->base.buffer_map = timed_buffer_map;
- ws->base.buffer_unmap = timed_buffer_unmap;
- ws->base.buffer_destroy = timed_buffer_destroy;
- ws->base.buffer_create = timed_buffer_create;
- ws->base.surface_buffer_create = timed_surface_buffer_create;
- ws->base.flush_frontbuffer = timed_flush_frontbuffer;
- ws->base.get_name = timed_get_name;
- ws->base.fence_reference = timed_fence_reference;
- ws->base.fence_signalled = timed_fence_signalled;
- ws->base.fence_finish = timed_fence_finish;
- ws->base.destroy = timed_winsys_destroy;
-
- ws->backend = backend;
-
- return &ws->base;
-}
-
diff --git a/src/gallium/auxiliary/util/u_timed_winsys.h b/src/gallium/auxiliary/util/u_timed_winsys.h
deleted file mode 100644
index 542365112d..0000000000
--- a/src/gallium/auxiliary/util/u_timed_winsys.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
- * All Rights Reserved.
- *
- * 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- *
- **************************************************************************/
-/*
- * Authors: Keith Whitwell <keithw-at-tungstengraphics-dot-com>
- */
-
-
-#ifndef U_TIMED_WINSYS_H
-#define U_TIMED_WINSYS_H
-
-
-struct pipe_winsys;
-struct pipe_winsys *u_timed_winsys_create( struct pipe_winsys *backend );
-
-
-#endif
diff --git a/src/gallium/auxiliary/util/u_transfer.c b/src/gallium/auxiliary/util/u_transfer.c
new file mode 100644
index 0000000000..bedace3b1d
--- /dev/null
+++ b/src/gallium/auxiliary/util/u_transfer.c
@@ -0,0 +1,110 @@
+#include "pipe/p_context.h"
+#include "util/u_rect.h"
+#include "util/u_inlines.h"
+#include "util/u_transfer.h"
+#include "util/u_memory.h"
+
+/* One-shot transfer operation with data supplied in a user
+ * pointer. XXX: strides??
+ */
+void u_default_transfer_inline_write( struct pipe_context *pipe,
+ struct pipe_resource *resource,
+ struct pipe_subresource sr,
+ unsigned usage,
+ const struct pipe_box *box,
+ const void *data,
+ unsigned stride,
+ unsigned slice_stride)
+{
+ struct pipe_transfer *transfer = NULL;
+ uint8_t *map = NULL;
+
+ transfer = pipe->get_transfer(pipe,
+ resource,
+ sr,
+ usage,
+ box );
+ if (transfer == NULL)
+ goto out;
+
+ map = pipe_transfer_map(pipe, transfer);
+ if (map == NULL)
+ goto out;
+
+ assert(box->depth == 1); /* XXX: fix me */
+
+ util_copy_rect(map,
+ resource->format,
+ transfer->stride, /* bytes? */
+ 0, 0,
+ box->width,
+ box->height,
+ data,
+ box->width, /* bytes? texels? */
+ 0, 0);
+
+out:
+ if (map)
+ pipe_transfer_unmap(pipe, transfer);
+
+ if (transfer)
+ pipe_transfer_destroy(pipe, transfer);
+}
+
+
+boolean u_default_resource_get_handle(struct pipe_screen *screen,
+ struct pipe_resource *resource,
+ struct winsys_handle *handle)
+{
+ return FALSE;
+}
+
+
+
+void u_default_transfer_flush_region( struct pipe_context *pipe,
+ struct pipe_transfer *transfer,
+ const struct pipe_box *box)
+{
+ /* This is a no-op implementation, nothing to do.
+ */
+}
+
+unsigned u_default_is_resource_referenced( struct pipe_context *pipe,
+ struct pipe_resource *resource,
+ unsigned face, unsigned level)
+{
+ return 0;
+}
+
+struct pipe_transfer * u_default_get_transfer(struct pipe_context *context,
+ struct pipe_resource *resource,
+ struct pipe_subresource sr,
+ unsigned usage,
+ const struct pipe_box *box)
+{
+ struct pipe_transfer *transfer = CALLOC_STRUCT(pipe_transfer);
+ if (transfer == NULL)
+ return NULL;
+
+ transfer->resource = resource;
+ transfer->sr = sr;
+ transfer->usage = usage;
+ transfer->box = *box;
+
+ /* Note strides are zero, this is ok for buffers, but not for
+ * textures 2d & higher at least.
+ */
+ return transfer;
+}
+
+void u_default_transfer_unmap( struct pipe_context *pipe,
+ struct pipe_transfer *transfer )
+{
+}
+
+void u_default_transfer_destroy(struct pipe_context *pipe,
+ struct pipe_transfer *transfer)
+{
+ FREE(transfer);
+}
+
diff --git a/src/gallium/auxiliary/util/u_transfer.h b/src/gallium/auxiliary/util/u_transfer.h
new file mode 100644
index 0000000000..eb07945d15
--- /dev/null
+++ b/src/gallium/auxiliary/util/u_transfer.h
@@ -0,0 +1,145 @@
+
+#ifndef U_TRANSFER_H
+#define U_TRANSFER_H
+
+/* Fallback implementations for inline read/writes which just go back
+ * to the regular transfer behaviour.
+ */
+#include "pipe/p_state.h"
+
+struct pipe_context;
+
+boolean u_default_resource_get_handle(struct pipe_screen *screen,
+ struct pipe_resource *resource,
+ struct winsys_handle *handle);
+
+void u_default_transfer_inline_write( struct pipe_context *pipe,
+ struct pipe_resource *resource,
+ struct pipe_subresource sr,
+ unsigned usage,
+ const struct pipe_box *box,
+ const void *data,
+ unsigned stride,
+ unsigned slice_stride);
+
+void u_default_transfer_flush_region( struct pipe_context *pipe,
+ struct pipe_transfer *transfer,
+ const struct pipe_box *box);
+
+unsigned u_default_is_resource_referenced( struct pipe_context *pipe,
+ struct pipe_resource *resource,
+ unsigned face, unsigned level);
+
+struct pipe_transfer * u_default_get_transfer(struct pipe_context *context,
+ struct pipe_resource *resource,
+ struct pipe_subresource sr,
+ unsigned usage,
+ const struct pipe_box *box);
+
+void u_default_transfer_unmap( struct pipe_context *pipe,
+ struct pipe_transfer *transfer );
+
+void u_default_transfer_destroy(struct pipe_context *pipe,
+ struct pipe_transfer *transfer);
+
+
+
+/* Useful helper to allow >1 implementation of resource functionality
+ * to exist in a single driver. This is intended to be transitionary!
+ */
+struct u_resource_vtbl {
+
+ boolean (*resource_get_handle)(struct pipe_screen *,
+ struct pipe_resource *tex,
+ struct winsys_handle *handle);
+
+ void (*resource_destroy)(struct pipe_screen *,
+ struct pipe_resource *pt);
+
+ unsigned (*is_resource_referenced)(struct pipe_context *pipe,
+ struct pipe_resource *texture,
+ unsigned face, unsigned level);
+
+ struct pipe_transfer *(*get_transfer)(struct pipe_context *,
+ struct pipe_resource *resource,
+ struct pipe_subresource,
+ unsigned usage,
+ const struct pipe_box *);
+
+ void (*transfer_destroy)(struct pipe_context *,
+ struct pipe_transfer *);
+
+ void *(*transfer_map)( struct pipe_context *,
+ struct pipe_transfer *transfer );
+
+ void (*transfer_flush_region)( struct pipe_context *,
+ struct pipe_transfer *transfer,
+ const struct pipe_box *);
+
+ void (*transfer_unmap)( struct pipe_context *,
+ struct pipe_transfer *transfer );
+
+ void (*transfer_inline_write)( struct pipe_context *pipe,
+ struct pipe_resource *resource,
+ struct pipe_subresource sr,
+ unsigned usage,
+ const struct pipe_box *box,
+ const void *data,
+ unsigned stride,
+ unsigned slice_stride);
+};
+
+
+struct u_resource {
+ struct pipe_resource b;
+ struct u_resource_vtbl *vtbl;
+};
+
+
+boolean u_resource_get_handle_vtbl(struct pipe_screen *screen,
+ struct pipe_resource *resource,
+ struct winsys_handle *handle);
+
+void u_resource_destroy_vtbl(struct pipe_screen *screen,
+ struct pipe_resource *resource);
+
+unsigned u_is_resource_referenced_vtbl( struct pipe_context *pipe,
+ struct pipe_resource *resource,
+ unsigned face, unsigned level);
+
+struct pipe_transfer *u_get_transfer_vtbl(struct pipe_context *context,
+ struct pipe_resource *resource,
+ struct pipe_subresource sr,
+ unsigned usage,
+ const struct pipe_box *box);
+
+void u_transfer_destroy_vtbl(struct pipe_context *pipe,
+ struct pipe_transfer *transfer);
+
+void *u_transfer_map_vtbl( struct pipe_context *pipe,
+ struct pipe_transfer *transfer );
+
+void u_transfer_flush_region_vtbl( struct pipe_context *pipe,
+ struct pipe_transfer *transfer,
+ const struct pipe_box *box);
+
+void u_transfer_unmap_vtbl( struct pipe_context *rm_ctx,
+ struct pipe_transfer *transfer );
+
+void u_transfer_inline_write_vtbl( struct pipe_context *rm_ctx,
+ struct pipe_resource *resource,
+ struct pipe_subresource sr,
+ unsigned usage,
+ const struct pipe_box *box,
+ const void *data,
+ unsigned stride,
+ unsigned slice_stride);
+
+
+
+
+
+
+
+
+#endif
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c
index 012b2ae233..75d44432d9 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -31,7 +31,7 @@
#include "pipe/p_defines.h"
#include "util/u_inlines.h"
-#include "pipe/p_screen.h"
+#include "pipe/p_context.h"
#include "util/u_memory.h"
#include "util/u_math.h"
@@ -39,7 +39,7 @@
struct u_upload_mgr {
- struct pipe_screen *screen;
+ struct pipe_context *pipe;
unsigned default_size;
unsigned alignment;
@@ -47,21 +47,21 @@ struct u_upload_mgr {
/* The active buffer:
*/
- struct pipe_buffer *buffer;
+ struct pipe_resource *buffer;
unsigned size;
unsigned offset;
};
-struct u_upload_mgr *u_upload_create( struct pipe_screen *screen,
+struct u_upload_mgr *u_upload_create( struct pipe_context *pipe,
unsigned default_size,
unsigned alignment,
unsigned usage )
{
struct u_upload_mgr *upload = CALLOC_STRUCT( u_upload_mgr );
+ upload->pipe = pipe;
upload->default_size = default_size;
- upload->screen = screen;
upload->alignment = alignment;
upload->usage = usage;
upload->buffer = NULL;
@@ -69,31 +69,44 @@ struct u_upload_mgr *u_upload_create( struct pipe_screen *screen,
return upload;
}
-
+/* Slightly specialized version of buffer_write designed to maximize
+ * chances of the driver consolidating successive writes into a single
+ * upload.
+ *
+ * dirty_size may be slightly greater than size to cope with
+ * alignment. We don't want to leave holes between succesively mapped
+ * regions as that may prevent the driver from consolidating uploads.
+ *
+ * Note that the 'data' pointer has probably come from the application
+ * and we cannot read even a byte past its end without risking
+ * segfaults, or at least complaints from valgrind..
+ */
static INLINE enum pipe_error
-my_buffer_write(struct pipe_screen *screen,
- struct pipe_buffer *buf,
+my_buffer_write(struct pipe_context *pipe,
+ struct pipe_resource *buf,
unsigned offset, unsigned size, unsigned dirty_size,
const void *data)
{
+ struct pipe_transfer *transfer = NULL;
uint8_t *map;
- assert(offset < buf->size);
- assert(offset + size <= buf->size);
+ assert(offset < buf->width0);
+ assert(offset + size <= buf->width0);
assert(dirty_size >= size);
assert(size);
- map = pipe_buffer_map_range(screen, buf, offset, size,
- PIPE_BUFFER_USAGE_CPU_WRITE |
- PIPE_BUFFER_USAGE_FLUSH_EXPLICIT |
- PIPE_BUFFER_USAGE_DISCARD |
- PIPE_BUFFER_USAGE_UNSYNCHRONIZED);
+ map = pipe_buffer_map_range(pipe, buf, offset, dirty_size,
+ PIPE_TRANSFER_WRITE |
+ PIPE_TRANSFER_FLUSH_EXPLICIT |
+ PIPE_TRANSFER_DISCARD |
+ PIPE_TRANSFER_UNSYNCHRONIZED,
+ &transfer);
if (map == NULL)
return PIPE_ERROR_OUT_OF_MEMORY;
memcpy(map + offset, data, size);
- pipe_buffer_flush_mapped_range(screen, buf, offset, dirty_size);
- pipe_buffer_unmap(screen, buf);
+ pipe_buffer_flush_mapped_range(pipe, transfer, offset, dirty_size);
+ pipe_buffer_unmap(pipe, buf, transfer);
return PIPE_OK;
}
@@ -109,7 +122,7 @@ my_buffer_write(struct pipe_screen *screen,
*/
void u_upload_flush( struct u_upload_mgr *upload )
{
- pipe_buffer_reference( &upload->buffer, NULL );
+ pipe_resource_reference( &upload->buffer, NULL );
upload->size = 0;
}
@@ -135,9 +148,8 @@ u_upload_alloc_buffer( struct u_upload_mgr *upload,
*/
size = align(MAX2(upload->default_size, min_size), 4096);
- upload->buffer = pipe_buffer_create( upload->screen,
- upload->alignment,
- upload->usage | PIPE_BUFFER_USAGE_CPU_WRITE,
+ upload->buffer = pipe_buffer_create( upload->pipe->screen,
+ upload->usage,
size );
if (upload->buffer == NULL)
goto fail;
@@ -149,7 +161,7 @@ u_upload_alloc_buffer( struct u_upload_mgr *upload,
fail:
if (upload->buffer)
- pipe_buffer_reference( &upload->buffer, NULL );
+ pipe_resource_reference( &upload->buffer, NULL );
return PIPE_ERROR_OUT_OF_MEMORY;
}
@@ -159,7 +171,7 @@ enum pipe_error u_upload_data( struct u_upload_mgr *upload,
unsigned size,
const void *data,
unsigned *out_offset,
- struct pipe_buffer **outbuf )
+ struct pipe_resource **outbuf )
{
unsigned alloc_size = align( size, upload->alignment );
enum pipe_error ret = PIPE_OK;
@@ -172,7 +184,7 @@ enum pipe_error u_upload_data( struct u_upload_mgr *upload,
/* Copy the data, using map_range if available:
*/
- ret = my_buffer_write( upload->screen,
+ ret = my_buffer_write( upload->pipe,
upload->buffer,
upload->offset,
size,
@@ -183,7 +195,7 @@ enum pipe_error u_upload_data( struct u_upload_mgr *upload,
/* Emit the return values:
*/
- pipe_buffer_reference( outbuf, upload->buffer );
+ pipe_resource_reference( outbuf, upload->buffer );
*out_offset = upload->offset;
upload->offset += alloc_size;
return PIPE_OK;
@@ -198,15 +210,18 @@ enum pipe_error u_upload_data( struct u_upload_mgr *upload,
enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
unsigned offset,
unsigned size,
- struct pipe_buffer *inbuf,
+ struct pipe_resource *inbuf,
unsigned *out_offset,
- struct pipe_buffer **outbuf )
+ struct pipe_resource **outbuf )
{
enum pipe_error ret = PIPE_OK;
+ struct pipe_transfer *transfer = NULL;
const char *map = NULL;
- map = (const char *)pipe_buffer_map(
- upload->screen, inbuf, PIPE_BUFFER_USAGE_CPU_READ );
+ map = (const char *)pipe_buffer_map(upload->pipe,
+ inbuf,
+ PIPE_TRANSFER_READ,
+ &transfer);
if (map == NULL) {
ret = PIPE_ERROR_OUT_OF_MEMORY;
@@ -226,7 +241,7 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
done:
if (map)
- pipe_buffer_unmap( upload->screen, inbuf );
+ pipe_buffer_unmap( upload->pipe, inbuf, transfer );
return ret;
}
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.h b/src/gallium/auxiliary/util/u_upload_mgr.h
index e158bed9d0..a124924fc8 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.h
+++ b/src/gallium/auxiliary/util/u_upload_mgr.h
@@ -35,11 +35,11 @@
#include "pipe/p_defines.h"
struct pipe_screen;
-struct pipe_buffer;
+struct pipe_resource;
struct u_upload_mgr;
-struct u_upload_mgr *u_upload_create( struct pipe_screen *screen,
+struct u_upload_mgr *u_upload_create( struct pipe_context *pipe,
unsigned default_size,
unsigned alignment,
unsigned usage );
@@ -61,15 +61,15 @@ enum pipe_error u_upload_data( struct u_upload_mgr *upload,
unsigned size,
const void *data,
unsigned *out_offset,
- struct pipe_buffer **outbuf );
+ struct pipe_resource **outbuf );
enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
unsigned offset,
unsigned size,
- struct pipe_buffer *inbuf,
+ struct pipe_resource *inbuf,
unsigned *out_offset,
- struct pipe_buffer **outbuf );
+ struct pipe_resource **outbuf );