Skip to content

Commit

Permalink
Fix some unused variable warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Themaister committed Oct 2, 2024
1 parent 071bd52 commit 802b0b1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions application/input/input_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ void InputTrackerSDL::update(InputTracker &tracker)

for (int i = 0; i < int(InputTracker::Joypads); i++)
{
LOGI("SDL polling!\n");
auto *pad = pads[i];
if (!pad)
continue;

LOGI("SDL polling #2!\n");

static const struct
{
JoypadKey gkey;
Expand Down
7 changes: 7 additions & 0 deletions application/platforms/application_sdl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ struct WSIPlatformSDL : GraniteWSIPlatform

LOGI("SDL_Init(GAMEPAD) took %.3f seconds async.\n", tmp_timer.end());

LOGI("Pushing task to main thread.\n");
push_task_to_main_thread([this]() {
LOGI("Running task in main thread.\n");
if (!pad.init(get_input_tracker(), [](std::function<void ()> func) { func(); }))
LOGE("Failed to init gamepad tracker.\n");

Expand Down Expand Up @@ -336,8 +338,12 @@ struct WSIPlatformSDL : GraniteWSIPlatform
begin_async_input_handling();
{
process_events_async_thread();
LOGI("nyaa 1\n");
if (gamepad_init_async.load(std::memory_order_acquire))
{
LOGI("nyaa 2\n");
pad.update(get_input_tracker());
}
}
end_async_input_handling();
get_input_tracker().dispatch_current_state(0.0, override_handler);
Expand Down Expand Up @@ -429,6 +435,7 @@ struct WSIPlatformSDL : GraniteWSIPlatform
{
if (e.type == wake_event_type)
{
LOGI("Processing events main thread.\n");
process_events_main_thread();
return true;
}
Expand Down
5 changes: 2 additions & 3 deletions vulkan/wsi_dxgi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ void DXGIInteropSwapchain::reset_backbuffer_state()
backbuffers.clear();
}

bool DXGIInteropSwapchain::setup_per_frame_state(PerFrameState &state, unsigned index,
unsigned width, unsigned height, VkFormat format)
bool DXGIInteropSwapchain::setup_per_frame_state(PerFrameState &state, unsigned index)
{
HRESULT hr;
if (FAILED(hr = swapchain->GetBuffer(index, IID_PPV_ARGS(&state.backbuffer))))
Expand Down Expand Up @@ -363,7 +362,7 @@ bool DXGIInteropSwapchain::init_swapchain(HWND hwnd_, VkSurfaceFormatKHR format,

backbuffers.resize(desc.BufferCount);
for (unsigned i = 0; i < desc.BufferCount; i++)
if (!setup_per_frame_state(backbuffers[i], i, width, height, format.format))
if (!setup_per_frame_state(backbuffers[i], i))
return false;

ExternalHandle imported_image;
Expand Down
2 changes: 1 addition & 1 deletion vulkan/wsi_dxgi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class DXGIInteropSwapchain
ComPtr<ID3D12Resource> blit_backbuffer;
ImageHandle vulkan_backbuffer;

bool setup_per_frame_state(PerFrameState &state, unsigned index, unsigned width, unsigned height, VkFormat format);
bool setup_per_frame_state(PerFrameState &state, unsigned index);
void reset_backbuffer_state();

uint64_t completed_presents = 0;
Expand Down

0 comments on commit 802b0b1

Please sign in to comment.