From ab1d40b84a9812d73411f3499274a6cbf3f25373 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 11 Jul 2016 10:55:18 -0700 Subject: [PATCH] vc4: Add a flag in the screen to track control flow support. For now it's still always false, but I need it in place for kernel backwards compat support as I extend the backend for control flow. --- src/gallium/drivers/vc4/vc4_program.c | 1 + src/gallium/drivers/vc4/vc4_screen.c | 13 ++++++++++++- src/gallium/drivers/vc4/vc4_screen.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 0a231b2f6e8..dec14453203 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -1765,6 +1765,7 @@ vc4_shader_ntq(struct vc4_context *vc4, enum qstage stage, { struct vc4_compile *c = qir_compile_init(); + c->vc4 = vc4; c->stage = stage; c->shader_state = &key->shader_state->base; c->program_id = key->shader_state->program_id; diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c index 609dc913655..f60500ddec3 100644 --- a/src/gallium/drivers/vc4/vc4_screen.c +++ b/src/gallium/drivers/vc4/vc4_screen.c @@ -329,8 +329,10 @@ vc4_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader, case PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS: case PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS: return 16384; + case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH: - return 0; + return vc4_screen(pscreen)->has_control_flow; + case PIPE_SHADER_CAP_MAX_INPUTS: if (shader == PIPE_SHADER_FRAGMENT) return 8; @@ -494,6 +496,12 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen, return retval == usage; } +static bool +vc4_supports_branches(struct vc4_screen *screen) +{ + return false; +} + struct pipe_screen * vc4_screen_create(int fd) { @@ -512,6 +520,9 @@ vc4_screen_create(int fd) screen->fd = fd; list_inithead(&screen->bo_cache.time_list); + if (vc4_supports_branches(screen)) + screen->has_control_flow = true; + vc4_fence_init(screen); vc4_debug = debug_get_option_vc4_debug(); diff --git a/src/gallium/drivers/vc4/vc4_screen.h b/src/gallium/drivers/vc4/vc4_screen.h index 03f76b257e3..6cecca63bc4 100644 --- a/src/gallium/drivers/vc4/vc4_screen.h +++ b/src/gallium/drivers/vc4/vc4_screen.h @@ -75,6 +75,7 @@ struct vc4_screen { uint32_t bo_size; uint32_t bo_count; + bool has_control_flow; }; static inline struct vc4_screen * -- 2.30.2