Merge pull request #16616 from hrydgard/assorted-asserts

Add some asserts in the hope of gathering some more info
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2022-12-19 08:09:29 +01:00
commit df428019f8
4 files changed
+11 -5

No files matched your search

+3 -1
View File
@@ -796,7 +796,9 @@ public:
}
void SetBlendAndMask(int colorMask, bool blendEnabled, GLenum srcColor, GLenum dstColor, GLenum srcAlpha, GLenum dstAlpha, GLenum funcColor, GLenum funcAlpha) {
_dbg_assert_(curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER);
// Make this one only a non-debug _assert_, since it often comes first.
// Lets us collect info about this potential crash through assert extra data.
_assert_(curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER);
GLRRenderData data{ GLRRenderCommand::BLEND };
data.blend.mask = colorMask;
data.blend.enabled = blendEnabled;
+5 -4
View File
@@ -281,8 +281,7 @@ private:
class OpenGLPipeline : public Pipeline {
public:
OpenGLPipeline(GLRenderManager *render) : render_(render) {
}
OpenGLPipeline(GLRenderManager *render) : render_(render) {}
~OpenGLPipeline() {
for (auto &iter : shaders) {
iter->Release();
@@ -1142,17 +1141,19 @@ Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc, const
iter->AddRef();
pipeline->shaders.push_back(static_cast<OpenGLShaderModule *>(iter));
} else {
ERROR_LOG(G3D, "ERROR: Tried to create graphics pipeline %s with a null shader module", tag);
ERROR_LOG(G3D, "ERROR: Tried to create graphics pipeline %s with a null shader module", tag ? tag : "no tag");
delete pipeline;
return nullptr;
}
}
if (desc.uniformDesc) {
pipeline->dynamicUniforms = *desc.uniformDesc;
}
pipeline->samplers_ = desc.samplers;
if (pipeline->LinkShaders(desc)) {
_assert_((u32)desc.prim < ARRAY_SIZE(primToGL));
// Build the rest of the virtual pipeline object.
pipeline->prim = primToGL[(int)desc.prim];
pipeline->depthStencil = (OpenGLDepthStencilState *)desc.depthStencil;
@@ -1161,7 +1162,7 @@ Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc, const
pipeline->inputLayout = (OpenGLInputLayout *)desc.inputLayout;
return pipeline;
} else {
ERROR_LOG(G3D, "Failed to create pipeline %s - shaders failed to link", tag);
ERROR_LOG(G3D, "Failed to create pipeline %s - shaders failed to link", tag ? tag : "no tag");
delete pipeline;
return nullptr;
}
@@ -635,6 +635,7 @@ void VulkanRenderManager::EndCurRenderStep() {
for (VKRGraphicsPipeline *pipeline : pipelinesToCheck_) {
if (!pipeline->pipeline[(size_t)rpType]) {
pipeline->pipeline[(size_t)rpType] = Promise<VkPipeline>::CreateEmpty();
_assert_(renderPass);
compileQueue_.push_back(CompileQueueEntry(pipeline, renderPass->Get(vulkan_, rpType, sampleCount), rpType, sampleCount));
needsCompile = true;
}
+2
View File
@@ -876,6 +876,8 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) {
Core_SetGraphicsContext(graphicsContext);
g_draw = graphicsContext->GetDrawContext();
_assert_(g_draw);
if (!CreateGlobalPipelines()) {
ERROR_LOG(G3D, "Failed to create global pipelines");
return false;