Merge pull request #671 from fuzeofficlal/fix/copyresource-cpu-texture-source
GPU: upload CPU-written textures before full and region copies
This commit is contained in:
commit
778b512619
1 file changed
+6
@@ -446,6 +446,9 @@ extern "system" fn copy_resource(this: This, dst: This, src: This) {
|
|||||||
crate::resource::host_resource(dst),
|
crate::resource::host_resource(dst),
|
||||||
crate::resource::host_resource(src),
|
crate::resource::host_resource(src),
|
||||||
) {
|
) {
|
||||||
|
if crate::texture::title_written(from) {
|
||||||
|
crate::texture::upload(list, src, from);
|
||||||
|
}
|
||||||
ensure_state(list, dst, COPY_DEST);
|
ensure_state(list, dst, COPY_DEST);
|
||||||
ensure_state(list, src, COPY_SOURCE);
|
ensure_state(list, src, COPY_SOURCE);
|
||||||
crate::texture::host_written(dst);
|
crate::texture::host_written(dst);
|
||||||
@@ -535,6 +538,9 @@ extern "system" fn copy_texture_region(
|
|||||||
let Some(texture) = crate::resource::host_resource(src.resource) else {
|
let Some(texture) = crate::resource::host_resource(src.resource) else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
if crate::texture::title_written(texture) {
|
||||||
|
crate::texture::upload(list, src.resource, texture);
|
||||||
|
}
|
||||||
ensure_state(list, src.resource, COPY_SOURCE);
|
ensure_state(list, src.resource, COPY_SOURCE);
|
||||||
from.resource = texture.as_raw().cast_const().cast();
|
from.resource = texture.as_raw().cast_const().cast();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user