This commit is contained in:
2025-01-12 07:52:13 -06:00
parent 58cf983e5e
commit a7f7015212
2 changed files with 4 additions and 3 deletions

View File

@@ -959,7 +959,7 @@ function calc_image_size(img)
return [img.texture.width*img.rect.width, img.texture.height*img.rect.height];
}
render.tile = function tile(image, rect = [0,0], color = Color.white)
function tile(image, rect = [0,0], color = Color.white)
{
if (!image) throw Error ('Need an image to render.')
if (typeof image === "string")

View File

@@ -3454,6 +3454,7 @@ switch (sfmt) {
case SDL_PIXELFORMAT_XRGB8888:
case SDL_PIXELFORMAT_XBGR8888:
chosen_format = SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM;
break;
case SDL_PIXELFORMAT_RGBA4444:
case SDL_PIXELFORMAT_ABGR4444:
@@ -4209,7 +4210,7 @@ JSC_CCALL(gpu_upload,
return JS_ThrowReferenceError(js, "Failed to begin copy pass");
}
void *mapped_data = SDL_MapGPUTransferBuffer(gpu, transfer, true);
void *mapped_data = SDL_MapGPUTransferBuffer(gpu, transfer, false);
if (!mapped_data) {
SDL_EndGPUCopyPass(copy_pass);
free(items);
@@ -4239,7 +4240,7 @@ JSC_CCALL(gpu_upload,
.offset = 0,
.size = items[i].size
},
true
false
);
current_offset += items[i].size;
}