Commit 4c050f22 authored by Ilia Mirkin's avatar Ilia Mirkin Committed by Marge Bot

panfrost: enable DrawTransformFeedback*

This is needed for ARB_transform_feedback2, which I plan on requiring
for ES3. Also update docs/features.txt
Signed-off-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <!6247>
parent e8b3bc1d
Pipeline #196642 waiting for manual action with stages
......@@ -136,7 +136,7 @@ GL 4.0, GLSL 4.00 --- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virg
GL_ARB_texture_cube_map_array DONE (i965/gen6+, nv50, softpipe, swr, zink)
GL_ARB_texture_gather DONE (freedreno, i965/gen6+, nv50, softpipe, swr, v3d)
GL_ARB_texture_query_lod DONE (freedreno, i965, nv50, softpipe, swr, v3d, panfrost)
GL_ARB_transform_feedback2 DONE (i965/gen6+, nv50, softpipe, swr, v3d)
GL_ARB_transform_feedback2 DONE (i965/gen6+, nv50, softpipe, swr, v3d, panfrost)
GL_ARB_transform_feedback3 DONE (i965/gen7+, softpipe, swr)
......
......@@ -1271,16 +1271,16 @@ panfrost_emit_varyings(struct panfrost_batch *batch,
}
static unsigned
panfrost_streamout_offset(unsigned stride, unsigned offset,
panfrost_streamout_offset(unsigned stride,
struct pipe_stream_output_target *target)
{
return (target->buffer_offset + (offset * stride * 4)) & 63;
return (target->buffer_offset + (pan_so_target(target)->offset * stride * 4)) & 63;
}
static void
panfrost_emit_streamout(struct panfrost_batch *batch,
struct mali_attribute_buffer_packed *slot,
unsigned stride_words, unsigned offset, unsigned count,
unsigned stride_words, unsigned count,
struct pipe_stream_output_target *target)
{
unsigned stride = stride_words * 4;
......@@ -1300,7 +1300,7 @@ panfrost_emit_streamout(struct panfrost_batch *batch,
PAN_BO_ACCESS_FRAGMENT);
/* We will have an offset applied to get alignment */
mali_ptr addr = bo->gpu + target->buffer_offset + (offset * stride);
mali_ptr addr = bo->gpu + target->buffer_offset + (pan_so_target(target)->offset * stride);
pan_pack(slot, ATTRIBUTE_BUFFER, cfg) {
cfg.pointer = (addr & ~63);
......@@ -1713,7 +1713,6 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
for (unsigned i = 0; i < ctx->streamout.num_targets; ++i) {
streamout_offsets[i] = panfrost_streamout_offset(
so->stride[i],
ctx->streamout.offsets[i],
ctx->streamout.targets[i]);
}
......@@ -1749,7 +1748,6 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
for (unsigned i = 0; i < ctx->streamout.num_targets; ++i) {
panfrost_emit_streamout(batch, &varyings[xfb_base + i],
so->stride[i],
ctx->streamout.offsets[i],
out_count,
ctx->streamout.targets[i]);
}
......
......@@ -245,7 +245,7 @@ panfrost_update_streamout_offsets(struct panfrost_context *ctx)
count = u_stream_outputs_for_vertices(ctx->active_prim,
ctx->vertex_count);
ctx->streamout.offsets[i] += count;
pan_so_target(ctx->streamout.targets[i])->offset += count;
}
}
......@@ -358,7 +358,9 @@ panfrost_draw_vbo(
cfg.index_count = info->count;
} else {
ctx->offset_start = info->start;
cfg.index_count = ctx->vertex_count;
cfg.index_count = info->count_from_stream_output ?
pan_so_target(info->count_from_stream_output)->offset :
ctx->vertex_count;
}
}
......@@ -1360,7 +1362,7 @@ panfrost_create_stream_output_target(struct pipe_context *pctx,
{
struct pipe_stream_output_target *target;
target = rzalloc(pctx, struct pipe_stream_output_target);
target = &rzalloc(pctx, struct panfrost_streamout_target)->base;
if (!target)
return NULL;
......@@ -1396,7 +1398,7 @@ panfrost_set_stream_output_targets(struct pipe_context *pctx,
for (unsigned i = 0; i < num_targets; i++) {
if (offsets[i] != -1)
so->offsets[i] = offsets[i];
pan_so_target(targets[i])->offset = offsets[i];
pipe_so_target_reference(&so->targets[i], targets[i]);
}
......
......@@ -86,9 +86,13 @@ struct panfrost_fence {
bool signaled;
};
struct panfrost_streamout_target {
struct pipe_stream_output_target base;
uint32_t offset;
};
struct panfrost_streamout {
struct pipe_stream_output_target *targets[PIPE_MAX_SO_BUFFERS];
uint32_t offsets[PIPE_MAX_SO_BUFFERS];
unsigned num_targets;
};
......@@ -301,6 +305,12 @@ pan_context(struct pipe_context *pcontext)
return (struct panfrost_context *) pcontext;
}
static inline struct panfrost_streamout_target *
pan_so_target(struct pipe_stream_output_target *target)
{
return (struct panfrost_streamout_target *)target;
}
static inline struct panfrost_shader_state *
panfrost_get_shader_state(struct panfrost_context *ctx,
enum pipe_shader_type st)
......
......@@ -161,6 +161,7 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
return is_bifrost ? 0 : 64;
case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
return is_bifrost ? 0 : 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment