mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
Improve SwapBuffers a bit.
This commit is contained in:
parent
c95557f48b
commit
99878298da
1 changed files with 25 additions and 12 deletions
|
|
@ -49,6 +49,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include "nouveau_tex.h"
|
#include "nouveau_tex.h"
|
||||||
#include "nouveau_msg.h"
|
#include "nouveau_msg.h"
|
||||||
#include "nouveau_reg.h"
|
#include "nouveau_reg.h"
|
||||||
|
#include "nouveau_lock.h"
|
||||||
#include "nv10_swtcl.h"
|
#include "nv10_swtcl.h"
|
||||||
|
|
||||||
#include "vblank.h"
|
#include "vblank.h"
|
||||||
|
|
@ -303,6 +304,8 @@ static void nouveauDoSwapBuffers(nouveauContextPtr nmesa,
|
||||||
{
|
{
|
||||||
struct gl_framebuffer *fb;
|
struct gl_framebuffer *fb;
|
||||||
nouveau_renderbuffer *src, *dst;
|
nouveau_renderbuffer *src, *dst;
|
||||||
|
drm_clip_rect_t *box;
|
||||||
|
int nbox, i;
|
||||||
|
|
||||||
fb = (struct gl_framebuffer *)dPriv->driverPrivate;
|
fb = (struct gl_framebuffer *)dPriv->driverPrivate;
|
||||||
dst = (nouveau_renderbuffer*)
|
dst = (nouveau_renderbuffer*)
|
||||||
|
|
@ -311,19 +314,29 @@ static void nouveauDoSwapBuffers(nouveauContextPtr nmesa,
|
||||||
fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
|
fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
|
||||||
|
|
||||||
#ifdef ALLOW_MULTI_SUBCHANNEL
|
#ifdef ALLOW_MULTI_SUBCHANNEL
|
||||||
/* Ignore this.. it's a hack to test double-buffering, and not how
|
LOCK_HARDWARE(nmesa);
|
||||||
* SwapBuffers should look :)
|
nbox = dPriv->numClipRects;
|
||||||
*/
|
box = dPriv->pClipRects;
|
||||||
BEGIN_RING_SIZE(NvSubCtxSurf2D, NV10_CONTEXT_SURFACES_2D_FORMAT, 4);
|
|
||||||
OUT_RING (6); /* X8R8G8B8 */
|
|
||||||
OUT_RING ((dst->pitch << 16) | src->pitch);
|
|
||||||
OUT_RING (src->offset);
|
|
||||||
OUT_RING (dst->offset);
|
|
||||||
|
|
||||||
BEGIN_RING_SIZE(NvSubImageBlit, NV10_IMAGE_BLIT_SET_POINT, 3);
|
if (nbox) {
|
||||||
OUT_RING ((0 << 16) | 0); /* src point */
|
BEGIN_RING_SIZE(NvSubCtxSurf2D,
|
||||||
OUT_RING ((0 << 16) | 0); /* dst point */
|
NV10_CONTEXT_SURFACES_2D_FORMAT, 4);
|
||||||
OUT_RING ((fb->Height << 16) | fb->Width); /* width/height */
|
OUT_RING (6); /* X8R8G8B8 */
|
||||||
|
OUT_RING ((dst->pitch << 16) | src->pitch);
|
||||||
|
OUT_RING (src->offset);
|
||||||
|
OUT_RING (dst->offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i=0; i<nbox; i++, box++) {
|
||||||
|
BEGIN_RING_SIZE(NvSubImageBlit, NV10_IMAGE_BLIT_SET_POINT, 3);
|
||||||
|
OUT_RING (((box->y1 - dPriv->y) << 16) |
|
||||||
|
(box->x1 - dPriv->x));
|
||||||
|
OUT_RING ((box->y1 << 16) | box->x1);
|
||||||
|
OUT_RING (((box->y2 - box->y1) << 16) |
|
||||||
|
(box->x2 - box->x1));
|
||||||
|
}
|
||||||
|
|
||||||
|
UNLOCK_HARDWARE(nmesa);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue