mesa: fix some bugs (#4475)

* mesa: fix some bugs

* fix some bugs
This commit is contained in:
X512
2020-02-18 08:53:48 +09:00
committed by GitHub
parent 2a19d241c2
commit 27efcb3690
2 changed files with 135 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ providing 3D rendering to Haiku applications."
HOMEPAGE="https://www.mesa3d.org/"
COPYRIGHT="1999-2018 Brian Paul"
LICENSE="MIT"
REVISION="5"
REVISION="6"
SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz"
CHECKSUM_SHA256="cbc0d681cc4df47d8deb5a36f45b420978128522fd665b2cd4c7096316f11bdb"
PATCHES="mesa-$portVersion.patchset"

View File

@@ -657,3 +657,137 @@ index 9f1ade6..e53dcb7 100644
--
2.19.1
From fdcea9ca68070bafb72bf4905e68b971bee6554a Mon Sep 17 00:00:00 2001
From: X512 <danger_mail@list.ru>
Date: Thu, 19 Dec 2019 03:35:55 +0900
Subject: [PATCH 2/4] Fix rendering area size
---
src/gallium/targets/haiku-softpipe/GalliumContext.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
index 0356f65..0cf1f1d 100644
--- a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
+++ b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp
@@ -376,8 +376,8 @@ GalliumContext::Validate(uint32 width, uint32 height)
return false;
}
- if (fContext[fCurrentContext]->width != width
- || fContext[fCurrentContext]->height != height) {
+ if (fContext[fCurrentContext]->width != width + 1
+ || fContext[fCurrentContext]->height != height + 1) {
Invalidate(width, height);
return false;
}
@@ -393,8 +393,8 @@ GalliumContext::Invalidate(uint32 width, uint32 height)
assert(fContext[fCurrentContext]);
// Update st_context dimensions
- fContext[fCurrentContext]->width = width;
- fContext[fCurrentContext]->height = height;
+ fContext[fCurrentContext]->width = width + 1;
+ fContext[fCurrentContext]->height = height + 1;
// Is this the best way to invalidate?
p_atomic_inc(&fContext[fCurrentContext]->read->stfbi->stamp);
--
2.24.1
From 6bd4156830ceddc56fcc5c03551b7f802b0127fd Mon Sep 17 00:00:00 2001
From: X512 <danger_mail@list.ru>
Date: Mon, 23 Dec 2019 04:01:22 +0900
Subject: [PATCH 3/4] fix CopyPixels
---
src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp b/src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp
index 4e4888a..881d226 100644
--- a/src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp
+++ b/src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp
@@ -246,7 +246,7 @@ SoftwareRenderer::CopyPixelsOut(BPoint location, BBitmap *bitmap)
d = (uint32 *)(pd + (y + (uint32)(dr.top - sr.top))
* bitmap->BytesPerRow());
d += (uint32) dr.left;
- memcpy(d, s, dr.IntegerWidth() * 4);
+ memcpy(d, s, (dr.IntegerWidth() + 1) * 4);
}
return B_OK;
@@ -288,7 +288,7 @@ SoftwareRenderer::CopyPixelsIn(BBitmap *bitmap, BPoint location)
* fBitmap->BytesPerRow());
d += (uint32) dr.left;
- memcpy(d, s, dr.IntegerWidth() * 4);
+ memcpy(d, s, (dr.IntegerWidth() + 1) * 4);
}
return B_OK;
--
2.24.1
From e9ca6f798363f2f5695e754e8e3232fbc591b9d2 Mon Sep 17 00:00:00 2001
From: X512 <danger_mail@list.ru>
Date: Mon, 23 Dec 2019 04:12:42 +0900
Subject: [PATCH 4/4] fix artifacts in SwapBuffers for BDirectWindow
---
src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp b/src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp
index 881d226..4c584c3 100644
--- a/src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp
+++ b/src/gallium/targets/haiku-softpipe/SoftwareRenderer.cpp
@@ -183,14 +183,13 @@ SoftwareRenderer::SwapBuffers(bool vsync)
int32 height = clip->bottom - clip->top + 1;
int32 bytesWidth
= (clip->right - clip->left + 1) * bytesPerPixel;
- bytesWidth -= bytesPerPixel;
uint8 *p = (uint8 *)fInfo->bits + clip->top
* fInfo->bytes_per_row + clip->left * bytesPerPixel;
uint8 *b = (uint8 *)fBitmap->Bits()
+ (clip->top - fInfo->window_bounds.top) * bytesPerRow
+ (clip->left - fInfo->window_bounds.left) * bytesPerPixel;
- for (int y = 0; y < height - 1; y++) {
+ for (int y = 0; y < height; y++) {
memcpy(p, b, bytesWidth);
p += fInfo->bytes_per_row;
b += bytesPerRow;
--
2.24.1
From b3449b964046378676cd6251ab9d937041c86497 Mon Sep 17 00:00:00 2001
From: X512 <danger_mail@list.ru>
Date: Mon, 23 Dec 2019 04:33:43 +0900
Subject: [PATCH 5/5] Remove LockGL/UnlockGL in BGLView::FrameResized. Fixes
deadlocks.
---
src/hgl/GLView.cpp | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/hgl/GLView.cpp b/src/hgl/GLView.cpp
index 9e01dcc..71c4873 100644
--- a/src/hgl/GLView.cpp
+++ b/src/hgl/GLView.cpp
@@ -260,12 +260,10 @@ BGLView::FrameResized(float width, float height)
v->ConvertToParent(&fBounds);
if (fRenderer) {
- LockGL();
_LockDraw();
_CallDirectConnected();
fRenderer->FrameResized(width, height);
_UnlockDraw();
- UnlockGL();
}
BView::FrameResized(width, height);
--
2.24.1