mirror of
https://github.com/Takiiiiiiii/strato.git
synced 2025-07-17 08:46:39 +00:00
Utilize TextureView
rather than Texture
for presentation
`PresentationEngine` and `GraphicBufferProducer` methods that utilized textures for the surface utilized the `Texture` type rather than the `TextureView` type, this was never correct but at the time of authoring this code `TextureView` was not finalized and in a major flux which is why it was not utilized and `Texture` was utilized instead. Now that is is far more stable, it has been replaced with `TextureView`.
This commit is contained in:
@ -96,9 +96,10 @@ namespace skyline::gpu {
|
||||
|
||||
frame.fence.Wait(state.soc->host1x);
|
||||
|
||||
std::scoped_lock textureLock(*frame.texture);
|
||||
if (frame.texture->format != swapchainFormat || frame.texture->dimensions != swapchainExtent)
|
||||
UpdateSwapchain(frame.texture->format, frame.texture->dimensions);
|
||||
std::scoped_lock textureLock(*frame.textureView);
|
||||
auto texture{frame.textureView->texture};
|
||||
if (frame.textureView->format != swapchainFormat || texture->dimensions != swapchainExtent)
|
||||
UpdateSwapchain(frame.textureView->format, texture->dimensions);
|
||||
|
||||
int result;
|
||||
if (frame.crop && frame.crop != windowCrop) {
|
||||
@ -131,8 +132,8 @@ namespace skyline::gpu {
|
||||
|
||||
std::ignore = gpu.vkDevice.waitForFences(*acquireFence, true, std::numeric_limits<u64>::max());
|
||||
|
||||
frame.texture->SynchronizeHost();
|
||||
images.at(nextImage.second)->CopyFrom(frame.texture, vk::ImageSubresourceRange{
|
||||
texture->SynchronizeHost();
|
||||
images.at(nextImage.second)->CopyFrom(texture, vk::ImageSubresourceRange{
|
||||
.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.levelCount = 1,
|
||||
.layerCount = 1,
|
||||
@ -373,7 +374,7 @@ namespace skyline::gpu {
|
||||
}
|
||||
}
|
||||
|
||||
u64 PresentationEngine::Present(const std::shared_ptr<Texture> &texture, i64 timestamp, i64 swapInterval, AndroidRect crop, NativeWindowScalingMode scalingMode, NativeWindowTransform transform, skyline::service::hosbinder::AndroidFence fence, const std::function<void()>& presentCallback) {
|
||||
u64 PresentationEngine::Present(const std::shared_ptr<TextureView> &texture, i64 timestamp, i64 swapInterval, AndroidRect crop, NativeWindowScalingMode scalingMode, NativeWindowTransform transform, skyline::service::hosbinder::AndroidFence fence, const std::function<void()>& presentCallback) {
|
||||
if (!vkSurface.has_value()) {
|
||||
// We want this function to generally (not necessarily always) block when a surface is not present to implicitly pause the game
|
||||
std::unique_lock lock(mutex);
|
||||
|
@ -54,7 +54,7 @@ namespace skyline::gpu {
|
||||
bool choreographerStop{}; //!< If the Choreographer thread should stop on the next ALooper_wake()
|
||||
|
||||
struct PresentableFrame {
|
||||
std::shared_ptr<Texture> texture{};
|
||||
std::shared_ptr<TextureView> textureView{};
|
||||
skyline::service::hosbinder::AndroidFence fence{}; //!< The fence that must be waited on prior to using the texture
|
||||
i64 timestamp{}; //!< The earliest timestamp (relative to ARM CPU timer) that this frame must be presented at
|
||||
i64 swapInterval{}; //!< The interval between frames in terms of 60Hz display refreshes (1/60th of a second)
|
||||
@ -120,7 +120,7 @@ namespace skyline::gpu {
|
||||
* @return The ID of this frame for correlating it with presentation timing readouts
|
||||
* @note The texture **must** be locked prior to calling this
|
||||
*/
|
||||
u64 Present(const std::shared_ptr<Texture> &texture, i64 timestamp, i64 swapInterval, service::hosbinder::AndroidRect crop, service::hosbinder::NativeWindowScalingMode scalingMode, service::hosbinder::NativeWindowTransform transform, skyline::service::hosbinder::AndroidFence fence, const std::function<void()>& presentCallback);
|
||||
u64 Present(const std::shared_ptr<TextureView> &texture, i64 timestamp, i64 swapInterval, service::hosbinder::AndroidRect crop, service::hosbinder::NativeWindowScalingMode scalingMode, service::hosbinder::NativeWindowTransform transform, skyline::service::hosbinder::AndroidFence fence, const std::function<void()>& presentCallback);
|
||||
|
||||
/**
|
||||
* @return A transform that the application should render with to elide costly transforms later
|
||||
|
Reference in New Issue
Block a user