Skip to content

Commit

Permalink
Merge pull request #312 from ConfettiFX/confetti-dev
Browse files Browse the repository at this point in the history
iOS ui patch
  • Loading branch information
wolfgangfengel authored Sep 9, 2024
2 parents 06c0073 + 84b2d3e commit 9d43e69
Show file tree
Hide file tree
Showing 54 changed files with 1,711 additions and 3,085 deletions.
2 changes: 1 addition & 1 deletion Common_3/Application/Profiler/GpuProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ void exitGpuProfilers()

ProfileToken initGpuProfiler(Renderer* pRenderer, Queue* pQueue, const char* pName)
{
if (!pRenderer->pGpu->mSettings.mTimestampQueries)
if (!pRenderer->pGpu->mTimestampQueries)
{
LOGF(LogLevel::eWARNING, "GPU timestamp queries not supported");
return PROFILE_INVALID_TOKEN;
Expand Down
23 changes: 11 additions & 12 deletions Common_3/Application/Profiler/ProfilerBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1941,18 +1941,17 @@ void initProfiler(ProfilerDesc* pDesc)
}
#endif
// store active gpu settings
ProfileGet()->pGpuSettings = &pDesc->pRenderer->pGpu->mSettings;
ProfileGet()->pGpuDesc = pDesc->pRenderer->pGpu;
#ifdef ENABLE_FORGE_FONTS
// set gpu profiler title text
if (pDesc->pRenderer->pGpu->mSettings.mGpuVendorPreset.mGpuDriverVersion[0] != '\0')
if (pDesc->pRenderer->pGpu->mGpuVendorPreset.mGpuDriverVersion[0] != '\0')
{
snprintf(gGpuProfileTitleText, sizeof(gGpuProfileTitleText), "%s \t\t\t\t Driver: %s",
pDesc->pRenderer->pGpu->mSettings.mGpuVendorPreset.mGpuName,
pDesc->pRenderer->pGpu->mSettings.mGpuVendorPreset.mGpuDriverVersion);
pDesc->pRenderer->pGpu->mGpuVendorPreset.mGpuName, pDesc->pRenderer->pGpu->mGpuVendorPreset.mGpuDriverVersion);
}
else
{
snprintf(gGpuProfileTitleText, sizeof(gGpuProfileTitleText), "%s", pDesc->pRenderer->pGpu->mSettings.mGpuVendorPreset.mGpuName);
snprintf(gGpuProfileTitleText, sizeof(gGpuProfileTitleText), "%s", pDesc->pRenderer->pGpu->mGpuVendorPreset.mGpuName);
}
#endif
#endif
Expand Down Expand Up @@ -3832,11 +3831,11 @@ void ProfileDumpHtml(ProfileWriteCallback CB, void* Handle, int nMaxFrames, cons
}

// dump info
if (g_Profile.pGpuSettings != NULL)
if (g_Profile.pGpuDesc != NULL)
{
ProfilePrintf(CB, Handle, "var GpuName = '%s';\n", g_Profile.pGpuSettings->mGpuVendorPreset.mGpuName);
ProfilePrintf(CB, Handle, "var VendorID = '%#x';\n", g_Profile.pGpuSettings->mGpuVendorPreset.mVendorId);
ProfilePrintf(CB, Handle, "var ModelID = '%#x';\n", g_Profile.pGpuSettings->mGpuVendorPreset.mModelId);
ProfilePrintf(CB, Handle, "var GpuName = '%s';\n", g_Profile.pGpuDesc->mGpuVendorPreset.mGpuName);
ProfilePrintf(CB, Handle, "var VendorID = '%#x';\n", g_Profile.pGpuDesc->mGpuVendorPreset.mVendorId);
ProfilePrintf(CB, Handle, "var ModelID = '%#x';\n", g_Profile.pGpuDesc->mGpuVendorPreset.mModelId);
}

uint64_t nTicks = P_TICK();
Expand Down Expand Up @@ -4434,9 +4433,9 @@ void dumpBenchmarkData(IApp::Settings* pSettings, const char* outFilename, const
bformata(&output, "\"Application\": \"%s\", \n", appName);
bformata(&output, "\"Width\": %d, \n", pSettings->mWidth);
bformata(&output, "\"Height\": %d, \n\n", pSettings->mHeight);
bformata(&output, "\"GpuName\": \"%s\", \n", g_Profile.pGpuSettings->mGpuVendorPreset.mGpuName);
bformata(&output, "\"VendorID\": \"%#x\", \n", g_Profile.pGpuSettings->mGpuVendorPreset.mVendorId);
bformata(&output, "\"ModelID\": \"%#x\", \n\n", g_Profile.pGpuSettings->mGpuVendorPreset.mModelId);
bformata(&output, "\"GpuName\": \"%s\", \n", g_Profile.pGpuDesc->mGpuVendorPreset.mGpuName);
bformata(&output, "\"VendorID\": \"%#x\", \n", g_Profile.pGpuDesc->mGpuVendorPreset.mVendorId);
bformata(&output, "\"ModelID\": \"%#x\", \n\n", g_Profile.pGpuDesc->mGpuVendorPreset.mModelId);

const Profile& S = *ProfileGet();
for (uint32_t groupIndex = 0; groupIndex < S.nGroupCount; ++groupIndex)
Expand Down
24 changes: 12 additions & 12 deletions Common_3/Application/Profiler/ProfilerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ enum ProfileDumpType
#endif

struct Profile;
struct GPUSettings;
struct GpuDesc;

PROFILE_API ProfileToken ProfileFindToken(const char* sGroup, const char* sName, ThreadID* pThread = NULL);
PROFILE_API ProfileToken ProfileGetToken(const char* sGroup, const char* sName, uint32_t nColor,
Expand Down Expand Up @@ -860,17 +860,17 @@ struct Profile

uint32_t nOverflow;

uint64_t nGroupMask;
uint64_t nGroupMaskGpu;
uint32_t nRunning;
uint32_t nToggleRunning;
uint32_t nMaxGroupSize;
uint32_t nDumpFileNextFrame;
uint32_t nAutoClearFrames;
ProfileDumpType eDumpType;
uint32_t nDumpFrames;
const char* DumpFile;
const GPUSettings* pGpuSettings;
uint64_t nGroupMask;
uint64_t nGroupMaskGpu;
uint32_t nRunning;
uint32_t nToggleRunning;
uint32_t nMaxGroupSize;
uint32_t nDumpFileNextFrame;
uint32_t nAutoClearFrames;
ProfileDumpType eDumpType;
uint32_t nDumpFrames;
const char* DumpFile;
const GpuDesc* pGpuDesc;

int64_t nPauseTicks;

Expand Down
9 changes: 4 additions & 5 deletions Common_3/Application/UI/UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2894,8 +2894,8 @@ static void cmdDrawUICommand(Cmd* pCmd, const ImDrawCmd* pImDrawCmd, const float
prevSetIndexInOut = setIndex;
}

const uint32_t vtxSize = round_up(vertexCount * sizeof(ImDrawVert), pCmd->pRenderer->pGpu->mSettings.mUploadBufferAlignment);
const uint32_t idxSize = round_up(indexCount * sizeof(ImDrawIdx), pCmd->pRenderer->pGpu->mSettings.mUploadBufferAlignment);
const uint32_t vtxSize = round_up(vertexCount * sizeof(ImDrawVert), pCmd->pRenderer->pGpu->mUploadBufferAlignment);
const uint32_t idxSize = round_up(indexCount * sizeof(ImDrawIdx), pCmd->pRenderer->pGpu->mUploadBufferAlignment);
cmdDrawIndexed(pCmd, pImDrawCmd->ElemCount, pImDrawCmd->IdxOffset + globalIdxOffsetInOut, pImDrawCmd->VtxOffset + globalVtxOffsetInOut);
globalIdxOffsetInOut += idxSize / sizeof(ImDrawIdx);
globalVtxOffsetInOut += round_up(vtxSize, sizeof(ImDrawVert)) / sizeof(ImDrawVert);
Expand Down Expand Up @@ -3414,9 +3414,8 @@ void cmdDrawUserInterface(Cmd* pCmd)
{
const ImDrawList* pCmdList = pImDrawData->CmdLists[i];
const uint64_t vtxSize =
round_up_64(pCmdList->VtxBuffer.size() * sizeof(ImDrawVert), pCmd->pRenderer->pGpu->mSettings.mUploadBufferAlignment);
const uint64_t idxSize =
round_up_64(pCmdList->IdxBuffer.size() * sizeof(ImDrawIdx), pCmd->pRenderer->pGpu->mSettings.mUploadBufferAlignment);
round_up_64(pCmdList->VtxBuffer.size() * sizeof(ImDrawVert), pCmd->pRenderer->pGpu->mUploadBufferAlignment);
const uint64_t idxSize = round_up_64(pCmdList->IdxBuffer.size() * sizeof(ImDrawIdx), pCmd->pRenderer->pGpu->mUploadBufferAlignment);
BufferUpdateDesc update = { pUserInterface->pVertexBuffer, vtxDst, vtxSize };
beginUpdateResource(&update);
memcpy(update.pMappedData, pCmdList->VtxBuffer.Data, pCmdList->VtxBuffer.size() * sizeof(ImDrawVert));
Expand Down
Loading

0 comments on commit 9d43e69

Please sign in to comment.