2018-02-12 02:34:20 +00:00
|
|
|
// Copyright 2018 yuzu Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-03-17 03:06:24 +00:00
|
|
|
#include <array>
|
2019-02-26 06:01:48 +00:00
|
|
|
#include <bitset>
|
2021-09-30 20:11:47 +00:00
|
|
|
#include <cmath>
|
2019-12-27 01:14:10 +00:00
|
|
|
#include <limits>
|
2019-11-26 21:52:15 +00:00
|
|
|
#include <optional>
|
2019-05-14 12:41:51 +00:00
|
|
|
#include <type_traits>
|
2018-03-17 01:32:44 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
#include <vector>
|
2019-02-26 06:01:48 +00:00
|
|
|
|
2018-03-22 23:47:28 +00:00
|
|
|
#include "common/assert.h"
|
2018-02-12 17:34:41 +00:00
|
|
|
#include "common/bit_field.h"
|
|
|
|
#include "common/common_funcs.h"
|
2018-02-12 02:34:20 +00:00
|
|
|
#include "common/common_types.h"
|
2018-03-27 00:45:10 +00:00
|
|
|
#include "common/math_util.h"
|
2019-09-25 13:53:18 +00:00
|
|
|
#include "video_core/engines/const_buffer_info.h"
|
2020-04-28 01:47:58 +00:00
|
|
|
#include "video_core/engines/engine_interface.h"
|
2019-04-22 23:27:36 +00:00
|
|
|
#include "video_core/engines/engine_upload.h"
|
2018-03-24 04:45:24 +00:00
|
|
|
#include "video_core/gpu.h"
|
2020-05-29 04:53:27 +00:00
|
|
|
#include "video_core/macro/macro.h"
|
2018-03-23 23:56:27 +00:00
|
|
|
#include "video_core/textures/texture.h"
|
2018-02-12 02:34:20 +00:00
|
|
|
|
2019-02-16 03:05:17 +00:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2019-04-05 22:21:15 +00:00
|
|
|
namespace Tegra {
|
|
|
|
class MemoryManager;
|
|
|
|
}
|
|
|
|
|
2018-08-03 16:55:58 +00:00
|
|
|
namespace VideoCore {
|
|
|
|
class RasterizerInterface;
|
|
|
|
}
|
|
|
|
|
2018-07-20 22:14:17 +00:00
|
|
|
namespace Tegra::Engines {
|
2018-02-12 02:34:20 +00:00
|
|
|
|
2019-04-23 12:44:52 +00:00
|
|
|
/**
|
|
|
|
* This Engine is known as GF100_3D. Documentation can be found in:
|
|
|
|
* https://github.com/envytools/envytools/blob/master/rnndb/graph/gf100_3d.xml
|
|
|
|
* https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/nvc0/nvc0_3d.xml.h
|
|
|
|
*/
|
|
|
|
|
2018-04-14 03:13:47 +00:00
|
|
|
#define MAXWELL3D_REG_INDEX(field_name) \
|
|
|
|
(offsetof(Tegra::Engines::Maxwell3D::Regs, field_name) / sizeof(u32))
|
|
|
|
|
2021-02-16 23:52:12 +00:00
|
|
|
class Maxwell3D final : public EngineInterface {
|
2018-02-12 04:44:12 +00:00
|
|
|
public:
|
2020-06-11 03:58:57 +00:00
|
|
|
explicit Maxwell3D(Core::System& system, MemoryManager& memory_manager);
|
|
|
|
~Maxwell3D();
|
|
|
|
|
|
|
|
/// Binds a rasterizer to this engine.
|
2021-01-05 07:09:39 +00:00
|
|
|
void BindRasterizer(VideoCore::RasterizerInterface* rasterizer);
|
2018-02-12 02:34:20 +00:00
|
|
|
|
2018-02-12 17:34:41 +00:00
|
|
|
/// Register structure of the Maxwell3D engine.
|
|
|
|
/// TODO(Subv): This structure will need to be made bigger as more registers are discovered.
|
|
|
|
struct Regs {
|
2018-09-15 13:21:06 +00:00
|
|
|
static constexpr std::size_t NUM_REGS = 0xE00;
|
|
|
|
|
|
|
|
static constexpr std::size_t NumRenderTargets = 8;
|
|
|
|
static constexpr std::size_t NumViewports = 16;
|
|
|
|
static constexpr std::size_t NumCBData = 16;
|
|
|
|
static constexpr std::size_t NumVertexArrays = 32;
|
|
|
|
static constexpr std::size_t NumVertexAttributes = 32;
|
2019-04-30 03:09:51 +00:00
|
|
|
static constexpr std::size_t NumVaryings = 31;
|
2019-07-12 05:01:27 +00:00
|
|
|
static constexpr std::size_t NumImages = 8; // TODO(Rodrigo): Investigate this number
|
2018-11-29 19:13:13 +00:00
|
|
|
static constexpr std::size_t NumClipDistances = 8;
|
2020-03-02 04:54:00 +00:00
|
|
|
static constexpr std::size_t NumTransformFeedbackBuffers = 4;
|
2018-09-15 13:21:06 +00:00
|
|
|
static constexpr std::size_t MaxShaderProgram = 6;
|
|
|
|
static constexpr std::size_t MaxShaderStage = 5;
|
2018-03-17 22:06:23 +00:00
|
|
|
// Maximum number of const buffers per shader stage.
|
2018-09-15 13:21:06 +00:00
|
|
|
static constexpr std::size_t MaxConstBuffers = 18;
|
2019-07-06 02:11:58 +00:00
|
|
|
static constexpr std::size_t MaxConstBufferSize = 0x10000;
|
2018-03-17 03:47:45 +00:00
|
|
|
|
2020-01-28 02:48:15 +00:00
|
|
|
enum class QueryOperation : u32 {
|
|
|
|
Release = 0,
|
|
|
|
Acquire = 1,
|
|
|
|
Counter = 2,
|
|
|
|
Trap = 3,
|
2018-04-23 22:06:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum class QueryUnit : u32 {
|
|
|
|
VFetch = 1,
|
|
|
|
VP = 2,
|
|
|
|
Rast = 4,
|
|
|
|
StrmOut = 5,
|
|
|
|
GP = 6,
|
|
|
|
ZCull = 7,
|
|
|
|
Prop = 10,
|
|
|
|
Crop = 15,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class QuerySelect : u32 {
|
|
|
|
Zero = 0,
|
2019-07-01 02:21:28 +00:00
|
|
|
TimeElapsed = 2,
|
|
|
|
TransformFeedbackPrimitivesGenerated = 11,
|
|
|
|
PrimitivesGenerated = 18,
|
|
|
|
SamplesPassed = 21,
|
|
|
|
TransformFeedbackUnknown = 26,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct QueryCompare {
|
|
|
|
u32 initial_sequence;
|
|
|
|
u32 initial_mode;
|
|
|
|
u32 unknown1;
|
|
|
|
u32 unknown2;
|
|
|
|
u32 current_sequence;
|
|
|
|
u32 current_mode;
|
2018-04-23 22:06:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum class QuerySyncCondition : u32 {
|
|
|
|
NotEqual = 0,
|
|
|
|
GreaterThan = 1,
|
2018-02-12 17:34:41 +00:00
|
|
|
};
|
|
|
|
|
2019-07-01 02:21:28 +00:00
|
|
|
enum class ConditionMode : u32 {
|
|
|
|
Never = 0,
|
|
|
|
Always = 1,
|
|
|
|
ResNonZero = 2,
|
|
|
|
Equal = 3,
|
|
|
|
NotEqual = 4,
|
|
|
|
};
|
|
|
|
|
2018-03-17 00:23:11 +00:00
|
|
|
enum class ShaderProgram : u32 {
|
|
|
|
VertexA = 0,
|
|
|
|
VertexB = 1,
|
|
|
|
TesselationControl = 2,
|
|
|
|
TesselationEval = 3,
|
|
|
|
Geometry = 4,
|
|
|
|
Fragment = 5,
|
|
|
|
};
|
|
|
|
|
2018-03-24 20:26:14 +00:00
|
|
|
struct VertexAttribute {
|
|
|
|
enum class Size : u32 {
|
2018-08-12 01:36:40 +00:00
|
|
|
Invalid = 0x0,
|
2018-03-24 20:26:14 +00:00
|
|
|
Size_32_32_32_32 = 0x01,
|
|
|
|
Size_32_32_32 = 0x02,
|
|
|
|
Size_16_16_16_16 = 0x03,
|
|
|
|
Size_32_32 = 0x04,
|
|
|
|
Size_16_16_16 = 0x05,
|
|
|
|
Size_8_8_8_8 = 0x0a,
|
|
|
|
Size_16_16 = 0x0f,
|
|
|
|
Size_32 = 0x12,
|
|
|
|
Size_8_8_8 = 0x13,
|
|
|
|
Size_8_8 = 0x18,
|
|
|
|
Size_16 = 0x1b,
|
|
|
|
Size_8 = 0x1d,
|
|
|
|
Size_10_10_10_2 = 0x30,
|
|
|
|
Size_11_11_10 = 0x31,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class Type : u32 {
|
|
|
|
SignedNorm = 1,
|
|
|
|
UnsignedNorm = 2,
|
|
|
|
SignedInt = 3,
|
|
|
|
UnsignedInt = 4,
|
|
|
|
UnsignedScaled = 5,
|
|
|
|
SignedScaled = 6,
|
|
|
|
Float = 7,
|
|
|
|
};
|
|
|
|
|
|
|
|
union {
|
|
|
|
BitField<0, 5, u32> buffer;
|
|
|
|
BitField<6, 1, u32> constant;
|
|
|
|
BitField<7, 14, u32> offset;
|
|
|
|
BitField<21, 6, Size> size;
|
|
|
|
BitField<27, 3, Type> type;
|
|
|
|
BitField<31, 1, u32> bgra;
|
2018-09-05 09:36:50 +00:00
|
|
|
u32 hex;
|
2018-03-24 20:26:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
u32 ComponentCount() const {
|
|
|
|
switch (size) {
|
|
|
|
case Size::Size_32_32_32_32:
|
|
|
|
return 4;
|
|
|
|
case Size::Size_32_32_32:
|
|
|
|
return 3;
|
|
|
|
case Size::Size_16_16_16_16:
|
|
|
|
return 4;
|
|
|
|
case Size::Size_32_32:
|
|
|
|
return 2;
|
|
|
|
case Size::Size_16_16_16:
|
|
|
|
return 3;
|
|
|
|
case Size::Size_8_8_8_8:
|
|
|
|
return 4;
|
|
|
|
case Size::Size_16_16:
|
|
|
|
return 2;
|
|
|
|
case Size::Size_32:
|
|
|
|
return 1;
|
|
|
|
case Size::Size_8_8_8:
|
|
|
|
return 3;
|
|
|
|
case Size::Size_8_8:
|
|
|
|
return 2;
|
|
|
|
case Size::Size_16:
|
|
|
|
return 1;
|
|
|
|
case Size::Size_8:
|
|
|
|
return 1;
|
|
|
|
case Size::Size_10_10_10_2:
|
|
|
|
return 4;
|
|
|
|
case Size::Size_11_11_10:
|
|
|
|
return 3;
|
|
|
|
default:
|
|
|
|
UNREACHABLE();
|
2018-12-19 01:52:32 +00:00
|
|
|
return 1;
|
2018-03-24 20:26:14 +00:00
|
|
|
}
|
|
|
|
}
|
2018-03-22 23:47:28 +00:00
|
|
|
|
2018-03-24 20:26:14 +00:00
|
|
|
u32 SizeInBytes() const {
|
|
|
|
switch (size) {
|
|
|
|
case Size::Size_32_32_32_32:
|
|
|
|
return 16;
|
|
|
|
case Size::Size_32_32_32:
|
|
|
|
return 12;
|
|
|
|
case Size::Size_16_16_16_16:
|
|
|
|
return 8;
|
|
|
|
case Size::Size_32_32:
|
|
|
|
return 8;
|
|
|
|
case Size::Size_16_16_16:
|
|
|
|
return 6;
|
|
|
|
case Size::Size_8_8_8_8:
|
|
|
|
return 4;
|
|
|
|
case Size::Size_16_16:
|
|
|
|
return 4;
|
|
|
|
case Size::Size_32:
|
|
|
|
return 4;
|
|
|
|
case Size::Size_8_8_8:
|
|
|
|
return 3;
|
|
|
|
case Size::Size_8_8:
|
|
|
|
return 2;
|
|
|
|
case Size::Size_16:
|
|
|
|
return 2;
|
|
|
|
case Size::Size_8:
|
|
|
|
return 1;
|
|
|
|
case Size::Size_10_10_10_2:
|
|
|
|
return 4;
|
|
|
|
case Size::Size_11_11_10:
|
|
|
|
return 4;
|
|
|
|
default:
|
|
|
|
UNREACHABLE();
|
2021-06-23 15:50:37 +00:00
|
|
|
return 1;
|
2018-03-24 20:26:14 +00:00
|
|
|
}
|
2018-03-22 23:47:28 +00:00
|
|
|
}
|
|
|
|
|
2018-03-24 20:26:14 +00:00
|
|
|
std::string SizeString() const {
|
|
|
|
switch (size) {
|
|
|
|
case Size::Size_32_32_32_32:
|
|
|
|
return "32_32_32_32";
|
|
|
|
case Size::Size_32_32_32:
|
|
|
|
return "32_32_32";
|
|
|
|
case Size::Size_16_16_16_16:
|
|
|
|
return "16_16_16_16";
|
|
|
|
case Size::Size_32_32:
|
|
|
|
return "32_32";
|
|
|
|
case Size::Size_16_16_16:
|
|
|
|
return "16_16_16";
|
|
|
|
case Size::Size_8_8_8_8:
|
|
|
|
return "8_8_8_8";
|
|
|
|
case Size::Size_16_16:
|
|
|
|
return "16_16";
|
|
|
|
case Size::Size_32:
|
|
|
|
return "32";
|
|
|
|
case Size::Size_8_8_8:
|
|
|
|
return "8_8_8";
|
|
|
|
case Size::Size_8_8:
|
|
|
|
return "8_8";
|
|
|
|
case Size::Size_16:
|
|
|
|
return "16";
|
|
|
|
case Size::Size_8:
|
|
|
|
return "8";
|
|
|
|
case Size::Size_10_10_10_2:
|
|
|
|
return "10_10_10_2";
|
|
|
|
case Size::Size_11_11_10:
|
|
|
|
return "11_11_10";
|
2019-04-03 07:33:36 +00:00
|
|
|
default:
|
|
|
|
UNREACHABLE();
|
|
|
|
return {};
|
2018-03-24 20:26:14 +00:00
|
|
|
}
|
2018-03-22 23:47:28 +00:00
|
|
|
}
|
2018-03-24 20:26:14 +00:00
|
|
|
|
2018-03-25 01:04:23 +00:00
|
|
|
std::string TypeString() const {
|
2018-03-24 20:26:14 +00:00
|
|
|
switch (type) {
|
|
|
|
case Type::SignedNorm:
|
2018-03-25 01:04:23 +00:00
|
|
|
return "SNORM";
|
2018-03-24 20:26:14 +00:00
|
|
|
case Type::UnsignedNorm:
|
2018-03-25 01:04:23 +00:00
|
|
|
return "UNORM";
|
2018-03-24 20:26:14 +00:00
|
|
|
case Type::SignedInt:
|
2018-03-25 01:04:23 +00:00
|
|
|
return "SINT";
|
2018-03-24 20:26:14 +00:00
|
|
|
case Type::UnsignedInt:
|
2018-03-25 01:04:23 +00:00
|
|
|
return "UINT";
|
2018-03-24 20:26:14 +00:00
|
|
|
case Type::UnsignedScaled:
|
2018-03-25 01:04:23 +00:00
|
|
|
return "USCALED";
|
2018-03-24 20:26:14 +00:00
|
|
|
case Type::SignedScaled:
|
2018-03-25 01:04:23 +00:00
|
|
|
return "SSCALED";
|
2018-03-24 20:26:14 +00:00
|
|
|
case Type::Float:
|
2018-03-25 01:04:23 +00:00
|
|
|
return "FLOAT";
|
2018-03-24 20:26:14 +00:00
|
|
|
}
|
|
|
|
UNREACHABLE();
|
|
|
|
return {};
|
|
|
|
}
|
2018-03-25 04:09:53 +00:00
|
|
|
|
|
|
|
bool IsNormalized() const {
|
|
|
|
return (type == Type::SignedNorm) || (type == Type::UnsignedNorm);
|
|
|
|
}
|
2018-08-12 01:36:40 +00:00
|
|
|
|
|
|
|
bool IsValid() const {
|
|
|
|
return size != Size::Invalid;
|
|
|
|
}
|
2018-09-05 09:36:50 +00:00
|
|
|
|
|
|
|
bool operator<(const VertexAttribute& other) const {
|
|
|
|
return hex < other.hex;
|
|
|
|
}
|
2018-03-24 20:26:14 +00:00
|
|
|
};
|
2018-03-22 23:47:28 +00:00
|
|
|
|
2020-04-12 03:21:27 +00:00
|
|
|
struct MsaaSampleLocation {
|
|
|
|
union {
|
|
|
|
BitField<0, 4, u32> x0;
|
|
|
|
BitField<4, 4, u32> y0;
|
|
|
|
BitField<8, 4, u32> x1;
|
|
|
|
BitField<12, 4, u32> y1;
|
|
|
|
BitField<16, 4, u32> x2;
|
|
|
|
BitField<20, 4, u32> y2;
|
|
|
|
BitField<24, 4, u32> x3;
|
|
|
|
BitField<28, 4, u32> y3;
|
|
|
|
};
|
|
|
|
|
|
|
|
constexpr std::pair<u32, u32> Location(int index) const {
|
|
|
|
switch (index) {
|
|
|
|
case 0:
|
|
|
|
return {x0, y0};
|
|
|
|
case 1:
|
|
|
|
return {x1, y1};
|
|
|
|
case 2:
|
|
|
|
return {x2, y2};
|
|
|
|
case 3:
|
|
|
|
return {x3, y3};
|
|
|
|
default:
|
|
|
|
UNREACHABLE();
|
|
|
|
return {0, 0};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-12-10 21:33:49 +00:00
|
|
|
enum class DepthMode : u32 {
|
|
|
|
MinusOneToOne = 0,
|
|
|
|
ZeroToOne = 1,
|
|
|
|
};
|
|
|
|
|
2018-03-22 23:47:28 +00:00
|
|
|
enum class PrimitiveTopology : u32 {
|
|
|
|
Points = 0x0,
|
|
|
|
Lines = 0x1,
|
|
|
|
LineLoop = 0x2,
|
|
|
|
LineStrip = 0x3,
|
|
|
|
Triangles = 0x4,
|
|
|
|
TriangleStrip = 0x5,
|
|
|
|
TriangleFan = 0x6,
|
|
|
|
Quads = 0x7,
|
|
|
|
QuadStrip = 0x8,
|
|
|
|
Polygon = 0x9,
|
|
|
|
LinesAdjacency = 0xa,
|
|
|
|
LineStripAdjacency = 0xb,
|
|
|
|
TrianglesAdjacency = 0xc,
|
|
|
|
TriangleStripAdjacency = 0xd,
|
|
|
|
Patches = 0xe,
|
|
|
|
};
|
|
|
|
|
2018-04-13 18:18:37 +00:00
|
|
|
enum class IndexFormat : u32 {
|
|
|
|
UnsignedByte = 0x0,
|
|
|
|
UnsignedShort = 0x1,
|
|
|
|
UnsignedInt = 0x2,
|
|
|
|
};
|
|
|
|
|
2018-07-02 18:31:20 +00:00
|
|
|
enum class ComparisonOp : u32 {
|
2018-07-05 18:01:31 +00:00
|
|
|
// These values are used by Nouveau and most games, they correspond to the OpenGL token
|
|
|
|
// values for these operations.
|
|
|
|
Never = 0x200,
|
|
|
|
Less = 0x201,
|
|
|
|
Equal = 0x202,
|
|
|
|
LessEqual = 0x203,
|
|
|
|
Greater = 0x204,
|
|
|
|
NotEqual = 0x205,
|
|
|
|
GreaterEqual = 0x206,
|
|
|
|
Always = 0x207,
|
|
|
|
|
|
|
|
// These values are used by some games, they seem to be NV04 values.
|
|
|
|
NeverOld = 1,
|
|
|
|
LessOld = 2,
|
|
|
|
EqualOld = 3,
|
|
|
|
LessEqualOld = 4,
|
|
|
|
GreaterOld = 5,
|
|
|
|
NotEqualOld = 6,
|
|
|
|
GreaterEqualOld = 7,
|
|
|
|
AlwaysOld = 8,
|
2018-07-02 18:31:20 +00:00
|
|
|
};
|
|
|
|
|
2018-08-20 23:42:36 +00:00
|
|
|
enum class LogicOperation : u32 {
|
|
|
|
Clear = 0x1500,
|
|
|
|
And = 0x1501,
|
|
|
|
AndReverse = 0x1502,
|
|
|
|
Copy = 0x1503,
|
|
|
|
AndInverted = 0x1504,
|
|
|
|
NoOp = 0x1505,
|
|
|
|
Xor = 0x1506,
|
|
|
|
Or = 0x1507,
|
|
|
|
Nor = 0x1508,
|
|
|
|
Equiv = 0x1509,
|
|
|
|
Invert = 0x150A,
|
|
|
|
OrReverse = 0x150B,
|
|
|
|
CopyInverted = 0x150C,
|
|
|
|
OrInverted = 0x150D,
|
|
|
|
Nand = 0x150E,
|
|
|
|
Set = 0x150F,
|
|
|
|
};
|
|
|
|
|
2018-08-22 04:25:46 +00:00
|
|
|
enum class StencilOp : u32 {
|
|
|
|
Keep = 1,
|
|
|
|
Zero = 2,
|
|
|
|
Replace = 3,
|
|
|
|
Incr = 4,
|
|
|
|
Decr = 5,
|
|
|
|
Invert = 6,
|
|
|
|
IncrWrap = 7,
|
|
|
|
DecrWrap = 8,
|
2018-11-07 03:27:12 +00:00
|
|
|
KeepOGL = 0x1E00,
|
|
|
|
ZeroOGL = 0,
|
|
|
|
ReplaceOGL = 0x1E01,
|
|
|
|
IncrOGL = 0x1E02,
|
|
|
|
DecrOGL = 0x1E03,
|
|
|
|
InvertOGL = 0x150A,
|
|
|
|
IncrWrapOGL = 0x8507,
|
|
|
|
DecrWrapOGL = 0x8508,
|
2018-08-22 04:25:46 +00:00
|
|
|
};
|
|
|
|
|
2019-07-27 22:40:10 +00:00
|
|
|
enum class CounterReset : u32 {
|
|
|
|
SampleCnt = 0x01,
|
|
|
|
Unk02 = 0x02,
|
|
|
|
Unk03 = 0x03,
|
|
|
|
Unk04 = 0x04,
|
|
|
|
EmittedPrimitives = 0x10, // Not tested
|
|
|
|
Unk11 = 0x11,
|
|
|
|
Unk12 = 0x12,
|
|
|
|
Unk13 = 0x13,
|
|
|
|
Unk15 = 0x15,
|
|
|
|
Unk16 = 0x16,
|
|
|
|
Unk17 = 0x17,
|
|
|
|
Unk18 = 0x18,
|
|
|
|
Unk1A = 0x1A,
|
|
|
|
Unk1B = 0x1B,
|
|
|
|
Unk1C = 0x1C,
|
|
|
|
Unk1D = 0x1D,
|
|
|
|
Unk1E = 0x1E,
|
|
|
|
GeneratedPrimitives = 0x1F,
|
|
|
|
};
|
|
|
|
|
2019-12-29 00:41:41 +00:00
|
|
|
enum class FrontFace : u32 {
|
|
|
|
ClockWise = 0x0900,
|
|
|
|
CounterClockWise = 0x0901,
|
|
|
|
};
|
2018-07-02 18:31:20 +00:00
|
|
|
|
2019-12-29 00:41:41 +00:00
|
|
|
enum class CullFace : u32 {
|
|
|
|
Front = 0x0404,
|
|
|
|
Back = 0x0405,
|
|
|
|
FrontAndBack = 0x0408,
|
2018-07-02 18:31:20 +00:00
|
|
|
};
|
|
|
|
|
2018-04-14 03:13:47 +00:00
|
|
|
struct Blend {
|
|
|
|
enum class Equation : u32 {
|
|
|
|
Add = 1,
|
|
|
|
Subtract = 2,
|
|
|
|
ReverseSubtract = 3,
|
|
|
|
Min = 4,
|
|
|
|
Max = 5,
|
2018-11-22 05:51:01 +00:00
|
|
|
|
|
|
|
// These values are used by Nouveau and some games.
|
|
|
|
AddGL = 0x8006,
|
2021-09-07 02:04:47 +00:00
|
|
|
MinGL = 0x8007,
|
|
|
|
MaxGL = 0x8008,
|
|
|
|
SubtractGL = 0x800a,
|
|
|
|
ReverseSubtractGL = 0x800b
|
2018-04-14 03:13:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum class Factor : u32 {
|
|
|
|
Zero = 0x1,
|
|
|
|
One = 0x2,
|
|
|
|
SourceColor = 0x3,
|
|
|
|
OneMinusSourceColor = 0x4,
|
|
|
|
SourceAlpha = 0x5,
|
|
|
|
OneMinusSourceAlpha = 0x6,
|
|
|
|
DestAlpha = 0x7,
|
|
|
|
OneMinusDestAlpha = 0x8,
|
|
|
|
DestColor = 0x9,
|
|
|
|
OneMinusDestColor = 0xa,
|
|
|
|
SourceAlphaSaturate = 0xb,
|
|
|
|
Source1Color = 0x10,
|
|
|
|
OneMinusSource1Color = 0x11,
|
|
|
|
Source1Alpha = 0x12,
|
|
|
|
OneMinusSource1Alpha = 0x13,
|
|
|
|
ConstantColor = 0x61,
|
|
|
|
OneMinusConstantColor = 0x62,
|
|
|
|
ConstantAlpha = 0x63,
|
|
|
|
OneMinusConstantAlpha = 0x64,
|
2018-08-12 01:57:16 +00:00
|
|
|
|
|
|
|
// These values are used by Nouveau and some games.
|
|
|
|
ZeroGL = 0x4000,
|
|
|
|
OneGL = 0x4001,
|
|
|
|
SourceColorGL = 0x4300,
|
|
|
|
OneMinusSourceColorGL = 0x4301,
|
|
|
|
SourceAlphaGL = 0x4302,
|
|
|
|
OneMinusSourceAlphaGL = 0x4303,
|
|
|
|
DestAlphaGL = 0x4304,
|
|
|
|
OneMinusDestAlphaGL = 0x4305,
|
|
|
|
DestColorGL = 0x4306,
|
|
|
|
OneMinusDestColorGL = 0x4307,
|
|
|
|
SourceAlphaSaturateGL = 0x4308,
|
|
|
|
ConstantColorGL = 0xc001,
|
|
|
|
OneMinusConstantColorGL = 0xc002,
|
|
|
|
ConstantAlphaGL = 0xc003,
|
|
|
|
OneMinusConstantAlphaGL = 0xc004,
|
|
|
|
Source1ColorGL = 0xc900,
|
|
|
|
OneMinusSource1ColorGL = 0xc901,
|
|
|
|
Source1AlphaGL = 0xc902,
|
|
|
|
OneMinusSource1AlphaGL = 0xc903,
|
2018-04-14 03:13:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
u32 separate_alpha;
|
|
|
|
Equation equation_rgb;
|
|
|
|
Factor factor_source_rgb;
|
|
|
|
Factor factor_dest_rgb;
|
|
|
|
Equation equation_a;
|
|
|
|
Factor factor_source_a;
|
|
|
|
Factor factor_dest_a;
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(1);
|
2018-04-14 03:13:47 +00:00
|
|
|
};
|
|
|
|
|
2019-11-01 03:43:59 +00:00
|
|
|
enum class TessellationPrimitive : u32 {
|
|
|
|
Isolines = 0,
|
|
|
|
Triangles = 1,
|
|
|
|
Quads = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class TessellationSpacing : u32 {
|
|
|
|
Equal = 0,
|
|
|
|
FractionalOdd = 1,
|
|
|
|
FractionalEven = 2,
|
|
|
|
};
|
|
|
|
|
2020-02-24 22:43:57 +00:00
|
|
|
enum class PolygonMode : u32 {
|
|
|
|
Point = 0x1b00,
|
|
|
|
Line = 0x1b01,
|
|
|
|
Fill = 0x1b02,
|
|
|
|
};
|
|
|
|
|
2020-03-22 03:33:55 +00:00
|
|
|
enum class ShadowRamControl : u32 {
|
2020-03-22 04:35:26 +00:00
|
|
|
// write value to shadow ram
|
2020-03-22 03:33:55 +00:00
|
|
|
Track = 0,
|
2020-03-22 04:35:26 +00:00
|
|
|
// write value to shadow ram ( with validation ??? )
|
2020-03-22 03:33:55 +00:00
|
|
|
TrackWithFilter = 1,
|
2020-03-22 04:35:26 +00:00
|
|
|
// only write to real hw register
|
2020-03-22 03:33:55 +00:00
|
|
|
Passthrough = 2,
|
2020-03-22 04:35:26 +00:00
|
|
|
// write value from shadow ram to real hw register
|
2020-03-22 03:33:55 +00:00
|
|
|
Replay = 3,
|
|
|
|
};
|
|
|
|
|
2020-05-04 20:49:48 +00:00
|
|
|
enum class ViewportSwizzle : u32 {
|
|
|
|
PositiveX = 0,
|
|
|
|
NegativeX = 1,
|
|
|
|
PositiveY = 2,
|
|
|
|
NegativeY = 3,
|
|
|
|
PositiveZ = 4,
|
|
|
|
NegativeZ = 5,
|
|
|
|
PositiveW = 6,
|
|
|
|
NegativeW = 7,
|
|
|
|
};
|
|
|
|
|
2020-12-30 05:25:23 +00:00
|
|
|
enum class SamplerIndex : u32 {
|
|
|
|
Independently = 0,
|
|
|
|
ViaHeaderIndex = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TileMode {
|
|
|
|
union {
|
|
|
|
BitField<0, 4, u32> block_width;
|
|
|
|
BitField<4, 4, u32> block_height;
|
|
|
|
BitField<8, 4, u32> block_depth;
|
|
|
|
BitField<12, 1, u32> is_pitch_linear;
|
|
|
|
BitField<16, 1, u32> is_3d;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
static_assert(sizeof(TileMode) == 4);
|
|
|
|
|
2018-06-26 18:38:53 +00:00
|
|
|
struct RenderTargetConfig {
|
|
|
|
u32 address_high;
|
|
|
|
u32 address_low;
|
|
|
|
u32 width;
|
|
|
|
u32 height;
|
|
|
|
Tegra::RenderTargetFormat format;
|
2020-12-30 05:25:23 +00:00
|
|
|
TileMode tile_mode;
|
2018-10-08 18:34:55 +00:00
|
|
|
union {
|
2020-12-30 05:25:23 +00:00
|
|
|
BitField<0, 16, u32> depth;
|
2018-10-16 01:04:20 +00:00
|
|
|
BitField<16, 1, u32> volume;
|
|
|
|
};
|
2018-06-26 18:38:53 +00:00
|
|
|
u32 layer_stride;
|
|
|
|
u32 base_layer;
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(7);
|
2018-06-26 18:38:53 +00:00
|
|
|
|
|
|
|
GPUVAddr Address() const {
|
|
|
|
return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
|
|
|
|
address_low);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-11-05 02:46:06 +00:00
|
|
|
struct ColorMask {
|
|
|
|
union {
|
|
|
|
u32 raw;
|
|
|
|
BitField<0, 4, u32> R;
|
|
|
|
BitField<4, 4, u32> G;
|
|
|
|
BitField<8, 4, u32> B;
|
|
|
|
BitField<12, 4, u32> A;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-11-14 17:34:02 +00:00
|
|
|
struct ViewportTransform {
|
|
|
|
f32 scale_x;
|
|
|
|
f32 scale_y;
|
|
|
|
f32 scale_z;
|
|
|
|
f32 translate_x;
|
|
|
|
f32 translate_y;
|
|
|
|
f32 translate_z;
|
2020-05-04 20:49:48 +00:00
|
|
|
union {
|
2020-05-04 21:31:17 +00:00
|
|
|
u32 raw;
|
2020-05-04 20:49:48 +00:00
|
|
|
BitField<0, 3, ViewportSwizzle> x;
|
|
|
|
BitField<4, 3, ViewportSwizzle> y;
|
|
|
|
BitField<8, 3, ViewportSwizzle> z;
|
|
|
|
BitField<12, 3, ViewportSwizzle> w;
|
|
|
|
} swizzle;
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(1);
|
2018-11-14 17:34:02 +00:00
|
|
|
|
2019-12-26 04:50:38 +00:00
|
|
|
Common::Rectangle<f32> GetRect() const {
|
2018-11-14 17:34:02 +00:00
|
|
|
return {
|
|
|
|
GetX(), // left
|
|
|
|
GetY() + GetHeight(), // top
|
|
|
|
GetX() + GetWidth(), // right
|
|
|
|
GetY() // bottom
|
|
|
|
};
|
2020-08-14 12:13:38 +00:00
|
|
|
}
|
2018-11-14 17:34:02 +00:00
|
|
|
|
2019-12-26 04:50:38 +00:00
|
|
|
f32 GetX() const {
|
|
|
|
return std::max(0.0f, translate_x - std::fabs(scale_x));
|
2018-11-14 17:34:02 +00:00
|
|
|
}
|
|
|
|
|
2019-12-26 04:50:38 +00:00
|
|
|
f32 GetY() const {
|
|
|
|
return std::max(0.0f, translate_y - std::fabs(scale_y));
|
2018-11-14 17:34:02 +00:00
|
|
|
}
|
|
|
|
|
2019-12-26 04:50:38 +00:00
|
|
|
f32 GetWidth() const {
|
|
|
|
return translate_x + std::fabs(scale_x) - GetX();
|
2018-11-14 17:34:02 +00:00
|
|
|
}
|
|
|
|
|
2019-12-26 04:50:38 +00:00
|
|
|
f32 GetHeight() const {
|
|
|
|
return translate_y + std::fabs(scale_y) - GetY();
|
2018-11-14 17:34:02 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ScissorTest {
|
|
|
|
u32 enable;
|
|
|
|
union {
|
|
|
|
BitField<0, 16, u32> min_x;
|
|
|
|
BitField<16, 16, u32> max_x;
|
|
|
|
};
|
|
|
|
union {
|
|
|
|
BitField<0, 16, u32> min_y;
|
|
|
|
BitField<16, 16, u32> max_y;
|
|
|
|
};
|
|
|
|
u32 fill;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ViewPort {
|
|
|
|
union {
|
|
|
|
BitField<0, 16, u32> x;
|
|
|
|
BitField<16, 16, u32> width;
|
|
|
|
};
|
|
|
|
union {
|
|
|
|
BitField<0, 16, u32> y;
|
|
|
|
BitField<16, 16, u32> height;
|
|
|
|
};
|
|
|
|
float depth_range_near;
|
|
|
|
float depth_range_far;
|
|
|
|
};
|
|
|
|
|
2020-03-11 04:08:28 +00:00
|
|
|
struct TransformFeedbackBinding {
|
2020-03-02 04:54:00 +00:00
|
|
|
u32 buffer_enable;
|
|
|
|
u32 address_high;
|
|
|
|
u32 address_low;
|
|
|
|
s32 buffer_size;
|
|
|
|
s32 buffer_offset;
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(3);
|
2020-03-02 22:31:26 +00:00
|
|
|
|
|
|
|
GPUVAddr Address() const {
|
|
|
|
return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
|
|
|
|
address_low);
|
|
|
|
}
|
2020-03-02 04:54:00 +00:00
|
|
|
};
|
|
|
|
static_assert(sizeof(TransformFeedbackBinding) == 32);
|
|
|
|
|
2020-03-11 04:08:28 +00:00
|
|
|
struct TransformFeedbackLayout {
|
2020-03-02 04:54:00 +00:00
|
|
|
u32 stream;
|
|
|
|
u32 varying_count;
|
|
|
|
u32 stride;
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(1);
|
2020-03-02 04:54:00 +00:00
|
|
|
};
|
|
|
|
static_assert(sizeof(TransformFeedbackLayout) == 16);
|
|
|
|
|
2018-09-15 13:21:06 +00:00
|
|
|
bool IsShaderConfigEnabled(std::size_t index) const {
|
2018-07-13 02:57:57 +00:00
|
|
|
// The VertexB is always enabled.
|
2018-09-15 13:21:06 +00:00
|
|
|
if (index == static_cast<std::size_t>(Regs::ShaderProgram::VertexB)) {
|
2018-07-13 02:57:57 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return shader_config[index].enable != 0;
|
|
|
|
}
|
|
|
|
|
2020-03-02 22:31:26 +00:00
|
|
|
bool IsShaderConfigEnabled(Regs::ShaderProgram type) const {
|
|
|
|
return IsShaderConfigEnabled(static_cast<std::size_t>(type));
|
|
|
|
}
|
|
|
|
|
2018-02-12 17:34:41 +00:00
|
|
|
union {
|
|
|
|
struct {
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x44);
|
2020-04-28 05:14:11 +00:00
|
|
|
|
|
|
|
u32 wait_for_idle;
|
2018-04-24 01:01:29 +00:00
|
|
|
|
|
|
|
struct {
|
2018-10-30 03:36:03 +00:00
|
|
|
u32 upload_address;
|
2018-04-24 01:01:29 +00:00
|
|
|
u32 data;
|
|
|
|
u32 entry;
|
2018-10-30 03:36:03 +00:00
|
|
|
u32 bind;
|
2018-04-24 01:01:29 +00:00
|
|
|
} macros;
|
|
|
|
|
2020-03-22 03:33:55 +00:00
|
|
|
ShadowRamControl shadow_ram_control;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x16);
|
2019-04-22 23:27:36 +00:00
|
|
|
|
2019-04-25 16:57:10 +00:00
|
|
|
Upload::Registers upload;
|
2019-04-22 23:27:36 +00:00
|
|
|
struct {
|
|
|
|
union {
|
|
|
|
BitField<0, 1, u32> linear;
|
|
|
|
};
|
|
|
|
} exec_upload;
|
|
|
|
|
|
|
|
u32 data_upload;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x16);
|
2020-11-26 19:49:20 +00:00
|
|
|
|
|
|
|
u32 force_early_fragment_tests;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x2D);
|
2019-04-02 15:46:00 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
union {
|
|
|
|
BitField<0, 16, u32> sync_point;
|
|
|
|
BitField<16, 1, u32> unknown;
|
|
|
|
BitField<20, 1, u32> increment;
|
|
|
|
};
|
|
|
|
} sync_info;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x15);
|
2019-11-01 03:43:59 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
BitField<0, 2, TessellationPrimitive> prim;
|
|
|
|
BitField<4, 2, TessellationSpacing> spacing;
|
|
|
|
BitField<8, 1, u32> cw;
|
|
|
|
BitField<9, 1, u32> connected;
|
|
|
|
} tess_mode;
|
|
|
|
|
2019-11-01 07:39:48 +00:00
|
|
|
std::array<f32, 4> tess_level_outer;
|
|
|
|
std::array<f32, 2> tess_level_inner;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x10);
|
2019-12-18 22:26:52 +00:00
|
|
|
|
|
|
|
u32 rasterize_enable;
|
|
|
|
|
2020-03-02 04:54:00 +00:00
|
|
|
std::array<TransformFeedbackBinding, NumTransformFeedbackBuffers> tfb_bindings;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0xC0);
|
2020-03-02 04:54:00 +00:00
|
|
|
|
|
|
|
std::array<TransformFeedbackLayout, NumTransformFeedbackBuffers> tfb_layouts;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1);
|
2018-09-25 22:41:21 +00:00
|
|
|
|
|
|
|
u32 tfb_enabled;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x2E);
|
2018-03-19 21:46:29 +00:00
|
|
|
|
2018-11-13 23:13:16 +00:00
|
|
|
std::array<RenderTargetConfig, NumRenderTargets> rt;
|
2018-03-19 21:46:29 +00:00
|
|
|
|
2018-11-13 23:13:16 +00:00
|
|
|
std::array<ViewportTransform, NumViewports> viewport_transform;
|
|
|
|
|
|
|
|
std::array<ViewPort, NumViewports> viewports;
|
2018-03-24 06:22:19 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1D);
|
2018-03-21 04:28:06 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 first;
|
|
|
|
u32 count;
|
|
|
|
} vertex_buffer;
|
|
|
|
|
2019-12-10 21:33:49 +00:00
|
|
|
DepthMode depth_mode;
|
2018-06-07 04:53:43 +00:00
|
|
|
|
|
|
|
float clear_color[4];
|
|
|
|
float clear_depth;
|
2018-11-26 23:31:44 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x3);
|
2018-11-26 23:31:44 +00:00
|
|
|
|
2018-08-22 04:25:46 +00:00
|
|
|
s32 clear_stencil;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x2);
|
2020-02-24 22:43:57 +00:00
|
|
|
|
|
|
|
PolygonMode polygon_mode_front;
|
|
|
|
PolygonMode polygon_mode_back;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x3);
|
2018-11-26 23:31:44 +00:00
|
|
|
|
|
|
|
u32 polygon_offset_point_enable;
|
|
|
|
u32 polygon_offset_line_enable;
|
|
|
|
u32 polygon_offset_fill_enable;
|
|
|
|
|
2019-11-01 03:36:19 +00:00
|
|
|
u32 patch_vertices;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x4);
|
2020-12-30 05:25:23 +00:00
|
|
|
|
|
|
|
u32 fragment_barrier;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x7);
|
2018-10-09 00:49:36 +00:00
|
|
|
|
2018-11-13 23:13:16 +00:00
|
|
|
std::array<ScissorTest, NumViewports> scissor_test;
|
2018-10-09 00:49:36 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x15);
|
2018-08-22 04:25:46 +00:00
|
|
|
|
|
|
|
s32 stencil_back_func_ref;
|
2019-11-13 19:33:35 +00:00
|
|
|
u32 stencil_back_mask;
|
2020-02-02 20:50:46 +00:00
|
|
|
u32 stencil_back_func_mask;
|
2018-06-07 04:53:43 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x5);
|
2020-12-30 05:25:23 +00:00
|
|
|
|
|
|
|
u32 invalidate_texture_data_cache;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1);
|
2020-12-30 05:25:23 +00:00
|
|
|
|
|
|
|
u32 tiled_cache_barrier;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x4);
|
2018-11-05 02:46:06 +00:00
|
|
|
|
|
|
|
u32 color_mask_common;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x2);
|
2018-09-09 23:01:21 +00:00
|
|
|
|
2019-09-29 23:45:12 +00:00
|
|
|
f32 depth_bounds[2];
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x2);
|
2019-11-06 04:39:41 +00:00
|
|
|
|
|
|
|
u32 rt_separate_frag_data;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1);
|
2020-04-12 03:21:27 +00:00
|
|
|
|
|
|
|
u32 multisample_raster_enable;
|
|
|
|
u32 multisample_raster_samples;
|
|
|
|
std::array<u32, 4> multisample_sample_mask;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x5);
|
2018-03-19 21:49:41 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 address_high;
|
|
|
|
u32 address_low;
|
2018-07-02 17:42:04 +00:00
|
|
|
Tegra::DepthFormat format;
|
2020-12-30 05:25:23 +00:00
|
|
|
TileMode tile_mode;
|
2018-03-19 21:49:41 +00:00
|
|
|
u32 layer_stride;
|
|
|
|
|
|
|
|
GPUVAddr Address() const {
|
|
|
|
return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
|
|
|
|
address_low);
|
|
|
|
}
|
|
|
|
} zeta;
|
|
|
|
|
2020-12-30 05:25:23 +00:00
|
|
|
struct {
|
|
|
|
union {
|
|
|
|
BitField<0, 16, u32> x;
|
|
|
|
BitField<16, 16, u32> width;
|
|
|
|
};
|
|
|
|
union {
|
|
|
|
BitField<0, 16, u32> y;
|
|
|
|
BitField<16, 16, u32> height;
|
|
|
|
};
|
|
|
|
} render_area;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x3F);
|
2018-11-21 03:40:32 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
BitField<0, 4, u32> stencil;
|
|
|
|
BitField<4, 4, u32> unknown;
|
|
|
|
BitField<8, 4, u32> scissor;
|
|
|
|
BitField<12, 4, u32> viewport;
|
|
|
|
} clear_flags;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x10);
|
2020-02-24 22:43:57 +00:00
|
|
|
|
|
|
|
u32 fill_rectangle;
|
|
|
|
|
2021-06-23 06:32:41 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x2);
|
|
|
|
|
|
|
|
u32 conservative_raster_enable;
|
|
|
|
|
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x5);
|
2018-03-21 04:33:56 +00:00
|
|
|
|
2018-09-05 09:36:50 +00:00
|
|
|
std::array<VertexAttribute, NumVertexAttributes> vertex_attrib_format;
|
2018-03-21 04:33:56 +00:00
|
|
|
|
2020-04-12 03:21:27 +00:00
|
|
|
std::array<MsaaSampleLocation, 4> multisample_sample_locations;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x2);
|
2020-04-12 03:21:27 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
BitField<0, 1, u32> enable;
|
|
|
|
BitField<4, 3, u32> target;
|
|
|
|
} multisample_coverage_to_color;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x8);
|
2018-03-19 21:46:29 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
union {
|
|
|
|
BitField<0, 4, u32> count;
|
2018-09-09 23:01:21 +00:00
|
|
|
BitField<4, 3, u32> map_0;
|
|
|
|
BitField<7, 3, u32> map_1;
|
|
|
|
BitField<10, 3, u32> map_2;
|
|
|
|
BitField<13, 3, u32> map_3;
|
|
|
|
BitField<16, 3, u32> map_4;
|
|
|
|
BitField<19, 3, u32> map_5;
|
|
|
|
BitField<22, 3, u32> map_6;
|
|
|
|
BitField<25, 3, u32> map_7;
|
2018-03-19 21:46:29 +00:00
|
|
|
};
|
2018-09-09 23:01:21 +00:00
|
|
|
|
2020-12-30 05:25:23 +00:00
|
|
|
u32 Map(std::size_t index) const {
|
2018-09-09 23:01:21 +00:00
|
|
|
const std::array<u32, NumRenderTargets> maps{map_0, map_1, map_2, map_3,
|
|
|
|
map_4, map_5, map_6, map_7};
|
|
|
|
ASSERT(index < maps.size());
|
|
|
|
return maps[index];
|
|
|
|
}
|
2018-03-19 21:46:29 +00:00
|
|
|
} rt_control;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x2);
|
2018-07-21 05:54:47 +00:00
|
|
|
|
|
|
|
u32 zeta_width;
|
|
|
|
u32 zeta_height;
|
2020-02-16 07:12:38 +00:00
|
|
|
union {
|
2020-12-30 05:25:23 +00:00
|
|
|
BitField<0, 16, u32> zeta_depth;
|
2020-02-16 07:12:38 +00:00
|
|
|
BitField<16, 1, u32> zeta_volume;
|
|
|
|
};
|
2018-07-21 05:54:47 +00:00
|
|
|
|
2020-12-30 05:25:23 +00:00
|
|
|
SamplerIndex sampler_index;
|
|
|
|
|
2021-06-24 05:41:09 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x2);
|
|
|
|
|
|
|
|
std::array<u32, 8> gp_passthrough_mask;
|
|
|
|
|
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1B);
|
2018-07-02 18:31:20 +00:00
|
|
|
|
|
|
|
u32 depth_test_enable;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x5);
|
2018-06-08 22:04:41 +00:00
|
|
|
|
|
|
|
u32 independent_blend_enable;
|
|
|
|
|
2018-07-02 18:31:20 +00:00
|
|
|
u32 depth_write_enabled;
|
|
|
|
|
2018-09-25 22:41:21 +00:00
|
|
|
u32 alpha_test_enabled;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x6);
|
2018-07-04 15:26:46 +00:00
|
|
|
|
|
|
|
u32 d3d_cull_mode;
|
2018-07-02 18:31:20 +00:00
|
|
|
|
2018-07-05 18:01:31 +00:00
|
|
|
ComparisonOp depth_test_func;
|
2018-10-09 03:34:11 +00:00
|
|
|
float alpha_test_ref;
|
|
|
|
ComparisonOp alpha_test_func;
|
2018-11-02 03:21:25 +00:00
|
|
|
u32 draw_tfb_stride;
|
|
|
|
struct {
|
|
|
|
float r;
|
|
|
|
float g;
|
|
|
|
float b;
|
|
|
|
float a;
|
|
|
|
} blend_color;
|
2020-12-30 05:25:23 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x4);
|
2018-06-08 22:04:41 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 separate_alpha;
|
|
|
|
Blend::Equation equation_rgb;
|
|
|
|
Blend::Factor factor_source_rgb;
|
|
|
|
Blend::Factor factor_dest_rgb;
|
|
|
|
Blend::Equation equation_a;
|
|
|
|
Blend::Factor factor_source_a;
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(1);
|
2018-06-08 22:04:41 +00:00
|
|
|
Blend::Factor factor_dest_a;
|
|
|
|
|
|
|
|
u32 enable_common;
|
|
|
|
u32 enable[NumRenderTargets];
|
|
|
|
} blend;
|
|
|
|
|
2018-08-22 04:25:46 +00:00
|
|
|
u32 stencil_enable;
|
|
|
|
StencilOp stencil_front_op_fail;
|
|
|
|
StencilOp stencil_front_op_zfail;
|
|
|
|
StencilOp stencil_front_op_zpass;
|
|
|
|
ComparisonOp stencil_front_func_func;
|
|
|
|
s32 stencil_front_func_ref;
|
|
|
|
u32 stencil_front_func_mask;
|
|
|
|
u32 stencil_front_mask;
|
2018-07-17 20:00:21 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x2);
|
2018-11-14 01:09:01 +00:00
|
|
|
|
|
|
|
u32 frag_color_clamp;
|
2018-07-04 15:26:46 +00:00
|
|
|
|
|
|
|
union {
|
2018-11-25 07:37:29 +00:00
|
|
|
BitField<0, 1, u32> y_negate;
|
2018-07-04 15:26:46 +00:00
|
|
|
BitField<4, 1, u32> triangle_rast_flip;
|
|
|
|
} screen_y_control;
|
|
|
|
|
2020-02-25 00:02:32 +00:00
|
|
|
float line_width_smooth;
|
|
|
|
float line_width_aliased;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1B);
|
2020-12-30 05:25:23 +00:00
|
|
|
|
|
|
|
u32 invalidate_sampler_cache_no_wfi;
|
|
|
|
u32 invalidate_texture_header_cache_no_wfi;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x2);
|
2018-07-02 16:21:23 +00:00
|
|
|
|
|
|
|
u32 vb_element_base;
|
2019-09-15 15:48:54 +00:00
|
|
|
u32 vb_base_instance;
|
2018-07-02 16:21:23 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x35);
|
2018-11-26 23:45:21 +00:00
|
|
|
|
2019-12-26 05:20:08 +00:00
|
|
|
u32 clip_distance_enabled;
|
2018-11-26 23:45:21 +00:00
|
|
|
|
2019-07-27 22:40:10 +00:00
|
|
|
u32 samplecnt_enable;
|
2018-09-28 04:31:01 +00:00
|
|
|
|
|
|
|
float point_size;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1);
|
2020-02-04 18:19:45 +00:00
|
|
|
|
|
|
|
u32 point_sprite_enable;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x3);
|
2019-07-27 22:40:10 +00:00
|
|
|
|
|
|
|
CounterReset counter_reset;
|
|
|
|
|
2020-04-12 03:21:27 +00:00
|
|
|
u32 multisample_enable;
|
2018-07-21 05:54:47 +00:00
|
|
|
|
|
|
|
u32 zeta_enable;
|
|
|
|
|
2018-11-14 03:02:54 +00:00
|
|
|
union {
|
2018-11-14 20:31:47 +00:00
|
|
|
BitField<0, 1, u32> alpha_to_coverage;
|
|
|
|
BitField<4, 1, u32> alpha_to_one;
|
2018-11-14 03:02:54 +00:00
|
|
|
} multisample_control;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x4);
|
2019-07-01 02:21:28 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 address_high;
|
|
|
|
u32 address_low;
|
|
|
|
ConditionMode mode;
|
|
|
|
|
|
|
|
GPUVAddr Address() const {
|
|
|
|
return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
|
|
|
|
address_low);
|
|
|
|
}
|
|
|
|
} condition;
|
2018-03-19 05:36:25 +00:00
|
|
|
|
|
|
|
struct {
|
2020-12-30 05:25:23 +00:00
|
|
|
u32 address_high;
|
|
|
|
u32 address_low;
|
|
|
|
u32 limit;
|
2018-03-19 05:36:25 +00:00
|
|
|
|
2020-12-30 05:25:23 +00:00
|
|
|
GPUVAddr Address() const {
|
|
|
|
return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
|
|
|
|
address_low);
|
2018-03-19 05:36:25 +00:00
|
|
|
}
|
|
|
|
} tsc;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1);
|
2018-11-26 23:31:44 +00:00
|
|
|
|
|
|
|
float polygon_offset_factor;
|
|
|
|
|
2020-02-25 00:02:32 +00:00
|
|
|
u32 line_smooth_enable;
|
2018-03-19 05:32:57 +00:00
|
|
|
|
|
|
|
struct {
|
2020-12-30 05:25:23 +00:00
|
|
|
u32 address_high;
|
|
|
|
u32 address_low;
|
|
|
|
u32 limit;
|
2018-03-19 05:32:57 +00:00
|
|
|
|
2020-12-30 05:25:23 +00:00
|
|
|
GPUVAddr Address() const {
|
|
|
|
return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
|
|
|
|
address_low);
|
2018-03-19 05:32:57 +00:00
|
|
|
}
|
|
|
|
} tic;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x5);
|
2018-07-17 20:00:21 +00:00
|
|
|
|
2018-08-22 04:25:46 +00:00
|
|
|
u32 stencil_two_side_enable;
|
|
|
|
StencilOp stencil_back_op_fail;
|
|
|
|
StencilOp stencil_back_op_zfail;
|
|
|
|
StencilOp stencil_back_op_zpass;
|
|
|
|
ComparisonOp stencil_back_func_func;
|
2018-07-17 20:00:21 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x4);
|
2018-10-24 20:09:40 +00:00
|
|
|
|
|
|
|
u32 framebuffer_srgb;
|
|
|
|
|
2018-11-26 23:31:44 +00:00
|
|
|
float polygon_offset_units;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x4);
|
2020-04-12 03:21:27 +00:00
|
|
|
|
|
|
|
Tegra::Texture::MsaaMode multisample_mode;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0xC);
|
2018-07-04 15:26:46 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
BitField<2, 1, u32> coord_origin;
|
|
|
|
BitField<3, 10, u32> enable;
|
|
|
|
} point_coord_replace;
|
2018-03-19 05:32:57 +00:00
|
|
|
|
2018-03-17 00:23:11 +00:00
|
|
|
struct {
|
|
|
|
u32 code_address_high;
|
|
|
|
u32 code_address_low;
|
|
|
|
|
|
|
|
GPUVAddr CodeAddress() const {
|
|
|
|
return static_cast<GPUVAddr>(
|
|
|
|
(static_cast<GPUVAddr>(code_address_high) << 32) | code_address_low);
|
|
|
|
}
|
|
|
|
} code_address;
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(1);
|
2018-03-22 23:47:28 +00:00
|
|
|
|
2018-03-05 00:13:15 +00:00
|
|
|
struct {
|
|
|
|
u32 vertex_end_gl;
|
2018-03-21 04:28:06 +00:00
|
|
|
union {
|
|
|
|
u32 vertex_begin_gl;
|
2018-03-22 23:47:28 +00:00
|
|
|
BitField<0, 16, PrimitiveTopology> topology;
|
2018-08-12 00:21:31 +00:00
|
|
|
BitField<26, 1, u32> instance_next;
|
|
|
|
BitField<27, 1, u32> instance_cont;
|
2018-03-21 04:28:06 +00:00
|
|
|
};
|
2018-03-05 00:13:15 +00:00
|
|
|
} draw;
|
2018-03-22 23:47:28 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0xA);
|
2018-10-25 23:04:13 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 enabled;
|
|
|
|
u32 index;
|
|
|
|
} primitive_restart;
|
|
|
|
|
2021-06-12 00:52:04 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0xE);
|
|
|
|
|
|
|
|
u32 provoking_vertex_last;
|
|
|
|
|
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x50);
|
2018-04-13 18:18:37 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 start_addr_high;
|
|
|
|
u32 start_addr_low;
|
|
|
|
u32 end_addr_high;
|
|
|
|
u32 end_addr_low;
|
|
|
|
IndexFormat format;
|
|
|
|
u32 first;
|
|
|
|
u32 count;
|
|
|
|
|
|
|
|
unsigned FormatSizeInBytes() const {
|
|
|
|
switch (format) {
|
|
|
|
case IndexFormat::UnsignedByte:
|
|
|
|
return 1;
|
|
|
|
case IndexFormat::UnsignedShort:
|
|
|
|
return 2;
|
|
|
|
case IndexFormat::UnsignedInt:
|
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
UNREACHABLE();
|
2018-12-19 01:52:32 +00:00
|
|
|
return 1;
|
2018-04-13 18:18:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GPUVAddr StartAddress() const {
|
|
|
|
return static_cast<GPUVAddr>(
|
|
|
|
(static_cast<GPUVAddr>(start_addr_high) << 32) | start_addr_low);
|
|
|
|
}
|
|
|
|
|
|
|
|
GPUVAddr EndAddress() const {
|
|
|
|
return static_cast<GPUVAddr>((static_cast<GPUVAddr>(end_addr_high) << 32) |
|
|
|
|
end_addr_low);
|
|
|
|
}
|
2018-10-02 17:47:26 +00:00
|
|
|
|
|
|
|
/// Adjust the index buffer offset so it points to the first desired index.
|
|
|
|
GPUVAddr IndexStart() const {
|
|
|
|
return StartAddress() + static_cast<size_t>(first) *
|
|
|
|
static_cast<size_t>(FormatSizeInBytes());
|
|
|
|
}
|
2018-04-13 18:18:37 +00:00
|
|
|
} index_array;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x7);
|
2018-07-02 18:31:20 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1F);
|
2018-11-26 23:31:44 +00:00
|
|
|
|
|
|
|
float polygon_offset_clamp;
|
2018-08-18 19:42:26 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 is_instanced[NumVertexArrays];
|
|
|
|
|
|
|
|
/// Returns whether the vertex array specified by index is supposed to be
|
|
|
|
/// accessed per instance or not.
|
2020-04-17 21:37:27 +00:00
|
|
|
bool IsInstancingEnabled(std::size_t index) const {
|
2018-08-18 19:42:26 +00:00
|
|
|
return is_instanced[index];
|
|
|
|
}
|
|
|
|
} instanced_arrays;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x4);
|
2020-01-15 19:14:17 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
BitField<0, 1, u32> enable;
|
|
|
|
BitField<4, 8, u32> unk4;
|
|
|
|
} vp_point_size;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(1);
|
2018-07-02 18:31:20 +00:00
|
|
|
|
2019-12-29 00:41:41 +00:00
|
|
|
u32 cull_test_enabled;
|
|
|
|
FrontFace front_face;
|
|
|
|
CullFace cull_face;
|
2018-07-02 18:31:20 +00:00
|
|
|
|
2018-11-24 16:15:14 +00:00
|
|
|
u32 pixel_center_integer;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1);
|
2018-11-24 16:15:14 +00:00
|
|
|
|
|
|
|
u32 viewport_transform_enabled;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x3);
|
2018-11-23 15:11:21 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
BitField<0, 1, u32> depth_range_0_1;
|
|
|
|
BitField<3, 1, u32> depth_clamp_near;
|
|
|
|
BitField<4, 1, u32> depth_clamp_far;
|
2020-04-27 23:50:14 +00:00
|
|
|
BitField<11, 1, u32> depth_clamp_disabled;
|
2018-11-23 15:11:21 +00:00
|
|
|
} view_volume_clip_control;
|
2018-08-20 23:42:36 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1F);
|
2019-11-06 04:39:41 +00:00
|
|
|
|
|
|
|
u32 depth_bounds_enable;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(1);
|
2019-11-06 04:39:41 +00:00
|
|
|
|
2018-08-20 23:42:36 +00:00
|
|
|
struct {
|
|
|
|
u32 enable;
|
|
|
|
LogicOperation operation;
|
|
|
|
} logic_op;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x1);
|
2018-06-07 04:53:43 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
u32 raw;
|
|
|
|
BitField<0, 1, u32> Z;
|
|
|
|
BitField<1, 1, u32> S;
|
|
|
|
BitField<2, 1, u32> R;
|
|
|
|
BitField<3, 1, u32> G;
|
|
|
|
BitField<4, 1, u32> B;
|
|
|
|
BitField<5, 1, u32> A;
|
|
|
|
BitField<6, 4, u32> RT;
|
|
|
|
BitField<10, 11, u32> layer;
|
|
|
|
} clear_buffers;
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0xB);
|
2018-11-05 02:46:06 +00:00
|
|
|
std::array<ColorMask, NumRenderTargets> color_mask;
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x38);
|
2018-04-13 18:18:37 +00:00
|
|
|
|
2018-02-12 17:34:41 +00:00
|
|
|
struct {
|
|
|
|
u32 query_address_high;
|
|
|
|
u32 query_address_low;
|
|
|
|
u32 query_sequence;
|
|
|
|
union {
|
|
|
|
u32 raw;
|
2020-01-28 02:48:15 +00:00
|
|
|
BitField<0, 2, QueryOperation> operation;
|
2018-02-12 17:34:41 +00:00
|
|
|
BitField<4, 1, u32> fence;
|
2018-04-23 22:06:57 +00:00
|
|
|
BitField<12, 4, QueryUnit> unit;
|
|
|
|
BitField<16, 1, QuerySyncCondition> sync_cond;
|
|
|
|
BitField<23, 5, QuerySelect> select;
|
|
|
|
BitField<28, 1, u32> short_query;
|
2018-02-12 17:34:41 +00:00
|
|
|
} query_get;
|
|
|
|
|
|
|
|
GPUVAddr QueryAddress() const {
|
|
|
|
return static_cast<GPUVAddr>(
|
|
|
|
(static_cast<GPUVAddr>(query_address_high) << 32) | query_address_low);
|
|
|
|
}
|
|
|
|
} query;
|
2018-03-17 00:23:11 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x3C);
|
2018-03-17 03:47:45 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
union {
|
|
|
|
BitField<0, 12, u32> stride;
|
|
|
|
BitField<12, 1, u32> enable;
|
|
|
|
};
|
|
|
|
u32 start_high;
|
|
|
|
u32 start_low;
|
|
|
|
u32 divisor;
|
|
|
|
|
|
|
|
GPUVAddr StartAddress() const {
|
|
|
|
return static_cast<GPUVAddr>((static_cast<GPUVAddr>(start_high) << 32) |
|
|
|
|
start_low);
|
|
|
|
}
|
2018-04-22 00:19:33 +00:00
|
|
|
|
|
|
|
bool IsEnabled() const {
|
|
|
|
return enable != 0 && StartAddress() != 0;
|
|
|
|
}
|
|
|
|
|
2018-03-17 03:47:45 +00:00
|
|
|
} vertex_array[NumVertexArrays];
|
|
|
|
|
2018-06-08 22:04:41 +00:00
|
|
|
Blend independent_blend[NumRenderTargets];
|
2018-03-17 03:47:45 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 limit_high;
|
|
|
|
u32 limit_low;
|
|
|
|
|
|
|
|
GPUVAddr LimitAddress() const {
|
|
|
|
return static_cast<GPUVAddr>((static_cast<GPUVAddr>(limit_high) << 32) |
|
2021-01-16 23:48:58 +00:00
|
|
|
limit_low);
|
2018-03-17 03:47:45 +00:00
|
|
|
}
|
|
|
|
} vertex_array_limit[NumVertexArrays];
|
2018-03-17 00:23:11 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
union {
|
|
|
|
BitField<0, 1, u32> enable;
|
|
|
|
BitField<4, 4, ShaderProgram> program;
|
|
|
|
};
|
2018-04-08 03:14:41 +00:00
|
|
|
u32 offset;
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(14);
|
2018-03-17 03:06:24 +00:00
|
|
|
} shader_config[MaxShaderProgram];
|
2018-03-17 00:23:11 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x60);
|
2019-08-31 20:43:19 +00:00
|
|
|
|
|
|
|
u32 firmware[0x20];
|
2018-03-17 21:17:45 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 cb_size;
|
|
|
|
u32 cb_address_high;
|
|
|
|
u32 cb_address_low;
|
|
|
|
u32 cb_pos;
|
2021-01-24 07:31:41 +00:00
|
|
|
std::array<u32, NumCBData> cb_data;
|
2018-03-17 22:06:23 +00:00
|
|
|
|
|
|
|
GPUVAddr BufferAddress() const {
|
|
|
|
return static_cast<GPUVAddr>(
|
|
|
|
(static_cast<GPUVAddr>(cb_address_high) << 32) | cb_address_low);
|
|
|
|
}
|
2018-03-17 21:17:45 +00:00
|
|
|
} const_buffer;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x10);
|
2018-03-17 21:17:45 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
union {
|
2018-03-17 22:06:23 +00:00
|
|
|
u32 raw_config;
|
2018-03-17 21:17:45 +00:00
|
|
|
BitField<0, 1, u32> valid;
|
|
|
|
BitField<4, 5, u32> index;
|
|
|
|
};
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(7);
|
2018-03-17 22:08:26 +00:00
|
|
|
} cb_bind[MaxShaderStage];
|
2018-03-17 21:17:45 +00:00
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x56);
|
2018-03-18 08:13:22 +00:00
|
|
|
|
|
|
|
u32 tex_cb_index;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x7D);
|
2020-03-02 04:54:00 +00:00
|
|
|
|
|
|
|
std::array<std::array<u8, 128>, NumTransformFeedbackBuffers> tfb_varying_locs;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x298);
|
2018-03-18 20:22:06 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
/// Compressed address of a buffer that holds information about bound SSBOs.
|
|
|
|
/// This address is usually bound to c0 in the shaders.
|
|
|
|
u32 buffer_address;
|
|
|
|
|
|
|
|
GPUVAddr BufferAddress() const {
|
|
|
|
return static_cast<GPUVAddr>(buffer_address) << 8;
|
|
|
|
}
|
|
|
|
} ssbo_info;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0x11);
|
2018-03-19 00:03:20 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 address[MaxShaderStage];
|
|
|
|
u32 size[MaxShaderStage];
|
|
|
|
} tex_info_buffers;
|
|
|
|
|
2021-01-15 07:25:40 +00:00
|
|
|
INSERT_PADDING_WORDS_NOINIT(0xCC);
|
2018-02-12 17:34:41 +00:00
|
|
|
};
|
|
|
|
std::array<u32, NUM_REGS> reg_array;
|
|
|
|
};
|
2020-03-22 06:41:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Regs regs{};
|
2018-02-12 17:34:41 +00:00
|
|
|
|
2020-03-22 03:33:55 +00:00
|
|
|
/// Store temporary hw register values, used by some calls to restore state after a operation
|
|
|
|
Regs shadow_state;
|
|
|
|
|
2018-02-12 17:34:41 +00:00
|
|
|
static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), "Maxwell3D Regs has wrong size");
|
2019-05-14 12:41:51 +00:00
|
|
|
static_assert(std::is_trivially_copyable_v<Regs>, "Maxwell3D Regs must be trivially copyable");
|
2018-02-12 17:34:41 +00:00
|
|
|
|
2018-03-17 03:06:24 +00:00
|
|
|
struct State {
|
2018-03-17 22:06:23 +00:00
|
|
|
struct ShaderStageInfo {
|
|
|
|
std::array<ConstBufferInfo, Regs::MaxConstBuffers> const_buffers;
|
|
|
|
};
|
|
|
|
|
2018-03-17 22:08:26 +00:00
|
|
|
std::array<ShaderStageInfo, Regs::MaxShaderStage> shader_stages;
|
2021-01-16 23:48:58 +00:00
|
|
|
|
2018-08-12 00:21:31 +00:00
|
|
|
u32 current_instance = 0; ///< Current instance to be used to simulate instanced rendering.
|
2018-03-17 03:06:24 +00:00
|
|
|
};
|
|
|
|
|
2018-03-17 21:17:45 +00:00
|
|
|
State state{};
|
2018-03-17 03:06:24 +00:00
|
|
|
|
2018-03-28 20:14:47 +00:00
|
|
|
/// Reads a register value located at the input method address
|
|
|
|
u32 GetRegisterValue(u32 method) const;
|
|
|
|
|
2018-03-23 23:56:27 +00:00
|
|
|
/// Write the value to the register identified by method.
|
2020-04-28 01:47:58 +00:00
|
|
|
void CallMethod(u32 method, u32 method_argument, bool is_last_call) override;
|
2018-03-23 23:56:27 +00:00
|
|
|
|
2020-04-20 06:16:56 +00:00
|
|
|
/// Write multiple values to the register identified by method.
|
2020-04-28 17:53:47 +00:00
|
|
|
void CallMultiMethod(u32 method, const u32* base_start, u32 amount,
|
|
|
|
u32 methods_pending) override;
|
2020-04-20 06:16:56 +00:00
|
|
|
|
2019-09-15 15:48:54 +00:00
|
|
|
/// Write the value to the register identified by method.
|
2020-04-28 01:47:58 +00:00
|
|
|
void CallMethodFromMME(u32 method, u32 method_argument);
|
2019-09-15 15:48:54 +00:00
|
|
|
|
|
|
|
void FlushMMEInlineDraw();
|
|
|
|
|
2019-07-01 02:21:28 +00:00
|
|
|
bool ShouldExecute() const {
|
|
|
|
return execute_on;
|
|
|
|
}
|
|
|
|
|
2020-06-11 03:58:57 +00:00
|
|
|
VideoCore::RasterizerInterface& Rasterizer() {
|
|
|
|
return *rasterizer;
|
2020-06-04 15:42:19 +00:00
|
|
|
}
|
|
|
|
|
2020-06-11 03:58:57 +00:00
|
|
|
const VideoCore::RasterizerInterface& Rasterizer() const {
|
|
|
|
return *rasterizer;
|
2020-06-05 03:09:52 +00:00
|
|
|
}
|
|
|
|
|
2019-09-22 11:23:13 +00:00
|
|
|
enum class MMEDrawMode : u32 {
|
2019-09-15 15:48:54 +00:00
|
|
|
Undefined,
|
|
|
|
Array,
|
|
|
|
Indexed,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MMEDrawState {
|
2019-09-22 11:23:13 +00:00
|
|
|
MMEDrawMode current_mode{MMEDrawMode::Undefined};
|
2019-09-15 18:25:07 +00:00
|
|
|
u32 current_count{};
|
|
|
|
u32 instance_count{};
|
|
|
|
bool instance_mode{};
|
|
|
|
bool gl_begin_consume{};
|
|
|
|
u32 gl_end_count{};
|
2019-09-15 15:48:54 +00:00
|
|
|
} mme_draw;
|
|
|
|
|
2020-02-21 04:19:07 +00:00
|
|
|
struct DirtyState {
|
|
|
|
using Flags = std::bitset<std::numeric_limits<u8>::max()>;
|
|
|
|
using Table = std::array<u8, Regs::NUM_REGS>;
|
|
|
|
using Tables = std::array<Table, 2>;
|
|
|
|
|
|
|
|
Flags flags;
|
|
|
|
Tables tables{};
|
2019-12-27 01:14:10 +00:00
|
|
|
} dirty;
|
|
|
|
|
2018-02-12 17:34:41 +00:00
|
|
|
private:
|
2018-10-26 03:42:39 +00:00
|
|
|
void InitializeRegisterDefaults();
|
|
|
|
|
2020-07-12 08:03:05 +00:00
|
|
|
void ProcessMacro(u32 method, const u32* base_start, u32 amount, bool is_last_call);
|
|
|
|
|
|
|
|
u32 ProcessShadowRam(u32 method, u32 argument);
|
|
|
|
|
|
|
|
void ProcessDirtyRegisters(u32 method, u32 argument);
|
|
|
|
|
|
|
|
void ProcessMethodCall(u32 method, u32 argument, u32 nonshadow_argument, bool is_last_call);
|
|
|
|
|
2018-03-26 20:46:49 +00:00
|
|
|
/// Retrieves information about a specific TIC entry from the TIC buffer.
|
|
|
|
Texture::TICEntry GetTICEntry(u32 tic_index) const;
|
|
|
|
|
|
|
|
/// Retrieves information about a specific TSC entry from the TSC buffer.
|
|
|
|
Texture::TSCEntry GetTSCEntry(u32 tsc_index) const;
|
|
|
|
|
2018-03-18 08:13:22 +00:00
|
|
|
/**
|
2018-03-18 09:17:10 +00:00
|
|
|
* Call a macro on this engine.
|
2020-12-07 01:48:10 +00:00
|
|
|
*
|
2018-03-18 08:13:22 +00:00
|
|
|
* @param method Method to call
|
|
|
|
* @param parameters Arguments to the method call
|
|
|
|
*/
|
2020-06-03 06:33:38 +00:00
|
|
|
void CallMacroMethod(u32 method, const std::vector<u32>& parameters);
|
2018-03-18 08:13:22 +00:00
|
|
|
|
2018-10-30 03:36:03 +00:00
|
|
|
/// Handles writes to the macro uploading register.
|
2018-04-24 01:01:29 +00:00
|
|
|
void ProcessMacroUpload(u32 data);
|
|
|
|
|
2018-10-30 03:36:03 +00:00
|
|
|
/// Handles writes to the macro bind register.
|
|
|
|
void ProcessMacroBind(u32 data);
|
|
|
|
|
2019-08-31 20:43:19 +00:00
|
|
|
/// Handles firmware blob 4
|
|
|
|
void ProcessFirmwareCall4();
|
|
|
|
|
2018-06-07 04:53:43 +00:00
|
|
|
/// Handles a write to the CLEAR_BUFFERS register.
|
|
|
|
void ProcessClearBuffers();
|
|
|
|
|
2018-02-12 17:34:41 +00:00
|
|
|
/// Handles a write to the QUERY_GET register.
|
|
|
|
void ProcessQueryGet();
|
|
|
|
|
2019-07-27 22:40:10 +00:00
|
|
|
/// Writes the query result accordingly.
|
2020-01-28 02:48:15 +00:00
|
|
|
void StampQueryResult(u64 payload, bool long_query);
|
|
|
|
|
2019-07-27 22:40:10 +00:00
|
|
|
/// Handles conditional rendering.
|
2019-07-01 02:21:28 +00:00
|
|
|
void ProcessQueryCondition();
|
|
|
|
|
2019-07-27 22:40:10 +00:00
|
|
|
/// Handles counter resets.
|
|
|
|
void ProcessCounterReset();
|
|
|
|
|
2019-04-02 15:46:00 +00:00
|
|
|
/// Handles writes to syncing register.
|
|
|
|
void ProcessSyncPoint();
|
|
|
|
|
2018-03-18 20:19:47 +00:00
|
|
|
/// Handles a write to the CB_DATA[i] register.
|
2019-07-12 13:25:47 +00:00
|
|
|
void StartCBData(u32 method);
|
2018-03-18 20:19:47 +00:00
|
|
|
void ProcessCBData(u32 value);
|
2020-04-20 06:16:56 +00:00
|
|
|
void ProcessCBMultiData(u32 method, const u32* start_base, u32 amount);
|
2019-07-12 13:25:47 +00:00
|
|
|
void FinishCBData();
|
2018-03-18 20:19:47 +00:00
|
|
|
|
2018-03-17 22:06:23 +00:00
|
|
|
/// Handles a write to the CB_BIND register.
|
2021-01-16 23:48:58 +00:00
|
|
|
void ProcessCBBind(size_t stage_index);
|
2018-03-17 22:06:23 +00:00
|
|
|
|
2018-03-05 00:13:15 +00:00
|
|
|
/// Handles a write to the VERTEX_END_GL register, triggering a draw.
|
|
|
|
void DrawArrays();
|
2019-09-22 11:23:13 +00:00
|
|
|
|
|
|
|
// Handles a instance drawcall from MME
|
|
|
|
void StepInstance(MMEDrawMode expected_mode, u32 count);
|
2019-11-26 21:52:15 +00:00
|
|
|
|
|
|
|
/// Returns a query's value or an empty object if the value will be deferred through a cache.
|
|
|
|
std::optional<u64> GetQueryResult();
|
2020-12-07 01:51:03 +00:00
|
|
|
|
|
|
|
Core::System& system;
|
|
|
|
MemoryManager& memory_manager;
|
|
|
|
|
|
|
|
VideoCore::RasterizerInterface* rasterizer = nullptr;
|
|
|
|
|
|
|
|
/// Start offsets of each macro in macro_memory
|
|
|
|
std::array<u32, 0x80> macro_positions{};
|
|
|
|
|
|
|
|
std::array<bool, Regs::NUM_REGS> mme_inline{};
|
|
|
|
|
|
|
|
/// Macro method that is currently being executed / being fed parameters.
|
|
|
|
u32 executing_macro = 0;
|
|
|
|
/// Parameters that have been submitted to the macro call so far.
|
|
|
|
std::vector<u32> macro_params;
|
|
|
|
|
|
|
|
/// Interpreter for the macro codes uploaded to the GPU.
|
|
|
|
std::unique_ptr<MacroEngine> macro_engine;
|
|
|
|
|
|
|
|
static constexpr u32 null_cb_data = 0xFFFFFFFF;
|
|
|
|
struct CBDataState {
|
|
|
|
std::array<std::array<u32, 0x4000>, 16> buffer;
|
|
|
|
u32 current{null_cb_data};
|
|
|
|
u32 id{null_cb_data};
|
|
|
|
u32 start_pos{};
|
|
|
|
u32 counter{};
|
|
|
|
};
|
|
|
|
CBDataState cb_data_state;
|
|
|
|
|
|
|
|
Upload::State upload_state;
|
|
|
|
|
|
|
|
bool execute_on{true};
|
2018-02-12 04:44:12 +00:00
|
|
|
};
|
2018-02-12 02:34:20 +00:00
|
|
|
|
2018-02-12 17:34:41 +00:00
|
|
|
#define ASSERT_REG_POSITION(field_name, position) \
|
|
|
|
static_assert(offsetof(Maxwell3D::Regs, field_name) == position * 4, \
|
|
|
|
"Field " #field_name " has invalid position")
|
|
|
|
|
2020-04-28 05:14:11 +00:00
|
|
|
ASSERT_REG_POSITION(wait_for_idle, 0x44);
|
2018-04-24 01:01:29 +00:00
|
|
|
ASSERT_REG_POSITION(macros, 0x45);
|
2020-03-22 03:33:55 +00:00
|
|
|
ASSERT_REG_POSITION(shadow_ram_control, 0x49);
|
2019-04-22 23:27:36 +00:00
|
|
|
ASSERT_REG_POSITION(upload, 0x60);
|
|
|
|
ASSERT_REG_POSITION(exec_upload, 0x6C);
|
|
|
|
ASSERT_REG_POSITION(data_upload, 0x6D);
|
2020-11-26 19:49:20 +00:00
|
|
|
ASSERT_REG_POSITION(force_early_fragment_tests, 0x84);
|
2019-04-02 15:46:00 +00:00
|
|
|
ASSERT_REG_POSITION(sync_info, 0xB2);
|
2019-11-01 03:43:59 +00:00
|
|
|
ASSERT_REG_POSITION(tess_mode, 0xC8);
|
2019-11-01 07:39:48 +00:00
|
|
|
ASSERT_REG_POSITION(tess_level_outer, 0xC9);
|
|
|
|
ASSERT_REG_POSITION(tess_level_inner, 0xCD);
|
2019-12-18 22:26:52 +00:00
|
|
|
ASSERT_REG_POSITION(rasterize_enable, 0xDF);
|
2020-03-02 04:54:00 +00:00
|
|
|
ASSERT_REG_POSITION(tfb_bindings, 0xE0);
|
|
|
|
ASSERT_REG_POSITION(tfb_layouts, 0x1C0);
|
2018-09-25 22:41:21 +00:00
|
|
|
ASSERT_REG_POSITION(tfb_enabled, 0x1D1);
|
2018-03-19 21:46:29 +00:00
|
|
|
ASSERT_REG_POSITION(rt, 0x200);
|
2018-11-13 23:13:16 +00:00
|
|
|
ASSERT_REG_POSITION(viewport_transform, 0x280);
|
|
|
|
ASSERT_REG_POSITION(viewports, 0x300);
|
2018-03-21 04:28:06 +00:00
|
|
|
ASSERT_REG_POSITION(vertex_buffer, 0x35D);
|
2019-12-10 21:33:49 +00:00
|
|
|
ASSERT_REG_POSITION(depth_mode, 0x35F);
|
2018-06-07 04:53:43 +00:00
|
|
|
ASSERT_REG_POSITION(clear_color[0], 0x360);
|
|
|
|
ASSERT_REG_POSITION(clear_depth, 0x364);
|
2018-08-22 04:25:46 +00:00
|
|
|
ASSERT_REG_POSITION(clear_stencil, 0x368);
|
2020-02-24 22:43:57 +00:00
|
|
|
ASSERT_REG_POSITION(polygon_mode_front, 0x36B);
|
|
|
|
ASSERT_REG_POSITION(polygon_mode_back, 0x36C);
|
2018-11-26 23:31:44 +00:00
|
|
|
ASSERT_REG_POSITION(polygon_offset_point_enable, 0x370);
|
|
|
|
ASSERT_REG_POSITION(polygon_offset_line_enable, 0x371);
|
|
|
|
ASSERT_REG_POSITION(polygon_offset_fill_enable, 0x372);
|
2019-11-01 03:36:19 +00:00
|
|
|
ASSERT_REG_POSITION(patch_vertices, 0x373);
|
2020-12-30 05:25:23 +00:00
|
|
|
ASSERT_REG_POSITION(fragment_barrier, 0x378);
|
2018-10-09 00:49:36 +00:00
|
|
|
ASSERT_REG_POSITION(scissor_test, 0x380);
|
2018-08-22 04:25:46 +00:00
|
|
|
ASSERT_REG_POSITION(stencil_back_func_ref, 0x3D5);
|
2020-02-02 20:50:46 +00:00
|
|
|
ASSERT_REG_POSITION(stencil_back_mask, 0x3D6);
|
|
|
|
ASSERT_REG_POSITION(stencil_back_func_mask, 0x3D7);
|
2020-12-30 05:25:23 +00:00
|
|
|
ASSERT_REG_POSITION(invalidate_texture_data_cache, 0x3DD);
|
|
|
|
ASSERT_REG_POSITION(tiled_cache_barrier, 0x3DF);
|
2018-11-05 02:46:06 +00:00
|
|
|
ASSERT_REG_POSITION(color_mask_common, 0x3E4);
|
2019-11-06 04:39:41 +00:00
|
|
|
ASSERT_REG_POSITION(depth_bounds, 0x3E7);
|
2020-04-12 03:21:27 +00:00
|
|
|
ASSERT_REG_POSITION(rt_separate_frag_data, 0x3EB);
|
|
|
|
ASSERT_REG_POSITION(multisample_raster_enable, 0x3ED);
|
|
|
|
ASSERT_REG_POSITION(multisample_raster_samples, 0x3EE);
|
|
|
|
ASSERT_REG_POSITION(multisample_sample_mask, 0x3EF);
|
2018-03-19 21:49:41 +00:00
|
|
|
ASSERT_REG_POSITION(zeta, 0x3F8);
|
2020-12-30 05:25:23 +00:00
|
|
|
ASSERT_REG_POSITION(render_area, 0x3FD);
|
2018-11-21 03:40:32 +00:00
|
|
|
ASSERT_REG_POSITION(clear_flags, 0x43E);
|
2020-02-24 22:43:57 +00:00
|
|
|
ASSERT_REG_POSITION(fill_rectangle, 0x44F);
|
2021-06-23 06:32:41 +00:00
|
|
|
ASSERT_REG_POSITION(conservative_raster_enable, 0x452);
|
2018-09-05 09:36:50 +00:00
|
|
|
ASSERT_REG_POSITION(vertex_attrib_format, 0x458);
|
2020-04-12 03:21:27 +00:00
|
|
|
ASSERT_REG_POSITION(multisample_sample_locations, 0x478);
|
|
|
|
ASSERT_REG_POSITION(multisample_coverage_to_color, 0x47E);
|
2018-03-19 21:46:29 +00:00
|
|
|
ASSERT_REG_POSITION(rt_control, 0x487);
|
2018-07-21 05:54:47 +00:00
|
|
|
ASSERT_REG_POSITION(zeta_width, 0x48a);
|
|
|
|
ASSERT_REG_POSITION(zeta_height, 0x48b);
|
2020-12-30 05:25:23 +00:00
|
|
|
ASSERT_REG_POSITION(zeta_depth, 0x48c);
|
|
|
|
ASSERT_REG_POSITION(sampler_index, 0x48D);
|
2021-06-24 05:41:09 +00:00
|
|
|
ASSERT_REG_POSITION(gp_passthrough_mask, 0x490);
|
2018-07-02 18:31:20 +00:00
|
|
|
ASSERT_REG_POSITION(depth_test_enable, 0x4B3);
|
2018-06-08 22:04:41 +00:00
|
|
|
ASSERT_REG_POSITION(independent_blend_enable, 0x4B9);
|
2018-07-02 18:31:20 +00:00
|
|
|
ASSERT_REG_POSITION(depth_write_enabled, 0x4BA);
|
2018-09-25 22:41:21 +00:00
|
|
|
ASSERT_REG_POSITION(alpha_test_enabled, 0x4BB);
|
2018-07-04 15:26:46 +00:00
|
|
|
ASSERT_REG_POSITION(d3d_cull_mode, 0x4C2);
|
2018-07-02 18:31:20 +00:00
|
|
|
ASSERT_REG_POSITION(depth_test_func, 0x4C3);
|
2018-11-02 03:21:25 +00:00
|
|
|
ASSERT_REG_POSITION(alpha_test_ref, 0x4C4);
|
|
|
|
ASSERT_REG_POSITION(alpha_test_func, 0x4C5);
|
|
|
|
ASSERT_REG_POSITION(draw_tfb_stride, 0x4C6);
|
|
|
|
ASSERT_REG_POSITION(blend_color, 0x4C7);
|
2018-06-08 22:04:41 +00:00
|
|
|
ASSERT_REG_POSITION(blend, 0x4CF);
|
2018-08-22 04:25:46 +00:00
|
|
|
ASSERT_REG_POSITION(stencil_enable, 0x4E0);
|
|
|
|
ASSERT_REG_POSITION(stencil_front_op_fail, 0x4E1);
|
|
|
|
ASSERT_REG_POSITION(stencil_front_op_zfail, 0x4E2);
|
|
|
|
ASSERT_REG_POSITION(stencil_front_op_zpass, 0x4E3);
|
|
|
|
ASSERT_REG_POSITION(stencil_front_func_func, 0x4E4);
|
|
|
|
ASSERT_REG_POSITION(stencil_front_func_ref, 0x4E5);
|
|
|
|
ASSERT_REG_POSITION(stencil_front_func_mask, 0x4E6);
|
|
|
|
ASSERT_REG_POSITION(stencil_front_mask, 0x4E7);
|
2018-11-14 01:09:01 +00:00
|
|
|
ASSERT_REG_POSITION(frag_color_clamp, 0x4EA);
|
2018-07-04 15:26:46 +00:00
|
|
|
ASSERT_REG_POSITION(screen_y_control, 0x4EB);
|
2020-02-25 00:02:32 +00:00
|
|
|
ASSERT_REG_POSITION(line_width_smooth, 0x4EC);
|
|
|
|
ASSERT_REG_POSITION(line_width_aliased, 0x4ED);
|
2020-12-30 05:25:23 +00:00
|
|
|
ASSERT_REG_POSITION(invalidate_sampler_cache_no_wfi, 0x509);
|
|
|
|
ASSERT_REG_POSITION(invalidate_texture_header_cache_no_wfi, 0x50A);
|
2018-07-02 16:21:23 +00:00
|
|
|
ASSERT_REG_POSITION(vb_element_base, 0x50D);
|
2019-09-15 15:48:54 +00:00
|
|
|
ASSERT_REG_POSITION(vb_base_instance, 0x50E);
|
2018-11-26 23:45:21 +00:00
|
|
|
ASSERT_REG_POSITION(clip_distance_enabled, 0x544);
|
2019-07-27 22:40:10 +00:00
|
|
|
ASSERT_REG_POSITION(samplecnt_enable, 0x545);
|
2018-09-28 04:31:01 +00:00
|
|
|
ASSERT_REG_POSITION(point_size, 0x546);
|
2020-02-04 18:19:45 +00:00
|
|
|
ASSERT_REG_POSITION(point_sprite_enable, 0x548);
|
2019-07-27 22:40:10 +00:00
|
|
|
ASSERT_REG_POSITION(counter_reset, 0x54C);
|
2020-04-12 03:21:27 +00:00
|
|
|
ASSERT_REG_POSITION(multisample_enable, 0x54D);
|
2018-07-21 05:54:47 +00:00
|
|
|
ASSERT_REG_POSITION(zeta_enable, 0x54E);
|
2018-11-14 03:02:54 +00:00
|
|
|
ASSERT_REG_POSITION(multisample_control, 0x54F);
|
2019-07-01 02:21:28 +00:00
|
|
|
ASSERT_REG_POSITION(condition, 0x554);
|
2018-03-19 05:36:25 +00:00
|
|
|
ASSERT_REG_POSITION(tsc, 0x557);
|
2020-04-12 03:21:27 +00:00
|
|
|
ASSERT_REG_POSITION(polygon_offset_factor, 0x55B);
|
2020-02-25 00:02:32 +00:00
|
|
|
ASSERT_REG_POSITION(line_smooth_enable, 0x55C);
|
2018-03-19 05:32:57 +00:00
|
|
|
ASSERT_REG_POSITION(tic, 0x55D);
|
2018-08-22 04:25:46 +00:00
|
|
|
ASSERT_REG_POSITION(stencil_two_side_enable, 0x565);
|
|
|
|
ASSERT_REG_POSITION(stencil_back_op_fail, 0x566);
|
|
|
|
ASSERT_REG_POSITION(stencil_back_op_zfail, 0x567);
|
|
|
|
ASSERT_REG_POSITION(stencil_back_op_zpass, 0x568);
|
|
|
|
ASSERT_REG_POSITION(stencil_back_func_func, 0x569);
|
2018-10-24 20:09:40 +00:00
|
|
|
ASSERT_REG_POSITION(framebuffer_srgb, 0x56E);
|
2018-11-26 23:31:44 +00:00
|
|
|
ASSERT_REG_POSITION(polygon_offset_units, 0x56F);
|
2020-04-12 03:21:27 +00:00
|
|
|
ASSERT_REG_POSITION(multisample_mode, 0x574);
|
2018-07-04 15:26:46 +00:00
|
|
|
ASSERT_REG_POSITION(point_coord_replace, 0x581);
|
2018-03-17 00:23:11 +00:00
|
|
|
ASSERT_REG_POSITION(code_address, 0x582);
|
|
|
|
ASSERT_REG_POSITION(draw, 0x585);
|
2018-10-25 23:04:13 +00:00
|
|
|
ASSERT_REG_POSITION(primitive_restart, 0x591);
|
2021-06-12 00:52:04 +00:00
|
|
|
ASSERT_REG_POSITION(provoking_vertex_last, 0x5A1);
|
2018-04-13 18:18:37 +00:00
|
|
|
ASSERT_REG_POSITION(index_array, 0x5F2);
|
2018-11-26 23:31:44 +00:00
|
|
|
ASSERT_REG_POSITION(polygon_offset_clamp, 0x61F);
|
2018-08-18 19:42:26 +00:00
|
|
|
ASSERT_REG_POSITION(instanced_arrays, 0x620);
|
2020-01-15 19:14:17 +00:00
|
|
|
ASSERT_REG_POSITION(vp_point_size, 0x644);
|
2019-12-29 00:41:41 +00:00
|
|
|
ASSERT_REG_POSITION(cull_test_enabled, 0x646);
|
|
|
|
ASSERT_REG_POSITION(front_face, 0x647);
|
|
|
|
ASSERT_REG_POSITION(cull_face, 0x648);
|
2018-11-24 16:15:14 +00:00
|
|
|
ASSERT_REG_POSITION(pixel_center_integer, 0x649);
|
|
|
|
ASSERT_REG_POSITION(viewport_transform_enabled, 0x64B);
|
2018-11-23 15:11:21 +00:00
|
|
|
ASSERT_REG_POSITION(view_volume_clip_control, 0x64F);
|
2019-11-06 04:39:41 +00:00
|
|
|
ASSERT_REG_POSITION(depth_bounds_enable, 0x66F);
|
2018-08-20 23:42:36 +00:00
|
|
|
ASSERT_REG_POSITION(logic_op, 0x671);
|
2018-06-07 04:53:43 +00:00
|
|
|
ASSERT_REG_POSITION(clear_buffers, 0x674);
|
2018-11-05 02:46:06 +00:00
|
|
|
ASSERT_REG_POSITION(color_mask, 0x680);
|
2018-02-12 17:34:41 +00:00
|
|
|
ASSERT_REG_POSITION(query, 0x6C0);
|
2018-03-17 03:47:45 +00:00
|
|
|
ASSERT_REG_POSITION(vertex_array[0], 0x700);
|
2018-06-08 22:04:41 +00:00
|
|
|
ASSERT_REG_POSITION(independent_blend, 0x780);
|
2018-03-17 03:47:45 +00:00
|
|
|
ASSERT_REG_POSITION(vertex_array_limit[0], 0x7C0);
|
2018-03-17 00:23:11 +00:00
|
|
|
ASSERT_REG_POSITION(shader_config[0], 0x800);
|
2019-08-31 20:43:19 +00:00
|
|
|
ASSERT_REG_POSITION(firmware, 0x8C0);
|
2018-03-17 21:17:45 +00:00
|
|
|
ASSERT_REG_POSITION(const_buffer, 0x8E0);
|
2018-03-17 21:29:20 +00:00
|
|
|
ASSERT_REG_POSITION(cb_bind[0], 0x904);
|
2018-03-18 08:13:22 +00:00
|
|
|
ASSERT_REG_POSITION(tex_cb_index, 0x982);
|
2020-03-02 04:54:00 +00:00
|
|
|
ASSERT_REG_POSITION(tfb_varying_locs, 0xA00);
|
2018-03-18 20:22:06 +00:00
|
|
|
ASSERT_REG_POSITION(ssbo_info, 0xD18);
|
2018-03-19 00:03:20 +00:00
|
|
|
ASSERT_REG_POSITION(tex_info_buffers.address[0], 0xD2A);
|
|
|
|
ASSERT_REG_POSITION(tex_info_buffers.size[0], 0xD2F);
|
2018-02-12 17:34:41 +00:00
|
|
|
|
|
|
|
#undef ASSERT_REG_POSITION
|
|
|
|
|
2018-07-20 22:14:17 +00:00
|
|
|
} // namespace Tegra::Engines
|