In theory, it could work, but there's still some very big gaps.
Anything marked with XXX should be taken care of first, probably.
LIBNAME = r300
C_SOURCES = \
+ r300_blit.c \
r300_clear.c \
r300_context.c \
r300_screen.c \
- r300_state.c
+ r300_state.c \
+ r300_surface.c
include ../../Makefile.template
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE. */
+#include "r300_blit.h"
+
/* Does a "paint" into the specified rectangle.
* Returns 1 on success, 0 on error. */
int r300_fill_blit(struct r300_context* r300,
#ifndef R300_BLIT_H
#define R300_BLIT_H
+#include "pipe/p_state.h"
+
+#include "radeon_reg.h"
+
+/* Forward declarations. */
+struct r300_context;
+
extern int r300_fill_blit(struct r300_context* r300,
unsigned cpp,
short dst_pitch,
- struct pipe_buffer *dst_buffer,
+ struct pipe_buffer* dst_buffer,
unsigned dst_offset,
short x, short y,
short w, short h,
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE. */
+#include "r300_clear.h"
+
/* This gets its own file because Intel's is in its own file.
* I assume there's a good reason. */
-void r300_clear(struct pipe_context* pipe, struct pipe_surface* ps, unsigned val)
+void r300_clear(struct pipe_context* pipe,
+ struct pipe_surface* ps,
+ unsigned color)
{
- pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
+ pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color);
ps->status = PIPE_SURFACE_STATUS_DEFINED;
}
\ No newline at end of file
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE. */
-void r300_clear(struct pipe_context* pipe, struct pipe_surface* ps, unsigned val);
\ No newline at end of file
+#include "pipe/p_context.h"
+
+void r300_clear(struct pipe_context* pipe,
+ struct pipe_surface* ps,
+ unsigned color);
struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd);
r300->cs = cs_gem_create(csm, 64 * 1024 / 4); */
+ r300_init_surface_functions(r300);
+
return &r300->context;
-}
\ No newline at end of file
+}
#include "pipe/p_context.h"
+#include "r300_surface.h"
+
struct r300_context {
/* Parent class */
struct pipe_context context;
struct pipe_surface* surface,
unsigned flags)
{
- /* XXX is this all we need to do here? */
+ /* XXX this is not quite right */
char* map = pipe_buffer_map(screen, surface->buffer, flags);
if (!map) {
#ifndef R300_SURFACE_H
#define R300_SURFACE_H
+#include "pipe/p_context.h"
+#include "pipe/p_screen.h"
+
+#include "util/u_rect.h"
+
#include "r300_blit.h"
+#include "r300_context.h"
+
+void r300_init_surface_functions(struct r300_context* r300);
#endif /* R300_SURFACE_H */