Merge remote-tracking branch 'origin/master' into Resource-Update
Conflicts: include/Nazara/Audio/Music.hpp include/Nazara/Audio/SoundBuffer.hpp include/Nazara/Core/Resource.hpp include/Nazara/Core/ResourceListener.hpp include/Nazara/Graphics/Material.hpp include/Nazara/Renderer/Context.hpp include/Nazara/Renderer/RenderBuffer.hpp include/Nazara/Renderer/Shader.hpp include/Nazara/Renderer/Texture.hpp include/Nazara/Renderer/UberShader.hpp include/Nazara/Utility/Animation.hpp include/Nazara/Utility/Buffer.hpp include/Nazara/Utility/Image.hpp include/Nazara/Utility/IndexBuffer.hpp include/Nazara/Utility/Mesh.hpp include/Nazara/Utility/SkeletalMesh.hpp include/Nazara/Utility/Skeleton.hpp include/Nazara/Utility/StaticMesh.hpp include/Nazara/Utility/SubMesh.hpp include/Nazara/Utility/VertexBuffer.hpp include/Nazara/Utility/VertexDeclaration.hpp src/Nazara/Core/Resource.cpp src/Nazara/Core/ResourceListener.cpp src/Nazara/Graphics/DeferredRenderQueue.cpp src/Nazara/Graphics/ForwardRenderQueue.cpp src/Nazara/Graphics/SkinningManager.cpp src/Nazara/Renderer/RenderTexture.cpp src/Nazara/Renderer/Renderer.cpp src/Nazara/Utility/Mesh.cpp Former-commit-id: 99b5ad26a19fe9c9f8118da7b5920bffe89f60f8
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Renderer module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
@@ -16,17 +16,6 @@ m_program(0)
|
||||
{
|
||||
}
|
||||
|
||||
NzShader::NzShader(NzShader&& shader) :
|
||||
m_linked(shader.m_linked),
|
||||
m_program(shader.m_program)
|
||||
{
|
||||
for (unsigned int i = 0; i <= nzShaderStage_Max; ++i)
|
||||
m_attachedShaders[i] = std::move(shader.m_attachedShaders[i]);
|
||||
|
||||
shader.m_linked = false;
|
||||
shader.m_program = 0;
|
||||
}
|
||||
|
||||
NzShader::~NzShader()
|
||||
{
|
||||
Destroy();
|
||||
@@ -155,6 +144,7 @@ bool NzShader::Create()
|
||||
glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_InstanceData3], "InstanceData3");
|
||||
glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_InstanceData4], "InstanceData4");
|
||||
glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_InstanceData5], "InstanceData5");
|
||||
glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Color], "VertexColor");
|
||||
glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Normal], "VertexNormal");
|
||||
glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Position], "VertexPosition");
|
||||
glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Tangent], "VertexTangent");
|
||||
@@ -164,7 +154,6 @@ bool NzShader::Create()
|
||||
glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Userdata2], "VertexUserdata2");
|
||||
glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Userdata3], "VertexUserdata3");
|
||||
glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Userdata4], "VertexUserdata4");
|
||||
glBindAttribLocation(m_program, NzOpenGL::VertexComponentIndex[nzVertexComponent_Userdata5], "VertexUserdata5");
|
||||
|
||||
if (NzRenderer::HasCapability(nzRendererCap_MultipleRenderTargets))
|
||||
{
|
||||
@@ -254,10 +243,10 @@ NzString NzShader::GetSourceCode(nzShaderStage stage) const
|
||||
unsigned int totalLength = 0;
|
||||
for (unsigned int shader : m_attachedShaders[stage])
|
||||
{
|
||||
GLint length;
|
||||
glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &length);
|
||||
GLint length;
|
||||
glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &length);
|
||||
|
||||
totalLength += length - 1;
|
||||
totalLength += length - 1;
|
||||
}
|
||||
|
||||
totalLength += (m_attachedShaders[stage].size()-1)*(sizeof(sep)/sizeof(char));
|
||||
@@ -757,22 +746,6 @@ unsigned int NzShader::GetOpenGLID() const
|
||||
return m_program;
|
||||
}
|
||||
|
||||
NzShader& NzShader::operator=(NzShader&& shader)
|
||||
{
|
||||
Destroy();
|
||||
|
||||
for (unsigned int i = 0; i <= nzShaderStage_Max; ++i)
|
||||
m_attachedShaders[i] = std::move(shader.m_attachedShaders[i]);
|
||||
|
||||
m_linked = shader.m_linked;
|
||||
m_program = shader.m_program;
|
||||
|
||||
shader.m_linked = false;
|
||||
shader.m_program = 0;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool NzShader::IsStageSupported(nzShaderStage stage)
|
||||
{
|
||||
return NzShaderStage::IsSupported(stage);
|
||||
@@ -789,7 +762,6 @@ bool NzShader::PostLinkage()
|
||||
// Pour éviter de se tromper entre le nom et la constante
|
||||
#define CacheUniform(name) m_uniformLocations[nzShaderUniform_##name] = glGetUniformLocation(m_program, #name)
|
||||
|
||||
CacheUniform(EyePosition);
|
||||
CacheUniform(InvProjMatrix);
|
||||
CacheUniform(InvTargetSize);
|
||||
CacheUniform(InvViewMatrix);
|
||||
@@ -798,7 +770,6 @@ bool NzShader::PostLinkage()
|
||||
CacheUniform(InvWorldViewMatrix);
|
||||
CacheUniform(InvWorldViewProjMatrix);
|
||||
CacheUniform(ProjMatrix);
|
||||
CacheUniform(SceneAmbient);
|
||||
CacheUniform(TargetSize);
|
||||
CacheUniform(ViewMatrix);
|
||||
CacheUniform(ViewProjMatrix);
|
||||
|
||||
Reference in New Issue
Block a user