I am drawing this VkImage already on my app, its already transitioned to SHADER_READ_ONLY, and so its ready to be used by skia. 100% the case, its a valid texture, and it works already. It's in the correct transition state of SHADER_READ_ONLY.
I am giving it the proper coordinates (replaced with a fill box, which paints perfectly)
none sk_draw_fill_preserve(sk a) {
SkCanvas* sk = (SkCanvas*)a->sk_canvas;
draw_state ds = (draw_state)last(a->state);
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
if (ds->blur_radius > 0.0f)
paint.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, ds->blur_radius));
paint.setColor(ds->fill_color);
paint.setAntiAlias(true);
if (ds->tx) {
GrDirectContext* direct_ctx = a->skia->ctx.get();
texture tx = ds->tx;
GrVkImageInfo vk_info = {};
vk_info.fImage = tx->vk_image; // 0x0000510000000051 (same one used successfully given to a frosted blur shader, which works
vk_info.fImageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
vk_info.fImageTiling = VK_IMAGE_TILING_OPTIMAL;
vk_info.fFormat = tx->vk_format; // VK_FORMAT_B8G8R8A8_UNORM
vk_info.fLevelCount = 1;
GrBackendTexture backendTex = GrBackendTextures::MakeVk(tx->width, tx->height, vk_info);
sk_sp<SkImage> sk_image = SkImages::BorrowTextureFrom(
direct_ctx,
backendTex,
kTopLeft_GrSurfaceOrigin,
kRGBA_8888_SkColorType,
kPremul_SkAlphaType,
nullptr
);
SkRect dst = SkRect::MakeXYWH(ds->x, ds->y, ds->w, ds->h);
SkSamplingOptions sampling(SkFilterMode::kLinear, SkMipmapMode::kNone);
//paint.setColor(SK_ColorWHITE); // <-- this works
//sk->drawRect(dst, paint); // below, we get zero result.
sk->drawImageRect(sk_image, dst, sampling, &paint);
sk_sync(); // <-- ensuring a flush here right away
} else
sk->drawPath(*(SkPath*)a->sk_path, paint);
}
Theres no Vk Validation errors to this, either. (they are enabled)
It just doesnt paint on my window like the White rectangle does in the same transform.