summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2015-02-19 16:35:45 +0100
committerAxel Davy <[email protected]>2015-04-29 08:28:11 +0200
commit4c2247ac60f426a6441f964f2204af9f8dc04dc5 (patch)
tree5344322836836db3038167a53c8bd21189d2d05c /src
parente558ce98f2b01e11ff79c29efaea2877121ae04a (diff)
st/nine: Remove impossible cases with Managed textures
Copying to/from a Managed texture is forbidden. Rendering to a Managed texture is forbidden. Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/nine/surface9.c23
-rw-r--r--src/gallium/state_trackers/nine/volume9.c19
2 files changed, 8 insertions, 34 deletions
diff --git a/src/gallium/state_trackers/nine/surface9.c b/src/gallium/state_trackers/nine/surface9.c
index 3a0b4d0c948..5c6b3bf2c3d 100644
--- a/src/gallium/state_trackers/nine/surface9.c
+++ b/src/gallium/state_trackers/nine/surface9.c
@@ -166,8 +166,7 @@ NineSurface9_CreatePipeSurface( struct NineSurface9 *This, const int sRGB )
struct pipe_surface templ;
enum pipe_format srgb_format;
- assert(This->desc.Pool == D3DPOOL_DEFAULT ||
- This->desc.Pool == D3DPOOL_MANAGED);
+ assert(This->desc.Pool == D3DPOOL_DEFAULT);
assert(resource);
srgb_format = util_format_srgb(resource->format);
@@ -504,6 +503,9 @@ NineSurface9_CopySurface( struct NineSurface9 *This,
DBG("This=%p From=%p pDestPoint=%p pSourceRect=%p\n",
This, From, pDestPoint, pSourceRect);
+ assert(This->base.pool != D3DPOOL_MANAGED &&
+ From->base.pool != D3DPOOL_MANAGED);
+
user_assert(This->desc.Format == From->desc.Format, D3DERR_INVALIDCALL);
dst_box.x = pDestPoint ? pDestPoint->x : 0;
@@ -544,20 +546,6 @@ NineSurface9_CopySurface( struct NineSurface9 *This,
dst_box.width = src_box.width;
dst_box.height = src_box.height;
- /* Don't copy to device memory of managed resources.
- * We don't want to download it back again later.
- */
- if (This->base.pool == D3DPOOL_MANAGED)
- r_dst = NULL;
-
- /* Don't copy from stale device memory of managed resources.
- * Also, don't copy between system and device if we don't have to.
- */
- if (From->base.pool == D3DPOOL_MANAGED) {
- if (!r_dst || NineSurface9_IsDirty(From))
- r_src = NULL;
- }
-
/* check source block align for compressed textures */
if (util_format_is_compressed(From->base.info.format) &&
((src_box.width != From->desc.Width) ||
@@ -623,8 +611,7 @@ NineSurface9_CopySurface( struct NineSurface9 *This,
From->stride, src_box.x, src_box.y);
}
- if (This->base.pool == D3DPOOL_DEFAULT ||
- This->base.pool == D3DPOOL_MANAGED)
+ if (This->base.pool == D3DPOOL_DEFAULT)
NineSurface9_MarkContainerDirty(This);
if (!r_dst && This->base.resource)
NineSurface9_AddDirtyRect(This, &dst_box);
diff --git a/src/gallium/state_trackers/nine/volume9.c b/src/gallium/state_trackers/nine/volume9.c
index 24d5d53f01d..8c9f148373b 100644
--- a/src/gallium/state_trackers/nine/volume9.c
+++ b/src/gallium/state_trackers/nine/volume9.c
@@ -355,6 +355,8 @@ NineVolume9_CopyVolume( struct NineVolume9 *This,
DBG("This=%p From=%p dstx=%u dsty=%u dstz=%u pSrcBox=%p\n",
This, From, dstx, dsty, dstz, pSrcBox);
+ assert(This->desc.Pool != D3DPOOL_MANAGED &&
+ From->desc.Pool != D3DPOOL_MANAGED);
user_assert(This->desc.Format == From->desc.Format, D3DERR_INVALIDCALL);
dst_box.x = dstx;
@@ -392,20 +394,6 @@ NineVolume9_CopyVolume( struct NineVolume9 *This,
dst_box.height = src_box.height;
dst_box.depth = src_box.depth;
- /* Don't copy to device memory of managed resources.
- * We don't want to download it back again later.
- */
- if (This->desc.Pool == D3DPOOL_MANAGED)
- r_dst = NULL;
-
- /* Don't copy from stale device memory of managed resources.
- * Also, don't copy between system and device if we don't have to.
- */
- if (From->desc.Pool == D3DPOOL_MANAGED) {
- if (!r_dst || NineVolume9_IsDirty(From))
- r_src = NULL;
- }
-
if (r_dst && r_src) {
pipe->resource_copy_region(pipe,
r_dst, This->level,
@@ -452,8 +440,7 @@ NineVolume9_CopyVolume( struct NineVolume9 *This,
src_box.x, src_box.y, src_box.z);
}
- if (This->desc.Pool == D3DPOOL_DEFAULT ||
- This->desc.Pool == D3DPOOL_MANAGED)
+ if (This->desc.Pool == D3DPOOL_DEFAULT)
NineVolume9_MarkContainerDirty(This);
if (!r_dst && This->resource)
NineVolume9_AddDirtyRegion(This, &dst_box);