diff options
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/Makefile.sources | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_buffer.c | 63 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_descriptors.c | 27 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_resource.h | 6 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.h | 2 |
5 files changed, 29 insertions, 70 deletions
diff --git a/src/gallium/drivers/radeonsi/Makefile.sources b/src/gallium/drivers/radeonsi/Makefile.sources index 4e1f9712efc..11b3319ac72 100644 --- a/src/gallium/drivers/radeonsi/Makefile.sources +++ b/src/gallium/drivers/radeonsi/Makefile.sources @@ -1,6 +1,5 @@ C_SOURCES := \ si_blit.c \ - si_buffer.c \ si_commands.c \ si_compute.c \ si_descriptors.c \ diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c deleted file mode 100644 index 79944052689..00000000000 --- a/src/gallium/drivers/radeonsi/si_buffer.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2010 Jerome Glisse <[email protected]> - * - * 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. - * - * Authors: - * Jerome Glisse - * Corbin Simpson <[email protected]> - */ - -#include "pipe/p_screen.h" -#include "util/u_format.h" -#include "util/u_math.h" -#include "util/u_inlines.h" -#include "util/u_memory.h" -#include "util/u_upload_mgr.h" - -#include "si.h" -#include "si_pipe.h" - -void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuffer, - const uint8_t *ptr, unsigned size, - uint32_t *const_offset) -{ - if (SI_BIG_ENDIAN) { - uint32_t *tmpPtr; - unsigned i; - - if (!(tmpPtr = malloc(size))) { - R600_ERR("Failed to allocate BE swap buffer.\n"); - return; - } - - for (i = 0; i < size / 4; ++i) { - tmpPtr[i] = util_bswap32(((uint32_t *)ptr)[i]); - } - - u_upload_data(sctx->b.uploader, 0, size, tmpPtr, const_offset, - (struct pipe_resource**)rbuffer); - - free(tmpPtr); - } else { - u_upload_data(sctx->b.uploader, 0, size, ptr, const_offset, - (struct pipe_resource**)rbuffer); - } -} diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index e64799d904a..f29d8bb3f1d 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -29,6 +29,7 @@ #include "si_shader.h" #include "util/u_memory.h" +#include "util/u_upload_mgr.h" #define SI_NUM_CONTEXTS 16 @@ -400,6 +401,32 @@ static void si_buffer_resources_begin_new_cs(struct si_context *sctx, /* CONSTANT BUFFERS */ +void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuffer, + const uint8_t *ptr, unsigned size, uint32_t *const_offset) +{ + if (SI_BIG_ENDIAN) { + uint32_t *tmpPtr; + unsigned i; + + if (!(tmpPtr = malloc(size))) { + R600_ERR("Failed to allocate BE swap buffer.\n"); + return; + } + + for (i = 0; i < size / 4; ++i) { + tmpPtr[i] = util_bswap32(((uint32_t *)ptr)[i]); + } + + u_upload_data(sctx->b.uploader, 0, size, tmpPtr, const_offset, + (struct pipe_resource**)rbuffer); + + free(tmpPtr); + } else { + u_upload_data(sctx->b.uploader, 0, size, ptr, const_offset, + (struct pipe_resource**)rbuffer); + } +} + static void si_set_constant_buffer(struct pipe_context *ctx, uint shader, uint slot, struct pipe_constant_buffer *input) { diff --git a/src/gallium/drivers/radeonsi/si_resource.h b/src/gallium/drivers/radeonsi/si_resource.h index a76419c7b2b..37312864d06 100644 --- a/src/gallium/drivers/radeonsi/si_resource.h +++ b/src/gallium/drivers/radeonsi/si_resource.h @@ -44,10 +44,4 @@ struct si_surface { struct pipe_surface base; }; -struct si_context; - -void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuffer, - const uint8_t *ptr, unsigned size, - uint32_t *const_offset); - #endif diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index 3fe3cb80538..a4073d82574 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -199,6 +199,8 @@ void si_all_descriptors_begin_new_cs(struct si_context *sctx); void si_copy_buffer(struct si_context *sctx, struct pipe_resource *dst, struct pipe_resource *src, uint64_t dst_offset, uint64_t src_offset, unsigned size); +void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuffer, + const uint8_t *ptr, unsigned size, uint32_t *const_offset); /* si_state.c */ struct si_pipe_shader_selector; |