Merge branch 'FlaxEngine:master' into master

This commit is contained in:
Ruan Lucas
2023-04-29 08:48:52 -04:00
committed by GitHub
3 changed files with 17 additions and 11 deletions

View File

@@ -133,8 +133,9 @@ void GPUTextureDX11::OnResidentMipsChanged()
srDesc.Texture2D.MostDetailedMip = firstMipIndex;
srDesc.Texture2D.MipLevels = mipLevels;
}
ID3D11ShaderResourceView* srView;
VALIDATE_DIRECTX_RESULT(_device->GetDevice()->CreateShaderResourceView(_resource, &srDesc, &srView));
ID3D11ShaderResourceView* srView = nullptr;
if (mipLevels != 0)
VALIDATE_DIRECTX_RESULT(_device->GetDevice()->CreateShaderResourceView(_resource, &srDesc, &srView));
GPUTextureViewDX11& view = IsVolume() ? _handleVolume : _handlesPerSlice[0];
if (view.GetParent() == nullptr)
view.Init(this, nullptr, srView, nullptr, nullptr, Format(), MultiSampleLevel());

View File

@@ -240,7 +240,8 @@ void GPUTextureDX12::OnResidentMipsChanged()
GPUTextureViewDX12& view = IsVolume() ? _handleVolume : _handlesPerSlice[0];
if (view.GetParent() == nullptr)
view.Init(this, _device, this, Format(), MultiSampleLevel());
view.SetSRV(srDesc);
if (mipLevels != 0)
view.SetSRV(srDesc);
}
void GPUTextureDX12::OnReleaseGPU()

View File

@@ -201,25 +201,29 @@ void Font::ProcessText(const StringView& text, Array<FontLineCache>& outputLines
moveLine = true;
if (lastWhitespaceIndex != INVALID_INDEX)
{
// Back
cursorX = lastWhitespaceX;
tmpLine.LastCharIndex = lastWhitespaceIndex - 1;
currentIndex = lastWhitespaceIndex + 1;
nextCharIndex = currentIndex;
nextCharIndex = currentIndex = lastWhitespaceIndex + 1;
}
else if (lastUpperIndex != INVALID_INDEX)
{
// Skip moving twice for the same character
if (outputLines.HasItems() && outputLines.Last().LastCharIndex == lastUpperIndex - 1)
{
currentIndex = nextCharIndex;
lastMoveLine = moveLine;
continue;
}
cursorX = lastUpperX;
tmpLine.LastCharIndex = lastUpperIndex - 1;
currentIndex = lastUpperIndex + 1;
nextCharIndex = currentIndex;
nextCharIndex = currentIndex = lastUpperIndex;
}
else if (lastUnderscoreIndex != INVALID_INDEX)
{
cursorX = lastUnderscoreX;
tmpLine.LastCharIndex = lastUnderscoreIndex;
currentIndex = lastUnderscoreIndex + 1;
nextCharIndex = currentIndex;
tmpLine.LastCharIndex = lastUnderscoreIndex - 2;
nextCharIndex = currentIndex = lastUnderscoreIndex + 1;
}
else
{