1 /*
2 * Copyright 2010 Red Hat Inc.
3 * Authors: Dave Airlie
4 * SPDX-License-Identifier: MIT
5 */
6
7 #ifndef R300_SCREEN_BUFFER_H
8 #define R300_SCREEN_BUFFER_H
9
10 #include <stdio.h>
11 #include "util/compiler.h"
12 #include "pipe/p_state.h"
13 #include "util/u_transfer.h"
14
15 #include "r300_screen.h"
16 #include "r300_context.h"
17
18 /* Functions. */
19
20 void r300_upload_index_buffer(struct r300_context *r300,
21 struct pipe_resource **index_buffer,
22 unsigned index_size, unsigned *start,
23 unsigned count, const uint8_t *ptr);
24
25 void r300_resource_destroy(struct pipe_screen *screen,
26 struct pipe_resource *buf);
27
28 struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
29 const struct pipe_resource *templ);
30
31 /* Inline functions. */
32
r300_buffer(struct pipe_resource * buffer)33 static inline struct r300_buffer *r300_buffer(struct pipe_resource *buffer)
34 {
35 return (struct r300_buffer *)buffer;
36 }
37
38 void *
39 r300_buffer_transfer_map( struct pipe_context *context,
40 struct pipe_resource *resource,
41 unsigned level,
42 unsigned usage,
43 const struct pipe_box *box,
44 struct pipe_transfer **ptransfer );
45
46 void r300_buffer_transfer_unmap( struct pipe_context *pipe,
47 struct pipe_transfer *transfer );
48
49 #endif
50