Fix warnings, ignore new CMake build directories (#3356)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,6 +21,7 @@ local.properties
|
||||
.cache
|
||||
compile_commands.json
|
||||
/build
|
||||
/build-*
|
||||
**/.idea
|
||||
**/.clwb
|
||||
/new_offline.db
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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_);
|
||||
|
||||
@@ -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 {};
|
||||
|
||||
Reference in New Issue
Block a user