early-access version 2643
This commit is contained in:
parent
ec43dfdade
commit
190c6bed11
5 changed files with 22 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
yuzu emulator early access
|
yuzu emulator early access
|
||||||
=============
|
=============
|
||||||
|
|
||||||
This is the source code for early-access 2642.
|
This is the source code for early-access 2643.
|
||||||
|
|
||||||
## Legal Notice
|
## Legal Notice
|
||||||
|
|
||||||
|
|
|
@ -520,6 +520,8 @@ bool RasterizerOpenGL::AccelerateDisplay(const Tegra::FramebufferConfig& config,
|
||||||
// ASSERT_MSG(image_view->size.width == config.width, "Framebuffer width is different");
|
// ASSERT_MSG(image_view->size.width == config.width, "Framebuffer width is different");
|
||||||
// ASSERT_MSG(image_view->size.height == config.height, "Framebuffer height is different");
|
// ASSERT_MSG(image_view->size.height == config.height, "Framebuffer height is different");
|
||||||
|
|
||||||
|
screen_info.texture.width = image_view->size.width;
|
||||||
|
screen_info.texture.height = image_view->size.height;
|
||||||
screen_info.display_texture = image_view->Handle(Shader::TextureType::Color2D);
|
screen_info.display_texture = image_view->Handle(Shader::TextureType::Color2D);
|
||||||
screen_info.display_srgb = VideoCore::Surface::IsPixelFormatSRGB(image_view->format);
|
screen_info.display_srgb = VideoCore::Surface::IsPixelFormatSRGB(image_view->format);
|
||||||
return true;
|
return true;
|
||||||
|
@ -557,12 +559,19 @@ void RasterizerOpenGL::SyncViewport() {
|
||||||
const bool dirty_viewport = flags[Dirty::Viewports] || rescale_viewports;
|
const bool dirty_viewport = flags[Dirty::Viewports] || rescale_viewports;
|
||||||
const bool dirty_clip_control = flags[Dirty::ClipControl];
|
const bool dirty_clip_control = flags[Dirty::ClipControl];
|
||||||
|
|
||||||
if (dirty_clip_control || flags[Dirty::FrontFace]) {
|
if (dirty_viewport || dirty_clip_control || flags[Dirty::FrontFace]) {
|
||||||
flags[Dirty::FrontFace] = false;
|
flags[Dirty::FrontFace] = false;
|
||||||
|
|
||||||
GLenum mode = MaxwellToGL::FrontFace(regs.front_face);
|
GLenum mode = MaxwellToGL::FrontFace(regs.front_face);
|
||||||
|
bool flip_faces = false;
|
||||||
if (regs.screen_y_control.triangle_rast_flip != 0 &&
|
if (regs.screen_y_control.triangle_rast_flip != 0 &&
|
||||||
regs.viewport_transform[0].scale_y < 0.0f) {
|
regs.viewport_transform[0].scale_y < 0.0f) {
|
||||||
|
flip_faces = !flip_faces;
|
||||||
|
}
|
||||||
|
if (regs.viewport_transform[0].scale_z < 0.0f) {
|
||||||
|
flip_faces = !flip_faces;
|
||||||
|
}
|
||||||
|
if (flip_faces) {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GL_CW:
|
case GL_CW:
|
||||||
mode = GL_CCW;
|
mode = GL_CCW;
|
||||||
|
|
|
@ -208,6 +208,8 @@ void RendererOpenGL::LoadFBToScreenInfo(const Tegra::FramebufferConfig& framebuf
|
||||||
// Framebuffer orientation handling
|
// Framebuffer orientation handling
|
||||||
framebuffer_transform_flags = framebuffer.transform_flags;
|
framebuffer_transform_flags = framebuffer.transform_flags;
|
||||||
framebuffer_crop_rect = framebuffer.crop_rect;
|
framebuffer_crop_rect = framebuffer.crop_rect;
|
||||||
|
framebuffer_width = framebuffer.width;
|
||||||
|
framebuffer_height = framebuffer.height;
|
||||||
|
|
||||||
const VAddr framebuffer_addr{framebuffer.address + framebuffer.offset};
|
const VAddr framebuffer_addr{framebuffer.address + framebuffer.offset};
|
||||||
screen_info.was_accelerated =
|
screen_info.was_accelerated =
|
||||||
|
@ -480,9 +482,12 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
|
||||||
ASSERT_MSG(framebuffer_crop_rect.top == 0, "Unimplemented");
|
ASSERT_MSG(framebuffer_crop_rect.top == 0, "Unimplemented");
|
||||||
ASSERT_MSG(framebuffer_crop_rect.left == 0, "Unimplemented");
|
ASSERT_MSG(framebuffer_crop_rect.left == 0, "Unimplemented");
|
||||||
|
|
||||||
|
f32 scale_u = static_cast<f32>(framebuffer_width) / static_cast<f32>(screen_info.texture.width);
|
||||||
|
f32 scale_v =
|
||||||
|
static_cast<f32>(framebuffer_height) / static_cast<f32>(screen_info.texture.height);
|
||||||
|
|
||||||
// Scale the output by the crop width/height. This is commonly used with 1280x720 rendering
|
// Scale the output by the crop width/height. This is commonly used with 1280x720 rendering
|
||||||
// (e.g. handheld mode) on a 1920x1080 framebuffer.
|
// (e.g. handheld mode) on a 1920x1080 framebuffer.
|
||||||
f32 scale_u = 1.f, scale_v = 1.f;
|
|
||||||
if (framebuffer_crop_rect.GetWidth() > 0) {
|
if (framebuffer_crop_rect.GetWidth() > 0) {
|
||||||
scale_u = static_cast<f32>(framebuffer_crop_rect.GetWidth()) /
|
scale_u = static_cast<f32>(framebuffer_crop_rect.GetWidth()) /
|
||||||
static_cast<f32>(screen_info.texture.width);
|
static_cast<f32>(screen_info.texture.width);
|
||||||
|
|
|
@ -137,6 +137,8 @@ private:
|
||||||
/// Used for transforming the framebuffer orientation
|
/// Used for transforming the framebuffer orientation
|
||||||
Service::android::BufferTransformFlags framebuffer_transform_flags{};
|
Service::android::BufferTransformFlags framebuffer_transform_flags{};
|
||||||
Common::Rectangle<int> framebuffer_crop_rect;
|
Common::Rectangle<int> framebuffer_crop_rect;
|
||||||
|
u32 framebuffer_width;
|
||||||
|
u32 framebuffer_height;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace OpenGL
|
} // namespace OpenGL
|
||||||
|
|
|
@ -1406,8 +1406,9 @@ void VKBlitScreen::SetVertexData(BufferData& data, const Tegra::FramebufferConfi
|
||||||
UNIMPLEMENTED_IF(framebuffer_crop_rect.top != 0);
|
UNIMPLEMENTED_IF(framebuffer_crop_rect.top != 0);
|
||||||
UNIMPLEMENTED_IF(framebuffer_crop_rect.left != 0);
|
UNIMPLEMENTED_IF(framebuffer_crop_rect.left != 0);
|
||||||
|
|
||||||
f32 scale_u = 1.0f;
|
f32 scale_u = static_cast<f32>(framebuffer.width) / static_cast<f32>(screen_info.width);
|
||||||
f32 scale_v = 1.0f;
|
f32 scale_v = static_cast<f32>(framebuffer.height) / static_cast<f32>(screen_info.height);
|
||||||
|
|
||||||
// Scale the output by the crop width/height. This is commonly used with 1280x720 rendering
|
// Scale the output by the crop width/height. This is commonly used with 1280x720 rendering
|
||||||
// (e.g. handheld mode) on a 1920x1080 framebuffer.
|
// (e.g. handheld mode) on a 1920x1080 framebuffer.
|
||||||
if (!fsr) {
|
if (!fsr) {
|
||||||
|
|
Loading…
Reference in a new issue