diff options
author | Marek Olšák <[email protected]> | 2019-12-29 22:02:28 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2020-01-08 13:40:59 -0500 |
commit | ce648b913f83b968eb6ba1ad33fdcf86d5942fe5 (patch) | |
tree | 96f88ed059e9037a89c69b076efbe3b2b781c6a5 /src/gallium/auxiliary/util/u_vbuf.c | |
parent | 472593e9cfcb8d5b49d2475ee677700584583812 (diff) |
gallium: put u_vbuf_get_caps return values into u_vbuf_caps
Acked-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_vbuf.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_vbuf.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c index 8d50092b4c4..9bed8d45230 100644 --- a/src/gallium/auxiliary/util/u_vbuf.c +++ b/src/gallium/auxiliary/util/u_vbuf.c @@ -255,11 +255,11 @@ static const struct { { PIPE_FORMAT_R8G8B8A8_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT }, }; -boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps, - unsigned flags) +void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps) { unsigned i; - boolean fallback = FALSE; + + memset(caps, 0, sizeof(*caps)); /* I'd rather have a bitfield of which formats are supported and a static * table of the translations indexed by format, but since we don't have C99 @@ -275,7 +275,7 @@ boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps, if (!screen->is_format_supported(screen, format, PIPE_BUFFER, 0, 0, PIPE_BIND_VERTEX_BUFFER)) { caps->format_translation[format] = vbuf_format_fallbacks[i].to; - fallback = TRUE; + caps->fallback_always = true; } } @@ -295,16 +295,15 @@ boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps, /* OpenGL 2.0 requires a minimum of 16 vertex buffers */ if (caps->max_vertex_buffers < 16) - fallback = TRUE; + caps->fallback_always = true; if (!caps->buffer_offset_unaligned || !caps->buffer_stride_unaligned || - !caps->velem_src_offset_unaligned || - (!(flags & U_VBUF_FLAG_NO_USER_VBOS) && !caps->user_vertex_buffers)) { - fallback = TRUE; - } + !caps->velem_src_offset_unaligned) + caps->fallback_always = true; - return fallback; + if (!caps->fallback_always && !caps->user_vertex_buffers) + caps->fallback_only_for_user_vbuffers = true; } struct u_vbuf * |