rpcsx/rpcs3/Emu/RSX/GL/GLVertexProgram.h

60 lines
1.7 KiB
C
Raw Normal View History

#pragma once
2015-05-19 19:43:22 +02:00
#include "../Common/VertexProgramDecompiler.h"
2014-08-04 01:33:57 +02:00
#include "Emu/RSX/RSXVertexProgram.h"
enum
{
GL_VP_FORCE_ATTRIB_SCALING = 1, //Scale vertex read result
GL_VP_ATTRIB_S16_INT = (1 << 1), //Attrib is a signed 16-bit integer
GL_VP_ATTRIB_S32_INT = (1 << 2), //Attrib is a signed 32-bit integer
GL_VP_SINT_MASK = (GL_VP_ATTRIB_S16_INT|GL_VP_ATTRIB_S32_INT)
};
2015-07-01 00:25:52 +02:00
struct GLVertexDecompilerThread : public VertexProgramDecompiler
{
2015-05-19 19:43:22 +02:00
std::string &m_shader;
protected:
std::string getFloatTypeName(size_t elementCount) override;
std::string getIntTypeName(size_t elementCount) override;
std::string getFunction(FUNCTION) override;
std::string compareFunction(COMPARE, const std::string&, const std::string&, bool scalar) override;
void insertHeader(std::stringstream &OS) override;
void insertInputs(std::stringstream &OS, const std::vector<ParamType> &inputs) override;
void insertConstants(std::stringstream &OS, const std::vector<ParamType> &constants) override;
void insertOutputs(std::stringstream &OS, const std::vector<ParamType> &outputs) override;
void insertMainStart(std::stringstream &OS) override;
void insertMainEnd(std::stringstream &OS) override;
const RSXVertexProgram &rsx_vertex_program;
std::unordered_map<std::string, int> input_locations;
2015-05-19 19:43:22 +02:00
public:
GLVertexDecompilerThread(const RSXVertexProgram &prog, std::string& shader, ParamArray&)
: VertexProgramDecompiler(prog)
2015-07-01 00:25:52 +02:00
, m_shader(shader)
, rsx_vertex_program(prog)
{
}
2015-07-01 00:25:52 +02:00
void Task();
};
class GLVertexProgram
2013-11-09 22:29:49 +01:00
{
public:
2013-11-09 22:29:49 +01:00
GLVertexProgram();
~GLVertexProgram();
2015-05-19 19:43:22 +02:00
ParamArray parr;
2015-07-01 00:25:52 +02:00
u32 id = 0;
std::string shader;
bool interleaved;
void Decompile(const RSXVertexProgram& prog);
void Compile();
private:
void Delete();
};