2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2014-02-10 19:54:46 +01:00
|
|
|
#pragma once
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2023-09-20 02:27:12 +02:00
|
|
|
#include <span>
|
|
|
|
|
2016-01-17 22:54:31 +01:00
|
|
|
#include "Common/CommonTypes.h"
|
2014-02-17 11:18:15 +01:00
|
|
|
#include "VideoCommon/ConstantManager.h"
|
2008-12-08 05:46:09 +01:00
|
|
|
|
2012-01-01 21:46:02 +01:00
|
|
|
class PointerWrap;
|
|
|
|
|
2008-12-26 11:43:18 +01:00
|
|
|
// The non-API dependent parts.
|
2022-12-27 17:42:02 +01:00
|
|
|
class PixelShaderManager final
|
2008-12-26 11:43:18 +01:00
|
|
|
{
|
2008-07-17 23:09:18 +02:00
|
|
|
public:
|
2022-12-27 17:42:02 +01:00
|
|
|
void Init();
|
|
|
|
void Dirty();
|
|
|
|
void DoState(PointerWrap& p);
|
2016-06-24 10:43:46 +02:00
|
|
|
|
2022-12-27 17:42:02 +01:00
|
|
|
void SetConstants(); // sets pixel shader constants
|
2016-06-24 10:43:46 +02:00
|
|
|
|
2014-09-17 18:46:23 +02:00
|
|
|
// constant management
|
|
|
|
// Some of these functions grab the constant values from global state,
|
|
|
|
// so make sure to call them after memory is committed
|
2022-12-27 17:42:02 +01:00
|
|
|
void SetTevColor(int index, int component, s32 value);
|
|
|
|
void SetTevKonstColor(int index, int component, s32 value);
|
|
|
|
void SetTevOrder(int index, u32 order);
|
|
|
|
void SetTevKSel(int index, u32 ksel);
|
|
|
|
void SetTevCombiner(int index, int alpha, u32 combiner);
|
|
|
|
void SetAlpha();
|
|
|
|
void SetAlphaTestChanged();
|
|
|
|
void SetDestAlphaChanged();
|
|
|
|
void SetTexDims(int texmapid, u32 width, u32 height);
|
|
|
|
void SetSamplerState(int texmapid, u32 tm0, u32 tm1);
|
|
|
|
void SetZTextureBias();
|
|
|
|
void SetViewportChanged();
|
|
|
|
void SetEfbScaleChanged(float scalex, float scaley);
|
|
|
|
void SetZSlope(float dfdx, float dfdy, float f0);
|
|
|
|
void SetIndMatrixChanged(int matrixidx);
|
|
|
|
void SetTevIndirectChanged();
|
|
|
|
void SetZTextureTypeChanged();
|
|
|
|
void SetZTextureOpChanged();
|
|
|
|
void SetIndTexScaleChanged(bool high);
|
|
|
|
void SetTexCoordChanged(u8 texmapid);
|
|
|
|
void SetFogColorChanged();
|
|
|
|
void SetFogParamChanged();
|
|
|
|
void SetFogRangeAdjustChanged();
|
|
|
|
void SetGenModeChanged();
|
|
|
|
void SetZModeControl();
|
|
|
|
void SetBlendModeChanged();
|
|
|
|
void SetBoundingBoxActive(bool active);
|
|
|
|
|
|
|
|
PixelShaderConstants constants{};
|
|
|
|
bool dirty = false;
|
|
|
|
|
2023-09-20 02:27:12 +02:00
|
|
|
// Constants for custom shaders
|
|
|
|
std::span<u8> custom_constants;
|
|
|
|
bool custom_constants_dirty = false;
|
|
|
|
|
2022-12-27 20:20:27 +01:00
|
|
|
private:
|
|
|
|
bool m_fog_range_adjusted_changed = false;
|
|
|
|
bool m_viewport_changed = false;
|
|
|
|
bool m_indirect_dirty = false;
|
|
|
|
bool m_dest_alpha_dirty = false;
|
2008-07-17 23:09:18 +02:00
|
|
|
};
|