[Mesa-dev] [PATCH] virgl: don't send a shader create with no data.

Erik Faye-Lund erik.faye-lund at collabora.com
Wed Aug 29 06:18:45 UTC 2018



On on., aug. 29, 2018 at 12:34 AM, Dave Airlie <airlied at gmail.com> 
wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> This fixes the situation where we'd send a shader with just the
> header and no data.
> 
> piglit/glsl-max-varyings test was causing this to happen, and
> the renderer fix was breaking it.
> ---
>  src/gallium/drivers/virgl/virgl_encode.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/virgl/virgl_encode.c 
> b/src/gallium/drivers/virgl/virgl_encode.c
> index b56e1f5e428..c1082791af5 100644
> --- a/src/gallium/drivers/virgl/virgl_encode.c
> +++ b/src/gallium/drivers/virgl/virgl_encode.c
> @@ -284,11 +284,12 @@ int virgl_encode_shader_state(struct 
> virgl_context *ctx,
>     while (left_bytes) {
>        uint32_t length, offlen;
>        int hdr_len = base_hdr_size + (first_pass ? strm_hdr_size : 0);
> -      if (ctx->cbuf->cdw + hdr_len + 1 > VIRGL_MAX_CMDBUF_DWORDS)
> +      if (ctx->cbuf->cdw + hdr_len + 1 >= VIRGL_MAX_CMDBUF_DWORDS)

Just a suggestion (doesn't affect the rb): You could also just remove 
the "+ 1" for the same effect, no?

>           ctx->base.flush(&ctx->base, NULL, 0);
> 
>        thispass = (VIRGL_MAX_CMDBUF_DWORDS - ctx->cbuf->cdw - hdr_len 
> - 1) * 4;
> 
> +      fprintf(stderr, "this pass is %d %d %d\n", thispass, 
> ctx->cbuf->cdw, hdr_len);

Please either drop this line, or change it to:

if (virgl_debug & VIRGL_DEBUG_VERBOSE)
   debug_printf("this pass is %d %d %d\n", thispass, ctx->cbuf->cdw, 
hdr_len);

...instead.

Otherwise we'll get spewing on stderr, which has been known to cause 
issues for some test-suite runners.

With that fixed:

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180829/e167f809/attachment.html>


More information about the mesa-dev mailing list