r600g: emit streamout from dma copy shader
[mesa.git] / src / gallium / drivers / softpipe / sp_texture.h
index 6b205dc53290cca4b6747aa1d5fbd6ad21cf985f..90f35e11631c46b79bed020d5ccb66872942cb8c 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  * 
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2007 VMware, Inc.
  * All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -18,7 +18,7 @@
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 #include "pipe/p_state.h"
-
-
-#define SP_MAX_TEXTURE_2D_LEVELS 13  /* 4K x 4K */
-#define SP_MAX_TEXTURE_3D_LEVELS 9   /* 512 x 512 x 512 */
+#include "sp_limits.h"
 
 
 struct pipe_context;
@@ -82,7 +79,6 @@ struct softpipe_transfer
 };
 
 
-
 /** cast wrappers */
 static INLINE struct softpipe_resource *
 softpipe_resource(struct pipe_resource *pt)
@@ -97,6 +93,22 @@ softpipe_transfer(struct pipe_transfer *pt)
 }
 
 
+/**
+ * Return pointer to a resource's actual data.
+ * This is a short-cut instead of using map()/unmap(), which should
+ * probably be fixed.
+ */
+static INLINE void *
+softpipe_resource_data(struct pipe_resource *pt)
+{
+   if (!pt)
+      return NULL;
+
+   assert(softpipe_resource(pt)->dt == NULL);
+   return softpipe_resource(pt)->data;
+}
+
+
 extern void
 softpipe_init_screen_texture_funcs(struct pipe_screen *screen);