Moved variadic templates arguments first in ShadowCommandBuffer to fix compilation with visual studio
This commit is contained in:
parent
c82ff61cf4
commit
1ba19948f6
src/graphics
@ -454,10 +454,10 @@ public:
|
|||||||
* \param cascade The cascade id (see cascading shadow maps)
|
* \param cascade The cascade id (see cascading shadow maps)
|
||||||
*/
|
*/
|
||||||
template<typename T, typename...Uniforms>
|
template<typename T, typename...Uniforms>
|
||||||
void drawIndirect(Uniforms ...uniforms, unsigned cascade) const
|
void drawIndirect(unsigned cascade, Uniforms ...uniforms) const
|
||||||
{
|
{
|
||||||
T::InstancedShadowPassShader::getInstance()->use();
|
T::InstancedShadowPassShader::getInstance()->use();
|
||||||
T::InstancedShadowPassShader::getInstance()->setUniforms(uniforms..., cascade);
|
T::InstancedShadowPassShader::getInstance()->setUniforms(cascade, uniforms...);
|
||||||
|
|
||||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType,
|
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType,
|
||||||
InstanceTypeShadow));
|
InstanceTypeShadow));
|
||||||
@ -487,14 +487,14 @@ public:
|
|||||||
* \param cascade The cascade id (see cascading shadow maps)
|
* \param cascade The cascade id (see cascading shadow maps)
|
||||||
*/
|
*/
|
||||||
template<typename T, typename...Uniforms>
|
template<typename T, typename...Uniforms>
|
||||||
void multidrawShadow(Uniforms ...uniforms, unsigned cascade) const
|
void multidrawShadow(unsigned cascade, Uniforms ...uniforms) const
|
||||||
{
|
{
|
||||||
int material_id = T::MaterialType + cascade * Material::SHADERTYPE_COUNT;
|
int material_id = T::MaterialType + cascade * Material::SHADERTYPE_COUNT;
|
||||||
|
|
||||||
if (m_size[material_id])
|
if (m_size[material_id])
|
||||||
{
|
{
|
||||||
T::InstancedShadowPassShader::getInstance()->use();
|
T::InstancedShadowPassShader::getInstance()->use();
|
||||||
T::InstancedShadowPassShader::getInstance()->setUniforms(uniforms..., cascade);
|
T::InstancedShadowPassShader::getInstance()->setUniforms(cascade, uniforms...);
|
||||||
|
|
||||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType,
|
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType,
|
||||||
InstanceTypeShadow));
|
InstanceTypeShadow));
|
||||||
|
@ -659,7 +659,7 @@ void DrawCalls::drawIndirectShadows(unsigned cascade) const
|
|||||||
m_shadow_cmd_buffer.drawIndirect<DetailMat>(cascade);
|
m_shadow_cmd_buffer.drawIndirect<DetailMat>(cascade);
|
||||||
m_shadow_cmd_buffer.drawIndirect<AlphaRef>(cascade);
|
m_shadow_cmd_buffer.drawIndirect<AlphaRef>(cascade);
|
||||||
m_shadow_cmd_buffer.drawIndirect<UnlitMat>(cascade);
|
m_shadow_cmd_buffer.drawIndirect<UnlitMat>(cascade);
|
||||||
m_shadow_cmd_buffer.drawIndirect<GrassMat,irr::core::vector3df>(m_wind_dir, cascade);
|
m_shadow_cmd_buffer.drawIndirect<GrassMat,irr::core::vector3df>(cascade, m_wind_dir);
|
||||||
m_shadow_cmd_buffer.drawIndirect<NormalMat>(cascade);
|
m_shadow_cmd_buffer.drawIndirect<NormalMat>(cascade);
|
||||||
m_shadow_cmd_buffer.drawIndirect<SplattingMat>(cascade);
|
m_shadow_cmd_buffer.drawIndirect<SplattingMat>(cascade);
|
||||||
m_shadow_cmd_buffer.drawIndirect<SphereMap>(cascade);
|
m_shadow_cmd_buffer.drawIndirect<SphereMap>(cascade);
|
||||||
@ -678,7 +678,7 @@ void DrawCalls::multidrawShadows(unsigned cascade) const
|
|||||||
m_shadow_cmd_buffer.multidrawShadow<NormalMat>(cascade);
|
m_shadow_cmd_buffer.multidrawShadow<NormalMat>(cascade);
|
||||||
m_shadow_cmd_buffer.multidrawShadow<AlphaRef>(cascade);
|
m_shadow_cmd_buffer.multidrawShadow<AlphaRef>(cascade);
|
||||||
m_shadow_cmd_buffer.multidrawShadow<UnlitMat>(cascade);
|
m_shadow_cmd_buffer.multidrawShadow<UnlitMat>(cascade);
|
||||||
m_shadow_cmd_buffer.multidrawShadow<GrassMat,irr::core::vector3df>(m_wind_dir, cascade);
|
m_shadow_cmd_buffer.multidrawShadow<GrassMat,irr::core::vector3df>(cascade, m_wind_dir);
|
||||||
m_shadow_cmd_buffer.multidrawShadow<SplattingMat>(cascade);
|
m_shadow_cmd_buffer.multidrawShadow<SplattingMat>(cascade);
|
||||||
m_shadow_cmd_buffer.multidrawShadow<SphereMap>(cascade);
|
m_shadow_cmd_buffer.multidrawShadow<SphereMap>(cascade);
|
||||||
}
|
}
|
||||||
|
@ -522,7 +522,7 @@ public:
|
|||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
class InstancedGrassShadowShader : public TextureShader<InstancedGrassShadowShader, 1,
|
class InstancedGrassShadowShader : public TextureShader<InstancedGrassShadowShader, 1,
|
||||||
core::vector3df, int>
|
int, core::vector3df>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InstancedGrassShadowShader()
|
InstancedGrassShadowShader()
|
||||||
@ -545,7 +545,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
assignSamplerNames(0, "tex", ST_TRILINEAR_ANISOTROPIC_FILTERED);
|
assignSamplerNames(0, "tex", ST_TRILINEAR_ANISOTROPIC_FILTERED);
|
||||||
assignUniforms("windDir", "layer");
|
assignUniforms("layer", "windDir");
|
||||||
} // InstancedGrassShadowShader
|
} // InstancedGrassShadowShader
|
||||||
}; // InstancedGrassShadowShader
|
}; // InstancedGrassShadowShader
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user