Renderer: Add NAZARA_REQUEST_DEDICATED_GPU macro

This commit is contained in:
Lynix 2021-08-04 15:58:24 +02:00
parent 90df17d45a
commit 2ee3957822
5 changed files with 27 additions and 0 deletions

View File

@ -15,6 +15,8 @@
#include <iostream>
#include <random>
NAZARA_REQUEST_DEDICATED_GPU()
/*
[layout(std140)]
struct PointLight

View File

@ -18,6 +18,8 @@
#include <array>
#include <iostream>
NAZARA_REQUEST_DEDICATED_GPU()
int main()
{
std::filesystem::path resourceDir = "resources";

View File

@ -8,6 +8,8 @@
#include <array>
#include <iostream>
NAZARA_REQUEST_DEDICATED_GPU()
const char shaderSource[] = R"(
option red: bool;

View File

@ -36,6 +36,7 @@
#include <Nazara/Renderer/DebugDrawer.hpp>
#include <Nazara/Renderer/Enums.hpp>
#include <Nazara/Renderer/Framebuffer.hpp>
#include <Nazara/Renderer/GpuSwitch.hpp>
#include <Nazara/Renderer/RenderBuffer.hpp>
#include <Nazara/Renderer/RenderBufferView.hpp>
#include <Nazara/Renderer/RenderDevice.hpp>

View File

@ -0,0 +1,20 @@
// Copyright (C) 2020 Jérôme Leclercq
// This file is part of the "Nazara Engine - Renderer module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Prerequisites.hpp>
#ifdef NAZARA_PLATFORM_WINDOWS
#define NAZARA_REQUEST_DEDICATED_GPU() \
extern "C" \
{ \
NAZARA_EXPORT unsigned long NvOptimusEnablement = 1; \
NAZARA_EXPORT unsigned long AmdPowerXpressRequestHighPerformance = 1; \
}
#else
#define NAZARA_REQUEST_DEDICATED_GPU()
#endif