diff --git a/GPU/Common/ShaderId.cpp b/GPU/Common/ShaderId.cpp index cb9b10af75..f59fa4f601 100644 --- a/GPU/Common/ShaderId.cpp +++ b/GPU/Common/ShaderId.cpp @@ -410,6 +410,11 @@ std::string GeometryShaderDesc(const GShaderID &id) { void ComputeGeometryShaderID(GShaderID *id_out, const Draw::Bugs &bugs, int prim) { GShaderID id; + // Early out. + if (!gstate_c.Use(GPU_USE_GS_CULLING)) { + *id_out = id; + return; + } bool isModeThrough = gstate.isModeThrough(); bool isCurve = gstate_c.submitType != SubmitType::DRAW; @@ -418,9 +423,8 @@ void ComputeGeometryShaderID(GShaderID *id_out, const Draw::Bugs &bugs, int prim bool vertexRangeCulling = !isCurve; bool clipClampedDepth = gstate_c.Use(GPU_USE_DEPTH_CLAMP) && !gstate_c.Use(GPU_USE_CLIP_DISTANCE); - // If we're not using GS culling, return a zero ID. - // Also, only use this for triangle primitives. - if ((!vertexRangeCulling && !clipClampedDepth) || isModeThrough || !isTriangle || !gstate_c.Use(GPU_USE_GS_CULLING)) { + // Only use this for triangle primitives, and if we actually need it. + if ((!vertexRangeCulling && !clipClampedDepth) || isModeThrough || !isTriangle) { *id_out = id; return; } diff --git a/GPU/Common/ShaderId.h b/GPU/Common/ShaderId.h index 6c3a886669..0a524e02f2 100644 --- a/GPU/Common/ShaderId.h +++ b/GPU/Common/ShaderId.h @@ -166,10 +166,12 @@ struct ShaderID { return d[word]; } + // Note: This is a binary copy to string-as-bytes, not a human-readable representation. void ToString(std::string *dest) const { dest->resize(sizeof(d)); memcpy(&(*dest)[0], d, sizeof(d)); } + // Note: This is a binary copy from string-as-bytes, not a human-readable representation. void FromString(std::string src) { memcpy(d, &(src)[0], sizeof(d)); }