summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_resource.h
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-07-28 12:18:19 -0400
committerJerome Glisse <jglisse@redhat.com>2010-07-28 12:18:19 -0400
commit742ee7935da60dda974795243d2e0fcf31accb59 (patch)
treefd2ac432637f39d85e8e6060d30389db196b9ba3 /src/gallium/drivers/r600/r600_resource.h
parentb346c4205dc19c9ffbff48ed8bd89687772a96f8 (diff)
r600g: cleanup resource buffer/texture mess
Use a common function, fix the mess it was before. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'src/gallium/drivers/r600/r600_resource.h')
-rw-r--r--src/gallium/drivers/r600/r600_resource.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_resource.h b/src/gallium/drivers/r600/r600_resource.h
index 95084a371b..0139a3b777 100644
--- a/src/gallium/drivers/r600/r600_resource.h
+++ b/src/gallium/drivers/r600/r600_resource.h
@@ -20,14 +20,47 @@
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
#ifndef R600_RESOURCE_H
#define R600_RESOURCE_H
+#include "util/u_transfer.h"
+
struct r600_context;
struct r600_screen;
+/* This gets further specialized into either buffer or texture
+ * structures. Use the vtbl struct to choose between the two
+ * underlying implementations.
+ */
+struct r600_resource {
+ struct u_resource base;
+ struct radeon_bo *bo;
+ u32 domain;
+ u32 flink;
+ struct pb_buffer *pb;
+};
+
+struct r600_resource_texture {
+ struct r600_resource resource;
+ unsigned long offset[PIPE_MAX_TEXTURE_LEVELS];
+ unsigned long pitch[PIPE_MAX_TEXTURE_LEVELS];
+ unsigned long stride[PIPE_MAX_TEXTURE_LEVELS];
+ unsigned long layer_size[PIPE_MAX_TEXTURE_LEVELS];
+ unsigned long stride_override;
+ unsigned long size;
+};
+
void r600_init_context_resource_functions(struct r600_context *r600);
void r600_init_screen_resource_functions(struct r600_screen *r600screen);
+/* r600_buffer */
+u32 r600_domain_from_usage(unsigned usage);
+
+/* r600_texture */
+struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
+ const struct pipe_resource *templ);
+struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen,
+ const struct pipe_resource *base,
+ struct winsys_handle *whandle);
+
#endif