A lot of fixes
This commit is contained in:
@@ -212,7 +212,7 @@ namespace Nz
|
||||
{
|
||||
if (auto it = m_pending.attachmentToTextures.find(depthStencilOutput); it == m_pending.attachmentToTextures.end())
|
||||
m_pending.attachmentToTextures.emplace(depthStencilOutput, textureId);
|
||||
else
|
||||
else if (it->second != textureId)
|
||||
throw std::runtime_error("depth-stencil output already assigned");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
#include <stdexcept>
|
||||
#include <Nazara/OpenGLRenderer/Debug.hpp>
|
||||
|
||||
#define NAZARA_OPENGLRENDERER_DEBUG 1
|
||||
|
||||
namespace Nz::GL
|
||||
{
|
||||
thread_local const Context* s_currentContext = nullptr;
|
||||
@@ -469,7 +467,7 @@ namespace Nz::GL
|
||||
{
|
||||
if (m_state.renderStates.depthCompare != renderStates.depthCompare)
|
||||
{
|
||||
glDepthFunc(ToOpenGL(m_state.renderStates.depthCompare));
|
||||
glDepthFunc(ToOpenGL(renderStates.depthCompare));
|
||||
m_state.renderStates.depthCompare = renderStates.depthCompare;
|
||||
}
|
||||
|
||||
@@ -516,12 +514,12 @@ namespace Nz::GL
|
||||
|
||||
if (currentStencilData.compare != newStencilData.compare ||
|
||||
currentStencilData.reference != newStencilData.reference ||
|
||||
currentStencilData.writeMask != newStencilData.writeMask)
|
||||
currentStencilData.compareMask != newStencilData.compareMask)
|
||||
{
|
||||
glStencilFuncSeparate((front) ? GL_FRONT : GL_BACK, ToOpenGL(newStencilData.compare), newStencilData.reference, newStencilData.writeMask);
|
||||
glStencilFuncSeparate((front) ? GL_FRONT : GL_BACK, ToOpenGL(newStencilData.compare), newStencilData.reference, newStencilData.compareMask);
|
||||
currentStencilData.compare = newStencilData.compare;
|
||||
currentStencilData.compareMask = newStencilData.compareMask;
|
||||
currentStencilData.reference = newStencilData.reference;
|
||||
currentStencilData.writeMask = newStencilData.writeMask;
|
||||
}
|
||||
|
||||
if (currentStencilData.depthFail != newStencilData.depthFail ||
|
||||
@@ -533,6 +531,12 @@ namespace Nz::GL
|
||||
currentStencilData.fail = newStencilData.fail;
|
||||
currentStencilData.pass = newStencilData.pass;
|
||||
}
|
||||
|
||||
if (currentStencilData.writeMask != newStencilData.writeMask)
|
||||
{
|
||||
glStencilMaskSeparate((front) ? GL_FRONT : GL_BACK, newStencilData.writeMask);
|
||||
currentStencilData.writeMask = newStencilData.writeMask;
|
||||
}
|
||||
};
|
||||
|
||||
ApplyStencilStates(true);
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace Nz
|
||||
|
||||
AppendHeader();
|
||||
|
||||
sanitizedAst->Visit(*this);
|
||||
targetAst->Visit(*this);
|
||||
|
||||
return state.stream.str();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,10 @@ namespace Nz
|
||||
|
||||
VkPipelineColorBlendAttachmentState& colorBlendState = colorBlendStates.emplace_back();
|
||||
colorBlendState.blendEnable = pipelineInfo.blending;
|
||||
colorBlendState.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT; //< TODO
|
||||
if (pipelineInfo.colorWrite)
|
||||
colorBlendState.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT; //< TODO
|
||||
else
|
||||
colorBlendState.colorWriteMask = 0;
|
||||
|
||||
if (pipelineInfo.blending)
|
||||
{
|
||||
|
||||
@@ -115,6 +115,9 @@ namespace Nz
|
||||
continue; //< Ignore
|
||||
}
|
||||
|
||||
if (!remainingStages.Test(stageType))
|
||||
continue;
|
||||
|
||||
m_stages.push_back({
|
||||
stageType,
|
||||
std::move(entryPoint.name)
|
||||
|
||||
Reference in New Issue
Block a user