-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vmu screen optimizations #1858
base: dev
Are you sure you want to change the base?
Vmu screen optimizations #1858
Conversation
Rebase this PR on the current dev branch. Dreamconn commits from Tails86 are unrelated and there are merge conflicts. |
I was afraid our work was going to mbe in there. First time using Git to this extent. cleaning now |
…on screen, and move VMU window in DX 11 renderer
435be2f
to
6ad179c
Compare
cc10011
to
0147cc8
Compare
ok all done and cleaned up (Thanks Tails) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test that the libretro core compiles and works properly with these changes.
core/rend/dx11/dx11_overlay.cpp
Outdated
deviceContext->OMSetBlendState(blendStates.getState(true, 8, 8), blend_factor, 0xffffffff); | ||
// Get current mouse position |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only implemented for DX11 so it shouldn't be part of this PR. Also input polling should not be done in renderers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thank you. I think i have this file put back. sorry, i had many bits, i thought i got them all, sorry.
core/rend/dx11/dx11_overlay.cpp
Outdated
} | ||
} | ||
if (crosshair) | ||
{ | ||
for (u32 i = 0; i < config::CrosshairColor.size(); i++) | ||
for (size_t i = 0; i < vmuTextures.size(); i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lightgun crosshairs and VMU displays are different things. This code shouldn't change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i am sorry, I p-ut it back
x /= config::ScreenStretching / 100.f; | ||
float halfWidth = lightgun_crosshair_size / 2.f / config::ScreenStretching * 100.f * config::RenderResolution / 480.f; | ||
float halfHeight = lightgun_crosshair_size / 2.f * config::RenderResolution / 480.f; | ||
x /= config::ScreenStretching / 100.f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid unnecessary white space changes as it makes it difficult to see the actual changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood, i will copy and move a bloc to another sheet, so when i revert i copy and paste back. or paste a few line s to undo my changes. so I am sorry, I am still learning, Ill watch spacing better.
core/rend/dx9/d3d_overlay.cpp
Outdated
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
Flycast is free software: you can redistribute it and/or modify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary white space changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i think i did it
(after i commit the changes here in the PR, i dont think it is updating this view here, so i can not verify I made the proper changes. how can i refresh these to see if i fixed thoes issues?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This view shows all commits but you haven't fixed this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
white space changes still there
core/rend/gles/gldraw.cpp
Outdated
drawGunCrosshair(i, width, height); | ||
if (config::OnlyShowVMUA1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixing up VMUs and crosshairs.
core/rend/vulkan/overlay.cpp
Outdated
@@ -129,8 +129,8 @@ void VulkanOverlay::Draw(vk::CommandBuffer commandBuffer, vk::Extent2D viewport, | |||
{ | |||
#ifndef LIBRETRO | |||
f32 vmu_padding = 8.f * scaling; | |||
f32 vmu_height = 32.f * scaling; | |||
f32 vmu_width = 48.f * scaling; | |||
f32 vmu_height = 70.f * scaling * config::VmuScreenSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why changing the default VMU height from 32 to 70?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was because every VMU was handling the size change differently (they were all different sizes when going through the renderers), but this was done to help ensure all sizes and transparencies were the same across all the renderers with the sizing and transparency features. It's not like this VMU is larger when set to normal size (1x), but if you REALLY insist, I can change it back. I just fear it will break the uniformity again. From what I see, nothing has really changed from the inital sizing, but like I said, I can do it if we need to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how more that doubling the VMU size can result in no visible size change at all.
core/rend/vulkan/overlay.cpp
Outdated
@@ -245,6 +244,8 @@ void VulkanOverlay::Draw(vk::CommandBuffer commandBuffer, vk::Extent2D viewport, | |||
}; | |||
xhairDrawer->Draw(commandBuffer, !imageViewBound ? xhairTexture->GetImageView() : vk::ImageView(), vtx, true, xhairColor); | |||
imageViewBound = true; | |||
if (config::OnlyShowVMUA1) | |||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not for crosshairs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
core/types.h
Outdated
@@ -162,6 +162,7 @@ struct settings_t | |||
float refreshRate = 0; | |||
float dpi = 96.f; | |||
float uiScale = 1.f; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary white space change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
core/ui/gui.cpp
Outdated
@@ -2294,78 +2303,113 @@ static void gui_settings_video() | |||
resLabels[i] += " (" + scalingsText[i] + ")"; | |||
} | |||
|
|||
ImGui::PushItemWidth(ImGui::CalcItemWidth() - innerSpacing * 2.0f - ImGui::GetFrameHeight() * 2.0f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary white space changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I think I got these. I wish there was a way to SEE the changes im submitting in this view, to ensure with out you having to check and resubmit the issues.
will be much more careful in future about this. i found out when i copy and paste a block , i had it set to tbs, where flycast is mixed tab/space, so things goofed up. I have resolved this .
ok reverted code back.
rmoved extra blocks out of the file. I think i fixed ym spacing issues.i obviously messed up when copying the original blocks back over when diagonosing issues, and then paste my corrected blocks... so i willtry to be mroe careful with the spacing issues.
spacing and bit fixes
removed crosshair imposter
removed final break in crosshairs section
removed whitepspcae change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok Im still getting the hang of this, seems i did the long way round here. but lets see.
core/rend/dx11/dx11_overlay.cpp
Outdated
deviceContext->OMSetBlendState(blendStates.getState(true, 8, 8), blend_factor, 0xffffffff); | ||
// Get current mouse position |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thank you. I think i have this file put back. sorry, i had many bits, i thought i got them all, sorry.
core/rend/dx11/dx11_overlay.cpp
Outdated
} | ||
} | ||
if (crosshair) | ||
{ | ||
for (u32 i = 0; i < config::CrosshairColor.size(); i++) | ||
for (size_t i = 0; i < vmuTextures.size(); i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i am sorry, I p-ut it back
x /= config::ScreenStretching / 100.f; | ||
float halfWidth = lightgun_crosshair_size / 2.f / config::ScreenStretching * 100.f * config::RenderResolution / 480.f; | ||
float halfHeight = lightgun_crosshair_size / 2.f * config::RenderResolution / 480.f; | ||
x /= config::ScreenStretching / 100.f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood, i will copy and move a bloc to another sheet, so when i revert i copy and paste back. or paste a few line s to undo my changes. so I am sorry, I am still learning, Ill watch spacing better.
core/rend/dx9/d3d_overlay.cpp
Outdated
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
Flycast is free software: you can redistribute it and/or modify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i think i did it
(after i commit the changes here in the PR, i dont think it is updating this view here, so i can not verify I made the proper changes. how can i refresh these to see if i fixed thoes issues?)
core/rend/dx9/d3d_overlay.cpp
Outdated
drawQuad(rect, color); | ||
if (config::OnlyShowVMUA1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, when i was trying to stpi the loop, i ende up in the wrong loop it seems.
core/rend/vulkan/overlay.cpp
Outdated
@@ -129,8 +129,8 @@ void VulkanOverlay::Draw(vk::CommandBuffer commandBuffer, vk::Extent2D viewport, | |||
{ | |||
#ifndef LIBRETRO | |||
f32 vmu_padding = 8.f * scaling; | |||
f32 vmu_height = 32.f * scaling; | |||
f32 vmu_width = 48.f * scaling; | |||
f32 vmu_height = 70.f * scaling * config::VmuScreenSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was because every VMU was handling the size change differently (they were all different sizes when going through the renderers), but this was done to help ensure all sizes and transparencies were the same across all the renderers with the sizing and transparency features. It's not like this VMU is larger when set to normal size (1x), but if you REALLY insist, I can change it back. I just fear it will break the uniformity again. From what I see, nothing has really changed from the inital sizing, but like I said, I can do it if we need to.
core/types.h
Outdated
@@ -162,6 +162,7 @@ struct settings_t | |||
float refreshRate = 0; | |||
float dpi = 96.f; | |||
float uiScale = 1.f; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
ok. im sorry, this is a bit of a learning curve. I will be mindful when I copy and paste blocks and lines back and forth when undoing changes, that I do not mess up spacing. I never had that issue brought to my attention before, becasue I have never done anything like this before. This whole process is brand new to me lol. it will be better next time. |
shell/libretro/option.cpp
Outdated
@@ -3,151 +3,152 @@ | |||
|
|||
This file is part of Flycast. | |||
|
|||
Flycast is free software: you can redistribute it and/or modify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary white space changes. Please fix.
shell/libretro/option.cpp
Outdated
Option<int> ScreenStretching("", 100); | ||
Option<bool> Fog(CORE_OPTION_NAME "_fog", true); | ||
Option<bool> FloatVMUs(""); | ||
Option<bool> OnlyShowVMUA1(CORE_OPTION_NAME "_only_show_vmu_a1", false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option isn't exposed in the libretro core (and it's not needed) so it's better to not give it an setting name:
Option<bool> OnlyShowVMUA1("");
} | ||
} | ||
if (crosshair) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary white space changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
white space changes still there
core/rend/dx9/d3d_overlay.cpp
Outdated
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
Flycast is free software: you can redistribute it and/or modify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This view shows all commits but you haven't fixed this part.
core/rend/gles/gldraw.cpp
Outdated
@@ -8,6 +8,9 @@ | |||
#ifdef LIBRETRO | |||
#include "postprocess.h" | |||
#include "vmu_xhair.h" | |||
// Add these global variables for the libretro build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are constants and should be marked constexpr
. And they don't need to be defined globally. Move these to where they are used (drawVmuTexture()
in the #ifdef LIBRETRO
section)
core/rend/gles/gldraw.cpp
Outdated
@@ -121,7 +124,7 @@ static TileClipping setTileClip(u32 tileclip, int clip_rect[4]) | |||
} | |||
|
|||
template <u32 Type, bool SortingEnabled> | |||
void SetGPState(const PolyParam* gp,u32 cflip=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tons and tons of unnecessary white space changes. Please fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still valid
core/rend/vulkan/overlay.cpp
Outdated
@@ -129,8 +129,8 @@ void VulkanOverlay::Draw(vk::CommandBuffer commandBuffer, vk::Extent2D viewport, | |||
{ | |||
#ifndef LIBRETRO | |||
f32 vmu_padding = 8.f * scaling; | |||
f32 vmu_height = 32.f * scaling; | |||
f32 vmu_width = 48.f * scaling; | |||
f32 vmu_height = 70.f * scaling * config::VmuScreenSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how more that doubling the VMU size can result in no visible size change at all.
ok I believe that is all back to normal for the White space changes . I have learned this lesson, and have been very acarefull in the current work im doing to avoid this. Thank you for being paitent.
fixed all white space changes
removed core option name
fixewd white space changes.
restored original size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. Again, I am still learning. I would be doing this better if there was a way to do the following, i am sure there is i jsut do not know...
When i come back thru, lets say, to fixe the white space changes, adn i edit and submit the changes right here one at a time, then i do one final "REVIEW CHANGES" is there any way to see on the compariison page, where its showing the old and the new side by side, with your comments, that i can get that page to update, to ENSURE its all done right and matching? after I make the changes and comment back, they main comparison screen will NOT reflect thoes chages. this will ensure I can verify i have done everything in less back and forths with us taking more of your time. I am still learning, sorry.
core/ui/gui.cpp
Outdated
@@ -2294,78 +2303,113 @@ static void gui_settings_video() | |||
resLabels[i] += " (" + scalingsText[i] + ")"; | |||
} | |||
|
|||
ImGui::PushItemWidth(ImGui::CalcItemWidth() - innerSpacing * 2.0f - ImGui::GetFrameHeight() * 2.0f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I think I got these. I wish there was a way to SEE the changes im submitting in this view, to ensure with out you having to check and resubmit the issues.
will be much more careful in future about this. i found out when i copy and paste a block , i had it set to tbs, where flycast is mixed tab/space, so things goofed up. I have resolved this .
REMOVED CROSSHAIR LINE, AND FIXED WHITE PSCAE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found moer fixes i didnt see needed
okr emoves the global variables from the top of the file Adds them as constexpr locals in the drawVmuTexture() function under the LIBRETRO section
re added, i might have accidently not put these back in but libretro had its own sizing and locations.
accidently removed and readded last line
fixed white space
white space changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All set I believe.
Added the ability to only render 1st VMU screen, added setting in GFX settings page.
Added the ability to change vmu screen sizes.
added ability to change transparency of VMU screens.
Settings both added in the Controls Page.
Also have DX11 renderer currently able to drage and move around the VMU screen. ( will do the other 3 after)