From: Corbin Simpson Date: Fri, 18 Dec 2009 21:40:24 +0000 (-0800) Subject: r300g: Nuke r300_vbo. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=62afcbb2338e30aab8c829e92456c073800156f6;p=mesa.git r300g: Nuke r300_vbo. --- diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index 8cfd4147c20..afddcb161fa 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -17,7 +17,6 @@ C_SOURCES = \ r300_state.c \ r300_state_derived.c \ r300_state_invariant.c \ - r300_vbo.c \ r300_vs.c \ r300_texture.c \ r300_tgsi_to_rc.c diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 4b210f72db2..425eb9f9ef3 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -37,7 +37,6 @@ #include "r300_reg.h" #include "r300_render.h" #include "r300_state_derived.h" -#include "r300_vbo.h" /* r300_render: Vertex and index buffer primitive emission. */ #define R300_MAX_VBO_SIZE (1024 * 1024) @@ -196,7 +195,14 @@ boolean r300_draw_range_elements(struct pipe_context* pipe, return FALSE; } - setup_index_buffer(r300, indexBuffer, indexSize); + if (!r300->winsys->add_buffer(r300->winsys, indexBuffer, + RADEON_GEM_DOMAIN_GTT, 0)) { + assert(0); + } + + if (!r300->winsys->validate(r300->winsys)) { + assert(0); + } r300_emit_dirty_state(r300); diff --git a/src/gallium/drivers/r300/r300_vbo.c b/src/gallium/drivers/r300/r300_vbo.c deleted file mode 100644 index d8610dadfae..00000000000 --- a/src/gallium/drivers/r300/r300_vbo.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2009 Maciej Cencora - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * 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 - * THE AUTHOR(S) AND/OR THEIR 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. - */ - -/* r300_vbo: Various helpers for emitting vertex buffers. Needs cleanup, - * refactoring, etc. */ - -#include "r300_vbo.h" - -#include "pipe/p_format.h" - -#include "r300_cs.h" -#include "r300_context.h" -#include "r300_state_inlines.h" -#include "r300_reg.h" - -#include "radeon_winsys.h" - -static INLINE int get_buffer_offset(struct r300_context *r300, - unsigned int buf_nr, - unsigned int elem_offset) -{ - return r300->vertex_buffer[buf_nr].buffer_offset + elem_offset; -} -#if 0 -/* XXX not called at all */ -static void setup_vertex_buffers(struct r300_context *r300) -{ - struct pipe_vertex_element *vert_elem; - int i; - - for (i = 0; i < r300->aos_count; i++) - { - vert_elem = &r300->vertex_element[i]; - /* XXX use translate module to convert the data */ - if (!format_is_supported(vert_elem->src_format, - vert_elem->nr_components)) { - assert(0); - /* - struct pipe_buffer *buf; - const unsigned int max_index = r300->vertex_buffers[vert_elem->vertex_buffer_index].max_index; - buf = pipe_buffer_create(r300->context.screen, 4, usage, vert_elem->nr_components * max_index * sizeof(float)); - */ - } - - if (get_buffer_offset(r300, - vert_elem->vertex_buffer_index, - vert_elem->src_offset) % 4) { - /* XXX need to align buffer */ - assert(0); - } - } -} -#endif -/* XXX these shouldn't be asserts since we can work around bad indexbufs */ -void setup_index_buffer(struct r300_context *r300, - struct pipe_buffer* indexBuffer, - unsigned indexSize) -{ - if (!r300->winsys->add_buffer(r300->winsys, indexBuffer, - RADEON_GEM_DOMAIN_GTT, 0)) { - assert(0); - } - - if (!r300->winsys->validate(r300->winsys)) { - assert(0); - } -} diff --git a/src/gallium/drivers/r300/r300_vbo.h b/src/gallium/drivers/r300/r300_vbo.h deleted file mode 100644 index 7afa75899cf..00000000000 --- a/src/gallium/drivers/r300/r300_vbo.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2009 Maciej Cencora - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * 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 - * THE AUTHOR(S) AND/OR THEIR 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. - */ - -#ifndef R300_VBO_H -#define R300_VBO_H - -struct r300_context; -struct pipe_buffer; - -void setup_vertex_attributes(struct r300_context *r300); - -void setup_index_buffer(struct r300_context *r300, - struct pipe_buffer* indexBuffer, - unsigned indexSize); - -#endif