iris: fix PIPE_RESOURCE_PARAM_STRIDE for buffers

Iris calls iris_resource_get_param with PIPE_RESOURCE_PARAM_STRIDE
internally now when exporting memory objects. OpenCL's gl_sharing allows
to export buffers as well, which do not have strides.

This fixes the assert being hit there for buffers.

Fixes: 831703157e ("iris: Use resource_get_param in resource_get_handle")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29501>
This commit is contained in:
Karol Herbst 2024-05-31 14:26:52 +02:00 committed by Marge Bot
parent 2620a7064c
commit bc149e0303

View file

@ -1680,8 +1680,12 @@ iris_resource_get_param(struct pipe_screen *pscreen,
* Also, although modifiers which use a clear color plane specify that
* the plane's pitch should be ignored, some kernels have been found to
* require 64-byte alignment.
*
* Also, for OpenCL gl_sharing we have to support exporting buffers, for
* which we report a stride of 0 here.
*/
assert(*value != 0 && (!wants_cc || *value % 64 == 0));
assert((*value != 0 || resource->target == PIPE_BUFFER) &&
(!wants_cc || *value % 64 == 0));
return true;
case PIPE_RESOURCE_PARAM_OFFSET: