aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2010-04-10 16:05:54 +0100
committerKeith Whitwell <[email protected]>2010-04-10 16:05:54 +0100
commit287c94ea4987033f9c99a2f91c5750c9083504ca (patch)
treea3c1d20522d0ba4a259a5c83e2126affd7aba83c /src/mesa/state_tracker
parente7f1e5ca648d6c96d056d3ae8eab65e98f47f311 (diff)
Squashed commit of the following:
commit 0189cb2fde9f5d7326fd4bfbc2e52db4cce73b3e Author: Keith Whitwell <[email protected]> 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 <[email protected]> Date: Sat Apr 10 13:49:34 2010 +0800 i915g: Initialize screen surface function. commit eb56e64986790aa2fa35534ce652b78656b0c3c5 Merge: f8b0a7f e7f1e5c Author: Keith Whitwell <[email protected]> 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 <[email protected]> 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 <[email protected]> Date: Fri Apr 9 18:07:56 2010 +0200 gallium: fix another compile warning after merge. Hmpf. commit 52953cd7b0e51deafecb812bdc40f9e45f9ac62a Author: Roland Scheidegger <[email protected]> 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 <[email protected]> Date: Fri Apr 9 17:51:23 2010 +0200 gallium: more comments fixup commit 8f3f9d5e1e9c0de98a3dfb19e81250d2c32ee4e9 Author: Roland Scheidegger <[email protected]> Date: Fri Apr 9 17:48:18 2010 +0200 gallium: another fix after merge commit 41f00a32ee5be91512c048bacb89ede0e04bc08d Author: Roland Scheidegger <[email protected]> Date: Fri Apr 9 17:44:30 2010 +0200 gallium: more pipe_texture/resource fixes after merge commit faf53328d1154c51d8a59513f2bfcae62272b0bf Author: Roland Scheidegger <[email protected]> Date: Fri Apr 9 17:44:24 2010 +0200 gallium: fix comments for changed USAGE flags commit fdcb17bea4b0798d316b56deea69832f41142adf Author: Roland Scheidegger <[email protected]> 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 <[email protected]> Date: Fri Apr 9 13:44:35 2010 +0100 llvmpipe: fix merge glitches commit 28f8b8683175149a381be5eff263d4c20568bce7 Author: Keith Whitwell <[email protected]> Date: Fri Apr 9 13:41:39 2010 +0100 r300g: update after merge for pipe_resources commit 248c93cbc066ba6e3fadd94c5fcf3bdbb373d8fd Author: Keith Whitwell <[email protected]> Date: Fri Apr 9 13:41:20 2010 +0100 st/mesa: fix old pipe_texture usages commit a563b1c5c2cb57b3ef28a3654d9b477460d13ced Author: Keith Whitwell <[email protected]> Date: Fri Apr 9 13:40:56 2010 +0100 r300g: remove unused variable commit 734500131d828c9dfd68c5fa26b3e6b07e086d2d Author: Keith Whitwell <[email protected]> Date: Fri Apr 9 13:40:36 2010 +0100 nv50: fix compiler warning commit efd402e13037e5c3e29759fa5b1c754c6d65d0e2 Merge: fec8a1d 5452615 Author: Keith Whitwell <[email protected]> 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 <[email protected]> Date: Sat Apr 3 07:58:34 2010 +0200 util: fix assertion failures in pipe_buffer_flush_mapped_range commit 1ff3984c2edce9927744f3cce3e7b07778990170 Author: Roland Scheidegger <[email protected]> Date: Thu Apr 8 17:44:54 2010 +0200 docs: fix transfer_map description commit 20bf14be8ac6438cb1afa38212e306fc06a5ed40 Author: Keith Whitwell <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> Date: Wed Apr 7 17:26:08 2010 +0100 nv50: fix compiler warning commit d040daff0642dd791ac38e9b353dc251b03fc873 Author: Keith Whitwell <[email protected]> Date: Wed Apr 7 17:25:58 2010 +0100 nvfx: fix compiler warning commit 49ec01dffb8e99ab3ff8f856287db7b4df3efed6 Author: Chia-I Wu <[email protected]> Date: Mon Apr 5 11:58:53 2010 +0800 mesa/es: Fixes for gallium-resources. commit 47c87ada452be45766928a01b6d69da63e3a5f5e Author: Marek Olšák <[email protected]> Date: Sat Apr 3 05:19:20 2010 +0200 r300g: fix transfers for textures created from winsys handles commit 5f2701fddaef9c18d85c049311c2819c49cc1ae0 Author: Luca Barbieri <[email protected]> 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 <[email protected]> Date: Sat Apr 3 03:27:19 2010 +0200 i965: add brw_resource.c to Makefile commit b94f3e7389cbd1b6465de3c04e8059ce73f1ea1f Author: Luca Barbieri <[email protected]> Date: Sat Apr 3 01:48:33 2010 +0200 nouveau: fix for gallium-resources commit a01ff99a19986e6beb7903431e60a074945b09bc Author: Roland Scheidegger <[email protected]> Date: Thu Apr 1 19:26:35 2010 +0200 gallium: fix missing includes commit 26aeded562ce947a6deeb867fe22bf8daf7b1a1a Author: Roland Scheidegger <[email protected]> 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/[email protected]/msg09619.html for a discussion of this. Video related work is done in origin/pipe-video branch. commit c64285aea45997a276fb141d7badc8a04f617c7c Author: Roland Scheidegger <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> Date: Thu Apr 1 00:05:12 2010 +0200 r300g: compile fixes commit 76711ff40d2092f9ef03d452de7458c4e76d9246 Author: Roland Scheidegger <[email protected]> Date: Thu Apr 1 00:04:47 2010 +0200 nvfx: more compile fixes commit c5d2e90c9cc119447a447dc04a4bce4ab91fc671 Author: Roland Scheidegger <[email protected]> Date: Wed Mar 31 23:18:50 2010 +0200 gallium: more mostly merge fallout fixes... commit fbc3722696790857f4adc936190406e74dffd969 Merge: 86d9225 d97f696 Author: Roland Scheidegger <[email protected]> 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 <[email protected]> Date: Wed Mar 31 19:06:06 2010 +0200 gallium: more fixes for bind changes commit a215ef0606347e34669a580ec8df93ede7e46399 Author: Roland Scheidegger <[email protected]> Date: Wed Mar 31 18:48:36 2010 +0200 gallium/docs: some updates for bind changes commit c6c7e6746cbc7af59f7972719ed76f43e8ac16fc Author: Roland Scheidegger <[email protected]> Date: Tue Mar 30 20:24:26 2010 +0200 gallium: more bind change compile fixes commit a83fa1504b78180524a5eb454ae186741a27cdf8 Author: Roland Scheidegger <[email protected]> Date: Tue Mar 30 17:37:13 2010 +0200 compile fixes commit 30dc8afcd243d6a160571bac5f06d773e54a4196 Author: Roland Scheidegger <[email protected]> Date: Tue Mar 30 16:56:28 2010 +0200 fix some merge issues commit 30aa617fee11fe50c0a9c2f33fcd120a474f5e34 Merge: 1dde609 3a830bc Author: Roland Scheidegger <[email protected]> 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 <[email protected]> Date: Wed Mar 24 02:35:00 2010 +0100 docs: some updates for pipe_resource commit f236f9660d31b936f54b64ae07e569f8637067bd Author: Luca Barbieri <[email protected]> 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 <[email protected]> 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 <[email protected]> Date: Tue Mar 23 14:00:52 2010 -0700 st/egl: fix up for binding flags commit c6a80dc32ef17bc972d4137ce7444ebed4d28ebb Author: Keith Whitwell <[email protected]> Date: Tue Mar 23 13:52:15 2010 -0700 r300: restore 4k alignment for oqbo buffers commit e75a8d5ea9e0ffcf67bc858e08937e10b4fc74ba Author: Keith Whitwell <[email protected]> Date: Tue Mar 23 13:00:07 2010 -0700 gallium: bind flags commit 1f5b509543a7f399835fd9edf27c18e1643fab7d Author: Roland Scheidegger <[email protected]> Date: Tue Mar 23 19:32:21 2010 +0100 i965g: scons compile fixes commit 2c385f8f905ec794d9119c05c6293e0b1b9b565a Author: Roland Scheidegger <[email protected]> Date: Tue Mar 23 19:20:33 2010 +0100 nouveau: drm compile fix commit b285086ebd5132b47c340897c4622cc9fbd286cb Author: Roland Scheidegger <[email protected]> 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 <[email protected]> Date: Tue Mar 23 16:21:03 2010 +0100 softpipe: Map GS constants, too. commit 366f1176fb89d2b1978da6cfe60000b76bbc7338 Author: Roland Scheidegger <[email protected]> Date: Tue Mar 23 15:51:52 2010 +0100 failover: update for pipe_resources commit 615f44d70d293704ed821bc0b21fcfe6e363895d Author: Roland Scheidegger <[email protected]> Date: Tue Mar 23 15:51:02 2010 +0100 identity: remove double is_resource_reference assignment commit 7008586020395905ddfff333d02b3893de369796 Author: Roland Scheidegger <[email protected]> Date: Tue Mar 23 15:50:32 2010 +0100 trace: compile fix commit 058c5697bda4c9cf7b49d26ee27a34586544efaa Merge: dd7ba13 b33fd3c Author: Keith Whitwell <[email protected]> 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 <[email protected]> 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 <[email protected]> Date: Mon Mar 22 20:50:49 2010 +0100 scons: Update file lists after gallium-resources changes. commit af9793ab9e5386b150d6b25c0d1978fdc67172e4 Author: Michal Krol <[email protected]> Date: Mon Mar 22 20:04:39 2010 +0100 gallium: Do not use `template` for formal parameter names. commit dc2e12d714c444af9ff1acdd5a7e91408b116c99 Author: Keith Whitwell <[email protected]> Date: Sun Mar 21 22:41:34 2010 +0000 ws/nouveau: remove pipe_texture reference commit b94c72329f1be85887d40d49b0586979da469d77 Author: Keith Whitwell <[email protected]> Date: Sun Mar 21 22:40:41 2010 +0000 ws/xlib: remove pipe_buffer reference in comment commit 0a2af3eeae7de1d1cb433f0a2c35136b115f9920 Author: Keith Whitwell <[email protected]> Date: Sun Mar 21 22:39:34 2010 +0000 st/vega: clean up reference to pipe_texture commit 437ce98daae46be5d532fbb04c7cbf4a503c1623 Author: Keith Whitwell <[email protected]> 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 <[email protected]> Date: Sun Mar 21 22:29:34 2010 +0000 st/xorg: update for pipe_resources commit eb39977fe7a1d9f0c3f4f2d4303a93c2c613cc3b Author: Keith Whitwell <[email protected]> Date: Sun Mar 21 22:23:51 2010 +0000 st/dri: update for pipe_resources commit e447aeff597a4d8c0f5de25854c14c99f2cc138c Author: Keith Whitwell <[email protected]> Date: Sun Mar 21 22:23:36 2010 +0000 st/egl: update for pipe_resources commit e4cc48da8fdbd7d521257a6d7cd10e6fc5aa1a65 Author: Keith Whitwell <[email protected]> Date: Sun Mar 21 22:08:44 2010 +0000 r300: drop use of R300 DONT SYNC flag commit 129a83ab4d32e44ded5faea3f86ae5e1e62cddb6 Author: Keith Whitwell <[email protected]> Date: Sun Mar 21 22:08:17 2010 +0000 pipebuffer: use transfer flag commit 575b35ee6b683d77095ef21c573c1de207107e79 Merge: f29ac73 9fc6c8b Author: Keith Whitwell <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> Date: Sun Mar 21 17:25:10 2010 +0000 nv50: fix warning commit 9683f4423449fa5acf6c019c571223650473bd82 Author: Keith Whitwell <[email protected]> Date: Sun Mar 21 17:14:31 2010 +0000 util: restore u_simple_screen, nouveau still relies on it commit 961cbcb62232689c959965384c6aa9b8eca697c1 Author: Keith Whitwell <[email protected]> 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 <[email protected]> Date: Sun Mar 21 10:02:54 2010 +0000 r300: fix compilation after merge Also build r300 by default. commit eb9c0175c8e4baca3fcb0b8364f83ceba9d74e0d Author: Keith Whitwell <[email protected]> Date: Sun Mar 21 09:59:49 2010 +0000 st/vega: fix up after merge commit ea8dd1d4ae7b58c9315c3491046ef3852ddd3377 Author: Keith Whitwell <[email protected]> Date: Sun Mar 21 09:59:44 2010 +0000 aux: remove unused piperesource helpers commit be7af29d3ad1a10409b0ea689d882cf30a4e1d62 Merge: d22c2c6 12deb9e Author: Keith Whitwell <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> Date: Thu Mar 18 06:00:34 2010 +0000 gallium: update new merges to pipe_resource commit 1cad983eac77a0c5333e6a3ce92b90ac87407714 Author: Keith Whitwell <[email protected]> Date: Thu Mar 18 06:00:19 2010 +0000 drm/sw: update new merges to pipe_resource commit 191d39490ed792c569f98d42cf05891b264f71f8 Author: Keith Whitwell <[email protected]> Date: Thu Mar 18 06:00:01 2010 +0000 vg: update new merges to pipe_resource commit b727c59bc44812ad503d9390505c92b738a5b8b0 Author: Keith Whitwell <[email protected]> Date: Thu Mar 18 05:59:38 2010 +0000 llvmpipe: update new merges to pipe_resource commit 5f4b64b37fdcd70162c382b2ebbd494bef751dbd Author: Keith Whitwell <[email protected]> Date: Thu Mar 18 05:59:23 2010 +0000 brw: pipe_resource fixes commit d4aca209f531f1b65bf706ce1e5fc0375b587eb6 Author: Keith Whitwell <[email protected]> Date: Thu Mar 18 05:59:06 2010 +0000 util: update new merges to pipe_resource commit cf6bef0afee10763c78509a3d17e9a6e49bcd3c8 Merge: 1997231 6de8e56 Author: Keith Whitwell <[email protected]> Date: Thu Mar 18 05:38:50 2010 +0000 Merge commit 'origin/master' into gallium-resources commit 1997231916144485c3c4a36f53eda39fce460272 Merge: ad88ac7 e1ee3ea Author: Keith Whitwell <[email protected]> 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 <[email protected]> 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 <[email protected]> Date: Mon Mar 15 22:21:48 2010 +0000 util: missing file commit f83c91db8ae63a3c3a34ff21492427a5663fb760 Merge: c1d4774 42910eb Author: Keith Whitwell <[email protected]> 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 <[email protected]> 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 <[email protected]> Date: Sun Mar 14 23:05:45 2010 +0000 llvmpipe: don't FREE userbuffer data commit 9bfa07afe179f8060e7beefb754a29c4d9c6e349 Merge: 65757a1 08cddfe Author: Keith Whitwell <[email protected]> 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 <[email protected]> Date: Sun Mar 14 22:41:17 2010 +0000 svga: build fixes commit 2f5435220501d4b3050cab2bb1dce6174cd13ff6 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 22:39:25 2010 +0000 gallivm: build fix commit 42642ec0984107d82b740711f2debbf38457a06e Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 22:38:33 2010 +0000 llvmpipe: convert to pipe_resources commit 7bbcb21e20cb545ef8dd5fc61d67ed931c69e813 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 22:19:30 2010 +0000 gallivm: convert to pipe_resources commit 88ae0d04610ca52649b42e32141a52af6d5a739b Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 21:01:22 2010 +0000 configs: build svga commit 0e112bc69828e65085ebfaef895ecd78fe53f1c4 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 21:01:17 2010 +0000 gallium: restore PIPE_BUFFER_USAGE_CUSTOM commit 102aca688b95c976b7178b84092fba7d041ff9d2 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 21:00:41 2010 +0000 util: more transfer helpers commit a79f6a4a0836fc64c07f9aeec21d914474fe3649 Author: Keith Whitwell <[email protected]> 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 <[email protected]> Date: Sun Mar 14 18:38:08 2010 +0000 brw: fix function name commit cfc9dd707d16e06fd23b6926da3a6e2269f31dc8 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 18:19:06 2010 +0000 gallium: enable brw compile commit 8a5b86d76bdd3c7de63322423f59940a4dc2ee25 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 18:18:50 2010 +0000 brw: compiles with pipe_resource commit 563ca458b548c41ca4dca559354c16ca1a80d009 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 18:18:42 2010 +0000 i915: hook up userbuffer create commit b5095b48247b6020e36cc942ac145c3fccbe9a19 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 17:20:51 2010 +0000 i915: use helpers for is_resource_referenced commit d5392bdc6d70002acf9c5bac0fde14ba405c4d84 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 17:20:38 2010 +0000 util: helpers for is_resource_referenced commit 2f3492a5aefbb2e745f6700d8e910ebb5cbb98cf Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 17:08:50 2010 +0000 i915: remove buffer.c again commit 1373a35b65fcc25ec6cdfea2703bbb3417de2c6d Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 17:08:34 2010 +0000 i915: add new files to scons commit 0251612d70e57fe38e10e75915b394631d224f2c Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 16:38:29 2010 +0000 i915: compiling with pipe_resources commit 9a0235864252929a8eedd44dbd2fe30fe54c531d Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 13:51:16 2010 +0000 gallium: remove inline_read transfer commit a6ba315e25793e0c228d3a4ae2f8201634dc9ff0 Author: Keith Whitwell <[email protected]> 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 <[email protected]> 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 <[email protected]> Date: Sun Mar 14 12:30:37 2010 +0000 identity: hook up inline transfer operations commit e4c152a344f2f53c842b810724a2ae7cb4554f58 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 12:21:54 2010 +0000 gallium: build trace and identity commit 0b5a311db78852fa9fd021e17b5968a1e0436b49 Author: Keith Whitwell <[email protected]> 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 <[email protected]> Date: Sun Mar 14 12:19:46 2010 +0000 identity: compiles with pipe_resources commit d0d630944304c208f6dade6ef8836763ee2bc7b4 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 12:13:02 2010 +0000 trace: compiles with pipe_resources commit a4451ea459cc8bfc915fe6aed2891b90854b6c9d Author: Keith Whitwell <[email protected]> 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 <[email protected]> Date: Sun Mar 14 11:39:21 2010 +0000 util: correct argument order in pipe_buffer_map commit 7e2696c06445282feb781047277b260308760a33 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 11:32:55 2010 +0000 softpipe: transfer flush commit a0543b13c042e3c1142522d9d136f16fd4cabf78 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 11:32:13 2010 +0000 util: noop implementation of transfer_flush_region commit ce418533be752dbeb164e7ff82a99483048e482b Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 11:26:07 2010 +0000 gallium: softpipe runs gears with pipe_resources commit bfda4f2eb34498e4b7f3c608d30fccff6bb9651b Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 11:25:48 2010 +0000 util: get clip_tile working again commit f5ef219c3bed62b6a0da842e675fae16268e0fbe Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 09:43:20 2010 +0000 softpipe: use u_transfer helpers commit 072957aab25affecf0702e925310e46c694a5ee4 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 09:42:46 2010 +0000 util: helpers for inline transfers commit 9c45561fb0d7a52400093bcb2ce5f727fafd7777 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 09:42:25 2010 +0000 util: fix typo calculating transfer box commit f3e98fd47f36804d019a684d49ff230df3ab0cf5 Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 09:25:46 2010 +0000 st/vega: convert to pipe_resource commit d1b7b00afc944f6499c83d676c7642115d62a62c Author: Keith Whitwell <[email protected]> Date: Sun Mar 14 08:37:56 2010 +0000 gallium: begin converting drivers to pipe_resource Work in progress... commit 51c25117f5d6da1926a2be5ecc66677952a8abf0 Author: Keith Whitwell <[email protected]> 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 <[email protected]> Date: Sat Mar 13 19:19:09 2010 +0000 heaps of wip commit ee6b3bc730fcdaf8da3646d62f04578ec06d36a1 Author: Keith Whitwell <[email protected]> Date: Sat Mar 13 16:38:02 2010 +0000 wip2 commit 1830880212445189fe267d615075239ed17c7cc0 Merge: 90b4045 47bfbd4 Author: Keith Whitwell <[email protected]> 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 <[email protected]> Date: Sat Mar 13 14:52:43 2010 +0000 wip
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_constbuf.c10
-rw-r--r--src/mesa/state_tracker/st_atom_framebuffer.c25
-rw-r--r--src/mesa/state_tracker/st_atom_pixeltransfer.c16
-rw-r--r--src/mesa/state_tracker/st_cb_accum.c9
-rw-r--r--src/mesa/state_tracker/st_cb_bitmap.c53
-rw-r--r--src/mesa/state_tracker/st_cb_blit.c2
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.c100
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.h5
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c10
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c69
-rw-r--r--src/mesa/state_tracker/st_cb_eglimage.c8
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c39
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.h4
-rw-r--r--src/mesa/state_tracker/st_cb_readpixels.c30
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c74
-rw-r--r--src/mesa/state_tracker/st_context.c2
-rw-r--r--src/mesa/state_tracker/st_context.h8
-rw-r--r--src/mesa/state_tracker/st_draw.c31
-rw-r--r--src/mesa/state_tracker/st_draw_feedback.c37
-rw-r--r--src/mesa/state_tracker/st_extensions.c20
-rw-r--r--src/mesa/state_tracker/st_format.c14
-rw-r--r--src/mesa/state_tracker/st_framebuffer.c4
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c30
-rw-r--r--src/mesa/state_tracker/st_inlines.h83
-rw-r--r--src/mesa/state_tracker/st_manager.c18
-rw-r--r--src/mesa/state_tracker/st_public.h4
-rw-r--r--src/mesa/state_tracker/st_texture.c71
-rw-r--r--src/mesa/state_tracker/st_texture.h30
28 files changed, 426 insertions, 380 deletions
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c
index d975cd66f7d..5ac81bd4ee2 100644
--- a/src/mesa/state_tracker/st_atom_constbuf.c
+++ b/src/mesa/state_tracker/st_atom_constbuf.c
@@ -57,7 +57,7 @@ void st_upload_constants( struct st_context *st,
unsigned shader_type)
{
struct pipe_context *pipe = st->pipe;
- struct pipe_buffer **cbuf = &st->state.constants[shader_type];
+ struct pipe_resource **cbuf = &st->state.constants[shader_type];
assert(shader_type == PIPE_SHADER_VERTEX ||
shader_type == PIPE_SHADER_FRAGMENT);
@@ -71,10 +71,10 @@ void st_upload_constants( struct st_context *st,
/* We always need to get a new buffer, to keep the drivers simple and
* avoid gratuitous rendering synchronization.
*/
- pipe_buffer_reference(cbuf, NULL );
- *cbuf = pipe_buffer_create(pipe->screen, 16,
- PIPE_BUFFER_USAGE_CONSTANT,
- paramBytes );
+ pipe_resource_reference(cbuf, NULL );
+ *cbuf = pipe_buffer_create(pipe->screen,
+ PIPE_BIND_CONSTANT_BUFFER,
+ paramBytes );
if (ST_DEBUG & DEBUG_CONSTANTS) {
debug_printf("%s(shader=%d, numParams=%d, stateFlags=0x%x)\n",
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
index 79ad70909a9..d33ddc83f64 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -45,7 +45,7 @@
/**
* When doing GL render to texture, we have to be sure that finalize_texture()
- * didn't yank out the pipe_texture that we earlier created a surface for.
+ * didn't yank out the pipe_resource that we earlier created a surface for.
* Check for that here and create a new surface if needed.
*/
static void
@@ -53,29 +53,30 @@ update_renderbuffer_surface(struct st_context *st,
struct st_renderbuffer *strb)
{
struct pipe_screen *screen = st->pipe->screen;
- struct pipe_texture *texture = strb->rtt->pt;
+ struct pipe_resource *resource = strb->rtt->pt;
int rtt_width = strb->Base.Width;
int rtt_height = strb->Base.Height;
if (!strb->surface ||
- strb->surface->texture != texture ||
+ strb->surface->texture != resource ||
strb->surface->width != rtt_width ||
strb->surface->height != rtt_height) {
GLuint level;
/* find matching mipmap level size */
- for (level = 0; level <= texture->last_level; level++) {
- if (u_minify(texture->width0, level) == rtt_width &&
- u_minify(texture->height0, level) == rtt_height) {
+ for (level = 0; level <= resource->last_level; level++) {
+ if (u_minify(resource->width0, level) == rtt_width &&
+ u_minify(resource->height0, level) == rtt_height) {
pipe_surface_reference(&strb->surface, NULL);
strb->surface = screen->get_tex_surface(screen,
- texture,
- strb->rtt_face,
- level,
- strb->rtt_slice,
- PIPE_BUFFER_USAGE_GPU_READ |
- PIPE_BUFFER_USAGE_GPU_WRITE);
+ resource,
+ strb->rtt_face,
+ level,
+ strb->rtt_slice,
+ PIPE_BIND_RENDER_TARGET |
+ PIPE_BIND_BLIT_SOURCE |
+ PIPE_BIND_BLIT_DESTINATION );
#if 0
printf("-- alloc new surface %d x %d into tex %p\n",
strb->surface->width, strb->surface->height,
diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c
index 03e33361448..4aac5bd97fe 100644
--- a/src/mesa/state_tracker/st_atom_pixeltransfer.c
+++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c
@@ -112,21 +112,21 @@ make_state_key(GLcontext *ctx, struct state_key *key)
}
-static struct pipe_texture *
+static struct pipe_resource *
create_color_map_texture(GLcontext *ctx)
{
struct pipe_context *pipe = ctx->st->pipe;
- struct pipe_texture *pt;
+ struct pipe_resource *pt;
enum pipe_format format;
const uint texSize = 256; /* simple, and usually perfect */
/* find an RGBA texture format */
format = st_choose_format(pipe->screen, GL_RGBA,
- PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER);
+ PIPE_TEXTURE_2D, PIPE_BIND_SAMPLER_VIEW);
/* create texture for color map/table */
pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format, 0,
- texSize, texSize, 1, PIPE_TEXTURE_USAGE_SAMPLER);
+ texSize, texSize, 1, PIPE_BIND_SAMPLER_VIEW);
return pt;
}
@@ -135,7 +135,7 @@ create_color_map_texture(GLcontext *ctx)
* Update the pixelmap texture with the contents of the R/G/B/A pixel maps.
*/
static void
-load_color_map_texture(GLcontext *ctx, struct pipe_texture *pt)
+load_color_map_texture(GLcontext *ctx, struct pipe_resource *pt)
{
struct pipe_context *pipe = ctx->st->pipe;
struct pipe_transfer *transfer;
@@ -150,7 +150,7 @@ load_color_map_texture(GLcontext *ctx, struct pipe_texture *pt)
transfer = st_cond_flush_get_tex_transfer(st_context(ctx),
pt, 0, 0, 0, PIPE_TRANSFER_WRITE,
0, 0, texSize, texSize);
- dest = (uint *) pipe->transfer_map(pipe, transfer);
+ dest = (uint *) pipe_transfer_map(pipe, transfer);
/* Pack four 1D maps into a 2D texture:
* R map is placed horizontally, indexed by S, in channel 0
@@ -171,8 +171,8 @@ load_color_map_texture(GLcontext *ctx, struct pipe_texture *pt)
}
}
- pipe->transfer_unmap(pipe, transfer);
- pipe->tex_transfer_destroy(pipe, transfer);
+ pipe_transfer_unmap(pipe, transfer);
+ pipe->transfer_destroy(pipe, transfer);
}
diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c
index 01aba3e3dd4..a693141921f 100644
--- a/src/mesa/state_tracker/st_cb_accum.c
+++ b/src/mesa/state_tracker/st_cb_accum.c
@@ -137,7 +137,8 @@ accum_accum(struct st_context *st, GLfloat value,
if (ST_DEBUG & DEBUG_FALLBACK)
debug_printf("%s: fallback processing\n", __FUNCTION__);
- color_trans = st_cond_flush_get_tex_transfer(st, color_strb->texture,
+ color_trans = st_cond_flush_get_tex_transfer(st,
+ color_strb->texture,
0, 0, 0,
PIPE_TRANSFER_READ, xpos, ypos,
width, height);
@@ -165,7 +166,7 @@ accum_accum(struct st_context *st, GLfloat value,
}
free(buf);
- pipe->tex_transfer_destroy(pipe, color_trans);
+ pipe->transfer_destroy(pipe, color_trans);
}
@@ -213,7 +214,7 @@ accum_load(struct st_context *st, GLfloat value,
}
free(buf);
- pipe->tex_transfer_destroy(pipe, color_trans);
+ pipe->transfer_destroy(pipe, color_trans);
}
@@ -280,7 +281,7 @@ accum_return(GLcontext *ctx, GLfloat value,
pipe_put_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
free(buf);
- pipe->tex_transfer_destroy(pipe, color_trans);
+ pipe->transfer_destroy(pipe, color_trans);
}
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index 9a0446bb710..074fc277110 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -92,7 +92,7 @@ struct bitmap_cache
/** Bitmap's Z position */
GLfloat zpos;
- struct pipe_texture *texture;
+ struct pipe_resource *texture;
struct pipe_transfer *trans;
GLboolean empty;
@@ -253,7 +253,7 @@ unpack_bitmap(struct st_context *st,
/**
* Create a texture which represents a bitmap image.
*/
-static struct pipe_texture *
+static struct pipe_resource *
make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
const struct gl_pixelstore_attrib *unpack,
const GLubyte *bitmap)
@@ -261,7 +261,7 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
struct pipe_context *pipe = ctx->st->pipe;
struct pipe_transfer *transfer;
ubyte *dest;
- struct pipe_texture *pt;
+ struct pipe_resource *pt;
/* PBO source... */
bitmap = _mesa_map_pbo_source(ctx, unpack, bitmap);
@@ -274,7 +274,7 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
*/
pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, ctx->st->bitmap.tex_format,
0, width, height, 1,
- PIPE_TEXTURE_USAGE_SAMPLER);
+ PIPE_BIND_SAMPLER_VIEW);
if (!pt) {
_mesa_unmap_pbo_source(ctx, unpack);
return NULL;
@@ -284,7 +284,7 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
PIPE_TRANSFER_WRITE,
0, 0, width, height);
- dest = pipe->transfer_map(pipe, transfer);
+ dest = pipe_transfer_map(pipe, transfer);
/* Put image into texture transfer */
memset(dest, 0xff, height * transfer->stride);
@@ -294,8 +294,8 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
_mesa_unmap_pbo_source(ctx, unpack);
/* Release transfer */
- pipe->transfer_unmap(pipe, transfer);
- pipe->tex_transfer_destroy(pipe, transfer);
+ pipe_transfer_unmap(pipe, transfer);
+ pipe->transfer_destroy(pipe, transfer);
return pt;
}
@@ -334,13 +334,13 @@ setup_bitmap_vertex_data(struct st_context *st,
GLuint i;
if (st->bitmap.vbuf_slot >= max_slots) {
- pipe_buffer_reference(&st->bitmap.vbuf, NULL);
+ pipe_resource_reference(&st->bitmap.vbuf, NULL);
st->bitmap.vbuf_slot = 0;
}
if (!st->bitmap.vbuf) {
- st->bitmap.vbuf = pipe_buffer_create(pipe->screen, 32,
- PIPE_BUFFER_USAGE_VERTEX,
+ st->bitmap.vbuf = pipe_buffer_create(pipe->screen,
+ PIPE_BIND_VERTEX_BUFFER,
max_slots * sizeof(st->bitmap.vertices));
}
@@ -530,7 +530,7 @@ reset_cache(struct st_context *st)
cache->ymax = -1000000;
if (cache->trans) {
- pipe->tex_transfer_destroy(pipe, cache->trans);
+ pipe->transfer_destroy(pipe, cache->trans);
cache->trans = NULL;
}
@@ -540,7 +540,8 @@ reset_cache(struct st_context *st)
cache->texture = st_texture_create(st, PIPE_TEXTURE_2D,
st->bitmap.tex_format, 0,
BITMAP_CACHE_WIDTH, BITMAP_CACHE_HEIGHT,
- 1, PIPE_TEXTURE_USAGE_SAMPLER);
+ 1,
+ PIPE_BIND_SAMPLER_VIEW);
}
@@ -580,7 +581,7 @@ create_cache_trans(struct st_context *st)
PIPE_TRANSFER_WRITE, 0, 0,
BITMAP_CACHE_WIDTH,
BITMAP_CACHE_HEIGHT);
- cache->buffer = pipe->transfer_map(pipe, cache->trans);
+ cache->buffer = pipe_transfer_map(pipe, cache->trans);
/* init image to all 0xff */
memset(cache->buffer, 0xff, cache->trans->stride * BITMAP_CACHE_HEIGHT);
@@ -614,10 +615,10 @@ st_flush_bitmap_cache(struct st_context *st)
if (cache->trans) {
if (0)
print_cache(cache);
- pipe->transfer_unmap(pipe, cache->trans);
+ pipe_transfer_unmap(pipe, cache->trans);
cache->buffer = NULL;
- pipe->tex_transfer_destroy(pipe, cache->trans);
+ pipe->transfer_destroy(pipe, cache->trans);
cache->trans = NULL;
}
@@ -636,7 +637,7 @@ st_flush_bitmap_cache(struct st_context *st)
}
/* release/free the texture */
- pipe_texture_reference(&cache->texture, NULL);
+ pipe_resource_reference(&cache->texture, NULL);
reset_cache(st);
}
@@ -652,7 +653,7 @@ st_flush_bitmap( struct st_context *st )
/* Release vertex buffer to avoid synchronous rendering if we were
* to map it in the next frame.
*/
- pipe_buffer_reference(&st->bitmap.vbuf, NULL);
+ pipe_resource_reference(&st->bitmap.vbuf, NULL);
st->bitmap.vbuf_slot = 0;
}
@@ -732,7 +733,7 @@ st_Bitmap(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap )
{
struct st_context *st = ctx->st;
- struct pipe_texture *pt;
+ struct pipe_resource *pt;
if (width == 0 || height == 0)
return;
@@ -768,7 +769,7 @@ st_Bitmap(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
}
/* release/free the texture */
- pipe_texture_reference(&pt, NULL);
+ pipe_resource_reference(&pt, NULL);
}
}
@@ -805,15 +806,15 @@ st_init_bitmap(struct st_context *st)
/* find a usable texture format */
if (screen->is_format_supported(screen, PIPE_FORMAT_I8_UNORM, PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+ PIPE_BIND_SAMPLER_VIEW, 0)) {
st->bitmap.tex_format = PIPE_FORMAT_I8_UNORM;
}
else if (screen->is_format_supported(screen, PIPE_FORMAT_A8_UNORM, PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+ PIPE_BIND_SAMPLER_VIEW, 0)) {
st->bitmap.tex_format = PIPE_FORMAT_A8_UNORM;
}
else if (screen->is_format_supported(screen, PIPE_FORMAT_L8_UNORM, PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+ PIPE_BIND_SAMPLER_VIEW, 0)) {
st->bitmap.tex_format = PIPE_FORMAT_L8_UNORM;
}
else {
@@ -843,16 +844,16 @@ st_destroy_bitmap(struct st_context *st)
}
if (st->bitmap.vbuf) {
- pipe_buffer_reference(&st->bitmap.vbuf, NULL);
+ pipe_resource_reference(&st->bitmap.vbuf, NULL);
st->bitmap.vbuf = NULL;
}
if (cache) {
if (cache->trans) {
- pipe->transfer_unmap(pipe, cache->trans);
- pipe->tex_transfer_destroy(pipe, cache->trans);
+ pipe_transfer_unmap(pipe, cache->trans);
+ pipe->transfer_destroy(pipe, cache->trans);
}
- pipe_texture_reference(&st->bitmap.cache->texture, NULL);
+ pipe_resource_reference(&st->bitmap.cache->texture, NULL);
free(st->bitmap.cache);
st->bitmap.cache = NULL;
}
diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c
index 06b0a18fd22..0498080ccfc 100644
--- a/src/mesa/state_tracker/st_cb_blit.c
+++ b/src/mesa/state_tracker/st_cb_blit.c
@@ -128,7 +128,7 @@ st_BlitFramebuffer(GLcontext *ctx,
srcAtt->CubeMapFace,
srcAtt->TextureLevel,
srcAtt->Zoffset,
- PIPE_BUFFER_USAGE_GPU_READ);
+ PIPE_BIND_BLIT_SOURCE);
if(!srcSurf)
return;
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index b55a085cc7c..f24145844b9 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -76,9 +76,10 @@ st_bufferobj_free(GLcontext *ctx, struct gl_buffer_object *obj)
struct st_buffer_object *st_obj = st_buffer_object(obj);
assert(obj->RefCount == 0);
+ assert(st_obj->transfer == NULL);
if (st_obj->buffer)
- pipe_buffer_reference(&st_obj->buffer, NULL);
+ pipe_resource_reference(&st_obj->buffer, NULL);
free(st_obj);
}
@@ -116,8 +117,15 @@ st_bufferobj_subdata(GLcontext *ctx,
if (!data)
return;
- st_cond_flush_pipe_buffer_write(st_context(ctx), st_obj->buffer,
- offset, size, data);
+ /* Now that transfers are per-context, we don't have to figure out
+ * flushing here. Usually drivers won't need to flush in this case
+ * even if the buffer is currently referenced by hardware - they
+ * just queue the upload as dma rather than mapping the underlying
+ * buffer directly.
+ */
+ pipe_buffer_write(st_context(ctx)->pipe,
+ st_obj->buffer,
+ offset, size, data);
}
@@ -141,8 +149,8 @@ st_bufferobj_get_subdata(GLcontext *ctx,
if (!size)
return;
- st_cond_flush_pipe_buffer_read(st_context(ctx), st_obj->buffer,
- offset, size, data);
+ pipe_buffer_read(st_context(ctx)->pipe, st_obj->buffer,
+ offset, size, data);
}
@@ -172,22 +180,24 @@ st_bufferobj_data(GLcontext *ctx,
switch(target) {
case GL_PIXEL_PACK_BUFFER_ARB:
case GL_PIXEL_UNPACK_BUFFER_ARB:
- buffer_usage = PIPE_BUFFER_USAGE_PIXEL;
+ buffer_usage = (PIPE_BIND_RENDER_TARGET |
+ PIPE_BIND_BLIT_SOURCE |
+ PIPE_BIND_BLIT_DESTINATION);
break;
case GL_ARRAY_BUFFER_ARB:
- buffer_usage = PIPE_BUFFER_USAGE_VERTEX;
+ buffer_usage = PIPE_BIND_VERTEX_BUFFER;
break;
case GL_ELEMENT_ARRAY_BUFFER_ARB:
- buffer_usage = PIPE_BUFFER_USAGE_INDEX;
+ buffer_usage = PIPE_BIND_INDEX_BUFFER;
break;
default:
buffer_usage = 0;
}
- pipe_buffer_reference( &st_obj->buffer, NULL );
+ pipe_resource_reference( &st_obj->buffer, NULL );
if (size != 0) {
- st_obj->buffer = pipe_buffer_create(pipe->screen, 32, buffer_usage, size);
+ st_obj->buffer = pipe_buffer_create(pipe->screen, buffer_usage, size);
if (!st_obj->buffer) {
return GL_FALSE;
@@ -215,21 +225,22 @@ st_bufferobj_map(GLcontext *ctx, GLenum target, GLenum access,
switch (access) {
case GL_WRITE_ONLY:
- flags = PIPE_BUFFER_USAGE_CPU_WRITE;
+ flags = PIPE_TRANSFER_WRITE;
break;
case GL_READ_ONLY:
- flags = PIPE_BUFFER_USAGE_CPU_READ;
+ flags = PIPE_TRANSFER_READ;
break;
case GL_READ_WRITE:
- /* fall-through */
default:
- flags = PIPE_BUFFER_USAGE_CPU_READ | PIPE_BUFFER_USAGE_CPU_WRITE;
+ flags = PIPE_TRANSFER_READ_WRITE;
break;
}
- obj->Pointer = st_cond_flush_pipe_buffer_map(st_context(ctx),
- st_obj->buffer,
- flags);
+ obj->Pointer = pipe_buffer_map(st_context(ctx)->pipe,
+ st_obj->buffer,
+ flags,
+ &st_obj->transfer);
+
if (obj->Pointer) {
obj->Offset = 0;
obj->Length = obj->Size;
@@ -255,25 +266,25 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target,
{
struct pipe_context *pipe = st_context(ctx)->pipe;
struct st_buffer_object *st_obj = st_buffer_object(obj);
- uint flags = 0x0;
+ enum pipe_transfer_usage flags = 0x0;
if (access & GL_MAP_WRITE_BIT)
- flags |= PIPE_BUFFER_USAGE_CPU_WRITE;
+ flags |= PIPE_TRANSFER_WRITE;
if (access & GL_MAP_READ_BIT)
- flags |= PIPE_BUFFER_USAGE_CPU_READ;
+ flags |= PIPE_TRANSFER_READ;
if (access & GL_MAP_FLUSH_EXPLICIT_BIT)
- flags |= PIPE_BUFFER_USAGE_FLUSH_EXPLICIT;
+ flags |= PIPE_TRANSFER_FLUSH_EXPLICIT;
if (access & GL_MAP_UNSYNCHRONIZED_BIT)
- flags |= PIPE_BUFFER_USAGE_UNSYNCHRONIZED;
+ flags |= PIPE_TRANSFER_UNSYNCHRONIZED;
/* ... other flags ...
*/
if (access & MESA_MAP_NOWAIT_BIT)
- flags |= PIPE_BUFFER_USAGE_DONTBLOCK;
+ flags |= PIPE_TRANSFER_DONTBLOCK;
assert(offset >= 0);
assert(length >= 0);
@@ -288,7 +299,11 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target,
obj->Pointer = &st_bufferobj_zero_length_range;
}
else {
- obj->Pointer = pipe_buffer_map_range(pipe->screen, st_obj->buffer, offset, length, flags);
+ obj->Pointer = pipe_buffer_map_range(pipe,
+ st_obj->buffer,
+ offset, length,
+ flags,
+ &st_obj->transfer);
if (obj->Pointer) {
obj->Pointer = (ubyte *) obj->Pointer + offset;
}
@@ -316,11 +331,12 @@ st_bufferobj_flush_mapped_range(GLcontext *ctx, GLenum target,
assert(offset >= 0);
assert(length >= 0);
assert(offset + length <= obj->Length);
+ assert(obj->Pointer);
if (!length)
return;
- pipe_buffer_flush_mapped_range(pipe->screen, st_obj->buffer,
+ pipe_buffer_flush_mapped_range(pipe, st_obj->transfer,
obj->Offset + offset, length);
}
@@ -334,9 +350,10 @@ st_bufferobj_unmap(GLcontext *ctx, GLenum target, struct gl_buffer_object *obj)
struct pipe_context *pipe = st_context(ctx)->pipe;
struct st_buffer_object *st_obj = st_buffer_object(obj);
- if(obj->Length)
- pipe_buffer_unmap(pipe->screen, st_obj->buffer);
+ if (obj->Length)
+ pipe_buffer_unmap(pipe, st_obj->buffer, st_obj->transfer);
+ st_obj->transfer = NULL;
obj->Pointer = NULL;
obj->Offset = 0;
obj->Length = 0;
@@ -357,6 +374,8 @@ st_copy_buffer_subdata(GLcontext *ctx,
struct pipe_context *pipe = st_context(ctx)->pipe;
struct st_buffer_object *srcObj = st_buffer_object(src);
struct st_buffer_object *dstObj = st_buffer_object(dst);
+ struct pipe_transfer *src_transfer;
+ struct pipe_transfer *dst_transfer;
ubyte *srcPtr, *dstPtr;
if(!size)
@@ -366,21 +385,36 @@ st_copy_buffer_subdata(GLcontext *ctx,
assert(!src->Pointer);
assert(!dst->Pointer);
- srcPtr = (ubyte *) pipe_buffer_map_range(pipe->screen,
+ srcPtr = (ubyte *) pipe_buffer_map_range(pipe,
srcObj->buffer,
readOffset, size,
- PIPE_BUFFER_USAGE_CPU_READ);
+ PIPE_TRANSFER_READ,
+ &src_transfer);
- dstPtr = (ubyte *) pipe_buffer_map_range(pipe->screen,
+ dstPtr = (ubyte *) pipe_buffer_map_range(pipe,
dstObj->buffer,
writeOffset, size,
- PIPE_BUFFER_USAGE_CPU_WRITE);
+ PIPE_TRANSFER_WRITE,
+ &dst_transfer);
if (srcPtr && dstPtr)
memcpy(dstPtr + writeOffset, srcPtr + readOffset, size);
- pipe_buffer_unmap(pipe->screen, srcObj->buffer);
- pipe_buffer_unmap(pipe->screen, dstObj->buffer);
+ pipe_buffer_unmap(pipe, srcObj->buffer, src_transfer);
+ pipe_buffer_unmap(pipe, dstObj->buffer, dst_transfer);
+}
+
+
+/* TODO: if buffer wasn't created with appropriate usage flags, need
+ * to recreate it now and copy contents -- or possibly create a
+ * gallium entrypoint to extend the usage flags and let the driver
+ * decide if a copy is necessary.
+ */
+void
+st_bufferobj_validate_usage(struct st_context *st,
+ struct st_buffer_object *obj,
+ unsigned usage)
+{
}
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.h b/src/mesa/state_tracker/st_cb_bufferobjects.h
index fda6d05dd34..955673ceb66 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.h
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.h
@@ -30,7 +30,7 @@
struct st_context;
struct gl_buffer_object;
-struct pipe_buffer;
+struct pipe_resource;
/**
* State_tracker vertex/pixel buffer object, derived from Mesa's
@@ -39,7 +39,8 @@ struct pipe_buffer;
struct st_buffer_object
{
struct gl_buffer_object Base;
- struct pipe_buffer *buffer;
+ struct pipe_resource *buffer; /* GPU storage */
+ struct pipe_transfer *transfer; /* In-progress map information */
};
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 6007c767182..eb9ba0557d3 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -99,7 +99,7 @@ st_destroy_clear(struct st_context *st)
st->clear.vs = NULL;
}
if (st->clear.vbuf) {
- pipe_buffer_reference(&st->clear.vbuf, NULL);
+ pipe_resource_reference(&st->clear.vbuf, NULL);
st->clear.vbuf = NULL;
}
}
@@ -131,13 +131,13 @@ draw_quad(GLcontext *ctx,
GLuint i;
if (st->clear.vbuf_slot >= max_slots) {
- pipe_buffer_reference(&st->clear.vbuf, NULL);
+ pipe_resource_reference(&st->clear.vbuf, NULL);
st->clear.vbuf_slot = 0;
}
if (!st->clear.vbuf) {
- st->clear.vbuf = pipe_buffer_create(pipe->screen, 32,
- PIPE_BUFFER_USAGE_VERTEX,
+ st->clear.vbuf = pipe_buffer_create(pipe->screen,
+ PIPE_BIND_VERTEX_BUFFER,
max_slots * sizeof(st->clear.vertices));
}
@@ -435,7 +435,7 @@ st_flush_clear(struct st_context *st)
/* Release vertex buffer to avoid synchronous rendering if we were
* to map it in the next frame.
*/
- pipe_buffer_reference(&st->clear.vbuf, NULL);
+ pipe_resource_reference(&st->clear.vbuf, NULL);
st->clear.vbuf_slot = 0;
}
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 93b95a534c7..955e371398d 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -296,13 +296,13 @@ base_format(GLenum format)
* If width, height are not POT and the driver only handles POT textures,
* allocate the next larger size of texture that is POT.
*/
-static struct pipe_texture *
+static struct pipe_resource *
alloc_texture(struct st_context *st, GLsizei width, GLsizei height,
enum pipe_format texFormat)
{
struct pipe_context *pipe = st->pipe;
struct pipe_screen *screen = pipe->screen;
- struct pipe_texture *pt;
+ struct pipe_resource *pt;
int ptw, pth;
ptw = width;
@@ -330,7 +330,7 @@ alloc_texture(struct st_context *st, GLsizei width, GLsizei height,
}
pt = st_texture_create(st, PIPE_TEXTURE_2D, texFormat, 0,
- ptw, pth, 1, PIPE_TEXTURE_USAGE_SAMPLER);
+ ptw, pth, 1, PIPE_BIND_SAMPLER_VIEW);
return pt;
}
@@ -340,7 +340,7 @@ alloc_texture(struct st_context *st, GLsizei width, GLsizei height,
* Make texture containing an image for glDrawPixels image.
* If 'pixels' is NULL, leave the texture image data undefined.
*/
-static struct pipe_texture *
+static struct pipe_resource *
make_texture(struct st_context *st,
GLsizei width, GLsizei height, GLenum format, GLenum type,
const struct gl_pixelstore_attrib *unpack,
@@ -349,7 +349,7 @@ make_texture(struct st_context *st,
GLcontext *ctx = st->ctx;
struct pipe_context *pipe = st->pipe;
gl_format mformat;
- struct pipe_texture *pt;
+ struct pipe_resource *pt;
enum pipe_format pipeFormat;
GLuint cpp;
GLenum baseFormat;
@@ -389,7 +389,7 @@ make_texture(struct st_context *st,
width, height);
/* map texture transfer */
- dest = pipe->transfer_map(pipe, transfer);
+ dest = pipe_transfer_map(pipe, transfer);
/* Put image into texture transfer.
@@ -409,8 +409,8 @@ make_texture(struct st_context *st,
unpack);
/* unmap */
- pipe->transfer_unmap(pipe, transfer);
- pipe->tex_transfer_destroy(pipe, transfer);
+ pipe_transfer_unmap(pipe, transfer);
+ pipe->transfer_destroy(pipe, transfer);
assert(success);
@@ -502,10 +502,11 @@ draw_quad(GLcontext *ctx, GLfloat x0, GLfloat y0, GLfloat z,
}
{
- struct pipe_buffer *buf;
+ struct pipe_resource *buf;
/* allocate/load buffer object with vertex data */
- buf = pipe_buffer_create(pipe->screen, 32, PIPE_BUFFER_USAGE_VERTEX,
+ buf = pipe_buffer_create(pipe->screen,
+ PIPE_BIND_VERTEX_BUFFER,
sizeof(verts));
st_no_flush_pipe_buffer_write(st, buf, 0, sizeof(verts), verts);
@@ -513,7 +514,7 @@ draw_quad(GLcontext *ctx, GLfloat x0, GLfloat y0, GLfloat z,
PIPE_PRIM_QUADS,
4, /* verts */
3); /* attribs/vert */
- pipe_buffer_reference(&buf, NULL);
+ pipe_resource_reference(&buf, NULL);
}
}
@@ -688,7 +689,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
usage, x, y,
width, height);
- stmap = pipe->transfer_map(pipe, pt);
+ stmap = pipe_transfer_map(pipe, pt);
pixels = _mesa_map_pbo_source(ctx, &clippedUnpack, pixels);
assert(pixels);
@@ -733,7 +734,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
}
/* now pack the stencil (and Z) values in the dest format */
- switch (pt->texture->format) {
+ switch (pt->resource->format) {
case PIPE_FORMAT_S8_USCALED:
{
ubyte *dest = stmap + spanY * pt->stride + spanX;
@@ -788,8 +789,8 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
_mesa_unmap_pbo_source(ctx, &clippedUnpack);
/* unmap the stencil buffer */
- pipe->transfer_unmap(pipe, pt);
- pipe->tex_transfer_destroy(pipe, pt);
+ pipe_transfer_unmap(pipe, pt);
+ pipe->transfer_destroy(pipe, pt);
}
@@ -830,7 +831,7 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
/* draw with textured quad */
{
- struct pipe_texture *pt
+ struct pipe_resource *pt
= make_texture(st, width, height, format, type, unpack, pixels);
if (pt) {
struct pipe_sampler_view *sv = st_sampler_view_from_texture(st->pipe, pt);
@@ -844,7 +845,7 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
color, GL_FALSE);
pipe_sampler_view_reference(&sv, NULL);
}
- pipe_texture_reference(&pt, NULL);
+ pipe_resource_reference(&pt, NULL);
}
}
}
@@ -889,11 +890,11 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
usage, dstx, dsty,
width, height);
- assert(util_format_get_blockwidth(ptDraw->texture->format) == 1);
- assert(util_format_get_blockheight(ptDraw->texture->format) == 1);
+ assert(util_format_get_blockwidth(ptDraw->resource->format) == 1);
+ assert(util_format_get_blockheight(ptDraw->resource->format) == 1);
/* map the stencil buffer */
- drawMap = pipe->transfer_map(pipe, ptDraw);
+ drawMap = pipe_transfer_map(pipe, ptDraw);
/* draw */
/* XXX PixelZoom not handled yet */
@@ -911,7 +912,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
dst = drawMap + y * ptDraw->stride;
src = buffer + i * width;
- switch (ptDraw->texture->format) {
+ switch (ptDraw->resource->format) {
case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
{
uint *dst4 = (uint *) dst;
@@ -946,8 +947,8 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
free(buffer);
/* unmap the stencil buffer */
- pipe->transfer_unmap(pipe, ptDraw);
- pipe->tex_transfer_destroy(pipe, ptDraw);
+ pipe_transfer_unmap(pipe, ptDraw);
+ pipe->transfer_destroy(pipe, ptDraw);
}
@@ -961,7 +962,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
struct pipe_screen *screen = pipe->screen;
struct st_renderbuffer *rbRead;
void *driver_vp, *driver_fp;
- struct pipe_texture *pt;
+ struct pipe_resource *pt;
struct pipe_sampler_view *sv;
GLfloat *color;
enum pipe_format srcFormat, texFormat;
@@ -996,7 +997,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
srcFormat = rbRead->texture->format;
if (screen->is_format_supported(screen, srcFormat, PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+ PIPE_BIND_SAMPLER_VIEW, 0)) {
texFormat = srcFormat;
}
else {
@@ -1004,13 +1005,13 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
if (type == GL_DEPTH) {
texFormat = st_choose_format(screen, GL_DEPTH_COMPONENT,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_DEPTH_STENCIL);
+ PIPE_BIND_DEPTH_STENCIL);
assert(texFormat != PIPE_FORMAT_NONE);
}
else {
/* default color format */
texFormat = st_choose_format(screen, GL_RGBA, PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER);
+ PIPE_BIND_SAMPLER_VIEW);
assert(texFormat != PIPE_FORMAT_NONE);
}
}
@@ -1042,7 +1043,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
sv = st_sampler_view_from_texture(st->pipe, pt);
if (!sv) {
- pipe_texture_reference(&pt, NULL);
+ pipe_resource_reference(&pt, NULL);
return;
}
@@ -1052,10 +1053,10 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
/* copy source framebuffer surface into mipmap/texture */
struct pipe_surface *psRead = screen->get_tex_surface(screen,
rbRead->texture, 0, 0, 0,
- PIPE_BUFFER_USAGE_GPU_READ);
+ PIPE_BIND_BLIT_SOURCE);
struct pipe_surface *psTex = screen->get_tex_surface(screen, pt, 0, 0, 0,
- PIPE_BUFFER_USAGE_GPU_WRITE );
-
+ PIPE_BIND_RENDER_TARGET |
+ PIPE_BIND_BLIT_DESTINATION);
pipe->surface_copy(pipe,
psTex, /* dest surf */
pack.SkipPixels, pack.SkipRows, /* dest pos */
@@ -1109,8 +1110,8 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
free(buf);
}
- pipe->tex_transfer_destroy(pipe, ptRead);
- pipe->tex_transfer_destroy(pipe, ptTex);
+ pipe->transfer_destroy(pipe, ptRead);
+ pipe->transfer_destroy(pipe, ptTex);
}
/* OK, the texture 'pt' contains the src image/pixels. Now draw a
@@ -1123,7 +1124,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
driver_fp,
color, invertTex);
- pipe_texture_reference(&pt, NULL);
+ pipe_resource_reference(&pt, NULL);
pipe_sampler_view_reference(&sv, NULL);
}
diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c
index 934b70dc1a6..3c4fe32090b 100644
--- a/src/mesa/state_tracker/st_cb_eglimage.c
+++ b/src/mesa/state_tracker/st_cb_eglimage.c
@@ -79,7 +79,7 @@ st_egl_image_target_renderbuffer_storage(GLcontext *ctx,
struct pipe_surface *ps;
unsigned usage;
- usage = PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE;
+ usage = PIPE_BIND_RENDER_TARGET | PIPE_BIND_BLIT_SOURCE | PIPE_BIND_BLIT_DESTINATION;
ps = st_manager_get_egl_image_surface(st, (void *) image_handle, usage);
if (ps) {
strb->Base.Width = ps->width;
@@ -90,7 +90,7 @@ st_egl_image_target_renderbuffer_storage(GLcontext *ctx,
strb->Base.InternalFormat = strb->Base._BaseFormat;
pipe_surface_reference(&strb->surface, ps);
- pipe_texture_reference(&strb->texture, ps->texture);
+ pipe_resource_reference(&strb->texture, ps->texture);
pipe_surface_reference(&ps, NULL);
}
@@ -128,7 +128,7 @@ st_bind_surface(GLcontext *ctx, GLenum target,
stObj->pipe = ctx->st->pipe;
/* FIXME create a non-default sampler view from the pipe_surface? */
- pipe_texture_reference(&stImage->pt, ps->texture);
+ pipe_resource_reference(&stImage->pt, ps->texture);
_mesa_dirty_texobj(ctx, texObj, GL_TRUE);
}
@@ -143,7 +143,7 @@ st_egl_image_target_texture_2d(GLcontext *ctx, GLenum target,
struct pipe_surface *ps;
unsigned usage;
- usage = PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE;
+ usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_BLIT_DESTINATION | PIPE_BIND_BLIT_SOURCE;
ps = st_manager_get_egl_image_surface(st, (void *) image_handle, usage);
if (ps) {
st_bind_surface(ctx, target, texObj, texImage, ps);
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 542ab38a50e..d50970f7e4b 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -96,13 +96,12 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
return strb->data != NULL;
}
else {
- struct pipe_texture template;
- unsigned surface_usage;
+ struct pipe_resource template;
/* Free the old surface and texture
*/
pipe_surface_reference( &strb->surface, NULL );
- pipe_texture_reference( &strb->texture, NULL );
+ pipe_resource_reference( &strb->texture, NULL );
pipe_sampler_view_reference(&strb->sampler_view, NULL);
/* Setup new texture template.
@@ -116,23 +115,14 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
template.last_level = 0;
template.nr_samples = rb->NumSamples;
if (util_format_is_depth_or_stencil(format)) {
- template.tex_usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL;
+ template.bind = PIPE_BIND_DEPTH_STENCIL;
}
else {
- template.tex_usage = (PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
- PIPE_TEXTURE_USAGE_RENDER_TARGET);
+ template.bind = (PIPE_BIND_DISPLAY_TARGET |
+ PIPE_BIND_RENDER_TARGET);
}
- /* Probably need dedicated flags for surface usage too:
- */
- surface_usage = (PIPE_BUFFER_USAGE_GPU_READ |
- PIPE_BUFFER_USAGE_GPU_WRITE);
-#if 0
- PIPE_BUFFER_USAGE_CPU_READ |
- PIPE_BUFFER_USAGE_CPU_WRITE);
-#endif
-
- strb->texture = screen->texture_create(screen, &template);
+ strb->texture = screen->resource_create(screen, &template);
if (!strb->texture)
return FALSE;
@@ -140,7 +130,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
strb->surface = screen->get_tex_surface(screen,
strb->texture,
0, 0, 0,
- surface_usage);
+ template.bind);
if (strb->surface) {
assert(strb->surface->texture);
assert(strb->surface->format);
@@ -162,7 +152,7 @@ st_renderbuffer_delete(struct gl_renderbuffer *rb)
struct st_renderbuffer *strb = st_renderbuffer(rb);
ASSERT(strb);
pipe_surface_reference(&strb->surface, NULL);
- pipe_texture_reference(&strb->texture, NULL);
+ pipe_resource_reference(&strb->texture, NULL);
pipe_sampler_view_reference(&strb->sampler_view, NULL);
free(strb->data);
free(strb);
@@ -323,7 +313,7 @@ st_render_texture(GLcontext *ctx,
struct pipe_screen *screen = ctx->st->pipe->screen;
struct st_renderbuffer *strb;
struct gl_renderbuffer *rb;
- struct pipe_texture *pt = st_get_texobj_texture(att->Texture);
+ struct pipe_resource *pt = st_get_texobj_texture(att->Texture);
struct st_texture_object *stObj;
const struct gl_texture_image *texImage;
GLint pt_level;
@@ -366,7 +356,7 @@ st_render_texture(GLcontext *ctx,
/*printf("***** pipe texture %d x %d\n", pt->width0, pt->height0);*/
- pipe_texture_reference( &strb->texture, pt );
+ pipe_resource_reference( &strb->texture, pt );
pipe_surface_reference(&strb->surface, NULL);
@@ -380,8 +370,7 @@ st_render_texture(GLcontext *ctx,
strb->rtt_face,
strb->rtt_level,
strb->rtt_slice,
- PIPE_BUFFER_USAGE_GPU_READ |
- PIPE_BUFFER_USAGE_GPU_WRITE);
+ PIPE_BIND_RENDER_TARGET);
strb->format = pt->format;
@@ -479,20 +468,20 @@ st_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
if (!st_validate_attachment(screen,
&fb->Attachment[BUFFER_DEPTH],
- PIPE_TEXTURE_USAGE_DEPTH_STENCIL)) {
+ PIPE_BIND_DEPTH_STENCIL)) {
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
return;
}
if (!st_validate_attachment(screen,
&fb->Attachment[BUFFER_STENCIL],
- PIPE_TEXTURE_USAGE_DEPTH_STENCIL)) {
+ PIPE_BIND_DEPTH_STENCIL)) {
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
return;
}
for (i = 0; i < ctx->Const.MaxColorAttachments; i++) {
if (!st_validate_attachment(screen,
&fb->Attachment[BUFFER_COLOR0 + i],
- PIPE_TEXTURE_USAGE_RENDER_TARGET)) {
+ PIPE_BIND_RENDER_TARGET)) {
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
return;
}
diff --git a/src/mesa/state_tracker/st_cb_fbo.h b/src/mesa/state_tracker/st_cb_fbo.h
index 7a45a608fe1..5f11a7cd8ab 100644
--- a/src/mesa/state_tracker/st_cb_fbo.h
+++ b/src/mesa/state_tracker/st_cb_fbo.h
@@ -37,7 +37,7 @@
struct st_renderbuffer
{
struct gl_renderbuffer Base;
- struct pipe_texture *texture;
+ struct pipe_resource *texture;
struct pipe_surface *surface; /* temporary view into texture */
struct pipe_sampler_view *sampler_view;
enum pipe_format format; /** preferred format, or PIPE_FORMAT_NONE */
@@ -54,7 +54,7 @@ struct st_renderbuffer
int rtt_level, rtt_face, rtt_slice;
/** Render to texture state */
- struct pipe_texture *texture_save;
+ struct pipe_resource *texture_save;
struct pipe_surface *surface_save;
struct pipe_sampler_view *sampler_view_save;
};
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index 10795ee9e4a..3c06221c87d 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -82,7 +82,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
width, height);
/* map the stencil buffer */
- stmap = pipe->transfer_map(pipe, pt);
+ stmap = pipe_transfer_map(pipe, pt);
/* width should never be > MAX_WIDTH since we did clipping earlier */
ASSERT(width <= MAX_WIDTH);
@@ -102,7 +102,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
}
/* get stencil (and Z) values */
- switch (pt->texture->format) {
+ switch (pt->resource->format) {
case PIPE_FORMAT_S8_USCALED:
{
const ubyte *src = stmap + srcY * pt->stride;
@@ -162,8 +162,8 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
}
/* unmap the stencil buffer */
- pipe->transfer_unmap(pipe, pt);
- pipe->tex_transfer_destroy(pipe, pt);
+ pipe_transfer_unmap(pipe, pt);
+ pipe->transfer_destroy(pipe, pt);
}
@@ -253,9 +253,9 @@ st_fast_readpixels(GLcontext *ctx, struct st_renderbuffer *strb,
return GL_FALSE;
}
- map = pipe->transfer_map(pipe, trans);
+ map = pipe_transfer_map(pipe, trans);
if (!map) {
- pipe->tex_transfer_destroy(pipe, trans);
+ pipe->transfer_destroy(pipe, trans);
return GL_FALSE;
}
@@ -317,8 +317,8 @@ st_fast_readpixels(GLcontext *ctx, struct st_renderbuffer *strb,
; /* nothing */
}
- pipe->transfer_unmap(pipe, trans);
- pipe->tex_transfer_destroy(pipe, trans);
+ pipe_transfer_unmap(pipe, trans);
+ pipe->transfer_destroy(pipe, trans);
}
return GL_TRUE;
@@ -437,8 +437,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
const GLint dstStride = _mesa_image_row_stride(&clippedPacking, width,
format, type);
- if (trans->texture->format == PIPE_FORMAT_Z24_UNORM_S8_USCALED ||
- trans->texture->format == PIPE_FORMAT_Z24X8_UNORM) {
+ if (trans->resource->format == PIPE_FORMAT_Z24_UNORM_S8_USCALED ||
+ trans->resource->format == PIPE_FORMAT_Z24X8_UNORM) {
if (format == GL_DEPTH_COMPONENT) {
for (i = 0; i < height; i++) {
GLuint ztemp[MAX_WIDTH];
@@ -469,8 +469,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
}
}
}
- else if (trans->texture->format == PIPE_FORMAT_S8_USCALED_Z24_UNORM ||
- trans->texture->format == PIPE_FORMAT_X8Z24_UNORM) {
+ else if (trans->resource->format == PIPE_FORMAT_S8_USCALED_Z24_UNORM ||
+ trans->resource->format == PIPE_FORMAT_X8Z24_UNORM) {
if (format == GL_DEPTH_COMPONENT) {
for (i = 0; i < height; i++) {
GLuint ztemp[MAX_WIDTH];
@@ -496,7 +496,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
}
}
}
- else if (trans->texture->format == PIPE_FORMAT_Z16_UNORM) {
+ else if (trans->resource->format == PIPE_FORMAT_Z16_UNORM) {
for (i = 0; i < height; i++) {
GLushort ztemp[MAX_WIDTH];
GLfloat zfloat[MAX_WIDTH];
@@ -511,7 +511,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
dst += dstStride;
}
}
- else if (trans->texture->format == PIPE_FORMAT_Z32_UNORM) {
+ else if (trans->resource->format == PIPE_FORMAT_Z32_UNORM) {
for (i = 0; i < height; i++) {
GLuint ztemp[MAX_WIDTH];
GLfloat zfloat[MAX_WIDTH];
@@ -542,7 +542,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
}
}
- pipe->tex_transfer_destroy(pipe, trans);
+ pipe->transfer_destroy(pipe, trans);
_mesa_unmap_pbo_dest(ctx, &clippedPacking);
}
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 390ada5489c..ce112f67957 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -123,7 +123,7 @@ st_DeleteTextureObject(GLcontext *ctx,
{
struct st_texture_object *stObj = st_texture_object(texObj);
if (stObj->pt)
- pipe_texture_reference(&stObj->pt, NULL);
+ pipe_resource_reference(&stObj->pt, NULL);
if (stObj->sampler_view) {
if (stObj->sampler_view->context != ctx->st->pipe) {
/* Take "ownership" of this texture sampler view by setting
@@ -148,7 +148,7 @@ st_FreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage)
DBG("%s\n", __FUNCTION__);
if (stImage->pt) {
- pipe_texture_reference(&stImage->pt, NULL);
+ pipe_resource_reference(&stImage->pt, NULL);
}
if (texImage->Data) {
@@ -214,17 +214,17 @@ do_memcpy(void *dest, const void *src, size_t n)
static GLuint
default_usage(enum pipe_format fmt)
{
- GLuint usage = PIPE_TEXTURE_USAGE_SAMPLER;
+ GLuint usage = PIPE_BIND_SAMPLER_VIEW;
if (util_format_is_depth_or_stencil(fmt))
- usage |= PIPE_TEXTURE_USAGE_DEPTH_STENCIL;
+ usage |= PIPE_BIND_DEPTH_STENCIL;
else
- usage |= PIPE_TEXTURE_USAGE_RENDER_TARGET;
+ usage |= PIPE_BIND_RENDER_TARGET;
return usage;
}
/**
- * Allocate a pipe_texture object for the given st_texture_object using
+ * Allocate a pipe_resource object for the given st_texture_object using
* the given st_texture_image to guess the mipmap size/levels.
*
* [comments...]
@@ -387,8 +387,8 @@ compress_with_blit(GLcontext * ctx,
struct pipe_context *pipe = ctx->st->pipe;
struct pipe_screen *screen = pipe->screen;
gl_format mesa_format;
- struct pipe_texture templ;
- struct pipe_texture *src_tex;
+ struct pipe_resource templ;
+ struct pipe_resource *src_tex;
struct pipe_sampler_view view_templ;
struct pipe_sampler_view *src_view;
struct pipe_surface *dst_surface;
@@ -403,7 +403,7 @@ compress_with_blit(GLcontext * ctx,
/* get destination surface (in the compressed texture) */
dst_surface = screen->get_tex_surface(screen, stImage->pt,
stImage->face, stImage->level, 0,
- PIPE_BUFFER_USAGE_GPU_WRITE);
+ PIPE_BIND_BLIT_DESTINATION);
if (!dst_surface) {
/* can't render into this format (or other problem) */
return GL_FALSE;
@@ -425,8 +425,9 @@ compress_with_blit(GLcontext * ctx,
templ.height0 = height;
templ.depth0 = 1;
templ.last_level = 0;
- templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
- src_tex = screen->texture_create(screen, &templ);
+ templ._usage = PIPE_USAGE_DEFAULT;
+ templ.bind = PIPE_BIND_SAMPLER_VIEW;
+ src_tex = screen->resource_create(screen, &templ);
if (!src_tex)
return GL_FALSE;
@@ -437,7 +438,7 @@ compress_with_blit(GLcontext * ctx,
0, 0, 0, /* face, level are zero */
PIPE_TRANSFER_WRITE,
0, 0, width, height); /* x, y, w, h */
- map = pipe->transfer_map(pipe, tex_xfer);
+ map = pipe_transfer_map(pipe, tex_xfer);
_mesa_texstore(ctx, 2, GL_RGBA, mesa_format,
map, /* dest ptr */
@@ -449,8 +450,8 @@ compress_with_blit(GLcontext * ctx,
pixels, /* source data */
unpack); /* source data packing */
- pipe->transfer_unmap(pipe, tex_xfer);
- pipe->tex_transfer_destroy(pipe, tex_xfer);
+ pipe_transfer_unmap(pipe, tex_xfer);
+ pipe->transfer_destroy(pipe, tex_xfer);
/* Create temporary sampler view */
u_sampler_view_default_template(&view_templ,
@@ -472,7 +473,7 @@ compress_with_blit(GLcontext * ctx,
PIPE_TEX_MIPFILTER_NEAREST);
pipe_surface_reference(&dst_surface, NULL);
- pipe_texture_reference(&src_tex, NULL);
+ pipe_resource_reference(&src_tex, NULL);
pipe_sampler_view_reference(&src_view, NULL);
return GL_TRUE;
@@ -560,7 +561,7 @@ st_TexImage(GLcontext * ctx,
* Release any old malloced memory.
*/
if (stImage->pt) {
- pipe_texture_reference(&stImage->pt, NULL);
+ pipe_resource_reference(&stImage->pt, NULL);
assert(!texImage->Data);
}
else if (texImage->Data) {
@@ -577,7 +578,7 @@ st_TexImage(GLcontext * ctx,
!st_texture_match_image(stObj->pt, &stImage->base,
stImage->face, stImage->level)) {
DBG("release it\n");
- pipe_texture_reference(&stObj->pt, NULL);
+ pipe_resource_reference(&stObj->pt, NULL);
assert(!stObj->pt);
pipe_sampler_view_reference(&stObj->sampler_view, NULL);
stObj->teximage_realloc = FALSE;
@@ -610,7 +611,7 @@ st_TexImage(GLcontext * ctx,
st_texture_match_image(stObj->pt, &stImage->base,
stImage->face, stImage->level)) {
- pipe_texture_reference(&stImage->pt, stObj->pt);
+ pipe_resource_reference(&stImage->pt, stObj->pt);
assert(stImage->pt);
}
@@ -644,7 +645,7 @@ st_TexImage(GLcontext * ctx,
screen->is_format_supported(screen,
stImage->pt->format,
stImage->pt->target,
- PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {
+ PIPE_BIND_RENDER_TARGET, 0)) {
if (!pixels)
goto done;
@@ -842,11 +843,14 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level,
const GLuint width = texImage->Width;
const GLuint height = texImage->Height;
struct pipe_surface *dst_surface;
- struct pipe_texture *dst_texture;
+ struct pipe_resource *dst_texture;
struct pipe_transfer *tex_xfer;
+ unsigned bind = (PIPE_BIND_BLIT_DESTINATION |
+ PIPE_BIND_RENDER_TARGET | /* util_blit may choose to render */
+ PIPE_BIND_TRANSFER_READ);
/* create temp / dest surface */
- if (!util_create_rgba_surface(screen, width, height,
+ if (!util_create_rgba_surface(screen, width, height, bind,
&dst_texture, &dst_surface)) {
_mesa_problem(ctx, "util_create_rgba_surface() failed "
"in decompress_with_blit()");
@@ -855,7 +859,7 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level,
/* blit/render/decompress */
util_blit_pixels_tex(ctx->st->blit,
- src_view, /* pipe_texture (src) */
+ src_view, /* pipe_resource (src) */
0, 0, /* src x0, y0 */
width, height, /* src x1, y1 */
dst_surface, /* pipe_surface (dst) */
@@ -876,7 +880,7 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level,
if (st_equal_formats(stImage->pt->format, format, type)) {
/* memcpy */
const uint bytesPerRow = width * util_format_get_blocksize(stImage->pt->format);
- ubyte *map = pipe->transfer_map(pipe, tex_xfer);
+ ubyte *map = pipe_transfer_map(pipe, tex_xfer);
GLuint row;
for (row = 0; row < height; row++) {
GLvoid *dest = _mesa_image_address2d(&ctx->Pack, pixels, width,
@@ -884,7 +888,7 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level,
memcpy(dest, map, bytesPerRow);
map += tex_xfer->stride;
}
- pipe->transfer_unmap(pipe, tex_xfer);
+ pipe_transfer_unmap(pipe, tex_xfer);
}
else {
/* format translation via floats */
@@ -908,7 +912,7 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level,
_mesa_unmap_pbo_dest(ctx, &ctx->Pack);
- pipe->tex_transfer_destroy(pipe, tex_xfer);
+ pipe->transfer_destroy(pipe, tex_xfer);
/* destroy the temp / dest surface */
util_destroy_rgba_surface(dst_texture, dst_surface);
@@ -1069,7 +1073,7 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level,
screen->is_format_supported(screen,
stImage->pt->format,
stImage->pt->target,
- PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {
+ PIPE_BIND_RENDER_TARGET, 0)) {
if (compress_with_blit(ctx, target, level,
xoffset, yoffset, zoffset,
width, height, depth,
@@ -1392,7 +1396,7 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level,
}
st_texture_image_unmap(ctx->st, stImage);
- pipe->tex_transfer_destroy(pipe, src_trans);
+ pipe->transfer_destroy(pipe, src_trans);
}
@@ -1577,7 +1581,7 @@ st_copy_texsubimage(GLcontext *ctx,
dest_surface = screen->get_tex_surface(screen, stImage->pt,
stImage->face, stImage->level,
destZ,
- PIPE_BUFFER_USAGE_GPU_WRITE);
+ PIPE_BIND_BLIT_DESTINATION);
/* for surface_copy(), y=0=top, always */
pipe->surface_copy(pipe,
@@ -1596,11 +1600,11 @@ st_copy_texsubimage(GLcontext *ctx,
texBaseFormat != GL_DEPTH_STENCIL &&
screen->is_format_supported(screen, src_format,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER,
+ PIPE_BIND_SAMPLER_VIEW,
0) &&
screen->is_format_supported(screen, dest_format,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_RENDER_TARGET,
+ PIPE_BIND_RENDER_TARGET,
0)) {
/* draw textured quad to do the copy */
GLint srcY0, srcY1;
@@ -1608,7 +1612,7 @@ st_copy_texsubimage(GLcontext *ctx,
dest_surface = screen->get_tex_surface(screen, stImage->pt,
stImage->face, stImage->level,
destZ,
- PIPE_BUFFER_USAGE_GPU_WRITE);
+ PIPE_BIND_BLIT_DESTINATION);
if (do_flip) {
srcY1 = strb->Base.Height - srcY - height;
@@ -1748,7 +1752,7 @@ copy_image_data_to_texture(struct st_context *st,
stImage->pt, /* src texture */
stImage->face);
- pipe_texture_reference(&stImage->pt, NULL);
+ pipe_resource_reference(&stImage->pt, NULL);
}
else if (stImage->base.Data) {
/* More straightforward upload.
@@ -1770,7 +1774,7 @@ copy_image_data_to_texture(struct st_context *st,
stImage->base.Data = NULL;
}
- pipe_texture_reference(&stImage->pt, stObj->pt);
+ pipe_resource_reference(&stImage->pt, stObj->pt);
}
@@ -1816,7 +1820,7 @@ st_finalize_texture(GLcontext *ctx,
if (firstImage->pt &&
firstImage->pt != stObj->pt &&
firstImage->pt->last_level >= stObj->lastLevel) {
- pipe_texture_reference(&stObj->pt, firstImage->pt);
+ pipe_resource_reference(&stObj->pt, firstImage->pt);
pipe_sampler_view_reference(&stObj->sampler_view, NULL);
}
@@ -1836,7 +1840,7 @@ st_finalize_texture(GLcontext *ctx,
stObj->pt->height0 != firstImage->base.Height2 ||
stObj->pt->depth0 != firstImage->base.Depth2)
{
- pipe_texture_reference(&stObj->pt, NULL);
+ pipe_resource_reference(&stObj->pt, NULL);
pipe_sampler_view_reference(&stObj->sampler_view, NULL);
ctx->st->dirty.st |= ST_NEW_FRAMEBUFFER;
}
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 83580591fc3..0a1503fc692 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -240,7 +240,7 @@ static void st_destroy_context_priv( struct st_context *st )
for (i = 0; i < Elements(st->state.constants); i++) {
if (st->state.constants[i]) {
- pipe_buffer_reference(&st->state.constants[i], NULL);
+ pipe_resource_reference(&st->state.constants[i], NULL);
}
}
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 786beaec08b..f28d5aa3ed3 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -95,7 +95,7 @@ struct st_context
struct pipe_sampler_state samplers[PIPE_MAX_SAMPLERS];
struct pipe_sampler_state *sampler_list[PIPE_MAX_SAMPLERS];
struct pipe_clip_state clip;
- struct pipe_buffer *constants[2];
+ struct pipe_resource *constants[2];
struct pipe_framebuffer_state framebuffer;
struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS];
struct pipe_scissor_state scissor;
@@ -143,7 +143,7 @@ struct st_context
GLuint user_prog_sn; /**< user fragment program serial no. */
struct st_fragment_program *combined_prog;
GLuint combined_prog_sn;
- struct pipe_texture *pixelmap_texture;
+ struct pipe_resource *pixelmap_texture;
struct pipe_sampler_view *pixelmap_sampler_view;
boolean pixelmap_enabled; /**< use the pixelmap texture? */
} pixel_xfer;
@@ -155,7 +155,7 @@ struct st_context
enum pipe_format tex_format;
void *vs;
float vertices[4][3][4]; /**< vertex pos + color + texcoord */
- struct pipe_buffer *vbuf;
+ struct pipe_resource *vbuf;
unsigned vbuf_slot; /* next free slot in vbuf */
struct bitmap_cache *cache;
} bitmap;
@@ -174,7 +174,7 @@ struct st_context
void *vs;
void *fs;
float vertices[4][2][4]; /**< vertex pos + color */
- struct pipe_buffer *vbuf;
+ struct pipe_resource *vbuf;
unsigned vbuf_slot;
} clear;
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index e0bb1a0af52..0ebc462ced4 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -360,12 +360,13 @@ setup_interleaved_attribs(GLcontext *ctx,
offset0 = low;
if (userSpace) {
vbuffer->buffer =
- pipe_user_buffer_create(pipe->screen, (void *) low, high - low);
+ pipe_user_buffer_create(pipe->screen, (void *) low, high - low,
+ PIPE_BIND_VERTEX_BUFFER);
vbuffer->buffer_offset = 0;
}
else {
vbuffer->buffer = NULL;
- pipe_buffer_reference(&vbuffer->buffer, stobj->buffer);
+ pipe_resource_reference(&vbuffer->buffer, stobj->buffer);
vbuffer->buffer_offset = pointer_to_offset(low);
}
vbuffer->stride = stride; /* in bytes */
@@ -422,7 +423,7 @@ setup_non_interleaved_attribs(GLcontext *ctx,
/*printf("stobj %u = %p\n", attr, (void*) stobj);*/
vbuffer[attr].buffer = NULL;
- pipe_buffer_reference(&vbuffer[attr].buffer, stobj->buffer);
+ pipe_resource_reference(&vbuffer[attr].buffer, stobj->buffer);
vbuffer[attr].buffer_offset = pointer_to_offset(arrays[mesaAttr]->Ptr);
velements[attr].src_offset = 0;
}
@@ -443,14 +444,19 @@ setup_non_interleaved_attribs(GLcontext *ctx,
bytes = arrays[mesaAttr]->Size
* _mesa_sizeof_type(arrays[mesaAttr]->Type);
}
- vbuffer[attr].buffer = pipe_user_buffer_create(pipe->screen,
- (void *) arrays[mesaAttr]->Ptr, bytes);
+ vbuffer[attr].buffer =
+ pipe_user_buffer_create(pipe->screen,
+ (void *) arrays[mesaAttr]->Ptr, bytes,
+ PIPE_BIND_VERTEX_BUFFER);
}
else {
/* no array, use ctx->Current.Attrib[] value */
bytes = sizeof(ctx->Current.Attrib[0]);
- vbuffer[attr].buffer = pipe_user_buffer_create(pipe->screen,
- (void *) ctx->Current.Attrib[mesaAttr], bytes);
+ vbuffer[attr].buffer =
+ pipe_user_buffer_create(pipe->screen,
+ (void *) ctx->Current.Attrib[mesaAttr],
+ bytes,
+ PIPE_BIND_VERTEX_BUFFER);
stride = 0;
}
@@ -618,7 +624,7 @@ st_draw_vbo(GLcontext *ctx,
if (ib) {
/* indexed primitive */
struct gl_buffer_object *bufobj = ib->obj;
- struct pipe_buffer *indexBuf = NULL;
+ struct pipe_resource *indexBuf = NULL;
unsigned indexSize, indexOffset, i;
unsigned prim;
@@ -641,13 +647,14 @@ st_draw_vbo(GLcontext *ctx,
if (bufobj && bufobj->Name) {
/* elements/indexes are in a real VBO */
struct st_buffer_object *stobj = st_buffer_object(bufobj);
- pipe_buffer_reference(&indexBuf, stobj->buffer);
+ pipe_resource_reference(&indexBuf, stobj->buffer);
indexOffset = pointer_to_offset(ib->ptr) / indexSize;
}
else {
/* element/indicies are in user space memory */
indexBuf = pipe_user_buffer_create(pipe->screen, (void *) ib->ptr,
- ib->count * indexSize);
+ ib->count * indexSize,
+ PIPE_BIND_INDEX_BUFFER);
indexOffset = 0;
}
@@ -683,7 +690,7 @@ st_draw_vbo(GLcontext *ctx,
}
}
- pipe_buffer_reference(&indexBuf, NULL);
+ pipe_resource_reference(&indexBuf, NULL);
}
else {
/* non-indexed */
@@ -706,7 +713,7 @@ st_draw_vbo(GLcontext *ctx,
/* unreference buffers (frees wrapped user-space buffer objects) */
for (attr = 0; attr < num_vbuffers; attr++) {
- pipe_buffer_reference(&vbuffer[attr].buffer, NULL);
+ pipe_resource_reference(&vbuffer[attr].buffer, NULL);
assert(!vbuffer[attr].buffer);
}
diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c
index 26a5b3fcd63..b717bd4e3fb 100644
--- a/src/mesa/state_tracker/st_draw_feedback.c
+++ b/src/mesa/state_tracker/st_draw_feedback.c
@@ -104,9 +104,12 @@ st_feedback_draw_vbo(GLcontext *ctx,
struct draw_context *draw = st->draw;
const struct st_vertex_program *vp;
const struct pipe_shader_state *vs;
- struct pipe_buffer *index_buffer_handle = 0;
+ struct pipe_resource *index_buffer_handle = 0;
struct pipe_vertex_buffer vbuffers[PIPE_MAX_SHADER_INPUTS];
struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS];
+ struct pipe_transfer *vb_transfer[PIPE_MAX_ATTRIBS];
+ struct pipe_transfer *ib_transfer;
+ struct pipe_transfer *cb_transfer;
GLuint attr, i;
ubyte *mapped_constants;
@@ -155,7 +158,7 @@ st_feedback_draw_vbo(GLcontext *ctx,
assert(stobj->buffer);
vbuffers[attr].buffer = NULL;
- pipe_buffer_reference(&vbuffers[attr].buffer, stobj->buffer);
+ pipe_resource_reference(&vbuffers[attr].buffer, stobj->buffer);
vbuffers[attr].buffer_offset = pointer_to_offset(arrays[0]->Ptr);
velements[attr].src_offset = arrays[mesaAttr]->Ptr - arrays[0]->Ptr;
}
@@ -168,7 +171,8 @@ st_feedback_draw_vbo(GLcontext *ctx,
/* wrap user data */
vbuffers[attr].buffer
= pipe_user_buffer_create(pipe->screen, (void *) arrays[mesaAttr]->Ptr,
- bytes);
+ bytes,
+ PIPE_BIND_VERTEX_BUFFER);
vbuffers[attr].buffer_offset = 0;
velements[attr].src_offset = 0;
}
@@ -191,8 +195,9 @@ st_feedback_draw_vbo(GLcontext *ctx,
#endif
/* map the attrib buffer */
- map = pipe_buffer_map(pipe->screen, vbuffers[attr].buffer,
- PIPE_BUFFER_USAGE_CPU_READ);
+ map = pipe_buffer_map(pipe, vbuffers[attr].buffer,
+ PIPE_TRANSFER_READ,
+ &vb_transfer[attr]);
draw_set_mapped_vertex_buffer(draw, attr, map);
}
@@ -221,13 +226,14 @@ st_feedback_draw_vbo(GLcontext *ctx,
index_buffer_handle = stobj->buffer;
- map = pipe_buffer_map(pipe->screen, index_buffer_handle,
- PIPE_BUFFER_USAGE_CPU_READ);
+ map = pipe_buffer_map(pipe, index_buffer_handle,
+ PIPE_TRANSFER_READ, &ib_transfer);
draw_set_mapped_element_buffer(draw, indexSize, map);
}
else {
draw_set_mapped_element_buffer(draw, indexSize, (void *) ib->ptr);
+ ib_transfer = NULL;
}
}
else {
@@ -237,12 +243,13 @@ st_feedback_draw_vbo(GLcontext *ctx,
/* map constant buffers */
- mapped_constants = pipe_buffer_map(pipe->screen,
+ mapped_constants = pipe_buffer_map(pipe,
st->state.constants[PIPE_SHADER_VERTEX],
- PIPE_BUFFER_USAGE_CPU_READ);
+ PIPE_TRANSFER_READ,
+ &cb_transfer);
draw_set_mapped_constant_buffer(st->draw, PIPE_SHADER_VERTEX, 0,
mapped_constants,
- st->state.constants[PIPE_SHADER_VERTEX]->size);
+ st->state.constants[PIPE_SHADER_VERTEX]->width0);
/* draw here */
@@ -252,20 +259,22 @@ st_feedback_draw_vbo(GLcontext *ctx,
/* unmap constant buffers */
- pipe_buffer_unmap(pipe->screen, st->state.constants[PIPE_SHADER_VERTEX]);
+ pipe_buffer_unmap(pipe, st->state.constants[PIPE_SHADER_VERTEX],
+ cb_transfer);
/*
* unmap vertex/index buffers
*/
for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
if (draw->pt.vertex_buffer[i].buffer) {
- pipe_buffer_unmap(pipe->screen, draw->pt.vertex_buffer[i].buffer);
- pipe_buffer_reference(&draw->pt.vertex_buffer[i].buffer, NULL);
+ pipe_buffer_unmap(pipe, draw->pt.vertex_buffer[i].buffer,
+ vb_transfer[i]);
+ pipe_resource_reference(&draw->pt.vertex_buffer[i].buffer, NULL);
draw_set_mapped_vertex_buffer(draw, i, NULL);
}
}
if (index_buffer_handle) {
- pipe_buffer_unmap(pipe->screen, index_buffer_handle);
+ pipe_buffer_unmap(pipe, index_buffer_handle, ib_transfer);
draw_set_mapped_element_buffer(draw, 0, NULL);
}
}
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index affb054866a..1e4b7b88405 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -287,39 +287,39 @@ void st_init_extensions(struct st_context *st)
*/
if (screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0) &&
+ PIPE_BIND_DEPTH_STENCIL, 0) &&
screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+ PIPE_BIND_SAMPLER_VIEW, 0)) {
ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
}
else if (screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0) &&
+ PIPE_BIND_DEPTH_STENCIL, 0) &&
screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+ PIPE_BIND_SAMPLER_VIEW, 0)) {
ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
}
/* sRGB support */
if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0) ||
+ PIPE_BIND_SAMPLER_VIEW, 0) ||
screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+ PIPE_BIND_SAMPLER_VIEW, 0)) {
ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
}
/* s3tc support */
if (screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0) &&
+ PIPE_BIND_SAMPLER_VIEW, 0) &&
(ctx->Mesa_DXTn ||
screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_RENDER_TARGET, 0))) {
+ PIPE_BIND_RENDER_TARGET, 0))) {
ctx->Extensions.EXT_texture_compression_s3tc = GL_TRUE;
ctx->Extensions.S3_s3tc = GL_TRUE;
}
@@ -327,10 +327,10 @@ void st_init_extensions(struct st_context *st)
/* ycbcr support */
if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0) ||
+ PIPE_BIND_SAMPLER_VIEW, 0) ||
screen->is_format_supported(screen, PIPE_FORMAT_YUYV,
PIPE_TEXTURE_2D,
- PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+ PIPE_BIND_SAMPLER_VIEW, 0)) {
ctx->Extensions.MESA_ycbcr_texture = GL_TRUE;
}
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index ecc08762bb2..731ec64c139 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -374,7 +374,7 @@ default_deep_rgba_format(struct pipe_screen *screen,
if (screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_SNORM, target, tex_usage, geom_flags)) {
return PIPE_FORMAT_R16G16B16A16_SNORM;
}
- if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET)
+ if (tex_usage & PIPE_BIND_RENDER_TARGET)
return default_rgba_format(screen, target, tex_usage, geom_flags);
else
return PIPE_FORMAT_NONE;
@@ -410,8 +410,8 @@ default_depth_format(struct pipe_screen *screen,
* Given an OpenGL internalFormat value for a texture or surface, return
* the best matching PIPE_FORMAT_x, or PIPE_FORMAT_NONE if there's no match.
* \param target one of PIPE_TEXTURE_x
- * \param tex_usage either PIPE_TEXTURE_USAGE_RENDER_TARGET
- * or PIPE_TEXTURE_USAGE_SAMPLER
+ * \param tex_usage either PIPE_BIND_RENDER_TARGET
+ * or PIPE_BIND_SAMPLER_VIEW
*/
enum pipe_format
st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
@@ -432,7 +432,7 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
case GL_COMPRESSED_RGB:
return default_rgb_format( screen, target, tex_usage, geom_flags );
case GL_RGBA16:
- if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET)
+ if (tex_usage & PIPE_BIND_RENDER_TARGET)
return default_deep_rgba_format( screen, target, tex_usage, geom_flags );
else
return default_rgba_format( screen, target, tex_usage, geom_flags );
@@ -645,9 +645,9 @@ st_choose_renderbuffer_format(struct pipe_screen *screen,
{
uint usage;
if (is_depth_or_stencil_format(internalFormat))
- usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL;
+ usage = PIPE_BIND_DEPTH_STENCIL;
else
- usage = PIPE_TEXTURE_USAGE_RENDER_TARGET;
+ usage = PIPE_BIND_RENDER_TARGET;
return st_choose_format(screen, internalFormat, PIPE_TEXTURE_2D, usage);
}
@@ -665,7 +665,7 @@ st_ChooseTextureFormat(GLcontext *ctx, GLint internalFormat,
(void) type;
pFormat = st_choose_format(ctx->st->pipe->screen, internalFormat,
- PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER);
+ PIPE_TEXTURE_2D, PIPE_BIND_SAMPLER_VIEW);
if (pFormat == PIPE_FORMAT_NONE)
return MESA_FORMAT_NONE;
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c
index d3c43bbc68a..819b4487ac2 100644
--- a/src/mesa/state_tracker/st_framebuffer.c
+++ b/src/mesa/state_tracker/st_framebuffer.c
@@ -196,7 +196,7 @@ st_set_framebuffer_surface(struct st_framebuffer *stfb,
/* replace the renderbuffer's surface/texture pointers */
pipe_surface_reference( &strb->surface, surf );
- pipe_texture_reference( &strb->texture, surf->texture );
+ pipe_resource_reference( &strb->texture, surf->texture );
pipe_sampler_view_reference(&strb->sampler_view, NULL);
if (ctx) {
@@ -243,7 +243,7 @@ st_get_framebuffer_surface(struct st_framebuffer *stfb, uint surfIndex, struct p
}
int
-st_get_framebuffer_texture(struct st_framebuffer *stfb, uint surfIndex, struct pipe_texture **texture)
+st_get_framebuffer_texture(struct st_framebuffer *stfb, uint surfIndex, struct pipe_resource **texture)
{
struct st_renderbuffer *strb;
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index 030b0a0f065..f0fe31967c3 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -91,7 +91,7 @@ st_render_mipmap(struct st_context *st,
/* check if we can render in the texture's format */
if (!screen->is_format_supported(screen, psv->format, psv->texture->target,
- PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) {
+ PIPE_BIND_RENDER_TARGET, 0)) {
return FALSE;
}
@@ -107,7 +107,7 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target,
struct gl_texture_object *texObj)
{
struct pipe_context *pipe = ctx->st->pipe;
- struct pipe_texture *pt = st_get_texobj_texture(texObj);
+ struct pipe_resource *pt = st_get_texobj_texture(texObj);
const uint baseLevel = texObj->BaseLevel;
const uint lastLevel = pt->last_level;
const uint face = _mesa_tex_target_to_face(target), zslice = 0;
@@ -142,11 +142,11 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target,
u_minify(pt->width0, dstLevel),
u_minify(pt->height0, dstLevel));
- srcData = (ubyte *) pipe->transfer_map(pipe, srcTrans);
- dstData = (ubyte *) pipe->transfer_map(pipe, dstTrans);
+ srcData = (ubyte *) pipe_transfer_map(pipe, srcTrans);
+ dstData = (ubyte *) pipe_transfer_map(pipe, dstTrans);
- srcStride = srcTrans->stride / util_format_get_blocksize(srcTrans->texture->format);
- dstStride = dstTrans->stride / util_format_get_blocksize(dstTrans->texture->format);
+ srcStride = srcTrans->stride / util_format_get_blocksize(srcTrans->resource->format);
+ dstStride = dstTrans->stride / util_format_get_blocksize(dstTrans->resource->format);
_mesa_generate_mipmap_level(target, datatype, comps,
0 /*border*/,
@@ -161,11 +161,11 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target,
dstData,
dstStride); /* stride in texels */
- pipe->transfer_unmap(pipe, srcTrans);
- pipe->transfer_unmap(pipe, dstTrans);
+ 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);
}
}
@@ -213,7 +213,7 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
{
struct st_context *st = ctx->st;
struct st_texture_object *stObj = st_texture_object(texObj);
- struct pipe_texture *pt = st_get_texobj_texture(texObj);
+ struct pipe_resource *pt = st_get_texobj_texture(texObj);
const uint baseLevel = texObj->BaseLevel;
uint lastLevel;
uint dstLevel;
@@ -231,7 +231,7 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
/* The current gallium texture doesn't have space for all the
* mipmap levels we need to generate. So allocate a new texture.
*/
- struct pipe_texture *oldTex = stObj->pt;
+ struct pipe_resource *oldTex = stObj->pt;
GLboolean needFlush;
/* create new texture with space for more levels */
@@ -242,7 +242,7 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
oldTex->width0,
oldTex->height0,
oldTex->depth0,
- oldTex->tex_usage);
+ oldTex->bind);
/* The texture isn't in a "complete" state yet so set the expected
* lastLevel here, since it won't get done in st_finalize_texture().
@@ -255,7 +255,7 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
st_finalize_texture(ctx, st->pipe, texObj, &needFlush);
/* release the old tex (will likely be freed too) */
- pipe_texture_reference(&oldTex, NULL);
+ pipe_resource_reference(&oldTex, NULL);
pipe_sampler_view_reference(&stObj->sampler_view, NULL);
pt = stObj->pt;
@@ -299,6 +299,6 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
dstImage->TexFormat = srcImage->TexFormat;
stImage = (struct st_texture_image *) dstImage;
- pipe_texture_reference(&stImage->pt, pt);
+ pipe_resource_reference(&stImage->pt, pt);
}
}
diff --git a/src/mesa/state_tracker/st_inlines.h b/src/mesa/state_tracker/st_inlines.h
index 7fcde7b1a96..32584b25c27 100644
--- a/src/mesa/state_tracker/st_inlines.h
+++ b/src/mesa/state_tracker/st_inlines.h
@@ -37,6 +37,7 @@
#include "pipe/p_screen.h"
#include "pipe/p_defines.h"
#include "util/u_inlines.h"
+#include "util/u_box.h"
#include "pipe/p_state.h"
#include "st_context.h"
@@ -45,7 +46,7 @@
static INLINE struct pipe_transfer *
st_cond_flush_get_tex_transfer(struct st_context *st,
- struct pipe_texture *pt,
+ struct pipe_resource *pt,
unsigned int face,
unsigned int level,
unsigned int zslice,
@@ -54,15 +55,26 @@ st_cond_flush_get_tex_transfer(struct st_context *st,
unsigned int w, unsigned int h)
{
struct pipe_context *context = st->pipe;
+ struct pipe_subresource subresource;
+ struct pipe_box box;
+
+ subresource.face = face;
+ subresource.level = level;
+
+ u_box_2d_zslice(x, y, zslice, w, h, &box);
st_teximage_flush_before_map(st, pt, face, level, usage);
- return context->get_tex_transfer(context, pt, face, level, zslice, usage,
- x, y, w, h);
+
+ return context->get_transfer(context,
+ pt,
+ subresource,
+ usage,
+ &box);
}
static INLINE struct pipe_transfer *
st_no_flush_get_tex_transfer(struct st_context *st,
- struct pipe_texture *pt,
+ struct pipe_resource *pt,
unsigned int face,
unsigned int level,
unsigned int zslice,
@@ -71,93 +83,76 @@ st_no_flush_get_tex_transfer(struct st_context *st,
unsigned int w, unsigned int h)
{
struct pipe_context *context = st->pipe;
-
- return context->get_tex_transfer(context, pt, face, level,
- zslice, usage, x, y, w, h);
-}
-
-static INLINE void *
-st_cond_flush_pipe_buffer_map(struct st_context *st,
- struct pipe_buffer *buf,
- unsigned int map_flags)
-{
- struct pipe_context *pipe = st->pipe;
- unsigned int referenced = pipe->is_buffer_referenced(pipe, buf);
-
- if (referenced && ((referenced & PIPE_REFERENCED_FOR_WRITE) ||
- (map_flags & PIPE_BUFFER_USAGE_CPU_WRITE)))
- st_flush(st, PIPE_FLUSH_RENDER_CACHE, NULL);
-
- return pipe_buffer_map(pipe->screen, buf, map_flags);
-}
-
-static INLINE void *
-st_no_flush_pipe_buffer_map(struct st_context *st,
- struct pipe_buffer *buf,
- unsigned int map_flags)
-{
- return pipe_buffer_map(st->pipe->screen, buf, map_flags);
+ struct pipe_box box;
+ struct pipe_subresource subresource = u_subresource( face, level );
+
+ u_box_2d_zslice( x, y, zslice,
+ w, h,
+ &box );
+
+ return context->get_transfer(context,
+ pt,
+ subresource,
+ usage,
+ &box);
}
static INLINE void
st_cond_flush_pipe_buffer_write(struct st_context *st,
- struct pipe_buffer *buf,
+ struct pipe_resource *buf,
unsigned int offset,
unsigned int size,
const void * data)
{
struct pipe_context *pipe = st->pipe;
- if (pipe->is_buffer_referenced(pipe, buf))
- st_flush(st, PIPE_FLUSH_RENDER_CACHE, NULL);
-
- pipe_buffer_write(pipe->screen, buf, offset, size, data);
+ pipe_buffer_write(pipe, buf, offset, size, data);
}
static INLINE void
st_no_flush_pipe_buffer_write(struct st_context *st,
- struct pipe_buffer *buf,
+ struct pipe_resource *buf,
unsigned int offset,
unsigned int size,
const void * data)
{
- pipe_buffer_write(st->pipe->screen, buf, offset, size, data);
+ pipe_buffer_write(st->pipe, buf, offset, size, data);
}
static INLINE void
st_no_flush_pipe_buffer_write_nooverlap(struct st_context *st,
- struct pipe_buffer *buf,
+ struct pipe_resource *buf,
unsigned int offset,
unsigned int size,
const void * data)
{
- pipe_buffer_write_nooverlap(st->pipe->screen, buf, offset, size, data);
+ pipe_buffer_write_nooverlap(st->pipe, buf, offset, size, data);
}
static INLINE void
st_cond_flush_pipe_buffer_read(struct st_context *st,
- struct pipe_buffer *buf,
+ struct pipe_resource *buf,
unsigned int offset,
unsigned int size,
void * data)
{
struct pipe_context *pipe = st->pipe;
- if (pipe->is_buffer_referenced(pipe, buf) & PIPE_REFERENCED_FOR_WRITE)
+ if (pipe->is_resource_referenced(pipe, buf, 0, 0) & PIPE_REFERENCED_FOR_WRITE)
st_flush(st, PIPE_FLUSH_RENDER_CACHE, NULL);
- pipe_buffer_read(pipe->screen, buf, offset, size, data);
+ pipe_buffer_read(pipe, buf, offset, size, data);
}
static INLINE void
st_no_flush_pipe_buffer_read(struct st_context *st,
- struct pipe_buffer *buf,
+ struct pipe_resource *buf,
unsigned int offset,
unsigned int size,
void * data)
{
- pipe_buffer_read(st->pipe->screen, buf, offset, size, data);
+ pipe_buffer_read(st->pipe, buf, offset, size, data);
}
#endif
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 4b4c17ca8b9..8a6c8256ff8 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -150,7 +150,7 @@ static void
st_framebuffer_validate(struct st_framebuffer *stfb, struct st_context *st)
{
struct pipe_screen *screen = st->pipe->screen;
- struct pipe_texture *textures[ST_ATTACHMENT_COUNT];
+ struct pipe_resource *textures[ST_ATTACHMENT_COUNT];
uint width, height;
unsigned i;
boolean changed = FALSE;
@@ -175,22 +175,22 @@ st_framebuffer_validate(struct st_framebuffer *stfb, struct st_context *st)
idx = attachment_to_buffer_index(stfb->statts[i]);
if (idx >= BUFFER_COUNT) {
- pipe_texture_reference(&textures[i], NULL);
+ pipe_resource_reference(&textures[i], NULL);
continue;
}
strb = st_renderbuffer(stfb->Base.Attachment[idx].Renderbuffer);
assert(strb);
if (strb->texture == textures[i]) {
- pipe_texture_reference(&textures[i], NULL);
+ pipe_resource_reference(&textures[i], NULL);
continue;
}
ps = screen->get_tex_surface(screen, textures[i], 0, 0, 0,
- PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE);
+ PIPE_BIND_RENDER_TARGET);
if (ps) {
pipe_surface_reference(&strb->surface, ps);
- pipe_texture_reference(&strb->texture, ps->texture);
+ pipe_resource_reference(&strb->texture, ps->texture);
/* ownership transfered */
pipe_surface_reference(&ps, NULL);
@@ -203,7 +203,7 @@ st_framebuffer_validate(struct st_framebuffer *stfb, struct st_context *st)
height = strb->Base.Height;
}
- pipe_texture_reference(&textures[i], NULL);
+ pipe_resource_reference(&textures[i], NULL);
}
if (changed) {
@@ -498,7 +498,7 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags,
static boolean
st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type target,
int level, enum pipe_format internal_format,
- struct pipe_texture *tex, boolean mipmap)
+ struct pipe_resource *tex, boolean mipmap)
{
struct st_context *st = (struct st_context *) stctxi;
GLcontext *ctx = st->ctx;
@@ -557,7 +557,7 @@ st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type target
}
stObj->pipe = st->pipe;
- pipe_texture_reference(&stImage->pt, tex);
+ pipe_resource_reference(&stImage->pt, tex);
_mesa_dirty_texobj(ctx, texObj, GL_TRUE);
_mesa_unlock_texture(ctx, texObj);
@@ -744,7 +744,7 @@ st_manager_get_egl_image_surface(struct st_context *st,
ps = smapi->screen->get_tex_surface(smapi->screen,
stimg.texture, stimg.face, stimg.level, stimg.zslice, usage);
- pipe_texture_reference(&stimg.texture, NULL);
+ pipe_resource_reference(&stimg.texture, NULL);
return ps;
}
diff --git a/src/mesa/state_tracker/st_public.h b/src/mesa/state_tracker/st_public.h
index 4b40d6d0448..18f82132b9f 100644
--- a/src/mesa/state_tracker/st_public.h
+++ b/src/mesa/state_tracker/st_public.h
@@ -53,7 +53,7 @@ struct st_framebuffer;
struct pipe_context;
struct pipe_fence_handle;
struct pipe_surface;
-struct pipe_texture;
+struct pipe_resource;
PUBLIC
@@ -94,7 +94,7 @@ int st_get_framebuffer_surface(struct st_framebuffer *stfb,
PUBLIC
int st_get_framebuffer_texture(struct st_framebuffer *stfb,
- uint surfIndex, struct pipe_texture **texture);
+ uint surfIndex, struct pipe_resource **texture);
PUBLIC
void *st_framebuffer_private( struct st_framebuffer *stfb );
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 5809927852d..a623eed50ac 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -69,12 +69,12 @@ target_to_target(GLenum target)
/**
- * Allocate a new pipe_texture object
+ * Allocate a new pipe_resource object
* width0, height0, depth0 are the dimensions of the level 0 image
* (the highest resolution). last_level indicates how many mipmap levels
* to allocate storage for. For non-mipmapped textures, this will be zero.
*/
-struct pipe_texture *
+struct pipe_resource *
st_texture_create(struct st_context *st,
enum pipe_texture_target target,
enum pipe_format format,
@@ -82,9 +82,9 @@ st_texture_create(struct st_context *st,
GLuint width0,
GLuint height0,
GLuint depth0,
- GLuint usage )
+ GLuint bind )
{
- struct pipe_texture pt, *newtex;
+ struct pipe_resource pt, *newtex;
struct pipe_screen *screen = st->pipe->screen;
assert(target <= PIPE_TEXTURE_CUBE);
@@ -95,7 +95,7 @@ st_texture_create(struct st_context *st,
assert(format);
assert(screen->is_format_supported(screen, format, target,
- PIPE_TEXTURE_USAGE_SAMPLER, 0));
+ PIPE_BIND_SAMPLER_VIEW, 0));
memset(&pt, 0, sizeof(pt));
pt.target = target;
@@ -104,9 +104,11 @@ st_texture_create(struct st_context *st,
pt.width0 = width0;
pt.height0 = height0;
pt.depth0 = depth0;
- pt.tex_usage = usage;
+ pt._usage = PIPE_USAGE_DEFAULT;
+ pt.bind = bind;
+ pt.flags = 0;
- newtex = screen->texture_create(screen, &pt);
+ newtex = screen->resource_create(screen, &pt);
assert(!newtex || pipe_is_referenced(&newtex->reference));
@@ -118,7 +120,7 @@ st_texture_create(struct st_context *st,
* Check if a texture image can be pulled into a unified mipmap texture.
*/
GLboolean
-st_texture_match_image(const struct pipe_texture *pt,
+st_texture_match_image(const struct pipe_resource *pt,
const struct gl_texture_image *image,
GLuint face, GLuint level)
{
@@ -152,7 +154,7 @@ st_texture_match_image(const struct pipe_texture *pt,
* These functions present that view to mesa:
*/
const GLuint *
-st_texture_depth_offsets(struct pipe_texture *pt, GLuint level)
+st_texture_depth_offsets(struct pipe_resource *pt, GLuint level)
{
static const GLuint zero = 0;
@@ -168,7 +170,7 @@ st_texture_depth_offsets(struct pipe_texture *pt, GLuint level)
* texture memory buffer, in bytes.
*/
GLuint
-st_texture_image_offset(const struct pipe_texture * pt,
+st_texture_image_offset(const struct pipe_resource * pt,
GLuint face, GLuint level)
{
if (pt->target == PIPE_TEXTURE_CUBE)
@@ -192,7 +194,7 @@ st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
GLuint x, GLuint y, GLuint w, GLuint h)
{
struct pipe_context *pipe = st->pipe;
- struct pipe_texture *pt = stImage->pt;
+ struct pipe_resource *pt = stImage->pt;
DBG("%s \n", __FUNCTION__);
@@ -201,7 +203,7 @@ st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
usage, x, y, w, h);
if (stImage->transfer)
- return pipe->transfer_map(pipe, stImage->transfer);
+ return pipe_transfer_map(pipe, stImage->transfer);
else
return NULL;
}
@@ -215,9 +217,9 @@ st_texture_image_unmap(struct st_context *st,
DBG("%s\n", __FUNCTION__);
- pipe->transfer_unmap(pipe, stImage->transfer);
+ pipe_transfer_unmap(pipe, stImage->transfer);
- pipe->tex_transfer_destroy(pipe, stImage->transfer);
+ pipe->transfer_destroy(pipe, stImage->transfer);
}
@@ -237,18 +239,18 @@ st_surface_data(struct pipe_context *pipe,
const void *src, unsigned src_stride,
unsigned srcx, unsigned srcy, unsigned width, unsigned height)
{
- void *map = pipe->transfer_map(pipe, dst);
+ void *map = pipe_transfer_map(pipe, dst);
- assert(dst->texture);
+ assert(dst->resource);
util_copy_rect(map,
- dst->texture->format,
+ dst->resource->format,
dst->stride,
dstx, dsty,
width, height,
src, src_stride,
srcx, srcy);
- pipe->transfer_unmap(pipe, dst);
+ pipe_transfer_unmap(pipe, dst);
}
@@ -256,7 +258,7 @@ st_surface_data(struct pipe_context *pipe,
*/
void
st_texture_image_data(struct st_context *st,
- struct pipe_texture *dst,
+ struct pipe_resource *dst,
GLuint face,
GLuint level,
void *src,
@@ -284,7 +286,7 @@ st_texture_image_data(struct st_context *st,
u_minify(dst->width0, level),
u_minify(dst->height0, level)); /* width, height */
- pipe->tex_transfer_destroy(pipe, dst_transfer);
+ pipe->transfer_destroy(pipe, dst_transfer);
srcUB += src_image_stride;
}
@@ -295,8 +297,8 @@ st_texture_image_data(struct st_context *st,
*/
void
st_texture_image_copy(struct pipe_context *pipe,
- struct pipe_texture *dst, GLuint dstLevel,
- struct pipe_texture *src,
+ struct pipe_resource *dst, GLuint dstLevel,
+ struct pipe_resource *src,
GLuint face)
{
struct pipe_screen *screen = pipe->screen;
@@ -337,10 +339,10 @@ st_texture_image_copy(struct pipe_context *pipe,
#endif
dst_surface = screen->get_tex_surface(screen, dst, face, dstLevel, i,
- PIPE_BUFFER_USAGE_GPU_WRITE);
+ PIPE_BIND_BLIT_DESTINATION);
src_surface = screen->get_tex_surface(screen, src, face, srcLevel, i,
- PIPE_BUFFER_USAGE_GPU_READ);
+ PIPE_BIND_BLIT_SOURCE);
pipe->surface_copy(pipe,
dst_surface,
@@ -416,7 +418,7 @@ st_bind_texture_surface(struct pipe_surface *ps, int target, int level,
texImage->TexFormat = st_ChooseTextureFormat(ctx, internalFormat,
GL_RGBA, GL_UNSIGNED_BYTE);
_mesa_set_fetch_functions(texImage, 2);
- pipe_texture_reference(&stImage->pt, ps->texture);
+ pipe_resource_reference(&stImage->pt, ps->texture);
_mesa_dirty_texobj(ctx, texObj, GL_TRUE);
_mesa_unlock_texture(ctx, texObj);
@@ -466,7 +468,7 @@ st_unbind_texture_surface(struct pipe_surface *ps, int target, int level)
/* Make sure the pipe surface is still bound. The texture object is still
* considered surface based even if this is the last bound surface. */
if (stImage->pt == ps->texture) {
- pipe_texture_reference(&stImage->pt, NULL);
+ pipe_resource_reference(&stImage->pt, NULL);
_mesa_clear_texture_image(ctx, texImage);
_mesa_dirty_texobj(ctx, texObj, GL_TRUE);
@@ -517,20 +519,21 @@ st_bind_teximage(struct st_framebuffer *stfb, uint surfIndex,
st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
/* save the renderbuffer's surface/texture info */
- pipe_texture_reference(&strb->texture_save, strb->texture);
+ pipe_resource_reference(&strb->texture_save, strb->texture);
pipe_surface_reference(&strb->surface_save, strb->surface);
pipe_sampler_view_reference(&strb->sampler_view_save, strb->sampler_view);
/* plug in new surface/texture info */
- pipe_texture_reference(&strb->texture, stImage->pt);
+ pipe_resource_reference(&strb->texture, stImage->pt);
/* XXX: Shouldn't we release reference to old surface here?
*/
strb->surface = screen->get_tex_surface(screen, strb->texture,
face, level, slice,
- (PIPE_BUFFER_USAGE_GPU_READ |
- PIPE_BUFFER_USAGE_GPU_WRITE));
+ (PIPE_BIND_RENDER_TARGET |
+ PIPE_BIND_BLIT_SOURCE |
+ PIPE_BIND_BLIT_DESTINATION));
pipe_sampler_view_reference(&strb->sampler_view, NULL);
@@ -562,11 +565,11 @@ st_release_teximage(struct st_framebuffer *stfb, uint surfIndex,
/* free tex surface, restore original */
pipe_surface_reference(&strb->surface, strb->surface_save);
- pipe_texture_reference(&strb->texture, strb->texture_save);
+ pipe_resource_reference(&strb->texture, strb->texture_save);
pipe_sampler_view_reference(&strb->sampler_view, strb->sampler_view_save);
pipe_surface_reference(&strb->surface_save, NULL);
- pipe_texture_reference(&strb->texture_save, NULL);
+ pipe_resource_reference(&strb->texture_save, NULL);
pipe_sampler_view_reference(&strb->sampler_view, NULL);
st->dirty.st |= ST_NEW_FRAMEBUFFER;
@@ -576,14 +579,14 @@ st_release_teximage(struct st_framebuffer *stfb, uint surfIndex,
void
st_teximage_flush_before_map(struct st_context *st,
- struct pipe_texture *pt,
+ struct pipe_resource *pt,
unsigned int face,
unsigned int level,
enum pipe_transfer_usage usage)
{
struct pipe_context *pipe = st->pipe;
unsigned referenced =
- pipe->is_texture_referenced(pipe, pt, face, level);
+ pipe->is_resource_referenced(pipe, pt, face, level);
if (referenced && ((referenced & PIPE_REFERENCED_FOR_WRITE) ||
(usage & PIPE_TRANSFER_WRITE)))
diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h
index c62f7f2cc0d..76ea7e6950a 100644
--- a/src/mesa/state_tracker/st_texture.h
+++ b/src/mesa/state_tracker/st_texture.h
@@ -35,7 +35,7 @@
#include "main/mtypes.h"
struct pipe_context;
-struct pipe_texture;
+struct pipe_resource;
struct st_texture_image
@@ -51,7 +51,7 @@ struct st_texture_image
* Else if stImage->base.Data != NULL, image is stored there.
* Else there is no image data.
*/
- struct pipe_texture *pt;
+ struct pipe_resource *pt;
struct pipe_transfer *transfer;
};
@@ -69,7 +69,7 @@ struct st_texture_object
/* On validation any active images held in main memory or in other
* textures will be copied to this texture and the old storage freed.
*/
- struct pipe_texture *pt;
+ struct pipe_resource *pt;
/* Default sampler view attached to this texture object. Created lazily
* on first binding.
@@ -100,7 +100,7 @@ st_texture_object(struct gl_texture_object *obj)
}
-static INLINE struct pipe_texture *
+static INLINE struct pipe_resource *
st_get_texobj_texture(struct gl_texture_object *texObj)
{
struct st_texture_object *stObj = st_texture_object(texObj);
@@ -108,7 +108,7 @@ st_get_texobj_texture(struct gl_texture_object *texObj)
}
-static INLINE struct pipe_texture *
+static INLINE struct pipe_resource *
st_get_stobj_texture(struct st_texture_object *stObj)
{
return stObj ? stObj->pt : NULL;
@@ -117,7 +117,7 @@ st_get_stobj_texture(struct st_texture_object *stObj)
static INLINE struct pipe_sampler_view *
st_sampler_view_from_texture(struct pipe_context *pipe,
- struct pipe_texture *texture)
+ struct pipe_resource *texture)
{
struct pipe_sampler_view templ;
@@ -144,7 +144,7 @@ st_get_stobj_sampler_view(struct st_texture_object *stObj)
}
-extern struct pipe_texture *
+extern struct pipe_resource *
st_texture_create(struct st_context *st,
enum pipe_texture_target target,
enum pipe_format format,
@@ -158,7 +158,7 @@ st_texture_create(struct st_context *st,
/* Check if an image fits into an existing texture object.
*/
extern GLboolean
-st_texture_match_image(const struct pipe_texture *pt,
+st_texture_match_image(const struct pipe_resource *pt,
const struct gl_texture_image *image,
GLuint face, GLuint level);
@@ -182,17 +182,17 @@ st_texture_image_unmap(struct st_context *st,
* value.
*/
extern const GLuint *
-st_texture_depth_offsets(struct pipe_texture *pt, GLuint level);
+st_texture_depth_offsets(struct pipe_resource *pt, GLuint level);
/* Return the linear offset of an image relative to the start of its region.
*/
extern GLuint
-st_texture_image_offset(const struct pipe_texture *pt,
+st_texture_image_offset(const struct pipe_resource *pt,
GLuint face, GLuint level);
extern GLuint
-st_texture_texel_offset(const struct pipe_texture * pt,
+st_texture_texel_offset(const struct pipe_resource * pt,
GLuint face, GLuint level,
GLuint col, GLuint row, GLuint img);
@@ -201,7 +201,7 @@ st_texture_texel_offset(const struct pipe_texture * pt,
*/
extern void
st_texture_image_data(struct st_context *st,
- struct pipe_texture *dst,
+ struct pipe_resource *dst,
GLuint face, GLuint level, void *src,
GLuint src_row_pitch, GLuint src_image_pitch);
@@ -210,13 +210,13 @@ st_texture_image_data(struct st_context *st,
*/
extern void
st_texture_image_copy(struct pipe_context *pipe,
- struct pipe_texture *dst, GLuint dstLevel,
- struct pipe_texture *src,
+ struct pipe_resource *dst, GLuint dstLevel,
+ struct pipe_resource *src,
GLuint face);
extern void
st_teximage_flush_before_map(struct st_context *st,
- struct pipe_texture *pt,
+ struct pipe_resource *pt,
unsigned int face,
unsigned int level,
enum pipe_transfer_usage usage);