[GPU] Move gamma ramp tracking to CommandProcessor.
This commit is contained in:
@@ -58,6 +58,50 @@ enum class SwapMode {
|
||||
kIgnored,
|
||||
};
|
||||
|
||||
enum class GammaRampType {
|
||||
kUnknown = 0,
|
||||
kNormal,
|
||||
kPWL,
|
||||
};
|
||||
|
||||
struct GammaRamp {
|
||||
struct NormalEntry {
|
||||
union {
|
||||
struct {
|
||||
uint32_t r : 10;
|
||||
uint32_t g : 10;
|
||||
uint32_t b : 10;
|
||||
uint32_t : 2;
|
||||
};
|
||||
uint32_t value;
|
||||
};
|
||||
};
|
||||
|
||||
struct PWLValue {
|
||||
union {
|
||||
struct {
|
||||
uint16_t base;
|
||||
uint16_t delta;
|
||||
};
|
||||
uint32_t value;
|
||||
};
|
||||
};
|
||||
|
||||
struct PWLEntry {
|
||||
union {
|
||||
struct {
|
||||
PWLValue r;
|
||||
PWLValue g;
|
||||
PWLValue b;
|
||||
};
|
||||
PWLValue values[3];
|
||||
};
|
||||
};
|
||||
|
||||
NormalEntry normal[256];
|
||||
PWLEntry pwl[256];
|
||||
};
|
||||
|
||||
class CommandProcessor {
|
||||
public:
|
||||
CommandProcessor(GraphicsSystem* graphics_system,
|
||||
@@ -119,6 +163,8 @@ class CommandProcessor {
|
||||
|
||||
virtual void WriteRegister(uint32_t index, uint32_t value);
|
||||
|
||||
void UpdateGammaRampValue(GammaRampType type, uint32_t value);
|
||||
|
||||
virtual void MakeCoherent();
|
||||
virtual void PrepareForWait();
|
||||
virtual void ReturnFromWait();
|
||||
@@ -237,6 +283,10 @@ class CommandProcessor {
|
||||
Shader* active_pixel_shader_ = nullptr;
|
||||
|
||||
bool paused_ = false;
|
||||
|
||||
GammaRamp gamma_ramp_ = {};
|
||||
int gamma_ramp_rw_subindex_ = 0;
|
||||
bool dirty_gamma_ramp_ = true;
|
||||
};
|
||||
|
||||
} // namespace gpu
|
||||
|
||||
Reference in New Issue
Block a user