diff options
author | Michel Dänzer <[email protected]> | 2014-08-28 11:12:20 +0900 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2014-08-29 12:15:10 +0900 |
commit | 6cd0dbc415dd092a72a8941c45ba812b9fe74b24 (patch) | |
tree | 8724e38825301c63ea643bbac78e70234d11dc51 /src/gallium/auxiliary/util | |
parent | 2a99b6e40f7a083797435fd46b0fa885759d92cb (diff) |
u_vbuf: Make sure all caps are initialized
Pointed out by valgrind.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83148
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_vbuf.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c index 4bee8998f8d..650df9f6aef 100644 --- a/src/gallium/auxiliary/util/u_vbuf.c +++ b/src/gallium/auxiliary/util/u_vbuf.c @@ -279,30 +279,22 @@ boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps) } } - if (!screen->get_param(screen, - PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY)) { - caps->buffer_offset_unaligned = TRUE; - } else { - fallback = TRUE; - } - - if (!screen->get_param(screen, - PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY)) { - caps->buffer_stride_unaligned = TRUE; - } else { - fallback = TRUE; - } - - if (!screen->get_param(screen, - PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY)) { - caps->velem_src_offset_unaligned = TRUE; - } else { - fallback = TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_USER_VERTEX_BUFFERS)) { - caps->user_vertex_buffers = TRUE; - } else { + caps->buffer_offset_unaligned = + !screen->get_param(screen, + PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY); + caps->buffer_stride_unaligned = + !screen->get_param(screen, + PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY); + caps->velem_src_offset_unaligned = + !screen->get_param(screen, + PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY); + caps->user_vertex_buffers = + screen->get_param(screen, PIPE_CAP_USER_VERTEX_BUFFERS); + + if (!caps->buffer_offset_unaligned || + !caps->buffer_stride_unaligned || + !caps->velem_src_offset_unaligned || + !caps->user_vertex_buffers) { fallback = TRUE; } |