swr: support NULL-resources
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 6 Mar 2019 12:28:51 +0000 (13:28 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 29 Apr 2019 10:28:38 +0000 (10:28 +0000)
commitef13691e0c07d909a4f14280ca4fefbd79a9865b
tree784630d6eb769603a6592efd05dc0c0b4dfa8290
parent04b0c6e9df718ff0f4d9f74c2a7142de44b0eb97
swr: support NULL-resources

It's legal for a buffer-object to have a NULL-resource, but let's just
skip over it, as there's nothing to do.

This patch switches the order of the conditionals in swr_update_derived,
so the logic becomes a bit more straight forward:

if (is_user_buffer)
   ...
else if (resource)
   ...
else
   ...

...instead of this:

if (!is_user_buffer)
   if (resource)
      ...
   else
      ...
else
   ...

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Alok Hota <alok.hota@intel.com>
src/gallium/drivers/swr/swr_state.cpp