mirror of
https://github.com/leozide/leocad.git
synced 2026-07-27 19:56:49 +00:00
Fixed texture upload from worker threads.
This commit is contained in:
+6
-2
@@ -255,7 +255,7 @@ void lcScene::DrawOpaqueMeshes(lcContext* Context, bool DrawLit, int PrimitiveTy
|
||||
}
|
||||
}
|
||||
|
||||
const lcTexture* const Texture = Section->Texture;
|
||||
lcTexture* const Texture = Section->Texture;
|
||||
int VertexBufferOffset = Mesh->mVertexCacheOffset != -1 ? Mesh->mVertexCacheOffset : 0;
|
||||
const int IndexBufferOffset = Mesh->mIndexCacheOffset != -1 ? Mesh->mIndexCacheOffset : 0;
|
||||
|
||||
@@ -266,6 +266,8 @@ void lcScene::DrawOpaqueMeshes(lcContext* Context, bool DrawLit, int PrimitiveTy
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Texture->NeedsUpload())
|
||||
Texture->Upload(Context);
|
||||
Context->SetMaterial(TexturedMaterial);
|
||||
VertexBufferOffset += Mesh->mNumVertices * sizeof(lcVertex);
|
||||
Context->SetVertexFormat(VertexBufferOffset, 3, 1, 2, 0, DrawLit);
|
||||
@@ -357,7 +359,7 @@ void lcScene::DrawTranslucentMeshes(lcContext* Context, bool DrawLit, bool DrawF
|
||||
break;
|
||||
}
|
||||
|
||||
const lcTexture* Texture = Section->Texture;
|
||||
lcTexture* const Texture = Section->Texture;
|
||||
int VertexBufferOffset = Mesh->mVertexCacheOffset != -1 ? Mesh->mVertexCacheOffset : 0;
|
||||
const int IndexBufferOffset = Mesh->mIndexCacheOffset != -1 ? Mesh->mIndexCacheOffset : 0;
|
||||
|
||||
@@ -368,6 +370,8 @@ void lcScene::DrawTranslucentMeshes(lcContext* Context, bool DrawLit, bool DrawF
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Texture->NeedsUpload())
|
||||
Texture->Upload(Context);
|
||||
Context->SetMaterial(TexturedMaterial);
|
||||
VertexBufferOffset += Mesh->mNumVertices * sizeof(lcVertex);
|
||||
Context->SetVertexFormat(VertexBufferOffset, 3, 1, 2, 0, DrawLit);
|
||||
|
||||
Reference in New Issue
Block a user