R-b

On 20 Sep. 2017 22:07, "Samuel Pitoiset" <samuel.pitoi...@gmail.com> wrote:

> The number of viewports/scissors can only be specified at pipeline
> creation time, so make sure to copy them when binding a new one
> because the dynamic state is cleared in BeginCommandBuffer().
>
> Fixes: dcf46e995d ("radv: do not update the number of scissors in
> vkCmdSetScissor()")
> Fixes: 60878dd00c ("radv: do not update the number of viewports in
> vkCmdSetViewport()")
> Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
> ---
>  src/amd/vulkan/radv_cmd_buffer.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_
> buffer.c
> index 0c3a5c6ffc..78b235fa22 100644
> --- a/src/amd/vulkan/radv_cmd_buffer.c
> +++ b/src/amd/vulkan/radv_cmd_buffer.c
> @@ -83,14 +83,18 @@ radv_dynamic_state_copy(struct radv_dynamic_state
> *dest,
>                         const struct radv_dynamic_state *src,
>                         uint32_t copy_mask)
>  {
> +       /* Make sure to copy the number of viewports/scissors because they
> can
> +        * only be specified at pipeline creation time.
> +        */
> +       dest->viewport.count = src->viewport.count;
> +       dest->scissor.count = src->scissor.count;
> +
>         if (copy_mask & (1 << VK_DYNAMIC_STATE_VIEWPORT)) {
> -               dest->viewport.count = src->viewport.count;
>                 typed_memcpy(dest->viewport.viewports,
> src->viewport.viewports,
>                              src->viewport.count);
>         }
>
>         if (copy_mask & (1 << VK_DYNAMIC_STATE_SCISSOR)) {
> -               dest->scissor.count = src->scissor.count;
>                 typed_memcpy(dest->scissor.scissors,
> src->scissor.scissors,
>                              src->scissor.count);
>         }
> --
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to