Skip to content

Commit

Permalink
Adding AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE to fit GLES texture re…
Browse files Browse the repository at this point in the history
…quirements
  • Loading branch information
twaik committed Mar 25, 2024
1 parent ff323da commit 9e61493
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/src/main/cpp/lorie/InitOutput.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static void lorieUpdateBuffer(void) {
d0.width = pScreenPtr->width;
d0.height = pScreenPtr->height;
d0.layers = 1;
d0.usage = USAGE;
d0.usage = USAGE | AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE;
d0.format = pvfb->root.flip
? AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM
: AHARDWAREBUFFER_FORMAT_B8G8R8A8_UNORM;
Expand Down Expand Up @@ -411,7 +411,7 @@ static inline Bool loriePixmapLock(PixmapPtr pixmap) {
}

AHardwareBuffer_describe(pvfb->root.buffer, &desc);
status = AHardwareBuffer_lock(pvfb->root.buffer, desc.usage, -1, NULL, &data);
status = AHardwareBuffer_lock(pvfb->root.buffer, USAGE, -1, NULL, &data);
pvfb->root.locked = status == 0;
if (pvfb->root.locked)
pixmap->drawable.pScreen->ModifyPixmapHeader(pixmap, desc.width, desc.height, -1, -1, desc.stride * 4, data);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/cpp/lorie/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ int renderer_init(JNIEnv* env, int* legacy_drawing, uint8_t* flip) {
.width = 64,
.height = 64,
.layers = 1,
.usage = AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN | AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN,
.usage = AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE | AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN | AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN,
.format = AHARDWAREBUFFER_FORMAT_B8G8R8A8_UNORM
};

Expand Down

0 comments on commit 9e61493

Please sign in to comment.