Fix warnings, ignore new CMake build directories (#3356)

This commit is contained in:
Tim Sylvester
2025-04-02 12:51:34 -07:00
committed by GitHub
parent b022d4878d
commit 2868ee829a
4 changed files with 7 additions and 6 deletions

1
.gitignore vendored
View File

@@ -21,6 +21,7 @@ local.properties
.cache
compile_commands.json
/build
/build-*
**/.idea
**/.clwb
/new_offline.db

View File

@@ -266,8 +266,8 @@ PremultipliedImage drawGlyphBitmap(GlyphID glyphID, CTFontRef font, GlyphMetrics
CFArrayRef glyphRuns = CTLineGetGlyphRuns(*line);
CTRunRef glyphRun = (CTRunRef)CFArrayGetValueAtIndex(glyphRuns, 0);
CFRange wholeRunRange = CFRangeMake(0, CTRunGetGlyphCount(glyphRun));
CGSize advances[wholeRunRange.length];
CTRunGetAdvances(glyphRun, wholeRunRange, advances);
std::vector<CGSize> advances(wholeRunRange.length);
CTRunGetAdvances(glyphRun, wholeRunRange, advances.data());
metrics.advance = std::round(advances[0].width);
// Mimic glyph PBF metrics.

View File

@@ -184,7 +184,7 @@ void BufferResource::updateVertexBindOffset(const MTLRenderCommandEncoderPtr& en
// The documentation for `setVertexBufferOffset` indicates that it should work for buffers
// assigned using `setVertexBytes` but, in practice, it produces a validation failure:
// `Set Vertex Buffer Offset Validation index(1) must have an existing buffer.`
if (const auto* mtlBuf = buffer.get()) {
if (buffer.get()) {
encoder->setVertexBufferOffset(offset, index);
} else {
bindVertex(encoder, offset, index, size_);
@@ -195,7 +195,7 @@ void BufferResource::updateFragmentBindOffset(const MTLRenderCommandEncoderPtr&
std::size_t offset,
std::size_t index,
std::size_t size_) const noexcept {
if (const auto* mtlBuf = buffer.get()) {
if (buffer.get()) {
encoder->setFragmentBufferOffset(offset, index);
} else {
bindFragment(encoder, offset, index, size_);

View File

@@ -605,12 +605,12 @@ MTLDepthStencilStatePtr Context::makeDepthStencilState(const gfx::DepthMode& dep
// `Draw Errors Validation MTLDepthStencilDescriptor sets depth test but MTLRenderPassDescriptor has a nil
// depthAttachment texture`
if (auto* depthTarget = rpd->depthAttachment()) {
if (auto* tex = depthTarget->texture()) {
if (depthTarget->texture()) {
applyDepthMode(depthMode, depthStencilDescriptor.get());
}
}
if (auto* stencilTarget = rpd->stencilAttachment()) {
if (auto* tex = stencilTarget->texture()) {
if (stencilTarget->texture()) {
auto stencilDescriptor = NS::TransferPtr(MTL::StencilDescriptor::alloc()->init());
if (!stencilDescriptor) {
return {};