summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2016-07-11 10:55:18 -0700
committerEric Anholt <[email protected]>2016-07-12 17:42:40 -0700
commitab1d40b84a9812d73411f3499274a6cbf3f25373 (patch)
tree8d2ab8a70cf7b29e25d6d76ed9232081d6ebf6d8 /src
parent05bcd9dd960d5658801ab35d429ba9778f67cad0 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c1
-rw-r--r--src/gallium/drivers/vc4/vc4_screen.c13
-rw-r--r--src/gallium/drivers/vc4/vc4_screen.h1
3 files changed, 14 insertions, 1 deletions
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 *