| 91 | return false; |
| 92 | } |
| 93 | static bool on_update_texture(device *device, const subresource_data &data, resource dst, uint32_t dst_subresource, const subresource_box *dst_box) |
| 94 | { |
| 95 | if (dst_subresource != 0) |
| 96 | return false; // Ignore updates to mipmap levels other than the base level |
| 97 | |
| 98 | const resource_desc dest_desc = device->get_resource_desc(dst); |
| 99 | if (!filter_texture(device, dest_desc, dst_box)) |
| 100 | return false; |
| 101 | |
| 102 | subresource_data new_data = data; |
| 103 | if (load_texture_image(dest_desc, new_data, s_data_to_delete)) |
| 104 | { |
| 105 | // Update texture with the new data |
| 106 | device->update_texture_region(new_data, dst, dst_subresource, dst_box); |
| 107 | |
| 108 | // Free the memory allocated via the 'load_texture_image' call above |
| 109 | s_data_to_delete.clear(); |
| 110 | |
| 111 | return true; // Texture was already updated now, so skip the original update command from the application |
| 112 | } |
| 113 | |
| 114 | return false; |
| 115 | } |
| 116 | |
| 117 | // Keep track of current resource between 'map_resource' and 'unmap_resource' event invocations |
| 118 | // It's also thread-local, for similar reasons as 's_data_to_delete' above, just that the two events that could interact with multiple threads here are 'map_texture_region' and 'unmap_texture_region'. |
nothing calls this directly
no test coverage detected