From eb7ef433bbbeabda963e74adf0ef61c47883f292 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 22 Jun 2010 06:41:15 +0200 Subject: r300g: optimize the immediate mode emission path a bit --- src/gallium/winsys/radeon/drm/radeon_r300.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gallium/winsys') diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c index 237fdc8bac4..d2d317dc209 100644 --- a/src/gallium/winsys/radeon/drm/radeon_r300.c +++ b/src/gallium/winsys/radeon/drm/radeon_r300.c @@ -192,6 +192,17 @@ static unsigned radeon_get_cs_free_dwords(struct r300_winsys_screen *rws) return cs->ndw - cs->cdw; } +static uint32_t *radeon_get_cs_pointer(struct r300_winsys_screen *rws, + unsigned count) +{ + struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); + struct radeon_cs *cs = ws->cs; + uint32_t *ptr = cs->packets + cs->cdw; + + cs->cdw += count; + return ptr; +} + static void radeon_write_cs_dword(struct r300_winsys_screen *rws, uint32_t dword) { @@ -316,6 +327,7 @@ radeon_setup_winsys(int fd, struct radeon_libdrm_winsys* ws) ws->base.validate = radeon_validate; ws->base.destroy = radeon_winsys_destroy; ws->base.get_cs_free_dwords = radeon_get_cs_free_dwords; + ws->base.get_cs_pointer = radeon_get_cs_pointer; ws->base.write_cs_dword = radeon_write_cs_dword; ws->base.write_cs_table = radeon_write_cs_table; ws->base.write_cs_reloc = radeon_write_cs_reloc; -- cgit v1.2.3