Added full support for runtime editing of material properties #215

Merged
Pycorax merged 14 commits from SP3-1-MaterialEditSupport into main 2022-11-17 09:22:53 +08:00
2 changed files with 21 additions and 4 deletions
Showing only changes of commit f0c09817ce - Show all commits

View File

@ -115,6 +115,7 @@ namespace Sandbox
SHSystemManager::RegisterRoutine<SHDebugDrawSystem, SHDebugDrawSystem::ProcessPointsRoutine>(); SHSystemManager::RegisterRoutine<SHDebugDrawSystem, SHDebugDrawSystem::ProcessPointsRoutine>();
SHSystemManager::RegisterRoutine<SHScriptEngine, SHScriptEngine::GizmosDrawRoutine>(); SHSystemManager::RegisterRoutine<SHScriptEngine, SHScriptEngine::GizmosDrawRoutine>();
SHSystemManager::RegisterRoutine<SHGraphicsSystem, SHGraphicsSystem::PrepareRenderRoutine>();
SHSystemManager::RegisterRoutine<SHGraphicsSystem, SHGraphicsSystem::BatcherDispatcherRoutine>(); SHSystemManager::RegisterRoutine<SHGraphicsSystem, SHGraphicsSystem::BatcherDispatcherRoutine>();
SHSystemManager::RegisterRoutine<SHGraphicsSystem, SHGraphicsSystem::BeginRoutine>(); SHSystemManager::RegisterRoutine<SHGraphicsSystem, SHGraphicsSystem::BeginRoutine>();

View File

@ -86,9 +86,17 @@ namespace SHADE
{ {
if (bufferHandle) if (bufferHandle)
{ {
// Resize // Resize if we need to resize
if (bufferHandle->GetSizeStored() < size)
{
bufferHandle->ResizeReplace(size, src, size); bufferHandle->ResizeReplace(size, src, size);
} }
// Otherwise just copy the data over
else
{
bufferHandle->MapWriteUnmap(src, size, 0, 0);
}
}
else else
{ {
// Create new // Create new
@ -113,8 +121,16 @@ namespace SHADE
{ {
if (bufferHandle) if (bufferHandle)
{ {
// Resize // Resize if we need to resize
bufferHandle->ResizeReplace(size, src, size); // TODO: Set to host visible method? if (bufferHandle->GetSizeStored() < size)
{
bufferHandle->ResizeReplace(size, src, size);
}
// Otherwise just copy the data over
else
{
bufferHandle->MapWriteUnmap(src, size, 0, 0);
}
} }
else else
{ {