Commit 1ac6322f authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'revert-b64f4c56' into 'master'

Revert "Merge branch 'gl_clipdistance_passthrough' into 'master'"

See merge request !6
parents 4eee0178 197ed498
......@@ -1615,20 +1615,6 @@ void ShaderProgGenerator::buildGeometryShader()
mainCode.push_back("gl_Position = gl_in[inIdx].gl_Position;");
mainCode.push_back("gl_PrimitiveID = gl_PrimitiveIDIn;");
// built-in gl_ClipDistance[]
static int maxClipDistances = -1;
if (maxClipDistances < 0)
{
glGetIntegerv(GL_MAX_CLIP_DISTANCES, &maxClipDistances);
maxClipDistances = std::min(maxClipDistances, 32); // clamp to 32 bits
}
for (int i = 0; i < maxClipDistances; ++i)
{
if (desc_.clipDistanceMask & (1 << i))
mainCode.push_back(QString("gl_ClipDistance[%1] = gl_in[inIdx].gl_ClipDistance[%1];").arg(i));
}
// custom IO
for (int i = 0; i < geometry_->getNumInputs(); ++i)
{
......@@ -2734,7 +2720,7 @@ QString ShaderGenDesc::toString() const
resStrm << "version: " << version;
resStrm << "\nshaderDesc.numLights: " << numLights;
resStrm << "shaderDesc.numLights: " << numLights;
if (numLights)
{
......
......@@ -102,7 +102,6 @@ public:
fragmentTemplateFile(""),
normalizeTexColors(true),
colorMaterialMode(GL_AMBIENT_AND_DIFFUSE),
clipDistanceMask(0),
textureTypes_(),
texGenDim(0),
texGenMode(GL_EYE_LINEAR),
......@@ -179,11 +178,6 @@ public:
// default: GL_AMBIENT_AND_DIFFUSE
GLenum colorMaterialMode;
// Bitmask of enabled hardware clip planes.
// Bit i represents the i'th clip plane starting at the least significant bit.
// This is needed to pass the gl_ClipDistance[] array through the geometry shader stage.
uint clipDistanceMask;
struct TextureType
{
GLenum type;
......@@ -285,13 +279,6 @@ public:
return false;
}
if (!geometryTemplateFile.isEmpty())
{
// clip distance mask only affects the geometry shader
if (clipDistanceMask != _rhs.clipDistanceMask)
return false;
}
if (fragmentTemplateFile != _rhs.fragmentTemplateFile)
return false;
......
......@@ -248,8 +248,6 @@ void ClippingNode::ClippingObjectModifier::apply(RenderObject* _obj)
// set shader modifier
_obj->shaderDesc.shaderMods.push_back(shaderModID);
// enable clip distance pass through in geometry shader
_obj->shaderDesc.clipDistanceMask = _obj->clipDistanceMask;
}
//=============================================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment