2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2023-09-19 18:27:12 -06:00
|
|
|
#include <span>
|
|
|
|
|
2016-01-17 14:54:31 -07:00
|
|
|
#include "Common/CommonTypes.h"
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "VideoCommon/ConstantManager.h"
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2012-01-01 13:46:02 -07:00
|
|
|
class PointerWrap;
|
|
|
|
|
2008-12-26 03:43:18 -07:00
|
|
|
// The non-API dependent parts.
|
2022-12-27 09:42:02 -07:00
|
|
|
class PixelShaderManager final
|
2008-12-26 03:43:18 -07:00
|
|
|
{
|
2008-12-07 21:46:09 -07:00
|
|
|
public:
|
2022-12-27 09:42:02 -07:00
|
|
|
void Init();
|
|
|
|
void Dirty();
|
|
|
|
void DoState(PointerWrap& p);
|
2016-06-24 02:43:46 -06:00
|
|
|
|
2022-12-27 09:42:02 -07:00
|
|
|
void SetConstants(); // sets pixel shader constants
|
2016-06-24 02:43:46 -06: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 09:42:02 -07: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-19 18:27:12 -06:00
|
|
|
// Constants for custom shaders
|
|
|
|
std::span<u8> custom_constants;
|
|
|
|
bool custom_constants_dirty = false;
|
|
|
|
|
2022-12-27 12:20:27 -07: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-12-07 21:46:09 -07:00
|
|
|
};
|