static bool
is_format_supported(struct pipe_screen *screen, enum pipe_format format,
- unsigned nr_samples, unsigned usage)
+ unsigned nr_samples, unsigned nr_storage_samples,
+ unsigned usage)
{
bool supported = screen->is_format_supported(screen, format, PIPE_TEXTURE_2D,
- nr_samples, usage);
+ nr_samples, nr_storage_samples,
+ usage);
/* for sampling, some formats can be emulated.. it doesn't matter that
* the surface will have a format that the driver can't cope with because
if (format == PIPE_FORMAT_IYUV) {
supported = screen->is_format_supported(screen, PIPE_FORMAT_R8_UNORM,
PIPE_TEXTURE_2D, nr_samples,
- usage);
+ nr_storage_samples, usage);
} else if (format == PIPE_FORMAT_NV12) {
supported = screen->is_format_supported(screen, PIPE_FORMAT_R8_UNORM,
PIPE_TEXTURE_2D, nr_samples,
- usage) &&
+ nr_storage_samples, usage) &&
screen->is_format_supported(screen, PIPE_FORMAT_R8G8_UNORM,
PIPE_TEXTURE_2D, nr_samples,
- usage);
+ nr_storage_samples, usage);
}
}
return false;
}
- if (!is_format_supported(screen, out->format, out->texture->nr_samples, usage)) {
+ if (!is_format_supported(screen, out->format, out->texture->nr_samples,
+ out->texture->nr_storage_samples, usage)) {
/* unable to specify a texture object using the specified EGL image */
pipe_resource_reference(&out->texture, NULL);
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(format not supported)", error);
stimg->texture->width0, stimg->texture->height0,
1, 0, internalFormat, texFormat);
- /* FIXME create a non-default sampler view from the stimg? */
pipe_resource_reference(&stObj->pt, stimg->texture);
st_texture_release_all_sampler_views(st, stObj);
pipe_resource_reference(&stImage->pt, stObj->pt);
+ if (st->pipe->screen->resource_changed)
+ st->pipe->screen->resource_changed(st->pipe->screen, stImage->pt);
stObj->surface_format = stimg->format;
+ stObj->level_override = stimg->level;
+ stObj->layer_override = stimg->layer;
_mesa_dirty_texobj(ctx, texObj);
}