mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-19 18:52:47 +01:00
ShaderGen: Handle ShaderCode objects directly.
ShaderGeneratorInterface does not have virtual function members, so we have to implement each type explicitly.
This commit is contained in:
parent
b236c363de
commit
fa32f751d3
@ -172,7 +172,7 @@ bool LineGeometryShader::SetShader(u32 components, float lineWidth,
|
||||
static char buffer[16384];
|
||||
ShaderCode code;
|
||||
code.SetBuffer(buffer);
|
||||
GenerateVSOutputStructForGS(code, API_D3D);
|
||||
GenerateVSOutputStruct(code, API_D3D);
|
||||
code.Write("\n%s", LINE_GS_COMMON);
|
||||
|
||||
std::stringstream numTexCoordsStream;
|
||||
|
@ -166,7 +166,7 @@ bool PointGeometryShader::SetShader(u32 components, float pointSize,
|
||||
static char buffer[16384];
|
||||
ShaderCode code;
|
||||
code.SetBuffer(buffer);
|
||||
GenerateVSOutputStructForGS(code, API_D3D);
|
||||
GenerateVSOutputStruct(code, API_D3D);
|
||||
code.Write("\n%s", POINT_GS_COMMON);
|
||||
|
||||
std::stringstream numTexCoordsStream;
|
||||
|
@ -69,11 +69,7 @@ static inline void GenerateGeometryShader(T& out, u32 components, API_TYPE ApiTy
|
||||
"\tfloat4 " I_STEREOPROJECTION"[8];\n"
|
||||
"};\n");
|
||||
|
||||
ShaderCode code;
|
||||
char buf[16384];
|
||||
code.SetBuffer(buf);
|
||||
GenerateVSOutputStructForGS(code, ApiType);
|
||||
out.Write(code.GetBuffer());
|
||||
GenerateVSOutputStruct(out, ApiType);
|
||||
|
||||
out.Write("centroid in VS_OUTPUT v[];\n");
|
||||
out.Write("centroid out VS_OUTPUT o;\n");
|
||||
|
@ -277,11 +277,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
|
||||
);
|
||||
}
|
||||
|
||||
ShaderCode code;
|
||||
char buf[16384];
|
||||
code.SetBuffer(buf);
|
||||
GenerateVSOutputStructForGS(code, ApiType);
|
||||
out.Write(code.GetBuffer());
|
||||
GenerateVSOutputStruct(out, ApiType);
|
||||
|
||||
const bool forced_early_z = g_ActiveConfig.backend_info.bSupportsEarlyZ && bpmem.UseEarlyDepthTest() && (g_ActiveConfig.bFastDepthCalc || bpmem.alpha_test.TestResult() == AlphaTest::UNDETERMINED);
|
||||
const bool per_pixel_depth = (bpmem.ztex2.op != ZTEXTURE_DISABLE && bpmem.UseLateDepthTest()) || (!g_ActiveConfig.bFastDepthCalc && bpmem.zmode.testenable && !forced_early_z);
|
||||
|
@ -467,7 +467,12 @@ void GenerateVertexShaderCode(VertexShaderCode& object, u32 components, API_TYPE
|
||||
GenerateVertexShader<VertexShaderCode>(object, components, api_type);
|
||||
}
|
||||
|
||||
void GenerateVSOutputStructForGS(ShaderCode& object, API_TYPE api_type)
|
||||
void GenerateVSOutputStruct(ShaderCode& object, API_TYPE api_type)
|
||||
{
|
||||
GenerateVSOutputStruct<ShaderCode>(object, api_type);
|
||||
}
|
||||
|
||||
void GenerateVSOutputStruct(ShaderGeneratorInterface& object, API_TYPE api_type)
|
||||
{
|
||||
// Ignore unknown types
|
||||
}
|
||||
|
@ -66,4 +66,5 @@ typedef ShaderCode VertexShaderCode; // TODO: Obsolete..
|
||||
|
||||
void GetVertexShaderUid(VertexShaderUid& object, u32 components, API_TYPE api_type);
|
||||
void GenerateVertexShaderCode(VertexShaderCode& object, u32 components, API_TYPE api_type);
|
||||
void GenerateVSOutputStructForGS(ShaderCode& object, API_TYPE api_type);
|
||||
void GenerateVSOutputStruct(ShaderCode& object, API_TYPE api_type);
|
||||
void GenerateVSOutputStruct(ShaderGeneratorInterface& object, API_TYPE api_type);
|
||||
|
Loading…
x
Reference in New Issue
Block a user