2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-01-17 21:54:31 +00:00
|
|
|
#include <string>
|
2022-03-05 20:52:43 +00:00
|
|
|
#include <vector>
|
2016-01-17 21:54:31 +00:00
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "VideoCommon/ConstantManager.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2012-01-01 20:46:02 +00:00
|
|
|
class PointerWrap;
|
|
|
|
|
2008-12-26 10:43:18 +00:00
|
|
|
// The non-API dependent parts.
|
|
|
|
class VertexShaderManager
|
|
|
|
{
|
|
|
|
public:
|
2009-09-15 21:49:15 +00:00
|
|
|
static void Init();
|
|
|
|
static void Dirty();
|
2012-01-01 20:46:02 +00:00
|
|
|
static void DoState(PointerWrap& p);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2009-09-15 21:49:15 +00:00
|
|
|
// constant management
|
2022-03-05 20:52:43 +00:00
|
|
|
static void SetConstants(const std::vector<std::string>& textures);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2009-09-15 21:49:15 +00:00
|
|
|
static void InvalidateXFRange(int start, int end);
|
2011-02-05 18:25:34 +00:00
|
|
|
static void SetTexMatrixChangedA(u32 value);
|
|
|
|
static void SetTexMatrixChangedB(u32 value);
|
|
|
|
static void SetViewportChanged();
|
|
|
|
static void SetProjectionChanged();
|
2015-08-17 01:07:10 +00:00
|
|
|
static void SetMaterialColorChanged(int index);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2017-07-20 05:25:27 +00:00
|
|
|
static void SetVertexFormat(u32 components);
|
|
|
|
static void SetTexMatrixInfoChanged(int index);
|
|
|
|
static void SetLightingConfigChanged();
|
|
|
|
|
2015-01-23 14:15:09 +00:00
|
|
|
// data: 3 floats representing the X, Y and Z vertex model coordinates and the posmatrix index.
|
2015-01-24 20:12:52 +00:00
|
|
|
// out: 4 floats which will be initialized with the corresponding clip space coordinates
|
2014-12-25 07:34:22 +00:00
|
|
|
// NOTE: g_fProjectionMatrix must be up to date when this is called
|
2015-01-24 20:12:52 +00:00
|
|
|
// (i.e. VertexShaderManager::SetConstants needs to be called before using this!)
|
|
|
|
static void TransformToClipSpace(const float* data, float* out, u32 mtxIdx);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2013-10-07 14:02:24 +00:00
|
|
|
static VertexShaderConstants constants;
|
|
|
|
static bool dirty;
|
2008-07-17 21:09:18 +00:00
|
|
|
};
|