Add wireframe support to Metal.
Also fixes segfault with cached shaders. Change-Id: I32be8c3dd28e93ffabc61437e62be729e4fc2d32 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261085 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
parent
e6d31bd089
commit
73d4615160
@ -87,6 +87,11 @@ void GrMtlOpsRenderPass::onDraw(const GrProgramInfo& programInfo,
|
||||
pipelineState->setDrawState(fActiveRenderCmdEncoder,
|
||||
programInfo.pipeline().outputSwizzle(),
|
||||
programInfo.pipeline().getXferProcessor());
|
||||
if (this->gpu()->caps()->wireframeMode() || programInfo.pipeline().isWireframe()) {
|
||||
[fActiveRenderCmdEncoder setTriangleFillMode:MTLTriangleFillModeLines];
|
||||
} else {
|
||||
[fActiveRenderCmdEncoder setTriangleFillMode:MTLTriangleFillModeFill];
|
||||
}
|
||||
|
||||
bool hasDynamicScissors = programInfo.hasDynamicScissors();
|
||||
bool hasDynamicTextures = programInfo.hasDynamicPrimProcTextures();
|
||||
|
@ -469,7 +469,9 @@ GrMtlPipelineState* GrMtlPipelineStateBuilder::finalize(GrRenderTarget* renderTa
|
||||
if (fGpu->getContext()->priv().options().fShaderCacheStrategy ==
|
||||
GrContextOptions::ShaderCacheStrategy::kSkSL) {
|
||||
for (int i = 0; i < kGrShaderTypeCount; ++i) {
|
||||
shaders[i] = GrShaderUtils::PrettyPrint(*sksl[i]);
|
||||
if (sksl[i]) {
|
||||
shaders[i] = GrShaderUtils::PrettyPrint(*sksl[i]);
|
||||
}
|
||||
}
|
||||
isSkSL = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user