mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-04 03:46:42 +01:00
VideoCommon: Make IsPassthrough() a function of the ShaderUid.
This commit is contained in:
parent
c9e469f832
commit
1b9fe70d7c
@ -211,7 +211,7 @@ bool GeometryShaderCache::SetShader(u32 primitive_type)
|
|||||||
last_uid = uid;
|
last_uid = uid;
|
||||||
|
|
||||||
// Check if the shader is a pass-through shader
|
// Check if the shader is a pass-through shader
|
||||||
if (IsPassthroughGeometryShader(uid))
|
if (uid.GetUidData()->IsPassthrough())
|
||||||
{
|
{
|
||||||
// Return the default pass-through shader
|
// Return the default pass-through shader
|
||||||
last_entry = &pass_entry;
|
last_entry = &pass_entry;
|
||||||
|
@ -211,7 +211,7 @@ SHADER* ProgramShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 components
|
|||||||
ShaderCode gcode;
|
ShaderCode gcode;
|
||||||
GenerateVertexShaderCode(vcode, components, API_OPENGL);
|
GenerateVertexShaderCode(vcode, components, API_OPENGL);
|
||||||
GeneratePixelShaderCode(pcode, dstAlphaMode, API_OPENGL, components);
|
GeneratePixelShaderCode(pcode, dstAlphaMode, API_OPENGL, components);
|
||||||
if (g_ActiveConfig.backend_info.bSupportsGeometryShaders && !IsPassthroughGeometryShader(uid.guid))
|
if (g_ActiveConfig.backend_info.bSupportsGeometryShaders && !uid.guid.GetUidData()->IsPassthrough())
|
||||||
GenerateGeometryShaderCode(gcode, primitive_type, API_OPENGL);
|
GenerateGeometryShaderCode(gcode, primitive_type, API_OPENGL);
|
||||||
|
|
||||||
if (g_ActiveConfig.bEnableShaderDebugging)
|
if (g_ActiveConfig.bEnableShaderDebugging)
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#include "VideoCommon/BPMemory.h"
|
#include "VideoCommon/BPMemory.h"
|
||||||
#include "VideoCommon/GeometryShaderGen.h"
|
#include "VideoCommon/GeometryShaderGen.h"
|
||||||
#include "VideoCommon/LightingShaderGen.h"
|
#include "VideoCommon/LightingShaderGen.h"
|
||||||
#include "VideoCommon/VertexManagerBase.h"
|
|
||||||
#include "VideoCommon/VertexShaderGen.h"
|
#include "VideoCommon/VertexShaderGen.h"
|
||||||
#include "VideoCommon/VideoConfig.h"
|
#include "VideoCommon/VideoConfig.h"
|
||||||
|
|
||||||
@ -302,9 +301,3 @@ void GenerateGeometryShaderCode(ShaderCode& object, u32 primitive_type, API_TYPE
|
|||||||
{
|
{
|
||||||
GenerateGeometryShader<ShaderCode>(object, primitive_type, ApiType);
|
GenerateGeometryShader<ShaderCode>(object, primitive_type, ApiType);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsPassthroughGeometryShader(GeometryShaderUid& object)
|
|
||||||
{
|
|
||||||
geometry_shader_uid_data* uid_data = object.GetUidData<geometry_shader_uid_data>();
|
|
||||||
return uid_data->primitive_type == PRIMITIVE_TRIANGLES && !uid_data->stereo && !uid_data->wireframe;
|
|
||||||
}
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "VideoCommon/ShaderGenCommon.h"
|
#include "VideoCommon/ShaderGenCommon.h"
|
||||||
|
#include "VideoCommon/VertexManagerBase.h"
|
||||||
#include "VideoCommon/VideoCommon.h"
|
#include "VideoCommon/VideoCommon.h"
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
@ -12,6 +13,7 @@
|
|||||||
struct geometry_shader_uid_data
|
struct geometry_shader_uid_data
|
||||||
{
|
{
|
||||||
u32 NumValues() const { return sizeof(geometry_shader_uid_data); }
|
u32 NumValues() const { return sizeof(geometry_shader_uid_data); }
|
||||||
|
bool IsPassthrough() const { return primitive_type == PRIMITIVE_TRIANGLES && !stereo && !wireframe; }
|
||||||
|
|
||||||
u32 stereo : 1;
|
u32 stereo : 1;
|
||||||
u32 numTexGens : 4;
|
u32 numTexGens : 4;
|
||||||
@ -26,4 +28,3 @@ typedef ShaderUid<geometry_shader_uid_data> GeometryShaderUid;
|
|||||||
|
|
||||||
void GenerateGeometryShaderCode(ShaderCode& object, u32 primitive_type, API_TYPE ApiType);
|
void GenerateGeometryShaderCode(ShaderCode& object, u32 primitive_type, API_TYPE ApiType);
|
||||||
void GetGeometryShaderUid(GeometryShaderUid& object, u32 primitive_type, API_TYPE ApiType);
|
void GetGeometryShaderUid(GeometryShaderUid& object, u32 primitive_type, API_TYPE ApiType);
|
||||||
bool IsPassthroughGeometryShader(GeometryShaderUid& object);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user