diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-03-25 04:57:27 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-03-26 23:35:58 +0000 |
commit | f277bd3c228f8ee349d2f41a52adae3678ddd019 (patch) | |
tree | 7f09f6b6b82133c07eae6e3985e398b7369b4e99 /src/gallium | |
parent | 89989e653e8158b02e5db17ea34834ed67d85c37 (diff) |
panfrost: Stub out ES3 caps/callbacks
Although this is not functional (and the command stream side is not
aiming for ES3 right now), this is enough to run dEQP-GLES3 shader
tests with the version override directive; this is useful, as some ES3
shader feature can occur in ES2 class shaders due to lowering.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 44 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_screen.c | 11 |
2 files changed, 54 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 80b9512371b..fd1fa7f328b 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -2403,6 +2403,46 @@ panfrost_get_query_result(struct pipe_context *pipe, return true; } +static struct pipe_stream_output_target * +panfrost_create_stream_output_target(struct pipe_context *pctx, + struct pipe_resource *prsc, + unsigned buffer_offset, + unsigned buffer_size) +{ + struct pipe_stream_output_target *target; + + target = CALLOC_STRUCT(pipe_stream_output_target); + + if (!target) + return NULL; + + pipe_reference_init(&target->reference, 1); + pipe_resource_reference(&target->buffer, prsc); + + target->context = pctx; + target->buffer_offset = buffer_offset; + target->buffer_size = buffer_size; + + return target; +} + +static void +panfrost_stream_output_target_destroy(struct pipe_context *pctx, + struct pipe_stream_output_target *target) +{ + pipe_resource_reference(&target->buffer, NULL); + free(target); +} + +static void +panfrost_set_stream_output_targets(struct pipe_context *pctx, + unsigned num_targets, + struct pipe_stream_output_target **targets, + const unsigned *offsets) +{ + /* STUB */ +} + static void panfrost_setup_hardware(struct panfrost_context *ctx) { @@ -2507,6 +2547,10 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags) gallium->end_query = panfrost_end_query; gallium->get_query_result = panfrost_get_query_result; + gallium->create_stream_output_target = panfrost_create_stream_output_target; + gallium->stream_output_target_destroy = panfrost_stream_output_target_destroy; + gallium->set_stream_output_targets = panfrost_set_stream_output_targets; + panfrost_resource_context_init(gallium); pscreen->driver->init_context(ctx); diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 9672048bca8..45569d59535 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -111,6 +111,14 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_TEXTURE_SWIZZLE: return 1; + /* TODO: ES3. We expose these caps so we can access higher dEQP + * tests; in actuality they are nonfunctional */ + case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS: + return 4; + case PIPE_CAP_TGSI_INSTANCEID: + case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR: + return 1; + case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: @@ -285,6 +293,7 @@ panfrost_get_shader_param(struct pipe_screen *screen, return 0; case PIPE_SHADER_CAP_MAX_INSTRUCTIONS: + return 0; case PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS: case PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS: case PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS: @@ -306,7 +315,7 @@ panfrost_get_shader_param(struct pipe_screen *screen, return 16 * 1024 * sizeof(float); case PIPE_SHADER_CAP_MAX_CONST_BUFFERS: - return 1; + return 4; case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED: return 0; |