epic: refactor SDL2_Renderer usage to IRenderer and queued texture rendering
- Updated the testing guide to clarify the testing framework's organization and execution methods, improving user understanding. - Refactored CMakeLists to include new platform-specific files, ensuring proper integration of the rendering backend. - Modified main application files to utilize the new IRenderer interface, enhancing flexibility in rendering operations. - Implemented deferred texture management in various components, allowing for more efficient graphics handling and improved performance. - Introduced new methods for texture creation and updates, streamlining the rendering process across the application. - Enhanced logging and error handling in the rendering pipeline to facilitate better debugging and diagnostics.
This commit is contained in:
@@ -177,7 +177,8 @@ TEST_F(GraphicsOptimizationBenchmarks, BatchTextureUpdatePerformance) {
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
for (auto& bitmap : bitmaps) {
|
||||
bitmap.UpdateTexture(nullptr); // Simulate renderer
|
||||
gfx::Arena::Get().QueueTextureCommand(
|
||||
gfx::Arena::TextureCommandType::UPDATE, &bitmap);
|
||||
}
|
||||
|
||||
auto end = std::chrono::high_resolution_clock::now();
|
||||
@@ -187,9 +188,10 @@ TEST_F(GraphicsOptimizationBenchmarks, BatchTextureUpdatePerformance) {
|
||||
start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
for (auto& bitmap : bitmaps) {
|
||||
bitmap.QueueTextureUpdate(nullptr); // Queue for batch processing
|
||||
gfx::Arena::Get().QueueTextureCommand(
|
||||
gfx::Arena::TextureCommandType::UPDATE, &bitmap);
|
||||
}
|
||||
arena.ProcessBatchTextureUpdates(); // Process all at once
|
||||
gfx::Arena::Get().ProcessTextureQueue(nullptr); // Process all at once
|
||||
|
||||
end = std::chrono::high_resolution_clock::now();
|
||||
auto batch_duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start);
|
||||
@@ -413,9 +415,9 @@ TEST_F(GraphicsOptimizationBenchmarks, OverallPerformanceIntegration) {
|
||||
start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
for (auto& sheet : graphics_sheets) {
|
||||
sheet.QueueTextureUpdate(nullptr);
|
||||
arena.QueueTextureCommand(gfx::Arena::TextureCommandType::UPDATE, &sheet);
|
||||
}
|
||||
arena.ProcessBatchTextureUpdates();
|
||||
arena.ProcessTextureQueue(nullptr);
|
||||
|
||||
end = std::chrono::high_resolution_clock::now();
|
||||
auto batch_duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start);
|
||||
|
||||
Reference in New Issue
Block a user