diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-06-26 15:59:29 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-06-28 15:09:07 -0700 |
commit | 7f5481258c5ba606a2169c370cf84fd528705751 (patch) | |
tree | 44c23d52cf8d67954df2abbe46668f00dac3cdf0 /src | |
parent | 804d1bd111fdb5f3cf49959a0122b547a231b0f3 (diff) |
panfrost: Implement primitive restart
For GLES3, just pass the flag through.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index be800ca6ce1..0dfdaf1c8b6 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -37,6 +37,7 @@ #include "util/half_float.h" #include "util/u_helpers.h" #include "util/u_format.h" +#include "util/u_prim_restart.h" #include "indices/u_primconvert.h" #include "tgsi/tgsi_parse.h" #include "util/u_math.h" @@ -1631,6 +1632,15 @@ panfrost_draw_vbo( int mode = info->mode; + /* Fallback unsupported restart index */ + unsigned primitive_index = (1 << (info->index_size * 8)) - 1; + + if (info->primitive_restart && info->index_size + && info->restart_index != primitive_index) { + util_draw_vbo_without_prim_restart(pipe, info); + return; + } + /* Fallback for unsupported modes */ if (!(ctx->draw_modes & (1 << mode))) { @@ -1667,6 +1677,9 @@ panfrost_draw_vbo( if (panfrost_writes_point_size(ctx)) draw_flags |= MALI_DRAW_VARYING_SIZE; + if (info->primitive_restart) + draw_flags |= MALI_DRAW_PRIMITIVE_RESTART_FIXED_INDEX; + /* For higher amounts of vertices (greater than what fits in a 16-bit * short), the other value is needed, otherwise there will be bizarre * rendering artefacts. It's not clear what these values mean yet. */ |