aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_tests.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-01-20 22:59:49 -0500
committerMarge Bot <[email protected]>2020-02-28 00:53:45 +0000
commitc9e4dc8d5e8f5e860f93eb3555a507402506b59a (patch)
tree60fe237f31934f94d67728e7d2940221b514faef /src/gallium/auxiliary/util/u_tests.c
parent6c90e39a5b854595e3bbbf30f01aaf7dc798158e (diff)
gallium: pass cso_velems_state into cso_context instead of pipe_vertex_element
This removes one memcpy from the CSO hashing code. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
Diffstat (limited to 'src/gallium/auxiliary/util/u_tests.c')
-rw-r--r--src/gallium/auxiliary/util/u_tests.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c
index 9751d9bcd6f..8ff22bccd4e 100644
--- a/src/gallium/auxiliary/util/u_tests.c
+++ b/src/gallium/auxiliary/util/u_tests.c
@@ -134,17 +134,17 @@ static void
util_set_interleaved_vertex_elements(struct cso_context *cso,
unsigned num_elements)
{
+ struct cso_velems_state velem;
unsigned i;
- struct pipe_vertex_element *velem =
- calloc(1, num_elements * sizeof(struct pipe_vertex_element));
+ memset(&velem, 0, sizeof(velem));
+ velem.count = num_elements;
for (i = 0; i < num_elements; i++) {
- velem[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
- velem[i].src_offset = i * 16;
+ velem.velems[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
+ velem.velems[i].src_offset = i * 16;
}
- cso_set_vertex_elements(cso, num_elements, velem);
- free(velem);
+ cso_set_vertex_elements(cso, &velem);
}
static void *