GSP: Update framebuffer information when necessary.

This commit is contained in:
Tony Wasserka 2014-08-19 20:57:43 +02:00
parent 590c206ac8
commit 14b24a75b3
2 changed files with 41 additions and 2 deletions

View file

@ -4,6 +4,8 @@
#pragma once
#include <cstddef>
#include "common/bit_field.h"
#include "core/hle/service/service.h"
@ -76,6 +78,22 @@ struct FrameBufferInfo {
};
static_assert(sizeof(FrameBufferInfo) == 0x1c, "Struct has incorrect size");
struct FrameBufferUpdate {
BitField<0, 1, u8> index; // Index used for GSP::SetBufferSwap
BitField<0, 1, u8> is_dirty; // true if GSP should update GPU framebuffer registers
u16 pad1;
FrameBufferInfo framebuffer_info[2];
u32 pad2;
};
static_assert(sizeof(FrameBufferUpdate) == 0x40, "Struct has incorrect size");
// TODO: Not sure if this padding is correct.
// Chances are the second block is stored at offset 0x24 rather than 0x20.
#ifndef _MSC_VER
static_assert(offsetof(FrameBufferUpdate, framebuffer_info[1]) == 0x20, "FrameBufferInfo element has incorrect alignment");
#endif
/// GSP command
struct Command {
BitField<0, 8, CommandId> id;