GPU: Refactor "VertexShader" namespace to "Shader".
- Also renames "vertex_shader.*" to "shader_interpreter.*"
This commit is contained in:
parent
4b7664fe12
commit
f622a78544
14 changed files with 49 additions and 51 deletions
|
@ -18,7 +18,7 @@
|
|||
#include "pica.h"
|
||||
#include "primitive_assembly.h"
|
||||
#include "renderer_base.h"
|
||||
#include "vertex_shader.h"
|
||||
#include "shader_interpreter.h"
|
||||
#include "video_core.h"
|
||||
|
||||
namespace Pica {
|
||||
|
@ -165,7 +165,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
|
|||
DebugUtils::GeometryDumper geometry_dumper;
|
||||
PrimitiveAssembler<DebugUtils::GeometryDumper::Vertex> dumping_primitive_assembler(regs.triangle_topology.Value());
|
||||
#endif
|
||||
PrimitiveAssembler<VertexShader::OutputVertex> primitive_assembler(regs.triangle_topology.Value());
|
||||
PrimitiveAssembler<Shader::OutputVertex> primitive_assembler(regs.triangle_topology.Value());
|
||||
|
||||
if (g_debug_context) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
|
@ -210,7 +210,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
|
|||
// The size has been tuned for optimal balance between hit-rate and the cost of lookup
|
||||
const size_t VERTEX_CACHE_SIZE = 32;
|
||||
std::array<u16, VERTEX_CACHE_SIZE> vertex_cache_ids;
|
||||
std::array<VertexShader::OutputVertex, VERTEX_CACHE_SIZE> vertex_cache;
|
||||
std::array<Shader::OutputVertex, VERTEX_CACHE_SIZE> vertex_cache;
|
||||
|
||||
unsigned int vertex_cache_pos = 0;
|
||||
vertex_cache_ids.fill(-1);
|
||||
|
@ -224,7 +224,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
|
|||
ASSERT(vertex != -1);
|
||||
|
||||
bool vertex_cache_hit = false;
|
||||
VertexShader::OutputVertex output;
|
||||
Shader::OutputVertex output;
|
||||
|
||||
if (is_indexed) {
|
||||
if (g_debug_context && Pica::g_debug_context->recorder) {
|
||||
|
@ -243,7 +243,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
|
|||
|
||||
if (!vertex_cache_hit) {
|
||||
// Initialize data for the current vertex
|
||||
VertexShader::InputVertex input;
|
||||
Shader::InputVertex input;
|
||||
|
||||
for (int i = 0; i < attribute_config.GetNumTotalAttributes(); ++i) {
|
||||
if (vertex_attribute_elements[i] != 0) {
|
||||
|
@ -306,9 +306,8 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
|
|||
std::bind(&DebugUtils::GeometryDumper::AddTriangle,
|
||||
&geometry_dumper, _1, _2, _3));
|
||||
#endif
|
||||
|
||||
// Send to vertex shader
|
||||
output = VertexShader::RunShader(input, attribute_config.GetNumTotalAttributes(), g_state.regs.vs, g_state.vs);
|
||||
output = Shader::RunShader(input, attribute_config.GetNumTotalAttributes(), g_state.regs.vs, g_state.vs);
|
||||
|
||||
if (is_indexed) {
|
||||
vertex_cache[vertex_cache_pos] = output;
|
||||
|
@ -319,9 +318,9 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
|
|||
|
||||
if (Settings::values.use_hw_renderer) {
|
||||
// Send to hardware renderer
|
||||
static auto AddHWTriangle = [](const Pica::VertexShader::OutputVertex& v0,
|
||||
const Pica::VertexShader::OutputVertex& v1,
|
||||
const Pica::VertexShader::OutputVertex& v2) {
|
||||
static auto AddHWTriangle = [](const Pica::Shader::OutputVertex& v0,
|
||||
const Pica::Shader::OutputVertex& v1,
|
||||
const Pica::Shader::OutputVertex& v2) {
|
||||
VideoCore::g_renderer->hw_rasterizer->AddTriangle(v0, v1, v2);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue