diff --git a/Content/Blueprints/Player/CM.uasset b/Content/Blueprints/Player/CM.uasset index 5aab19c3..bc9dd542 100644 Binary files a/Content/Blueprints/Player/CM.uasset and b/Content/Blueprints/Player/CM.uasset differ diff --git a/Content/Blueprints/Player/GI.uasset b/Content/Blueprints/Player/GI.uasset index a6b70402..4f08a677 100644 Binary files a/Content/Blueprints/Player/GI.uasset and b/Content/Blueprints/Player/GI.uasset differ diff --git a/Content/Blueprints/Player/MathAndConvertFns.uasset b/Content/Blueprints/Player/MathAndConvertFns.uasset index 8f089dd5..93a7bcb9 100644 Binary files a/Content/Blueprints/Player/MathAndConvertFns.uasset and b/Content/Blueprints/Player/MathAndConvertFns.uasset differ diff --git a/Content/Blueprints/Player/MyPawn.uasset b/Content/Blueprints/Player/MyPawn.uasset index c2774cfd..612e87b8 100644 Binary files a/Content/Blueprints/Player/MyPawn.uasset and b/Content/Blueprints/Player/MyPawn.uasset differ diff --git a/Content/Blueprints/Player/VR/VRHand.uasset b/Content/Blueprints/Player/VR/VRHand.uasset index 6eaca57e..98bf3ad1 100644 Binary files a/Content/Blueprints/Player/VR/VRHand.uasset and b/Content/Blueprints/Player/VR/VRHand.uasset differ diff --git a/Content/Blueprints/UI/Actors/HousePoint.uasset b/Content/Blueprints/UI/Actors/HousePoint.uasset index 623e7c5f..01d959cb 100644 Binary files a/Content/Blueprints/UI/Actors/HousePoint.uasset and b/Content/Blueprints/UI/Actors/HousePoint.uasset differ diff --git a/Content/Blueprints/UI/Actors/InfraPoint.uasset b/Content/Blueprints/UI/Actors/InfraPoint.uasset index 5abaecdf..367f85b1 100644 Binary files a/Content/Blueprints/UI/Actors/InfraPoint.uasset and b/Content/Blueprints/UI/Actors/InfraPoint.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset b/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset index bdca55a6..43156acf 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset and b/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/lift3dPanel.uasset b/Content/Blueprints/UI/WBPS/Menu/lift3dPanel.uasset index 9a743d58..6928671c 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/lift3dPanel.uasset and b/Content/Blueprints/UI/WBPS/Menu/lift3dPanel.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/sessionEnd.uasset b/Content/Blueprints/UI/WBPS/Menu/sessionEnd.uasset index 37fec30b..524ff6cc 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/sessionEnd.uasset and b/Content/Blueprints/UI/WBPS/Menu/sessionEnd.uasset differ diff --git a/Content/Blueprints/UI/WBPS/VR/lift3dPanel_VR.uasset b/Content/Blueprints/UI/WBPS/VR/lift3dPanel_VR.uasset index c7032529..7d7363b9 100644 Binary files a/Content/Blueprints/UI/WBPS/VR/lift3dPanel_VR.uasset and b/Content/Blueprints/UI/WBPS/VR/lift3dPanel_VR.uasset differ diff --git a/Content/Blueprints/UI/WBPS/VR/menuVR.uasset b/Content/Blueprints/UI/WBPS/VR/menuVR.uasset index ea63a7ab..dbf0b9b3 100644 Binary files a/Content/Blueprints/UI/WBPS/VR/menuVR.uasset and b/Content/Blueprints/UI/WBPS/VR/menuVR.uasset differ diff --git a/Content/Blueprints/UI/WBPS/filter/Filter.uasset b/Content/Blueprints/UI/WBPS/filter/Filter.uasset index 01f6c9d5..ee954f2c 100644 Binary files a/Content/Blueprints/UI/WBPS/filter/Filter.uasset and b/Content/Blueprints/UI/WBPS/filter/Filter.uasset differ diff --git a/Content/Blueprints/Utils/levelStruct.uasset b/Content/Blueprints/Utils/levelStruct.uasset index 08863b6c..2b5f344e 100644 Binary files a/Content/Blueprints/Utils/levelStruct.uasset and b/Content/Blueprints/Utils/levelStruct.uasset differ diff --git a/Content/Blueprints/World/BM_Elevator.uasset b/Content/Blueprints/World/BM_Elevator.uasset index 3dec7122..ef4bea61 100644 Binary files a/Content/Blueprints/World/BM_Elevator.uasset and b/Content/Blueprints/World/BM_Elevator.uasset differ diff --git a/Content/Blueprints/World/BP_House.uasset b/Content/Blueprints/World/BP_House.uasset index bb9f3476..bad36753 100644 Binary files a/Content/Blueprints/World/BP_House.uasset and b/Content/Blueprints/World/BP_House.uasset differ diff --git a/Content/Maps/MainScene.umap b/Content/Maps/MainScene.umap index 3ed0ea5f..5e39aad3 100644 Binary files a/Content/Maps/MainScene.umap and b/Content/Maps/MainScene.umap differ diff --git a/Content/Maps/Main_Building.umap b/Content/Maps/Main_Building.umap index 24c7e62a..58c71adb 100644 Binary files a/Content/Maps/Main_Building.umap and b/Content/Maps/Main_Building.umap differ diff --git a/Content/Maps/NightlightAim.umap b/Content/Maps/NightlightAim.umap index 6d9e2249..c3a0297b 100644 Binary files a/Content/Maps/NightlightAim.umap and b/Content/Maps/NightlightAim.umap differ diff --git a/Content/Maps/Yard_GP7-8.umap b/Content/Maps/Yard_GP7-8.umap index d9dbda12..2f350f20 100644 Binary files a/Content/Maps/Yard_GP7-8.umap and b/Content/Maps/Yard_GP7-8.umap differ diff --git a/Content/Materials/Master/M_NoRMA_Tile_Master.uasset b/Content/Materials/Master/M_NoRMA_Tile_Master.uasset index ac73cdb7..2fbdd4b3 100644 Binary files a/Content/Materials/Master/M_NoRMA_Tile_Master.uasset and b/Content/Materials/Master/M_NoRMA_Tile_Master.uasset differ diff --git a/Content/Materials/Masters/Common/M_holo_house.uasset b/Content/Materials/Masters/Common/M_holo_house.uasset index 6fa037a8..902348bb 100644 Binary files a/Content/Materials/Masters/Common/M_holo_house.uasset and b/Content/Materials/Masters/Common/M_holo_house.uasset differ diff --git a/Content/SkatePark/Naberez_Model/fix/Yard/MI_Roof4.uasset b/Content/SkatePark/Naberez_Model/fix/Yard/MI_Roof4.uasset index ed5112eb..802efe58 100644 Binary files a/Content/SkatePark/Naberez_Model/fix/Yard/MI_Roof4.uasset and b/Content/SkatePark/Naberez_Model/fix/Yard/MI_Roof4.uasset differ diff --git a/Content/SkatePark/Naberez_Model/fix/Yard/MI_Roof7.uasset b/Content/SkatePark/Naberez_Model/fix/Yard/MI_Roof7.uasset index 24396a13..e79196c6 100644 Binary files a/Content/SkatePark/Naberez_Model/fix/Yard/MI_Roof7.uasset and b/Content/SkatePark/Naberez_Model/fix/Yard/MI_Roof7.uasset differ diff --git a/Content/SkatePark/Naberez_Model/fix/Yard/vl0mfbllw_2K_Normal.uasset b/Content/SkatePark/Naberez_Model/fix/Yard/vl0mfbllw_2K_Normal.uasset index c24b6e0c..08c5fddb 100644 Binary files a/Content/SkatePark/Naberez_Model/fix/Yard/vl0mfbllw_2K_Normal.uasset and b/Content/SkatePark/Naberez_Model/fix/Yard/vl0mfbllw_2K_Normal.uasset differ diff --git a/Ivazowsky.uproject b/Ivazowsky.uproject index 3ea36cf2..85e1e2a7 100644 --- a/Ivazowsky.uproject +++ b/Ivazowsky.uproject @@ -1,6 +1,6 @@ { "FileVersion": 3, - "EngineAssociation": "5.1", + "EngineAssociation": "5.3", "Category": "", "Description": "", "Plugins": [ diff --git a/IvazowskyDev.uproject b/IvazowskyDev.uproject index 42438316..b23ea29b 100644 --- a/IvazowskyDev.uproject +++ b/IvazowskyDev.uproject @@ -1,6 +1,6 @@ { "FileVersion": 3, - "EngineAssociation": "5.1", + "EngineAssociation": "5.3", "Category": "", "Description": "", "Plugins": [ diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/config.json b/Samples/PixelStreaming/WebServers/Matchmaker/config.json deleted file mode 100644 index 9ee3c27e..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "HttpPort": 90, - "UseHTTPS": false, - "MatchmakerPort": 9999, - "LogToFile": true -} \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/matchmaker.js b/Samples/PixelStreaming/WebServers/Matchmaker/matchmaker.js deleted file mode 100644 index a1afca6a..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/matchmaker.js +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. -var enableRedirectionLinks = true; -var enableRESTAPI = true; - -const defaultConfig = { - // The port clients connect to the matchmaking service over HTTP - HttpPort: 80, - UseHTTPS: false, - // The matchmaking port the signaling service connects to the matchmaker - MatchmakerPort: 9999, - - // Log to file - LogToFile: true -}; - -// Similar to the Signaling Server (SS) code, load in a config.json file for the MM parameters -const argv = require('yargs').argv; - -var configFile = (typeof argv.configFile != 'undefined') ? argv.configFile.toString() : 'config.json'; -console.log(`configFile ${configFile}`); -const config = require('./modules/config.js').init(configFile, defaultConfig); -console.log("Config: " + JSON.stringify(config, null, '\t')); - -const express = require('express'); -var cors = require('cors'); -const app = express(); -const http = require('http').Server(app); -const fs = require('fs'); -const path = require('path'); -const logging = require('./modules/logging.js'); -logging.RegisterConsoleLogger(); - -if (config.LogToFile) { - logging.RegisterFileLogger('./logs'); -} - -// A list of all the Cirrus server which are connected to the Matchmaker. -var cirrusServers = new Map(); - -// -// Parse command line. -// - -if (typeof argv.HttpPort != 'undefined') { - config.HttpPort = argv.HttpPort; -} -if (typeof argv.MatchmakerPort != 'undefined') { - config.MatchmakerPort = argv.MatchmakerPort; -} - -http.listen(config.HttpPort, () => { - console.log('HTTP listening on *:' + config.HttpPort); -}); - - -if (config.UseHTTPS) { - //HTTPS certificate details - const options = { - key: fs.readFileSync(path.join(__dirname, './certificates/client-key.pem')), - cert: fs.readFileSync(path.join(__dirname, './certificates/client-cert.pem')) - }; - - var https = require('https').Server(options, app); - - //Setup http -> https redirect - console.log('Redirecting http->https'); - app.use(function (req, res, next) { - if (!req.secure) { - if (req.get('Host')) { - var hostAddressParts = req.get('Host').split(':'); - var hostAddress = hostAddressParts[0]; - if (httpsPort != 443) { - hostAddress = `${hostAddress}:${httpsPort}`; - } - return res.redirect(['https://', hostAddress, req.originalUrl].join('')); - } else { - console.error(`unable to get host name from header. Requestor ${req.ip}, url path: '${req.originalUrl}', available headers ${JSON.stringify(req.headers)}`); - return res.status(400).send('Bad Request'); - } - } - next(); - }); - - https.listen(443, function () { - console.log('Https listening on 443'); - }); -} - -// No servers are available so send some simple JavaScript to the client to make -// it retry after a short period of time. -function sendRetryResponse(res) { - res.send(`All ${cirrusServers.size} Cirrus servers are in use. Retrying in 3 seconds. - `); -} - -// Get a Cirrus server if there is one available which has no clients connected. -function getAvailableCirrusServer() { - for (cirrusServer of cirrusServers.values()) { - if (cirrusServer.numConnectedClients === 0 && cirrusServer.ready === true) { - - // Check if we had at least 10 seconds since the last redirect, avoiding the - // chance of redirecting 2+ users to the same SS before they click Play. - // In other words, give the user 10 seconds to click play button the claim the server. - if( cirrusServer.hasOwnProperty('lastRedirect')) { - if( ((Date.now() - cirrusServer.lastRedirect) / 1000) < 10 ) - continue; - } - cirrusServer.lastRedirect = Date.now(); - - return cirrusServer; - } - } - - console.log('WARNING: No empty Cirrus servers are available'); - return undefined; -} - -if(enableRESTAPI) { - // Handle REST signalling server only request. - app.options('/signallingserver', cors()) - app.get('/signallingserver', cors(), (req, res) => { - cirrusServer = getAvailableCirrusServer(); - if (cirrusServer != undefined) { - res.json({ signallingServer: `${cirrusServer.address}:${cirrusServer.port}`}); - console.log(`Returning ${cirrusServer.address}:${cirrusServer.port}`); - } else { - res.json({ signallingServer: '', error: 'No signalling servers available'}); - } - }); -} - -if(enableRedirectionLinks) { - // Handle standard URL. - app.get('/', (req, res) => { - cirrusServer = getAvailableCirrusServer(); - if (cirrusServer != undefined) { - res.redirect(`http://${cirrusServer.address}:${cirrusServer.port}/`); - //console.log(req); - console.log(`Redirect to ${cirrusServer.address}:${cirrusServer.port}`); - } else { - sendRetryResponse(res); - } - }); - - // Handle URL with custom HTML. - app.get('/custom_html/:htmlFilename', (req, res) => { - cirrusServer = getAvailableCirrusServer(); - if (cirrusServer != undefined) { - res.redirect(`http://${cirrusServer.address}:${cirrusServer.port}/custom_html/${req.params.htmlFilename}`); - console.log(`Redirect to ${cirrusServer.address}:${cirrusServer.port}`); - } else { - sendRetryResponse(res); - } - }); -} - -// -// Connection to Cirrus. -// - -const net = require('net'); - -function disconnect(connection) { - console.log(`Ending connection to remote address ${connection.remoteAddress}`); - connection.end(); -} - -const matchmaker = net.createServer((connection) => { - connection.on('data', (data) => { - try { - message = JSON.parse(data); - - if(message) - console.log(`Message TYPE: ${message.type}`); - } catch(e) { - console.log(`ERROR (${e.toString()}): Failed to parse Cirrus information from data: ${data.toString()}`); - disconnect(connection); - return; - } - if (message.type === 'connect') { - // A Cirrus server connects to this Matchmaker server. - cirrusServer = { - address: message.address, - port: message.port, - numConnectedClients: 0, - lastPingReceived: Date.now() - }; - cirrusServer.ready = message.ready === true; - - // Handles disconnects between MM and SS to not add dupes with numConnectedClients = 0 and redirect users to same SS - // Check if player is connected and doing a reconnect. message.playerConnected is a new variable sent from the SS to - // help track whether or not a player is already connected when a 'connect' message is sent (i.e., reconnect). - if(message.playerConnected == true) { - cirrusServer.numConnectedClients = 1; - } - - // Find if we already have a ciruss server address connected to (possibly a reconnect happening) - let server = [...cirrusServers.entries()].find(([key, val]) => val.address === cirrusServer.address && val.port === cirrusServer.port); - - // if a duplicate server with the same address isn't found -- add it to the map as an available server to send users to. - if (!server || server.size <= 0) { - console.log(`Adding connection for ${cirrusServer.address.split(".")[0]} with playerConnected: ${message.playerConnected}`) - cirrusServers.set(connection, cirrusServer); - } else { - console.log(`RECONNECT: cirrus server address ${cirrusServer.address.split(".")[0]} already found--replacing. playerConnected: ${message.playerConnected}`) - var foundServer = cirrusServers.get(server[0]); - - // Make sure to retain the numConnectedClients from the last one before the reconnect to MM - if (foundServer) { - cirrusServers.set(connection, cirrusServer); - console.log(`Replacing server with original with numConn: ${cirrusServer.numConnectedClients}`); - cirrusServers.delete(server[0]); - } else { - cirrusServers.set(connection, cirrusServer); - console.log("Connection not found in Map() -- adding a new one"); - } - } - } else if (message.type === 'streamerConnected') { - // The stream connects to a Cirrus server and so is ready to be used - cirrusServer = cirrusServers.get(connection); - if(cirrusServer) { - cirrusServer.ready = true; - console.log(`Cirrus server ${cirrusServer.address}:${cirrusServer.port} ready for use`); - } else { - disconnect(connection); - } - } else if (message.type === 'streamerDisconnected') { - // The stream connects to a Cirrus server and so is ready to be used - cirrusServer = cirrusServers.get(connection); - if(cirrusServer) { - cirrusServer.ready = false; - console.log(`Cirrus server ${cirrusServer.address}:${cirrusServer.port} no longer ready for use`); - } else { - disconnect(connection); - } - } else if (message.type === 'clientConnected') { - // A client connects to a Cirrus server. - cirrusServer = cirrusServers.get(connection); - if(cirrusServer) { - cirrusServer.numConnectedClients++; - console.log(`Client connected to Cirrus server ${cirrusServer.address}:${cirrusServer.port}`); - } else { - disconnect(connection); - } - } else if (message.type === 'clientDisconnected') { - // A client disconnects from a Cirrus server. - cirrusServer = cirrusServers.get(connection); - if(cirrusServer) { - cirrusServer.numConnectedClients--; - console.log(`Client disconnected from Cirrus server ${cirrusServer.address}:${cirrusServer.port}`); - if(cirrusServer.numConnectedClients === 0) { - // this make this server immediately available for a new client - cirrusServer.lastRedirect = 0; - } - } else { - disconnect(connection); - } - } else if (message.type === 'ping') { - cirrusServer = cirrusServers.get(connection); - if(cirrusServer) { - cirrusServer.lastPingReceived = Date.now(); - } else { - disconnect(connection); - } - } else { - console.log('ERROR: Unknown data: ' + JSON.stringify(message)); - disconnect(connection); - } - }); - - // A Cirrus server disconnects from this Matchmaker server. - connection.on('error', () => { - cirrusServer = cirrusServers.get(connection); - if(cirrusServer) { - cirrusServers.delete(connection); - console.log(`Cirrus server ${cirrusServer.address}:${cirrusServer.port} disconnected from Matchmaker`); - } else { - console.log(`Disconnected machine that wasn't a registered cirrus server, remote address: ${connection.remoteAddress}`); - } - }); -}); - -matchmaker.listen(config.MatchmakerPort, () => { - console.log('Matchmaker listening on *:' + config.MatchmakerPort); -}); diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/modules/config.js b/Samples/PixelStreaming/WebServers/Matchmaker/modules/config.js deleted file mode 100644 index b599f039..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/modules/config.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -//-- Provides configuration information from file and combines it with default values and command line arguments --// -//-- Hierachy of values: Default Values < Config File < Command Line arguments --// - -const fs = require('fs'); -const path = require('path'); -const argv = require('yargs').argv; - -function initConfig(configFile, defaultConfig){ - defaultConfig = defaultConfig || {}; - - // Using object spread syntax: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#Spread_in_object_literals - let config = {...defaultConfig}; - try{ - let configData = fs.readFileSync(configFile, 'UTF8'); - fileConfig = JSON.parse(configData); - config = {...config, ...fileConfig} - // Update config file with any additional defaults (does not override existing values if default has changed) - fs.writeFileSync(configFile, JSON.stringify(config, null, '\t'), 'UTF8'); - } catch(err) { - if (err.code === 'ENOENT') { - console.log("No config file found, writing defaults to log file " + configFile); - fs.writeFileSync(configFile, JSON.stringify(config, null, '\t'), 'UTF8'); - } else if (err instanceof SyntaxError) { - console.log(`ERROR: Invalid JSON in ${configFile}, ignoring file config, ${err}`) - } else { - console.log(`ERROR: ${err}`); - } - } - - try{ - //Make a copy of the command line args and remove the unneccessary ones - //The _ value is an array of any elements without a key - let commandLineConfig = {...argv} - delete commandLineConfig._; - delete commandLineConfig.help; - delete commandLineConfig.version; - delete commandLineConfig['$0']; - config = {...config, ...commandLineConfig} - } catch(err) { - console.log(`ERROR: ${err}`); - } - return config; -} - -module.exports = { - init: initConfig -} \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/modules/logging.js b/Samples/PixelStreaming/WebServers/Matchmaker/modules/logging.js deleted file mode 100644 index 9482c581..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/modules/logging.js +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -const fs = require('fs'); -const { Console } = require('console'); - -var loggers=[]; -var logFunctions=[]; -var logColorFunctions=[]; - -console.log = function(msg, ...args) { - logFunctions.forEach((logFunction) => { - logFunction(msg, ...args); - }); -} - -console.logColor = function(color, msg, ...args) { - logColorFunctions.forEach((logColorFunction) => { - logColorFunction(color, msg, ...args); - }); -} - -const AllAttributesOff = '\x1b[0m'; -const BoldOn = '\x1b[1m'; -const Black = '\x1b[30m'; -const Red = '\x1b[31m'; -const Green = '\x1b[32m'; -const Yellow = '\x1b[33m'; -const Blue = '\x1b[34m'; -const Magenta = '\x1b[35m'; -const Cyan = '\x1b[36m'; -const White = '\x1b[37m'; - -/** - * Pad the start of the given number with zeros so it takes up the number of digits. - * e.g. zeroPad(5, 3) = '005' and zeroPad(23, 2) = '23'. - */ -function zeroPad(number, digits) { - let string = number.toString(); - while (string.length < digits) { - string = '0' + string; - } - return string; -} - -/** - * Create a string of the form 'YEAR.MONTH.DATE.HOURS.MINUTES.SECONDS'. - */ -function dateTimeToString() { - let date = new Date(); - return `${date.getFullYear()}.${zeroPad(date.getMonth(), 2)}.${zeroPad(date.getDate(), 2)}.${zeroPad(date.getHours(), 2)}.${zeroPad(date.getMinutes(), 2)}.${zeroPad(date.getSeconds(), 2)}`; -} - -/** - * Create a string of the form 'HOURS.MINUTES.SECONDS.MILLISECONDS'. - */ -function timeToString() { - let date = new Date(); - return `${zeroPad(date.getHours(), 2)}:${zeroPad(date.getMinutes(), 2)}:${zeroPad(date.getSeconds(), 2)}.${zeroPad(date.getMilliseconds(), 3)}`; -} - -function RegisterFileLogger(path) { - if(path == null) - path = './'; - - if (!fs.existsSync(path)) - fs.mkdirSync(path); - - var output = fs.createWriteStream(`./logs/${dateTimeToString()}.log`); - var fileLogger = new Console(output); - logFunctions.push(function(msg, ...args) { - fileLogger.log(`${timeToString()} ${msg}`, ...args); - }); - - logColorFunctions.push(function(color, msg, ...args) { - fileLogger.log(`${timeToString()} ${msg}`, ...args); - }); - loggers.push(fileLogger); -} - -function RegisterConsoleLogger() { - var consoleLogger = new Console(process.stdout, process.stderr) - logFunctions.push(function(msg, ...args) { - consoleLogger.log(`${timeToString()} ${msg}`, ...args); - }); - - logColorFunctions.push(function(color, msg, ...args) { - consoleLogger.log(`${BoldOn}${color}${timeToString()} ${msg}${AllAttributesOff}`, ...args); - }); - loggers.push(consoleLogger); -} - -module.exports = { - //Functions - RegisterFileLogger, - RegisterConsoleLogger, - - //Variables - AllAttributesOff, - BoldOn, - Black, - Red, - Green, - Yellow, - Blue, - Magenta, - Cyan, - White -} \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/package-lock.json b/Samples/PixelStreaming/WebServers/Matchmaker/package-lock.json deleted file mode 100644 index 2cba76e5..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/package-lock.json +++ /dev/null @@ -1,1643 +0,0 @@ -{ - "name": "cirrus-matchmaker", - "version": "0.0.1", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "cirrus-matchmaker", - "version": "0.0.1", - "dependencies": { - "cors": "^2.8.5", - "express": "^4.18.2", - "socket.io": "4.6.0", - "yargs": "17.3.1" - } - }, - "node_modules/@socket.io/component-emitter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", - "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" - }, - "node_modules/@types/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" - }, - "node_modules/@types/cors": { - "version": "2.8.13", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", - "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/node": { - "version": "18.11.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.19.tgz", - "integrity": "sha512-YUgMWAQBWLObABqrvx8qKO1enAvBUdjZOAWQ5grBAkp5LQv45jBvYKZ3oFS9iKRCQyFjqw6iuEa1vmFqtxYLZw==" - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "node_modules/base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", - "engines": { - "node": "^4.5.0 || >= 5.9" - } - }, - "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/engine.io": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.4.0.tgz", - "integrity": "sha512-OgxY1c/RuCSeO/rTr8DIFXx76IzUUft86R7/P7MMbbkuzeqJoTNw2lmeD91IyGz41QYleIIjWeMJGgug043sfQ==", - "dependencies": { - "@types/cookie": "^0.4.1", - "@types/cors": "^2.8.12", - "@types/node": ">=10.0.0", - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "~0.4.1", - "cors": "~2.8.5", - "debug": "~4.3.1", - "engine.io-parser": "~5.0.3", - "ws": "~8.11.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/engine.io-parser": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.6.tgz", - "integrity": "sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==", - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/engine.io/node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/express/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/socket.io": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.0.tgz", - "integrity": "sha512-b65bp6INPk/BMMrIgVvX12x3Q+NqlGqSlTuvKQWt0BUJ3Hyy3JangBl7fEoWZTXbOKlCqNPbQ6MbWgok/km28w==", - "dependencies": { - "accepts": "~1.3.4", - "base64id": "~2.0.0", - "debug": "~4.3.2", - "engine.io": "~6.4.0", - "socket.io-adapter": "~2.5.2", - "socket.io-parser": "~4.2.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/socket.io-adapter": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz", - "integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==", - "dependencies": { - "ws": "~8.11.0" - } - }, - "node_modules/socket.io-parser": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.2.tgz", - "integrity": "sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==", - "dependencies": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "17.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==", - "engines": { - "node": ">=12" - } - } - }, - "dependencies": { - "@socket.io/component-emitter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", - "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" - }, - "@types/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" - }, - "@types/cors": { - "version": "2.8.13", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", - "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", - "requires": { - "@types/node": "*" - } - }, - "@types/node": { - "version": "18.11.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.19.tgz", - "integrity": "sha512-YUgMWAQBWLObABqrvx8qKO1enAvBUdjZOAWQ5grBAkp5LQv45jBvYKZ3oFS9iKRCQyFjqw6iuEa1vmFqtxYLZw==" - }, - "accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "requires": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==" - }, - "body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "requires": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "requires": { - "safe-buffer": "5.2.1" - } - }, - "content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" - }, - "cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "requires": { - "object-assign": "^4", - "vary": "^1" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - }, - "destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" - }, - "engine.io": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.4.0.tgz", - "integrity": "sha512-OgxY1c/RuCSeO/rTr8DIFXx76IzUUft86R7/P7MMbbkuzeqJoTNw2lmeD91IyGz41QYleIIjWeMJGgug043sfQ==", - "requires": { - "@types/cookie": "^0.4.1", - "@types/cors": "^2.8.12", - "@types/node": ">=10.0.0", - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "~0.4.1", - "cors": "~2.8.5", - "debug": "~4.3.1", - "engine.io-parser": "~5.0.3", - "ws": "~8.11.0" - }, - "dependencies": { - "cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" - } - } - }, - "engine.io-parser": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.6.tgz", - "integrity": "sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==" - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" - }, - "express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "requires": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" - }, - "http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "requires": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "requires": { - "mime-db": "1.52.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" - }, - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "requires": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - } - }, - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "requires": { - "side-channel": "^1.0.4" - } - }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" - }, - "raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "requires": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "requires": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - } - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - } - } - }, - "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - } - }, - "setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - } - }, - "socket.io": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.0.tgz", - "integrity": "sha512-b65bp6INPk/BMMrIgVvX12x3Q+NqlGqSlTuvKQWt0BUJ3Hyy3JangBl7fEoWZTXbOKlCqNPbQ6MbWgok/km28w==", - "requires": { - "accepts": "~1.3.4", - "base64id": "~2.0.0", - "debug": "~4.3.2", - "engine.io": "~6.4.0", - "socket.io-adapter": "~2.5.2", - "socket.io-parser": "~4.2.1" - } - }, - "socket.io-adapter": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz", - "integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==", - "requires": { - "ws": "~8.11.0" - } - }, - "socket.io-parser": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.2.tgz", - "integrity": "sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==", - "requires": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1" - } - }, - "statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" - }, - "type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - } - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", - "requires": {} - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" - }, - "yargs": { - "version": "17.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - } - }, - "yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==" - } - } -} diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/package.json b/Samples/PixelStreaming/WebServers/Matchmaker/package.json deleted file mode 100644 index 88bde87c..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "cirrus-matchmaker", - "version": "0.0.1", - "description": "Cirrus servers connect to the Matchmaker which redirects a browser to the next available Cirrus server", - "dependencies": { - "cors": "^2.8.5", - "express": "^4.18.2", - "socket.io": "4.6.0", - "yargs": "17.3.1" - } -} diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/bash/common_utils.sh b/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/bash/common_utils.sh deleted file mode 100644 index 402d44fd..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/bash/common_utils.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -function log_msg() { #message - if [ ! -z $VERBOSE ]; then - echo $1 - fi -} - -function print_usage() { - echo " - Usage: - ${0} [--help] [--publicip ] [--turn ] [--stun ] [cirrus options...] - Where: - --help will print this message and stop this script. - --debug will run all scripts with --inspect - --nosudo will run all scripts without \`sudo\` command useful for when run in containers. - --verbose will enable additional logging - --package-manager specify an alternative package manager to apt-get - " - exit 1 -} - -function use_args() { - while(($#)) ; do - case "$1" in - --debug ) IS_DEBUG=1; shift;; - --nosudo ) NO_SUDO=1; shift;; - --verbose ) VERBOSE=1; shift;; - --help ) print_usage;; - * ) echo "Unknown command"; shift;; - esac - done -} - -function call_setup_sh() { - bash "setup.sh" -} - -function start_process() { - if [ ! -z $NO_SUDO ]; then - log_msg "running with sudo removed" - eval $(echo "$@" | sed 's/sudo//g') - else - eval $@ - fi -} - -function get_version() { - local version=$1 - - if command -v $version; then - version=$($@) - fi - - echo $version | sed -E 's/[^0-9.]//g' -} diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/bash/run.sh b/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/bash/run.sh deleted file mode 100644 index 180e5525..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/bash/run.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. -BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -pushd "${BASH_LOCATION}" > /dev/null - -source common_utils.sh - -use_args "$@" -call_setup_sh - -process="${BASH_LOCATION}/node/bin/node matchmaker.js" - -pushd ../.. > /dev/null - -echo "" -echo "Starting Matchmaker use ctrl-c to exit" -echo "-----------------------------------------" -echo "" - -start_process $process - -popd > /dev/null # ../.. - -popd > /dev/null # BASH_SOURCE \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/bash/setup.sh b/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/bash/setup.sh deleted file mode 100644 index 3e947f5a..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/bash/setup.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. -BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -pushd "${BASH_LOCATION}" > /dev/null - -source common_utils.sh - -use_args $@ -# Azure specific fix to allow installing NodeJS from NodeSource -if test -f "/etc/apt/sources.list.d/azure-cli.list"; then - sudo touch /etc/apt/sources.list.d/nodesource.list - sudo touch /usr/share/keyrings/nodesource.gpg - sudo chmod 644 /etc/apt/sources.list.d/nodesource.list - sudo chmod 644 /usr/share/keyrings/nodesource.gpg - sudo chmod 644 /etc/apt/sources.list.d/azure-cli.list -fi - -function check_version() { #current_version #min_version - #check if same string - if [ -z "$2" ] || [ "$1" = "$2" ]; then - return 0 - fi - - local i current minimum - - IFS="." read -r -a current <<< $1 - IFS="." read -r -a minimum <<< $2 - - # fill empty fields in current with zeros - for ((i=${#current[@]}; i<${#minimum[@]}; i++)) - do - current[i]=0 - done - - for ((i=0; i<${#current[@]}; i++)) - do - if [[ -z ${minimum[i]} ]]; then - # fill empty fields in minimum with zeros - minimum[i]=0 - fi - - if ((10#${current[i]} > 10#${minimum[i]})); then - return 1 - fi - - if ((10#${current[i]} < 10#${minimum[i]})); then - return 2 - fi - done - - # if got this far string is the same once we added missing 0 - return 0 -} - -function check_and_install() { #dep_name #get_version_string #version_min #install_command - local is_installed=0 - - log_msg "Checking for required $1 install" - - local current=$(echo $2 | sed -E 's/[^0-9.]//g') - local minimum=$(echo $3 | sed -E 's/[^0-9.]//g') - - if [ $# -ne 4 ]; then - log_msg "check_and_install expects 4 args (dep_name get_version_string version_min install_command) got $#" - return -1 - fi - - if [ ! -z $current ]; then - log_msg "Current version: $current checking >= $minimum" - check_version "$current" "$minimum" - if [ "$?" -lt 2 ]; then - log_msg "$1 is installed." - return 0 - else - log_msg "Required install of $1 not found installing" - fi - fi - - if [ $is_installed -ne 1 ]; then - echo "$1 installation not found installing..." - - start_process $4 - - if [ $? -ge 1 ]; then - echo "Installation of $1 failed try running `export VERBOSE=1` then run this script again for more details" - exit 1 - fi - - fi -} - -echo "Checking Matchmaker dependencies..." - -# navigate to Matchmaker root -pushd ../.. > /dev/null - -node_version="" -if [[ -f "${BASH_LOCATION}/node/bin/node" ]]; then - node_version=$("${BASH_LOCATION}/node/bin/node" --version) -fi -check_and_install "node" "$node_version" "v16.4.2" "curl https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.gz --output node.tar.xz - && tar -xf node.tar.xz - && rm node.tar.xz - && mv node-v*-linux-x64 \"${BASH_LOCATION}/node\"" - -PATH="${BASH_LOCATION}/node/bin:$PATH" -"${BASH_LOCATION}/node/lib/node_modules/npm/bin/npm-cli.js" install - -popd > /dev/null # Matchmaker - -popd > /dev/null # BASH_SOURCE - -echo "All Matchmaker dependencies up to date." \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/cmd/run.bat b/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/cmd/run.bat deleted file mode 100644 index b94075e3..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/cmd/run.bat +++ /dev/null @@ -1,25 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script directory as working directory. -pushd "%~dp0" - -title Matchmaker - -@Rem Run setup to ensure we have node and matchmaker installed. -call setup.bat - -@Rem Move to matchmaker.js directory. -pushd ..\.. - -@Rem Run node server and pass any argument along. -platform_scripts\cmd\node\node.exe matchmaker %* - -@Rem Pop matchmaker.js directory. -popd - -@Rem Pop script directory. -popd - -pause \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/cmd/setup.bat b/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/cmd/setup.bat deleted file mode 100644 index 6653bd55..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/cmd/setup.bat +++ /dev/null @@ -1,17 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script location as working directory for commands. -pushd "%~dp0" - -@Rem Ensure we have NodeJs available for calling. -call setup_node.bat - -@Rem Move to matchmaker.js directory and install its package.json -pushd %~dp0\..\..\ -call platform_scripts\cmd\node\npm install --no-save -popd - -@Rem Pop working directory -popd diff --git a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/cmd/setup_node.bat b/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/cmd/setup_node.bat deleted file mode 100644 index cc079e57..00000000 --- a/Samples/PixelStreaming/WebServers/Matchmaker/platform_scripts/cmd/setup_node.bat +++ /dev/null @@ -1,35 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script location as working directory for commands. -pushd "%~dp0" - -@Rem Name and version of node that we are downloading -SET NodeVersion=v16.4.2 -SET NodeName=node-%NodeVersion%-win-x64 - -@Rem Look for a node directory next to this script -if exist node\ ( - echo Node directory found...skipping install. -) else ( - echo Node directory not found...beginning NodeJS download for Windows. - - @Rem Download nodejs and follow redirects. - curl -L -o ./node.zip "https://nodejs.org/dist/%NodeVersion%/%NodeName%.zip" - - @Rem Unarchive the .zip - tar -xf node.zip - - @Rem Rename the extracted, versioned, directory that contains the NodeJS binaries to simply "node". - ren "%NodeName%\" "node" - - @Rem Delete the downloaded node.zip - del node.zip -) - -@Rem Print node version -echo Node version: & node\node.exe -v - -@Rem Pop working directory -popd \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SFU/.dockerignore b/Samples/PixelStreaming/WebServers/SFU/.dockerignore deleted file mode 100644 index 3c3629e6..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/Samples/PixelStreaming/WebServers/SFU/config.js b/Samples/PixelStreaming/WebServers/SFU/config.js deleted file mode 100644 index 1387c88c..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/config.js +++ /dev/null @@ -1,108 +0,0 @@ -// Parse passed arguments -let passedPublicIP = null; -for(let arg of process.argv){ - if(arg && arg.startsWith("--PublicIP=")){ - let splitArr = arg.split("="); - if(splitArr.length == 2){ - passedPublicIP = splitArr[1]; - console.log("--PublicIP=" + passedPublicIP); - } - } -} - -const config = { - signallingURL: "ws://localhost:8889", - - mediasoup: { - worker: { - rtcMinPort: 40000, - rtcMaxPort: 49999, - logLevel: "debug", - logTags: [ - "info", - "ice", - "dtls", - "rtp", - "srtp", - "rtcp", - "sctp" - // 'rtx', - // 'bwe', - // 'score', - // 'simulcast', - // 'svc' - ], - }, - router: { - mediaCodecs: [ - { - kind: "audio", - mimeType: "audio/opus", - clockRate: 48000, - channels: 2, - }, - { - kind: 'video', - mimeType: 'video/VP8', - clockRate: 90000, - parameters: { - "packetization-mode": 1, - "profile-level-id": "42e01f", - "level-asymmetry-allowed": 1 - } - }, - { - kind: "video", - mimeType: "video/h264", - clockRate: 90000, - parameters: { - "packetization-mode": 1, - "profile-level-id": "42e01f", - "level-asymmetry-allowed": 1 - }, - }, - - ], - }, - - // here you must specify ip addresses to listen on - // some browsers have issues with connecting to ICE on - // localhost so you might have to specify a proper - // private or public ip here. - webRtcTransport: { - listenIps: passedPublicIP != null ? [{ ip: "0.0.0.0", announcedIp: passedPublicIP}] : getLocalListenIps(), - // 100 megabits - initialAvailableOutgoingBitrate: 100_000_000, - }, - }, -} - -function getLocalListenIps() { - const listenIps = [] - if (typeof window === 'undefined') { - const os = require('os') - const networkInterfaces = os.networkInterfaces() - const ips = [] - if (networkInterfaces) { - for (const [key, addresses] of Object.entries(networkInterfaces)) { - addresses.forEach(address => { - if (address.family === 'IPv4') { - listenIps.push({ ip: address.address, announcedIp: null }) - } - /* ignore link-local and other special ipv6 addresses. - * https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml - */ - else if (address.family === 'IPv6' && address.address[0] !== 'f') { - listenIps.push({ ip: address.address, announcedIp: null }) - } - }) - } - } - } - if (listenIps.length === 0) { - listenIps.push({ ip: '127.0.0.1', announcedIp: null }) - } - return listenIps -} - -module.exports = config; diff --git a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/LICENSE b/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/LICENSE deleted file mode 100644 index 706f43b4..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -ISC License - -Copyright © 2020, Iñaki Baz Castillo - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/README.md b/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/README.md deleted file mode 100644 index bcf82579..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/README.md +++ /dev/null @@ -1,182 +0,0 @@ -# mediasoup-sdp-bridge v3 - -[![][npm-shield-mediasoup-sdp-bridge]][npm-mediasoup-sdp-bridge] -[![][travis-ci-shield-mediasoup-sdp-bridge]][travis-ci-mediasoup-sdp-bridge] - -Node.js library to allow integration of SDP based clients with [mediasoup][mediasoup-website]. - - -## Website and Documentation - -* [mediasoup.org][mediasoup-website] - - -## Support Forum - -* [mediasoup.discourse.group][mediasoup-discourse] - - -## Use-Case Design Proposal - -This section contains a use-case that can serve as usage example to guide design of the internal implementation. - -Within the Node.js server app running mediasoup: - - -### mediasoup receiving media from a remote SDP endpoint - -```typescript -import * as SdpBridge from "mediasoup-sdp-bridge"; -import Signaling from "./my-signaling"; // Our own signaling stuff. - -const transport: Transport = ... // A mediasoup WebRtcTransport or PlainTransport. - -// Create an SdpEndpoint to handle SDP negotiation with the remote endpoint. -const sdpEndpoint = await SdpBridge.createSdpEndpoint({ - transport: transport, -}); - -// Upon receipt of an SDP Offer from the remote endpoint, apply it. -Signaling.on("sdp-offer", async (sdpOffer: string) => { - // For each media section in the SDP Offer, SdpEndpoint creates a new Producer - // on top of the Transport that was provided. - const producers: Producer[] = await sdpEndpoint.processOffer(sdpOffer); - - // Generate an SDP Answer and reply to the remote endpoint with it. - const sdpAnswer: string = sdpEndpoint.createAnswer(); - - await Signaling.sendAnswer(sdpAnswer); -}); -``` - - -### mediasoup sending media to a remote SDP endpoint - -```typescript -import * as SdpBridge from "mediasoup-sdp-bridge"; -import Signaling from "./my-signaling"; // Our own signaling stuff. - -const transport: Transport = ... // A mediasoup WebRtcTransport or PlainTransport. - -// Create an SdpEndpoint to send media to the remote endpoint. -const sdpEndpoint = await createSdpEndpoint({ - transport: transport, -}); - -// Listen for the "negotiationneeded" event, to send an SDP Offer to the remote -// endpoint. This event is emitted when transport.consume() is called, or when -// a Producer being consumed is closed or paused/resumed. -sdpEndpoint.on("negotiationneeded", () => { - // For each Consumer present in the Transport that was provided, - // SdpEndpoint creates a new media section in the SDP Offer. - const sdpOffer: string = sdpEndpoint.createOffer(); - - // Send the SDP Offer to the remote endpoint. - await Signaling.sendOffer(sdpOffer); -}); - -// Upon receipt of an SDP Answer from the remote endpoint, apply it. -Signaling.on("sdp-answer", async (sdpAnswer: string) => { - await sdpEndpoint.processAnswer(sdpAnswer); -}); - -// Generate remote endpoint's RTP capabilities based on a remote SDP or based -// on handmade capabilities. -const endpointRtpCapabilities = SdpBridge.generateRtpCapabilities( - router.rtpCapabilities, - remoteSdp -); -// or: -const endpointRtpCapabilities = SdpBridge.generateRtpCapabilities( - router.rtpCapabilities, - handmadeRtpCapabilities -); - -// If there were mediasoup Producers already created in the Router, or if a new -// one is created, and we want to consume them in the remote endpoint, tell the -// Transport to consume them. transport.consume() method will trigger the -// "negotiationneeded" event, handled above. -// -// NOTE: By calling consume() method in parallel (without waiting for the -// previous one to complete) we ensure that the "negotiationneeded" event will -// just be emitted once upon completion of all consume() calls, so a single -// SDP Offer/Answer roundtrip will be needed. -transport - .consume({ - producerId: producer1.id, - rtpCapabilities: endpointRtpCapabilities, - }) - .catch((error) => console.error("transport.consume() failed:", error)); - -transport - .consume({ - producerId: producer2.id, - rtpCapabilities: endpointRtpCapabilities, - }) - .catch((error) => console.error("transport.consume() failed:", error)); -``` - - -## Implementation Notes - -### Design limitations - -The initial Use-Case Design Proposal lacks an important detail: it uses an `endpointRtpCapabilities` object, which represents the WebRTC and RTP capabilities of the remote endpoint that will receive media from mediasoup. This *RtpCapabilities* object is assumed to be written either by hand, or obtained from a previous SDP message that somehow might have been obtained from the remote endpoint. It is only *after* having these *RtpCapabilities*, that the SDP Offer/Answer process starts. - -All this, however, goes backwards with the normal flow of the SDP Offer/Answer model. **The remote capabilities should be obtained from the SDP Offer/Answer exchange itself**, not as an unspecified out-of-band mechanism. In theory, how the mediasoup application learns about remote capabilities should come from one of these sources: - -1. An SDP Offer (with *recvonly* or *sendrecv* direction) from a remote endpoint that wants to receive media. - -2. An SDP Answer (with *recvonly* or *sendrecv* direction) from a remote endpoint, in response to an SDP Offer (with *sendonly* or *sendrecv* direction) that the application had previously sent. - -However, in practice both of these options conflict with the current design proposal: - -* (1) is not being considered for now. mediasoup is designed around the assumption that the participant sending media should always be the one starting the connection; thus, the endpoint that will send media is also the one sending the SDP Offer. - -* (2) is the ideal but *it's not possible* with the current design, because the remote capabilities must be already known by the time `sdpEndpoint.createOffer()` is called. - -(Note: Additionally, the *sendrecv* direction is also not considered for now. Both the local application or the remote endpoints are be assumed to be either *sendonly* or *recvonly*.) - - -### Current implementation - -The implementation found in this repo is enough to cover basic usage, but is not complete by any means. Also, it tries to work around the limitations described above, using alternatives that are far from ideal. - -Some notes: - -* Receiving media is the part that works best. It suffices to call `SdpEndpoint.processOffer()`, and this will return one Producer for each media section found in the SDP Offer. - -* Sending media, on the other hand, suffers from the limitation described in (2) above. To work around this, the class `BrowserRtpCapabilities` contains predefined capabilities objects for some of the most common web browsers. These can be used by the application to provide `transport.consume()` with something to work with. - - The obvious drawback to this solution is that the objects in `BrowserRtpCapabilities` must be kept up to date from time to time, in order to accurately represent the actual capabilities of web browsers. To help with this task, there is a handy tool that can be found in the [tools/browser-rtpcapabilities](./tools/browser-rtpcapabilities/) subdirectory. - -* SDP renegotiation is not implemented. The local endpoint cannot make an SDP Re-Offer when the state of the Producers or Consumers changes. - -* There are minor improvements to be done in the implementation. - - - Right now the SdpEndpoint class exports an `SdpEndpoint.addConsumer()` method, which the application uses to provide all Consumers that are created from the corresponding Transport. However, chances are that this is unnecessary: the Transport class already provides an observer event `Transport.observer.on("newconsumer")`, which could be used by the SdpEndpoint to be notified of all new Consumers in its Transport, saving the application the need to provide them explicitly with `addConsumer()`. - - - Some unexpected errors are not handled gracefully, and instead a "BUG" error is logged before the application is forced to exit. These should probably be replaced by a `throw new Error(...)`. - - - Some debug messages are simply commented out to avoid causing too much noise. A proper logging library should be used to allow setting different levels and hiding the less interesting ones. - - - The code hasn't been linted. The default linter rules were left as per the initial commit, but haven't been used yet. For now, the code has just been formatted with the default rules from *Prettier.js*. - - -## Contributors - -* Iñaki Baz Castillo [[website](https://inakibaz.me)|[github](https://github.com/ibc/)] -* Juan Navarro [[github](https://github.com/j1elo)] - - -## License - -[ISC](./LICENSE) - - -[mediasoup-website]: https://mediasoup.org -[mediasoup-discourse]: https://mediasoup.discourse.group -[npm-shield-mediasoup-sdp-bridge]: https://img.shields.io/npm/v/mediasoup-sdp-bridge.svg -[npm-mediasoup-sdp-bridge]: https://npmjs.org/package/mediasoup-sdp-bridge -[travis-ci-shield-mediasoup-sdp-bridge]: https://travis-ci.com/versatica/mediasoup-sdp-bridge.svg?branch=master -[travis-ci-mediasoup-sdp-bridge]: https://travis-ci.com/versatica/mediasoup-sdp-bridge diff --git a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/lib/BrowserRtpCapabilities.js b/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/lib/BrowserRtpCapabilities.js deleted file mode 100644 index efd1a707..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/lib/BrowserRtpCapabilities.js +++ /dev/null @@ -1,1182 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.safari = exports.chrome = exports.firefox = void 0; -exports.firefox = { - codecs: [ - { - kind: "audio", - mimeType: "audio/opus", - preferredPayloadType: 109, - clockRate: 48000, - channels: 2, - parameters: { - maxplaybackrate: 48000, - stereo: 1, - useinbandfec: 1, - }, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/G722", - preferredPayloadType: 9, - clockRate: 8000, - channels: 1, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/PCMU", - preferredPayloadType: 0, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/PCMA", - preferredPayloadType: 8, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/telephone-event", - preferredPayloadType: 101, - clockRate: 8000, - channels: 1, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/VP8", - preferredPayloadType: 120, - clockRate: 90000, - parameters: { - "max-fs": 12288, - "max-fr": 60, - }, - rtcpFeedback: [ - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 124, - clockRate: 90000, - parameters: { - apt: 120, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/VP9", - preferredPayloadType: 121, - clockRate: 90000, - parameters: { - "max-fs": 12288, - "max-fr": 60, - }, - rtcpFeedback: [ - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 125, - clockRate: 90000, - parameters: { - apt: 121, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/H264", - preferredPayloadType: 126, - clockRate: 90000, - parameters: { - "profile-level-id": "42e01f", - "level-asymmetry-allowed": 1, - "packetization-mode": 1, - }, - rtcpFeedback: [ - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 127, - clockRate: 90000, - parameters: { - apt: 126, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/H264", - preferredPayloadType: 97, - clockRate: 90000, - parameters: { - "profile-level-id": "42e01f", - "level-asymmetry-allowed": 1, - }, - rtcpFeedback: [ - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 98, - clockRate: 90000, - parameters: { - apt: 97, - }, - rtcpFeedback: [], - }, - ], - headerExtensions: [ - { - kind: "audio", - uri: "urn:ietf:params:rtp-hdrext:ssrc-audio-level", - preferredId: 1, - }, - { - kind: "audio", - uri: "urn:ietf:params:rtp-hdrext:sdes:mid", - preferredId: 3, - }, - { - kind: "video", - uri: "urn:ietf:params:rtp-hdrext:sdes:mid", - preferredId: 3, - }, - { - kind: "video", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", - preferredId: 4, - }, - { - kind: "video", - uri: "urn:ietf:params:rtp-hdrext:toffset", - preferredId: 5, - }, - { - kind: "video", - uri: "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01", - preferredId: 7, - }, - ], -}; -exports.chrome = { - codecs: [ - { - kind: "audio", - mimeType: "audio/opus", - preferredPayloadType: 111, - clockRate: 48000, - channels: 2, - parameters: { - minptime: 10, - useinbandfec: 1, - }, - rtcpFeedback: [ - { - type: "transport-cc", - }, - ], - }, - { - kind: "audio", - mimeType: "audio/ISAC", - preferredPayloadType: 103, - clockRate: 16000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/ISAC", - preferredPayloadType: 104, - clockRate: 32000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/G722", - preferredPayloadType: 9, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/PCMU", - preferredPayloadType: 0, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/PCMA", - preferredPayloadType: 8, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/CN", - preferredPayloadType: 106, - clockRate: 32000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/CN", - preferredPayloadType: 105, - clockRate: 16000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/CN", - preferredPayloadType: 13, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/telephone-event", - preferredPayloadType: 110, - clockRate: 48000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/telephone-event", - preferredPayloadType: 112, - clockRate: 32000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/telephone-event", - preferredPayloadType: 113, - clockRate: 16000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/telephone-event", - preferredPayloadType: 126, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/VP8", - preferredPayloadType: 96, - clockRate: 90000, - parameters: {}, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 97, - clockRate: 90000, - parameters: { - apt: 96, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/VP9", - preferredPayloadType: 98, - clockRate: 90000, - parameters: { - "profile-id": 0, - }, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 99, - clockRate: 90000, - parameters: { - apt: 98, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/VP9", - preferredPayloadType: 100, - clockRate: 90000, - parameters: { - "profile-id": 2, - }, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 101, - clockRate: 90000, - parameters: { - apt: 100, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/H264", - preferredPayloadType: 102, - clockRate: 90000, - parameters: { - "level-asymmetry-allowed": 1, - "packetization-mode": 1, - "profile-level-id": "42001f", - }, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 121, - clockRate: 90000, - parameters: { - apt: 102, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/H264", - preferredPayloadType: 127, - clockRate: 90000, - parameters: { - "level-asymmetry-allowed": 1, - "packetization-mode": 0, - "profile-level-id": "42001f", - }, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 120, - clockRate: 90000, - parameters: { - apt: 127, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/H264", - preferredPayloadType: 125, - clockRate: 90000, - parameters: { - "level-asymmetry-allowed": 1, - "packetization-mode": 1, - "profile-level-id": "42e01f", - }, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 107, - clockRate: 90000, - parameters: { - apt: 125, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/H264", - preferredPayloadType: 108, - clockRate: 90000, - parameters: { - "level-asymmetry-allowed": 1, - "packetization-mode": 0, - "profile-level-id": "42e01f", - }, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 109, - clockRate: 90000, - parameters: { - apt: 108, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/AV1X", - preferredPayloadType: 35, - clockRate: 90000, - parameters: {}, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 36, - clockRate: 90000, - parameters: { - apt: 35, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/red", - preferredPayloadType: 124, - clockRate: 90000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 119, - clockRate: 90000, - parameters: { - apt: 124, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/ulpfec", - preferredPayloadType: 123, - clockRate: 90000, - parameters: {}, - rtcpFeedback: [], - }, - ], - headerExtensions: [ - { - kind: "audio", - uri: "urn:ietf:params:rtp-hdrext:ssrc-audio-level", - preferredId: 1, - }, - { - kind: "audio", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", - preferredId: 2, - }, - { - kind: "audio", - uri: "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01", - preferredId: 3, - }, - { - kind: "audio", - uri: "urn:ietf:params:rtp-hdrext:sdes:mid", - preferredId: 4, - }, - { - kind: "audio", - uri: "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id", - preferredId: 5, - }, - { - kind: "audio", - uri: "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id", - preferredId: 6, - }, - { - kind: "video", - uri: "urn:ietf:params:rtp-hdrext:toffset", - preferredId: 14, - }, - { - kind: "video", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", - preferredId: 2, - }, - { - kind: "video", - uri: "urn:3gpp:video-orientation", - preferredId: 13, - }, - { - kind: "video", - uri: "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01", - preferredId: 3, - }, - { - kind: "video", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay", - preferredId: 12, - }, - { - kind: "video", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/video-content-type", - preferredId: 11, - }, - { - kind: "video", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/video-timing", - preferredId: 7, - }, - { - kind: "video", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/color-space", - preferredId: 8, - }, - { - kind: "video", - uri: "urn:ietf:params:rtp-hdrext:sdes:mid", - preferredId: 4, - }, - { - kind: "video", - uri: "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id", - preferredId: 5, - }, - { - kind: "video", - uri: "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id", - preferredId: 6, - }, - ], -}; -exports.safari = { - codecs: [ - { - kind: "audio", - mimeType: "audio/opus", - preferredPayloadType: 111, - clockRate: 48000, - channels: 2, - parameters: { - minptime: 10, - useinbandfec: 1, - }, - rtcpFeedback: [ - { - type: "transport-cc", - }, - ], - }, - { - kind: "audio", - mimeType: "audio/ISAC", - preferredPayloadType: 103, - clockRate: 16000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/G722", - preferredPayloadType: 9, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/PCMU", - preferredPayloadType: 0, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/PCMA", - preferredPayloadType: 8, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/CN", - preferredPayloadType: 105, - clockRate: 16000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/CN", - preferredPayloadType: 13, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/telephone-event", - preferredPayloadType: 110, - clockRate: 48000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/telephone-event", - preferredPayloadType: 113, - clockRate: 16000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "audio", - mimeType: "audio/telephone-event", - preferredPayloadType: 126, - clockRate: 8000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/H264", - preferredPayloadType: 96, - clockRate: 90000, - parameters: { - "level-asymmetry-allowed": 1, - "packetization-mode": 1, - "profile-level-id": "640c1f", - }, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 97, - clockRate: 90000, - parameters: { - apt: 96, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/H264", - preferredPayloadType: 98, - clockRate: 90000, - parameters: { - "level-asymmetry-allowed": 1, - "packetization-mode": 1, - "profile-level-id": "42e01f", - }, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 99, - clockRate: 90000, - parameters: { - apt: 98, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/H264", - preferredPayloadType: 100, - clockRate: 90000, - parameters: { - "level-asymmetry-allowed": 1, - "packetization-mode": 0, - "profile-level-id": "640c1f", - }, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 101, - clockRate: 90000, - parameters: { - apt: 100, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/H264", - preferredPayloadType: 102, - clockRate: 90000, - parameters: { - "level-asymmetry-allowed": 1, - "packetization-mode": 0, - "profile-level-id": "42e01f", - }, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 127, - clockRate: 90000, - parameters: { - apt: 102, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/VP8", - preferredPayloadType: 104, - clockRate: 90000, - parameters: {}, - rtcpFeedback: [ - { - type: "goog-remb", - }, - { - type: "transport-cc", - }, - { - type: "ccm", - parameter: "fir", - }, - { - type: "nack", - }, - { - type: "nack", - parameter: "pli", - }, - ], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 125, - clockRate: 90000, - parameters: { - apt: 104, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/red", - preferredPayloadType: 106, - clockRate: 90000, - parameters: {}, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/rtx", - preferredPayloadType: 107, - clockRate: 90000, - parameters: { - apt: 106, - }, - rtcpFeedback: [], - }, - { - kind: "video", - mimeType: "video/ulpfec", - preferredPayloadType: 108, - clockRate: 90000, - parameters: {}, - rtcpFeedback: [], - }, - ], - headerExtensions: [ - { - kind: "audio", - uri: "urn:ietf:params:rtp-hdrext:ssrc-audio-level", - preferredId: 1, - }, - { - kind: "audio", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", - preferredId: 2, - }, - { - kind: "audio", - uri: "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01", - preferredId: 3, - }, - { - kind: "audio", - uri: "urn:ietf:params:rtp-hdrext:sdes:mid", - preferredId: 4, - }, - { - kind: "audio", - uri: "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id", - preferredId: 5, - }, - { - kind: "audio", - uri: "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id", - preferredId: 6, - }, - { - kind: "video", - uri: "urn:ietf:params:rtp-hdrext:toffset", - preferredId: 14, - }, - { - kind: "video", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", - preferredId: 2, - }, - { - kind: "video", - uri: "urn:3gpp:video-orientation", - preferredId: 13, - }, - { - kind: "video", - uri: "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01", - preferredId: 3, - }, - { - kind: "video", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay", - preferredId: 12, - }, - { - kind: "video", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/video-content-type", - preferredId: 11, - }, - { - kind: "video", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/video-timing", - preferredId: 7, - }, - { - kind: "video", - uri: "http://www.webrtc.org/experiments/rtp-hdrext/color-space", - preferredId: 8, - }, - { - kind: "video", - uri: "urn:ietf:params:rtp-hdrext:sdes:mid", - preferredId: 4, - }, - { - kind: "video", - uri: "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id", - preferredId: 5, - }, - { - kind: "video", - uri: "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id", - preferredId: 6, - }, - ], -}; -//# sourceMappingURL=BrowserRtpCapabilities.js.map \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/lib/SdpUtils.js b/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/lib/SdpUtils.js deleted file mode 100644 index a1feb6f9..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/lib/SdpUtils.js +++ /dev/null @@ -1,89 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sdpToSendRtpParameters = exports.sdpToRecvRtpCapabilities = void 0; -const MsRtpUtils = __importStar(require("mediasoup-client/lib/handlers/sdp/unifiedPlanUtils")); -const MsSdpUtils = __importStar(require("mediasoup-client/lib/handlers/sdp/commonUtils")); -const MsOrtc = __importStar(require("mediasoup-client/lib/ortc")); -require("util").inspect.defaultOptions.depth = null; -function sdpToRecvRtpCapabilities(sdpObject, localCaps) { - const caps = MsSdpUtils.extractRtpCapabilities({ - sdpObject, - }); - try { - MsOrtc.validateRtpCapabilities(caps); - } - catch (err) { - console.error("FIXME BUG:", err); - process.exit(1); - } - const extendedCaps = MsOrtc.getExtendedRtpCapabilities(caps, localCaps); - const recvCaps = MsOrtc.getRecvRtpCapabilities(extendedCaps); - { - } - return recvCaps; -} -exports.sdpToRecvRtpCapabilities = sdpToRecvRtpCapabilities; -function sdpToSendRtpParameters(sdpObject, sdpMediaObj, localCaps, kind) { - var _a; - const caps = MsSdpUtils.extractRtpCapabilities({ - sdpObject, - }); - try { - MsOrtc.validateRtpCapabilities(caps); - } - catch (err) { - console.error("FIXME BUG:", err); - process.exit(1); - } - const extendedCaps = MsOrtc.getExtendedRtpCapabilities(caps, localCaps); - const sendParams = MsOrtc.getSendingRemoteRtpParameters(kind, extendedCaps); - // const sdpMediaObj = (sdpObject.media || []).find((m) => m.type === kind) || - // {}; - if ("mid" in sdpMediaObj) { - sendParams.mid = String(sdpMediaObj.mid); - } - else { - sendParams.mid = kind === "audio" ? "0" : "1"; - } - if ("rids" in sdpMediaObj) { - for (const mediaRid of sdpMediaObj.rids) { - (_a = sendParams.encodings) === null || _a === void 0 ? void 0 : _a.push({ rid: mediaRid.id }); - } - } - else { - // sendParams.encodings = MsRtpUtils.getRtpEncodings({ - // sdpObject, - // kind, - // }); - sendParams.encodings = MsRtpUtils.getRtpEncodings({ offerMediaObject: sdpMediaObj }); - } - sendParams.rtcp = { - cname: MsSdpUtils.getCname({ offerMediaObject: sdpMediaObj }), - reducedSize: "rtcpRsize" in sdpMediaObj && sdpMediaObj.rtcpRsize, - mux: "rtcpMux" in sdpMediaObj && sdpMediaObj.rtcpMux, - }; - { - } - return sendParams; -} -exports.sdpToSendRtpParameters = sdpToSendRtpParameters; -//# sourceMappingURL=SdpUtils.js.map \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/lib/index.js b/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/lib/index.js deleted file mode 100644 index 2725e69c..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/lib/index.js +++ /dev/null @@ -1,198 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.generateRtpCapabilities2 = exports.generateRtpCapabilities1 = exports.generateRtpCapabilities0 = exports.createSdpEndpoint = exports.SdpEndpoint = void 0; -const MsSdpUtils = __importStar(require("mediasoup-client/lib/handlers/sdp/commonUtils")); -const RemoteSdp_1 = require("mediasoup-client/lib/handlers/sdp/RemoteSdp"); -const SdpTransform = __importStar(require("sdp-transform")); -const uuid_1 = require("uuid"); -const BrowserRtpCapabilities = __importStar(require("./BrowserRtpCapabilities")); -const SdpUtils = __importStar(require("./SdpUtils")); -const MediaSection_1 = require("mediasoup-client/lib/handlers/sdp/MediaSection"); -require("util").inspect.defaultOptions.depth = null; -class SdpEndpoint { - constructor(webRtcTransport, localCaps) { - this.producers = []; - this.producerMedias = []; - this.consumers = []; - this.webRtcTransport = webRtcTransport; - this.transport = webRtcTransport; - this.localCaps = localCaps; - this.sctpMedia = null; - this.consumeData = false; - } - async processOffer(sdpOffer) { - if (this.remoteSdp) { - console.error("[SdpEndpoint.processOffer] ERROR: A remote description was already set"); - return []; - } - this.remoteSdp = sdpOffer; - const remoteSdpObj = SdpTransform.parse(sdpOffer); - await this.webRtcTransport.connect({ - dtlsParameters: MsSdpUtils.extractDtlsParameters({ - sdpObject: remoteSdpObj, - }), - }); - for (const media of remoteSdpObj.media) { - if (media.type == "application") { - this.sctpMedia = media; - console.log("[SdpEndpoint.processOffer] SCTP association received"); - } - else { - if (!("rtp" in media)) { - continue; - } - if (!("direction" in media)) { - continue; - } - if (media.direction !== "sendonly") { - continue; - } - const sendParams = SdpUtils.sdpToSendRtpParameters(remoteSdpObj, media, this.localCaps, media.type); - let producer; - try { - producer = await this.transport.produce({ - kind: media.type, - rtpParameters: sendParams, - paused: false, - }); - } - catch (err) { - console.error("FIXME BUG:", err); - process.exit(1); - } - this.producers.push(producer); - this.producerMedias.push(media); - console.log("[SdpEndpoint.processOffer] mediasoup Producer created, kind: %s, type: %s, paused: %s", producer.kind, producer.type, producer.paused); - } - } - return this.producers; - } - createAnswer() { - if (this.localSdp) { - console.error("[SdpEndpoint.createAnswer] ERROR: A local description was already set"); - return ""; - } - const sdpBuilder = new RemoteSdp_1.RemoteSdp({ - iceParameters: this.webRtcTransport.iceParameters, - iceCandidates: this.webRtcTransport.iceCandidates, - dtlsParameters: this.webRtcTransport.dtlsParameters, - sctpParameters: this.webRtcTransport.sctpParameters, - planB: false, - }); - console.log("[SdpEndpoint.createAnswer] Make 'recvonly' SDP Answer"); - for (let i = 0; i < this.producers.length; i++) { - const sdpMediaObj = this.producerMedias[i]; - const recvParams = this.producers[i].rtpParameters; - sdpBuilder.send({ - offerMediaObject: sdpMediaObj, - reuseMid: undefined, - offerRtpParameters: recvParams, - answerRtpParameters: recvParams, - codecOptions: undefined, - extmapAllowMixed: false, - }); - } - if (this.sctpMedia != null) { - sdpBuilder.sendSctpAssociation({offerMediaObject: this.sctpMedia}); - } - this.localSdp = sdpBuilder.getSdp(); - return this.localSdp; - } - addConsumer(consumer) { - this.consumers.push(consumer); - } - addConsumeData() { - this.consumeData = true; - } - createOffer() { - var _a; - if (this.localSdp) { - console.error("[SdpEndpoint.createOffer] ERROR: A local description was already set"); - return ""; - } - const sdpBuilder = new RemoteSdp_1.RemoteSdp({ - iceParameters: this.webRtcTransport.iceParameters, - iceCandidates: this.webRtcTransport.iceCandidates, - dtlsParameters: this.webRtcTransport.dtlsParameters, - sctpParameters: this.webRtcTransport.sctpParameters, - planB: false, - }); - const sendMsid = uuid_1.v4().substr(0, 8); - console.log("[SdpEndpoint.createOffer] Make 'sendonly' SDP Offer"); - for (let i = 0; i < this.consumers.length; i++) { - const mid = (_a = this.consumers[i].rtpParameters.mid) !== null && _a !== void 0 ? _a : "nomid"; - const kind = this.consumers[i].kind; - const sendParams = this.consumers[i].rtpParameters; - sdpBuilder.receive({ - mid, - kind, - offerRtpParameters: sendParams, - streamId: sendMsid, - trackId: `${sendMsid}-${kind}`, - }); - } - if (this.consumeData) { - sdpBuilder.receiveSctpAssociation(); - } - this.localSdp = sdpBuilder.getSdp(); - return this.localSdp; - } - async processAnswer(sdpAnswer) { - if (this.remoteSdp) { - console.error("[SdpEndpoint.processAnswer] ERROR: A remote description was already set"); - return; - } - this.remoteSdp = sdpAnswer; - const remoteSdpObj = SdpTransform.parse(sdpAnswer); - await this.webRtcTransport.connect({ - dtlsParameters: MsSdpUtils.extractDtlsParameters({ - sdpObject: remoteSdpObj, - }), - }); - { - } - } -} -exports.SdpEndpoint = SdpEndpoint; -function createSdpEndpoint(webRtcTransport, localCaps) { - return new SdpEndpoint(webRtcTransport, localCaps); -} -exports.createSdpEndpoint = createSdpEndpoint; -function generateRtpCapabilities0() { - return BrowserRtpCapabilities.chrome; -} -exports.generateRtpCapabilities0 = generateRtpCapabilities0; -function generateRtpCapabilities1(localCaps, remoteSdp) { - console.error("[SdpEndpoint.generateRtpCapabilities1] BUG: Not implemented"); - process.exit(1); - let caps; - return caps; -} -exports.generateRtpCapabilities1 = generateRtpCapabilities1; -function generateRtpCapabilities2(localCaps, remoteCaps) { - console.error("[SdpEndpoint.generateRtpCapabilities2] BUG: Not implemented"); - process.exit(1); - let caps; - return caps; -} -exports.generateRtpCapabilities2 = generateRtpCapabilities2; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/package.json b/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/package.json deleted file mode 100644 index f862047f..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/mediasoup-sdp-bridge/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "mediasoup-sdp-bridge", - "version": "3.6.5", - "description": "Node.js library to allow integration of SDP based clients with mediasoup", - "contributors": [ - "Iñaki Baz Castillo (https://inakibaz.me)", - "Juan Navarro (https://github.com/j1elo)" - ], - "homepage": "https://mediasoup.org", - "license": "ISC", - "repository": { - "type": "git", - "url": "https://github.com/versatica/mediasoup-sdp-bridge.git" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mediasoup" - }, - "main": "lib/index.js", - "types": "lib/index.d.ts", - "engines": { - "node": ">=10" - }, - "dependencies": { - "mediasoup-client": "^3.6.41" - } -} diff --git a/Samples/PixelStreaming/WebServers/SFU/package-lock.json b/Samples/PixelStreaming/WebServers/SFU/package-lock.json deleted file mode 100644 index 210a79d2..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/package-lock.json +++ /dev/null @@ -1,383 +0,0 @@ -{ - "name": "pixelstreaming-sfu", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "pixelstreaming-sfu", - "version": "1.0.0", - "dependencies": { - "mediasoup_prebuilt": "^3.8.4", - "mediasoup-sdp-bridge": "file:mediasoup-sdp-bridge", - "run-script-os": "^1.1.6", - "ws": "^7.1.2" - } - }, - "node_modules/@types/debug": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", - "dependencies": { - "@types/ms": "*" - } - }, - "node_modules/@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" - }, - "node_modules/@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" - }, - "node_modules/@types/node": { - "version": "16.11.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.10.tgz", - "integrity": "sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA==" - }, - "node_modules/awaitqueue": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/awaitqueue/-/awaitqueue-2.3.3.tgz", - "integrity": "sha512-RbzQg6VtPUtyErm55iuQLTrBJ2uihy5BKBOEkyBwv67xm5Fn2o/j+Bz+a5BmfSoe2oZ5dcz9Z3fExS8pL+LLhw==", - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/bowser": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", - "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==" - }, - "node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/fake-mediastreamtrack": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/fake-mediastreamtrack/-/fake-mediastreamtrack-1.1.6.tgz", - "integrity": "sha512-lcoO5oPsW57istAsnjvQxNjBEahi18OdUhWfmEewwfPfzNZnji5OXuodQM+VnUPi/1HnQRJ6gBUjbt1TNXrkjQ==", - "dependencies": { - "event-target-shim": "^5.0.1", - "uuid": "^8.1.0" - } - }, - "node_modules/h264-profile-level-id": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/h264-profile-level-id/-/h264-profile-level-id-1.0.1.tgz", - "integrity": "sha512-D3Rln/jKNjKDW5ZTJTK3niSoOGE+pFqPvRHHVgQN3G7umcn/zWGPUo8Q8VpDj16x3hKz++zVviRNRmXu5cpN+Q==", - "dependencies": { - "debug": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/mediasoup_prebuilt": { - "version": "3.8.4", - "resolved": "https://registry.npmjs.org/mediasoup_prebuilt/-/mediasoup_prebuilt-3.8.4.tgz", - "integrity": "sha512-IdPcuT3YTJXNFYAY4JuIy8sZ88qagKPg2dR8d4USR5csTvC+qOq9wAIywO+u2lxLjePHJH+Y8UBM3kKfyU6Uug==", - "dependencies": { - "@types/node": "^16.9.1", - "awaitqueue": "^2.3.3", - "debug": "^4.3.2", - "h264-profile-level-id": "^1.0.1", - "netstring": "^0.3.0", - "random-number": "^0.0.9", - "supports-color": "^9.0.2", - "uuid": "^8.3.2" - } - }, - "node_modules/mediasoup-client": { - "version": "3.6.46", - "resolved": "https://registry.npmjs.org/mediasoup-client/-/mediasoup-client-3.6.46.tgz", - "integrity": "sha512-Dv8RxCa1cjSPrKWGf1mnypU5TiQCnrOIy4JpZwwjRQzEtCukCfV1zQabij6BigrtkI+l22ui3fl67Mmm4I0XCA==", - "dependencies": { - "@types/debug": "^4.1.7", - "@types/events": "^3.0.0", - "awaitqueue": "^2.3.3", - "bowser": "^2.11.0", - "debug": "^4.3.2", - "events": "^3.3.0", - "fake-mediastreamtrack": "^1.1.6", - "h264-profile-level-id": "^1.0.1", - "sdp-transform": "^2.14.1", - "supports-color": "^9.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mediasoup" - } - }, - "node_modules/mediasoup-sdp-bridge": { - "version": "3.6.5", - "resolved": "file:mediasoup-sdp-bridge", - "license": "ISC", - "dependencies": { - "mediasoup-client": "^3.6.41" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mediasoup" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/netstring": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/netstring/-/netstring-0.3.0.tgz", - "integrity": "sha1-ho3FsgxY0/cwVTHUk2jqqr0ZtxI=", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/random-number": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/random-number/-/random-number-0.0.9.tgz", - "integrity": "sha512-ipG3kRCREi/YQpi2A5QGcvDz1KemohovWmH6qGfboVyyGdR2t/7zQz0vFxrfxpbHQgPPdtVlUDaks3aikD1Ljw==" - }, - "node_modules/run-script-os": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/run-script-os/-/run-script-os-1.1.6.tgz", - "integrity": "sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==", - "bin": { - "run-os": "index.js", - "run-script-os": "index.js" - } - }, - "node_modules/sdp-transform": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.1.tgz", - "integrity": "sha512-RjZyX3nVwJyCuTo5tGPx+PZWkDMCg7oOLpSlhjDdZfwUoNqG1mM8nyj31IGHyaPWXhjbP7cdK3qZ2bmkJ1GzRw==", - "bin": { - "sdp-verify": "checker.js" - } - }, - "node_modules/supports-color": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.1.0.tgz", - "integrity": "sha512-lOCGOTmBSN54zKAoPWhHkjoqVQ0MqgzPE5iirtoSixhr0ZieR/6l7WZ32V53cvy9+1qghFnIk7k52p991lKd6g==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/ws": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", - "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - } - }, - "dependencies": { - "@types/debug": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", - "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", - "requires": { - "@types/ms": "*" - } - }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" - }, - "@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" - }, - "@types/node": { - "version": "16.11.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.10.tgz", - "integrity": "sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA==" - }, - "awaitqueue": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/awaitqueue/-/awaitqueue-2.3.3.tgz", - "integrity": "sha512-RbzQg6VtPUtyErm55iuQLTrBJ2uihy5BKBOEkyBwv67xm5Fn2o/j+Bz+a5BmfSoe2oZ5dcz9Z3fExS8pL+LLhw==" - }, - "bowser": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", - "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==" - }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, - "event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" - }, - "events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" - }, - "fake-mediastreamtrack": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/fake-mediastreamtrack/-/fake-mediastreamtrack-1.1.6.tgz", - "integrity": "sha512-lcoO5oPsW57istAsnjvQxNjBEahi18OdUhWfmEewwfPfzNZnji5OXuodQM+VnUPi/1HnQRJ6gBUjbt1TNXrkjQ==", - "requires": { - "event-target-shim": "^5.0.1", - "uuid": "^8.1.0" - } - }, - "h264-profile-level-id": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/h264-profile-level-id/-/h264-profile-level-id-1.0.1.tgz", - "integrity": "sha512-D3Rln/jKNjKDW5ZTJTK3niSoOGE+pFqPvRHHVgQN3G7umcn/zWGPUo8Q8VpDj16x3hKz++zVviRNRmXu5cpN+Q==", - "requires": { - "debug": "^4.1.1" - } - }, - "mediasoup_prebuilt": { - "version": "3.8.4", - "resolved": "https://registry.npmjs.org/mediasoup_prebuilt/-/mediasoup_prebuilt-3.8.4.tgz", - "integrity": "sha512-IdPcuT3YTJXNFYAY4JuIy8sZ88qagKPg2dR8d4USR5csTvC+qOq9wAIywO+u2lxLjePHJH+Y8UBM3kKfyU6Uug==", - "requires": { - "@types/node": "^16.9.1", - "awaitqueue": "^2.3.3", - "debug": "^4.3.2", - "h264-profile-level-id": "^1.0.1", - "netstring": "^0.3.0", - "random-number": "^0.0.9", - "supports-color": "^9.0.2", - "uuid": "^8.3.2" - } - }, - "mediasoup-client": { - "version": "3.6.46", - "resolved": "https://registry.npmjs.org/mediasoup-client/-/mediasoup-client-3.6.46.tgz", - "integrity": "sha512-Dv8RxCa1cjSPrKWGf1mnypU5TiQCnrOIy4JpZwwjRQzEtCukCfV1zQabij6BigrtkI+l22ui3fl67Mmm4I0XCA==", - "requires": { - "@types/debug": "^4.1.7", - "@types/events": "^3.0.0", - "awaitqueue": "^2.3.3", - "bowser": "^2.11.0", - "debug": "^4.3.2", - "events": "^3.3.0", - "fake-mediastreamtrack": "^1.1.6", - "h264-profile-level-id": "^1.0.1", - "sdp-transform": "^2.14.1", - "supports-color": "^9.1.0" - } - }, - "mediasoup-sdp-bridge": { - "version": "3.6.5", - "requires": { - "mediasoup-client": "^3.6.41" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "netstring": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/netstring/-/netstring-0.3.0.tgz", - "integrity": "sha1-ho3FsgxY0/cwVTHUk2jqqr0ZtxI=" - }, - "random-number": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/random-number/-/random-number-0.0.9.tgz", - "integrity": "sha512-ipG3kRCREi/YQpi2A5QGcvDz1KemohovWmH6qGfboVyyGdR2t/7zQz0vFxrfxpbHQgPPdtVlUDaks3aikD1Ljw==" - }, - "run-script-os": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/run-script-os/-/run-script-os-1.1.6.tgz", - "integrity": "sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==" - }, - "sdp-transform": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.1.tgz", - "integrity": "sha512-RjZyX3nVwJyCuTo5tGPx+PZWkDMCg7oOLpSlhjDdZfwUoNqG1mM8nyj31IGHyaPWXhjbP7cdK3qZ2bmkJ1GzRw==" - }, - "supports-color": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.1.0.tgz", - "integrity": "sha512-lOCGOTmBSN54zKAoPWhHkjoqVQ0MqgzPE5iirtoSixhr0ZieR/6l7WZ32V53cvy9+1qghFnIk7k52p991lKd6g==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "ws": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", - "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", - "requires": {} - } - } -} diff --git a/Samples/PixelStreaming/WebServers/SFU/package.json b/Samples/PixelStreaming/WebServers/SFU/package.json deleted file mode 100644 index 754e9851..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "pixelstreaming-sfu", - "version": "1.0.0", - "description": "Reference implementation for a PixelStreaming SFU", - "scripts": { - "start-local": "run-script-os --", - "start-local:windows": ".\\platform_scripts\\cmd\\run.bat", - "start-local:default": "./platform_scripts/bash/run_local.sh", - "start-cloud": "run-script-os --", - "start-cloud:windows": ".\\platform_scripts\\cmd\\run_cloud.bat", - "start-cloud:default": "./platform_scripts/bash/run_cloud.sh", - "start": "run-script-os", - "start:windows": "platform_scripts\\cmd\\node\\node.exe sfu_server.js", - "start:default": "if [ `id -u` -eq 0 ]\nthen\n export process=\"./platform_scripts/bash/node/bin/node sfu_server.js\"\nelse\n export process=\"sudo ./platform_scripts/bash/node/bin/node sfu_server.js\"\nfi\n$process " - - }, - "dependencies": { - "mediasoup-sdp-bridge": "file:mediasoup-sdp-bridge", - "ws": "^7.1.2", - "mediasoup_prebuilt": "^3.8.4", - "run-script-os": "^1.1.6" - } -} diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/Dockerfile b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/Dockerfile deleted file mode 100644 index 7987117c..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright Epic Games, Inc. All Rights Reserved. - -FROM node:latest - -# Make sure Mediasoup requirements are met -RUN apt -y update -RUN apt -y install python3-pip - -# Copy the Selective Forwarding Unit (SFU) to the Docker build context -COPY . /opt/SFU - -# Install the dependencies for the mediasoup server -WORKDIR /opt/SFU -RUN npm update -RUN npm install . - -# Expose TCP port 80 for player WebSocket connections and web server HTTP access -EXPOSE 40000-49999 - -# Expose TCP port 8888 for streamer WebSocket connections -EXPOSE 8889 - -# Set the signalling server as the container's entrypoint -ENTRYPOINT ["/usr/local/bin/node", "/opt/SFU/sfu_server.js"] - diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/common_utils.sh b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/common_utils.sh deleted file mode 100644 index 3dcdb1ff..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/common_utils.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -function log_msg() { #message - if [ ! -z $VERBOSE ]; then - echo $1 - fi -} - -function print_usage() { - echo " - Usage: - ${0} [--help] [--publicip ] [sfu options...] - Where: - --help will print this message and stop this script. - --debug will run all scripts with --inspect - --nosudo will run all scripts without \`sudo\` command useful for when run in containers. - --verbose will enable additional logging - --package-manager specify an alternative package manager to apt-get - --publicip is used to define public ip address (using default port) for turn server, syntax: --publicip ; it is used for - default value: Retrieved from 'curl https://api.ipify.org' or if unsuccessful then set to 127.0.0.1. It is the IP address of the SFU - Other options: stored and passed to the SFU. All parameters printed once the script values are set. - " - exit 1 -} - -function print_parameters() { - echo "" - echo "${0} is running with the following parameters:" - echo "--------------------------------------" - echo "Public IP address : ${publicip}" - echo "SFU command line arguments: ${sfucmd}" - echo "" -} - -function set_start_default_values() { - # publicip and sfucmd are always needed - publicip=$(curl -s https://api.ipify.org) - if [[ -z $publicip ]]; then - publicip="127.0.0.1" - fi - - sfucmd="" -} - -function use_args() { - while(($#)) ; do - case "$1" in - --debug ) IS_DEBUG=1; shift;; - --nosudo ) NO_SUDO=1; shift;; - --verbose ) VERBOSE=1; shift;; - --publicip ) publicip="$2"; shift 2;; - --help ) print_usage;; - * ) echo "Unknown command, adding to SFU command line: $1"; sfucmd+=" $1"; shift;; - esac - done -} - -function call_setup_sh() { - bash "setup.sh" -} - -function start_process() { - if [ ! -z $NO_SUDO ]; then - log_msg "running with sudo removed" - eval $(echo "$@" | sed 's/sudo//g') - else - eval $@ - fi -} - -function get_version() { - local version=$1 - - if command -v $version; then - version=$($@) - fi - - echo $version | sed -E 's/[^0-9.]//g' -} diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/docker-build.sh b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/docker-build.sh deleted file mode 100644 index 546a6bdc..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/docker-build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -# Build docker image for the Selective Forwarding Unit (SFU) - -# When run from SFU/platform_scripts/bash, this uses the SFU directory -# as the build context so the SFU files can be successfully copied into the container image -docker build -t 'mediasoup_sfu:latest' -f ./Dockerfile ../.. - diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/docker-start.sh b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/docker-start.sh deleted file mode 100644 index 4eda05e2..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/docker-start.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -# Start docker container by name using host networking -docker run --name sfu_latest --network host --rm mediasoup_sfu - -# Interactive start example -#docker run --name sfu_latest --network host --rm -it --entrypoint /bin/bash mediasoup_sfu diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/docker-stop.sh b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/docker-stop.sh deleted file mode 100644 index 637eb277..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/docker-stop.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -# Stop the docker container -PSID=$(docker ps -a -q --filter="name=sfu_latest") -if [ -z "$PSID" ]; then - echo "Docker SFU is not running, no stopping will be done" - exit 1; -fi -echo "Stopping Mediasoup SFU server ..." -docker stop sfu_latest - diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/run_cloud.sh b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/run_cloud.sh deleted file mode 100644 index ee24da7d..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/run_cloud.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. -BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -pushd "${BASH_LOCATION}" > /dev/null - -source common_utils.sh - -set_start_default_values # No server specific defaults -use_args "$@" -call_setup_sh -print_parameters - -process="${BASH_LOCATION}/node/lib/node_modules/npm/bin/npm-cli.js run start:default --" -arguments="--PublicIP=${publicip}" - -# Add arguments passed to script to arguments for executable -arguments+=" ${sfucmd}" - -pushd ../.. > /dev/null - -echo "Running: $process $arguments" -PATH="${BASH_LOCATION}/node/bin:$PATH" -start_process $process $arguments -popd - -popd diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/run_local.sh b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/run_local.sh deleted file mode 100644 index feb26e0f..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/run_local.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. -BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -pushd "${BASH_LOCATION}" > /dev/null - -source common_utils.sh - -set_start_default_values # No server specific defaults -use_args "$@" -call_setup_sh - -process="${BASH_LOCATION}/node/lib/node_modules/npm/bin/npm-cli.js run start:default --" - -pushd ../.. > /dev/null - -echo "" -echo "Starting (S)elective (F)orwarding (U)nit use ctrl-c to exit" -echo "-----------------------------------------" -echo "" - -PATH="${BASH_LOCATION}/node/bin:$PATH" -start_process $process - -popd > /dev/null # ../.. - -popd > /dev/null # BASH_SOURCE \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/setup.sh b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/setup.sh deleted file mode 100644 index 06346acd..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/bash/setup.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. -BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -pushd "${BASH_LOCATION}" > /dev/null - -source common_utils.sh - -use_args $@ -# Azure specific fix to allow installing NodeJS from NodeSource -if test -f "/etc/apt/sources.list.d/azure-cli.list"; then - sudo touch /etc/apt/sources.list.d/nodesource.list - sudo touch /usr/share/keyrings/nodesource.gpg - sudo chmod 644 /etc/apt/sources.list.d/nodesource.list - sudo chmod 644 /usr/share/keyrings/nodesource.gpg - sudo chmod 644 /etc/apt/sources.list.d/azure-cli.list -fi - -function check_version() { #current_version #min_version - #check if same string - if [ -z "$2" ] || [ "$1" = "$2" ]; then - return 0 - fi - - local i current minimum - - IFS="." read -r -a current <<< $1 - IFS="." read -r -a minimum <<< $2 - - # fill empty fields in current with zeros - for ((i=${#current[@]}; i<${#minimum[@]}; i++)) - do - current[i]=0 - done - - for ((i=0; i<${#current[@]}; i++)) - do - if [[ -z ${minimum[i]} ]]; then - # fill empty fields in minimum with zeros - minimum[i]=0 - fi - - if ((10#${current[i]} > 10#${minimum[i]})); then - return 1 - fi - - if ((10#${current[i]} < 10#${minimum[i]})); then - return 2 - fi - done - - # if got this far string is the same once we added missing 0 - return 0 -} - -function check_and_install() { #dep_name #get_version_string #version_min #install_command - local is_installed=0 - - log_msg "Checking for required $1 install" - - local current=$(echo $2 | sed -E 's/[^0-9.]//g') - local minimum=$(echo $3 | sed -E 's/[^0-9.]//g') - - if [ $# -ne 4 ]; then - log_msg "check_and_install expects 4 args (dep_name get_version_string version_min install_command) got $#" - return -1 - fi - - if [ ! -z $current ]; then - log_msg "Current version: $current checking >= $minimum" - check_version "$current" "$minimum" - if [ "$?" -lt 2 ]; then - log_msg "$1 is installed." - return 0 - else - log_msg "Required install of $1 not found installing" - fi - fi - - if [ $is_installed -ne 1 ]; then - echo "$1 installation not found installing..." - - start_process $4 - - if [ $? -ge 1 ]; then - echo "Installation of $1 failed try running `export VERBOSE=1` then run this script again for more details" - exit 1 - fi - - fi -} - -echo "Checking Pixel Streaming SFU dependencies." - -# navigate to SFU root -pushd ../.. > /dev/null - -node_version="" -if [[ -f "${BASH_LOCATION}/node/bin/node" ]]; then - node_version=$("${BASH_LOCATION}/node/bin/node" --version) -fi -check_and_install "node" "$node_version" "v16.4.2" "curl https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.gz --output node.tar.xz - && tar -xf node.tar.xz - && rm node.tar.xz - && mv node-v*-linux-x64 \"${BASH_LOCATION}/node\"" - -PATH="${BASH_LOCATION}/node/bin:$PATH" -"${BASH_LOCATION}/node/lib/node_modules/npm/bin/npm-cli.js" install - -popd > /dev/null # SFU - -popd > /dev/null # BASH_SOURCE - -echo "All Pixel Streaming SFU dependencies up to date." \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/run_cloud.bat b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/run_cloud.bat deleted file mode 100644 index 6834f756..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/run_cloud.bat +++ /dev/null @@ -1,19 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script directory as working directory. -pushd "%~dp0" - -title SFU - -@Rem Get our public IP if we are running this SFU on the cloud we will need this. -FOR /F "tokens=*" %%g IN ('curl -L -S -s https://api.ipify.org') do (SET PUBLICIP=%%g) - -@Rem Call out run.bat and pass in the Public IP we grabbed earlier. -call run_local.bat --PublicIP=%PUBLICIP% - -@Rem Pop script directory. -popd - -pause \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/run_local.bat b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/run_local.bat deleted file mode 100644 index b182fb11..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/run_local.bat +++ /dev/null @@ -1,25 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script directory as working directory. -pushd "%~dp0" - -title SFU - -@Rem Run setup to ensure we have node and mediasoup installed. -call setup.bat - -@Rem Move to sfu_server.js directory. -pushd ..\.. - -@Rem Run node server and pass any argument along. -platform_scripts\cmd\node\node.exe sfu_server %* - -@Rem Pop sfu_server directory. -popd - -@Rem Pop script directory. -popd - -pause \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/setup.bat b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/setup.bat deleted file mode 100644 index 29468f30..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/setup.bat +++ /dev/null @@ -1,17 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script location as working directory for commands. -pushd "%~dp0" - -@Rem Ensure we have NodeJs available for calling. -call setup_node.bat - -@Rem Move to sfu_server.js directory and install its package.json -pushd %~dp0\..\..\ -call platform_scripts\cmd\node\npm install --no-save -popd - -@Rem Pop working directory -popd \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/setup_node.bat b/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/setup_node.bat deleted file mode 100644 index cc079e57..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/platform_scripts/cmd/setup_node.bat +++ /dev/null @@ -1,35 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script location as working directory for commands. -pushd "%~dp0" - -@Rem Name and version of node that we are downloading -SET NodeVersion=v16.4.2 -SET NodeName=node-%NodeVersion%-win-x64 - -@Rem Look for a node directory next to this script -if exist node\ ( - echo Node directory found...skipping install. -) else ( - echo Node directory not found...beginning NodeJS download for Windows. - - @Rem Download nodejs and follow redirects. - curl -L -o ./node.zip "https://nodejs.org/dist/%NodeVersion%/%NodeName%.zip" - - @Rem Unarchive the .zip - tar -xf node.zip - - @Rem Rename the extracted, versioned, directory that contains the NodeJS binaries to simply "node". - ren "%NodeName%\" "node" - - @Rem Delete the downloaded node.zip - del node.zip -) - -@Rem Print node version -echo Node version: & node\node.exe -v - -@Rem Pop working directory -popd \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SFU/sfu_server.js b/Samples/PixelStreaming/WebServers/SFU/sfu_server.js deleted file mode 100644 index 20b65575..00000000 --- a/Samples/PixelStreaming/WebServers/SFU/sfu_server.js +++ /dev/null @@ -1,321 +0,0 @@ -const config = require('./config'); -const WebSocket = require('ws'); -const mediasoup = require('mediasoup_prebuilt'); -const mediasoupSdp = require('mediasoup-sdp-bridge'); - -let signalServer = null; -let mediasoupRouter; -let streamer = null; -let peers = new Map(); - -function connectSignalling(server) { - console.log("Connecting to Signalling Server at %s", server); - signalServer = new WebSocket(server); - signalServer.addEventListener("open", _ => { console.log(`Connected to signalling server`); }); - signalServer.addEventListener("error", result => { console.log(`Error: ${result.message}`); }); - signalServer.addEventListener("message", result => onSignallingMessage(result.data)); - signalServer.addEventListener("close", result => { - console.log(`Disconnected from signalling server: ${result.code} ${result.reason}`); - console.log("Attempting reconnect to signalling server..."); - setTimeout(()=> { - connectSignalling(server); - }, 2000); - }); -} - -async function onStreamerOffer(sdp) { - console.log("Got offer from streamer"); - - if (streamer != null) { - signalServer.close(1013 /* Try again later */, 'Producer is already connected'); - return; - } - - const transport = await createWebRtcTransport("Streamer"); - const sdpEndpoint = mediasoupSdp.createSdpEndpoint(transport, mediasoupRouter.rtpCapabilities); - const producers = await sdpEndpoint.processOffer(sdp); - const sdpAnswer = sdpEndpoint.createAnswer(); - const answer = { type: "answer", sdp: sdpAnswer }; - - console.log("Sending answer to streamer."); - signalServer.send(JSON.stringify(answer)); - streamer = { transport: transport, producers: producers }; -} - -function getNextStreamerSCTPId() { - if(!streamer){ - throw new TypeError('Cannot generate an SCTP stream id - streamer was null.'); - } - if (!streamer.transport || !streamer.transport.sctpParameters || typeof streamer.transport.sctpParameters.MIS !== 'number') { - throw new TypeError('Streamer was not setup with the following require properties: streamer.transport.sctpParameters.MIS'); - } - const numStreams = streamer.transport.sctpParameters.MIS; - if (!streamer.dataStreamIds){ - streamer.dataStreamIds = Buffer.alloc(numStreams, 0); - } - if (!streamer.nextDataStreamId) { - streamer.nextDataStreamId = 0; - } - - let sctpStreamId; - for (let idx = streamer.nextDataStreamId; idx < streamer.dataStreamIds.length; ++idx) { - sctpStreamId = idx % streamer.dataStreamIds.length; - if (!streamer.dataStreamIds[sctpStreamId]) { - streamer.nextDataStreamId = sctpStreamId + 1; - return sctpStreamId; - } - } - console.error("No available SCTP ids, they are all allocated."); - return -1; -} - -function onStreamerDisconnected() { - console.log("Streamer disconnected"); - disconnectAllPeers(); - - if (streamer != null) { - for (const mediaProducer of streamer.producers) { - mediaProducer.close(); - } - streamer.transport.close(); - streamer = null; - } -} - -async function onPeerConnected(peerId) { - console.log("Player %s joined", peerId); - - if (streamer == null) { - console.log("No streamer connected, ignoring player."); - return; - } - - const transport = await createWebRtcTransport("Peer " + peerId); - const sdpEndpoint = mediasoupSdp.createSdpEndpoint( transport, mediasoupRouter.rtpCapabilities ); - sdpEndpoint.addConsumeData(); // adds the sctp 'application' section to the offer - - // media consumers - let consumers = []; - try { - for (const mediaProducer of streamer.producers) { - const consumer = await transport.consume({ producerId: mediaProducer.id, rtpCapabilities: mediasoupRouter.rtpCapabilities }); - consumer.observer.on("layerschange", function() { console.log("layer changed!", consumer.currentLayers); }); - sdpEndpoint.addConsumer(consumer); - consumers.push(consumer); - } - } catch(err) { - console.error("transport.consume() failed:", err); - return; - } - - const offerSignal = { - type: "offer", - playerId: peerId, - sdp: sdpEndpoint.createOffer(), - sfu: true // indicate we're offering from sfu - }; - - // send offer to peer - signalServer.send(JSON.stringify(offerSignal)); - - const newPeer = { - id: peerId, - transport: transport, - sdpEndpoint: sdpEndpoint, - consumers: consumers - }; - - // add the new peer - peers.set(peerId, newPeer); -} - -async function setupPeerDataChannels(peerId) { - const peer = peers.get(peerId); - if (!peer) { - console.error(`Could not send browser any datachannels for peer=${peerId} because peer was not found.`); - return; - } - - const nextStreamerSCTPStreamId = getNextStreamerSCTPId(); - const nextPeerSCTPStreamId = getNextStreamerSCTPId(); - - console.log(`Attempting streamer SCTP id=${nextStreamerSCTPStreamId}`); - - // streamer data producer (produces data for the peer) - peer.streamerDataProducer = await streamer.transport.produceData({label: 'send-datachannel', sctpStreamParameters: {streamId: nextStreamerSCTPStreamId, ordered: true}}); - - console.log(`Attempting peer SCTP id=${nextPeerSCTPStreamId}`); - - // peer data producer (produces data for the streamer) - peer.peerDataProducer = await peer.transport.produceData({label: 'send-datachannel', sctpStreamParameters: {streamId: nextPeerSCTPStreamId, ordered: true}}); - - // peer data consumer (consumes streamer data) - peer.peerDataConsumer = await peer.transport.consumeData({ dataProducerId: peer.streamerDataProducer.id }); - - // streamer data consumer (consumes peer data) - peer.streamerDataConsumer = await streamer.transport.consumeData({ dataProducerId: peer.peerDataProducer.id }); - - const peerSignal = { - type: 'peerDataChannels', - playerId: peerId, - sendStreamId: peer.peerDataProducer.sctpStreamParameters.streamId, - recvStreamId: peer.peerDataConsumer.sctpStreamParameters.streamId - }; - - // Send browser a message with a send/recv data channel SCTP stream id - signalServer.send(JSON.stringify(peerSignal)); - -} - -async function setupStreamerDataChannelsForPeer(peerId) { - - const peer = peers.get(peerId); - if (!peer) { - console.error(`Could not send streamer any datachannels for peer=${peerId} because peer was not found.`); - return; - } - - if(!peer.streamerDataProducer || !peer.streamerDataConsumer){ - console.error(`There was no streamer data producer/consumer setup for peer=${peerId}. Did you make sure to send "dataChannelRequest" first?`); - return; - } - - const streamerSignal = { - type: "streamerDataChannels", - playerId: peerId, - sendStreamId: peer.streamerDataProducer.sctpStreamParameters.streamId, - recvStreamId: peer.streamerDataConsumer.sctpStreamParameters.streamId - }; - - // send streamer a message with a send/recv data channel SCTP stream id - signalServer.send(JSON.stringify(streamerSignal)); -} - -async function onPeerAnswer(peerId, sdp) { - console.log("Got answer from player %s", peerId); - - const consumer = peers.get(peerId); - if (!consumer){ - console.error(`Unable to find player ${peerId}`); - } - else{ - consumer.sdpEndpoint.processAnswer(sdp); - } -} - -function onPeerDisconnected(peerId) { - console.log("Player %s disconnected", peerId); - const peer = peers.get(peerId); - if (peer != null) { - for (consumer of peer.consumers) { - consumer.close(); - } - if (peer.peerDataConsumer) { - peer.peerDataConsumer.close(); - peer.peerDataProducer.close(); - } - if(peer.streamerDataConsumer){ - // Set the streamer sctp id we generated back to zero indicating it can be reused. - if(streamer && streamer.dataStreamIds){ - const allocatedStreamId = peer.streamerDataProducer.sctpStreamParameters.streamId; - const allocatedPeerStreamId = peer.peerDataProducer.sctpStreamParameters.streamId; - streamer.dataStreamIds[allocatedStreamId] = 0; - streamer.dataStreamIds[allocatedPeerStreamId] = 0; - } - peer.streamerDataConsumer.close(); - peer.streamerDataProducer.close(); - } - peer.transport.close(); - } - peers.delete(peerId); -} - -function disconnectAllPeers() { - console.log("Disconnected all players"); - for (const [peerId, peer] of peers) { - onPeerDisconnected(peerId); - } -} - -async function onSignallingMessage(message) { - //console.log(`Got MSG: ${message}`); - const msg = JSON.parse(message); - - if (msg.type == 'offer') { - onStreamerOffer(msg.sdp); - } - else if (msg.type == 'answer') { - onPeerAnswer(msg.playerId, msg.sdp); - } - else if (msg.type == 'playerConnected') { - onPeerConnected(msg.playerId); - } - else if (msg.type == 'playerDisconnected') { - onPeerDisconnected(msg.playerId); - } - else if (msg.type == 'streamerDisconnected') { - onStreamerDisconnected(); - } - else if (msg.type == 'dataChannelRequest') { - setupPeerDataChannels(msg.playerId); - } - else if (msg.type == 'peerDataChannelsReady') { - setupStreamerDataChannelsForPeer(msg.playerId); - } - // todo a new message type for force layer switch (for debugging) - // see: https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-setPreferredLayers - // preferredLayers for debugging to select a particular simulcast layer, looks like { spatialLayer: 2, temporalLayer: 0 } -} - -async function startMediasoup() { - let worker = await mediasoup.createWorker({ - logLevel: config.mediasoup.worker.logLevel, - logTags: config.mediasoup.worker.logTags, - rtcMinPort: config.mediasoup.worker.rtcMinPort, - rtcMaxPort: config.mediasoup.worker.rtcMaxPort, - }); - - worker.on('died', () => { - console.error('mediasoup worker died (this should never happen)'); - process.exit(1); - }); - - const mediaCodecs = config.mediasoup.router.mediaCodecs; - const mediasoupRouter = await worker.createRouter({ mediaCodecs }); - - return mediasoupRouter; -} - -async function createWebRtcTransport(identifier) { - const { - listenIps, - initialAvailableOutgoingBitrate - } = config.mediasoup.webRtcTransport; - - const transport = await mediasoupRouter.createWebRtcTransport({ - listenIps: listenIps, - enableUdp: true, - enableTcp: false, - preferUdp: true, - enableSctp: true, // datachannels - initialAvailableOutgoingBitrate: initialAvailableOutgoingBitrate - }); - - transport.on("icestatechange", (iceState) => { console.log("%s ICE state changed to %s", identifier, iceState); }); - transport.on("iceselectedtuplechange", (iceTuple) => { console.log("%s ICE selected tuple %s", identifier, JSON.stringify(iceTuple)); }); - transport.on("sctpstatechange", (sctpState) => { console.log("%s SCTP state changed to %s", identifier, sctpState); }); - - return transport; -} - -async function main() { - console.log('Starting Mediasoup...'); - console.log("Config = "); - console.log(config); - - mediasoupRouter = await startMediasoup(); - - connectSignalling(config.signallingURL); -} - -main(); diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/.dockerignore b/Samples/PixelStreaming/WebServers/SignallingWebServer/.dockerignore deleted file mode 100644 index 9fc28969..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -logs/*.log -node_modules -platform_scripts -tps diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/Dockerfile b/Samples/PixelStreaming/WebServers/SignallingWebServer/Dockerfile deleted file mode 100644 index ceb20346..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# Use the current Long Term Support (LTS) version of Node.js -FROM node:lts - -# Copy the signalling server source code from the build context -COPY . /opt/SignallingWebServer - -# Install the dependencies for the signalling server -WORKDIR /opt/SignallingWebServer -RUN npm install . - -# Expose TCP ports 80 and 443 for player WebSocket connections and web server HTTP(S) access -EXPOSE 80 -EXPOSE 443 - -# Expose TCP port 8888 for streamer WebSocket connections -EXPOSE 8888 - -# Expose TCP port 8889 for connections from the SFU -EXPOSE 8889 - -# Expose TCP port 9999 for connections from the Matchmaker -EXPOSE 9999 - -# Set the signalling server as the container's entrypoint -ENTRYPOINT ["/usr/local/bin/node", "/opt/SignallingWebServer/cirrus.js"] diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/Public/login.html b/Samples/PixelStreaming/WebServers/SignallingWebServer/Public/login.html deleted file mode 100644 index ec2a2888..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/Public/login.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - Pixel Streaming Login - - - -
-
- -
-
- -
-
- -
-
- - - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/Public/stresstest.html b/Samples/PixelStreaming/WebServers/SignallingWebServer/Public/stresstest.html deleted file mode 100644 index e2724881..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/Public/stresstest.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - Pixel Streaming Stress Tester - - - -
- -
Total streams: 0
-
- Max peers: - 5 - -
-
- Peer creation interval (seconds): - -
-
- Peer deletion interval (seconds): - -
-
-
- - - - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/cirrus.js b/Samples/PixelStreaming/WebServers/SignallingWebServer/cirrus.js deleted file mode 100644 index f651f6df..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/cirrus.js +++ /dev/null @@ -1,932 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -//-- Server side logic. Serves pixel streaming WebRTC-based page, proxies data back to Streamer --// - -var express = require('express'); -var app = express(); - -const fs = require('fs'); -const path = require('path'); -const querystring = require('querystring'); -const bodyParser = require('body-parser'); -const logging = require('./modules/logging.js'); -logging.RegisterConsoleLogger(); - -// Command line argument --configFile needs to be checked before loading the config, all other command line arguments are dealt with through the config object - -const defaultConfig = { - UseFrontend: false, - UseMatchmaker: false, - UseHTTPS: false, - UseAuthentication: false, - LogToFile: true, - LogVerbose: true, - HomepageFile: 'player.html', - AdditionalRoutes: new Map(), - EnableWebserver: true, - MatchmakerAddress: "", - MatchmakerPort: 9999, - PublicIp: "localhost", - HttpPort: 80, - HttpsPort: 443, - StreamerPort: 8888, - SFUPort: 8889, - MaxPlayerCount: -1 -}; - -const argv = require('yargs').argv; -var configFile = (typeof argv.configFile != 'undefined') ? argv.configFile.toString() : path.join(__dirname, 'config.json'); -console.log(`configFile ${configFile}`); -const config = require('./modules/config.js').init(configFile, defaultConfig); - -if (config.LogToFile) { - logging.RegisterFileLogger('./logs/'); -} - -console.log("Config: " + JSON.stringify(config, null, '\t')); - -var http = require('http').Server(app); - -if (config.UseHTTPS) { - //HTTPS certificate details - const options = { - key: fs.readFileSync(path.join(__dirname, './certificates/client-key.pem')), - cert: fs.readFileSync(path.join(__dirname, './certificates/client-cert.pem')) - }; - - var https = require('https').Server(options, app); -} - -//If not using authetication then just move on to the next function/middleware -var isAuthenticated = redirectUrl => function (req, res, next) { return next(); } - -if (config.UseAuthentication && config.UseHTTPS) { - var passport = require('passport'); - require('./modules/authentication').init(app); - // Replace the isAuthenticated with the one setup on passport module - isAuthenticated = passport.authenticationMiddleware ? passport.authenticationMiddleware : isAuthenticated -} else if (config.UseAuthentication && !config.UseHTTPS) { - console.error('Trying to use authentication without using HTTPS, this is not allowed and so authentication will NOT be turned on, please turn on HTTPS to turn on authentication'); -} - -const helmet = require('helmet'); -var hsts = require('hsts'); -var net = require('net'); - -var FRONTEND_WEBSERVER = 'https://localhost'; -if (config.UseFrontend) { - var httpPort = 3000; - var httpsPort = 8000; - - //Required for self signed certs otherwise just get an error back when sending request to frontend see https://stackoverflow.com/a/35633993 - process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0" - - const httpsClient = require('./modules/httpsClient.js'); - var webRequest = new httpsClient(); -} else { - var httpPort = config.HttpPort; - var httpsPort = config.HttpsPort; -} - -var streamerPort = config.StreamerPort; // port to listen to Streamer connections -var sfuPort = config.SFUPort; - -var matchmakerAddress = '127.0.0.1'; -var matchmakerPort = 9999; -var matchmakerRetryInterval = 5; -var matchmakerKeepAliveInterval = 30; -var maxPlayerCount = -1; - -var gameSessionId; -var userSessionId; -var serverPublicIp; - -// `clientConfig` is send to Streamer and Players -// Example of STUN server setting -// let clientConfig = {peerConnectionOptions: { 'iceServers': [{'urls': ['stun:34.250.222.95:19302']}] }}; -var clientConfig = { type: 'config', peerConnectionOptions: {} }; - -// Parse public server address from command line -// --publicIp -try { - if (typeof config.PublicIp != 'undefined') { - serverPublicIp = config.PublicIp.toString(); - } - - if (typeof config.HttpPort != 'undefined') { - httpPort = config.HttpPort; - } - - if (typeof config.HttpsPort != 'undefined') { - httpsPort = config.HttpsPort; - } - - if (typeof config.StreamerPort != 'undefined') { - streamerPort = config.StreamerPort; - } - - if (typeof config.SFUPort != 'undefined') { - sfuPort = config.SFUPort; - } - - if (typeof config.FrontendUrl != 'undefined') { - FRONTEND_WEBSERVER = config.FrontendUrl; - } - - if (typeof config.peerConnectionOptions != 'undefined') { - clientConfig.peerConnectionOptions = JSON.parse(config.peerConnectionOptions); - console.log(`peerConnectionOptions = ${JSON.stringify(clientConfig.peerConnectionOptions)}`); - } else { - console.log("No peerConnectionConfig") - } - - if (typeof config.MatchmakerAddress != 'undefined') { - matchmakerAddress = config.MatchmakerAddress; - } - - if (typeof config.MatchmakerPort != 'undefined') { - matchmakerPort = config.MatchmakerPort; - } - - if (typeof config.MatchmakerRetryInterval != 'undefined') { - matchmakerRetryInterval = config.MatchmakerRetryInterval; - } - - if (typeof config.MaxPlayerCount != 'undefined') { - maxPlayerCount = config.MaxPlayerCount; - } -} catch (e) { - console.error(e); - process.exit(2); -} - -if (config.UseHTTPS) { - app.use(helmet()); - - app.use(hsts({ - maxAge: 15552000 // 180 days in seconds - })); - - //Setup http -> https redirect - console.log('Redirecting http->https'); - app.use(function (req, res, next) { - if (!req.secure) { - if (req.get('Host')) { - var hostAddressParts = req.get('Host').split(':'); - var hostAddress = hostAddressParts[0]; - if (httpsPort != 443) { - hostAddress = `${hostAddress}:${httpsPort}`; - } - return res.redirect(['https://', hostAddress, req.originalUrl].join('')); - } else { - console.error(`unable to get host name from header. Requestor ${req.ip}, url path: '${req.originalUrl}', available headers ${JSON.stringify(req.headers)}`); - return res.status(400).send('Bad Request'); - } - } - next(); - }); -} - -sendGameSessionData(); - -//Setup the login page if we are using authentication -if(config.UseAuthentication){ - if(config.EnableWebserver) { - app.get('/login', function(req, res){ - res.sendFile(path.join(__dirname, '/Public', '/login.html')); - }); - } - - // create application/x-www-form-urlencoded parser - var urlencodedParser = bodyParser.urlencoded({ extended: false }) - - //login page form data is posted here - app.post('/login', - urlencodedParser, - passport.authenticate('local', { failureRedirect: '/login' }), - function(req, res){ - //On success try to redirect to the page that they originally tired to get to, default to '/' if no redirect was found - var redirectTo = req.session.redirectTo ? req.session.redirectTo : '/'; - delete req.session.redirectTo; - console.log(`Redirecting to: '${redirectTo}'`); - res.redirect(redirectTo); - } - ); -} - -if(config.EnableWebserver) { - //Setup folders - app.use(express.static(path.join(__dirname, '/Public'))) - app.use('/images', express.static(path.join(__dirname, './images'))) - app.use('/scripts', [isAuthenticated('/login'),express.static(path.join(__dirname, '/scripts'))]); - app.use('/', [isAuthenticated('/login'), express.static(path.join(__dirname, '/custom_html'))]) -} - -try { - for (var property in config.AdditionalRoutes) { - if (config.AdditionalRoutes.hasOwnProperty(property)) { - console.log(`Adding additional routes "${property}" -> "${config.AdditionalRoutes[property]}"`) - app.use(property, [isAuthenticated('/login'), express.static(path.join(__dirname, config.AdditionalRoutes[property]))]); - } - } -} catch (err) { - console.error(`reading config.AdditionalRoutes: ${err}`) -} - -if(config.EnableWebserver) { - - // Request has been sent to site root, send the homepage file - app.get('/', isAuthenticated('/login'), function (req, res) { - homepageFile = (typeof config.HomepageFile != 'undefined' && config.HomepageFile != '') ? config.HomepageFile.toString() : defaultConfig.HomepageFile; - - let pathsToTry = [ path.join(__dirname, homepageFile), path.join(__dirname, '/Public', homepageFile), path.join(__dirname, '/custom_html', homepageFile), homepageFile ]; - - // Try a few paths, see if any resolve to a homepage file the user has set - for(let pathToTry of pathsToTry){ - if(fs.existsSync(pathToTry)){ - // Send the file for browser to display it - res.sendFile(pathToTry); - return; - } - } - - // Catch file doesn't exist, and send back 404 if not - console.error('Unable to locate file ' + homepageFile) - res.status(404).send('Unable to locate file ' + homepageFile); - return; - }); -} - -//Setup http and https servers -http.listen(httpPort, function () { - console.logColor(logging.Green, 'Http listening on *: ' + httpPort); -}); - -if (config.UseHTTPS) { - https.listen(httpsPort, function () { - console.logColor(logging.Green, 'Https listening on *: ' + httpsPort); - }); -} - -console.logColor(logging.Cyan, `Running Cirrus - The Pixel Streaming reference implementation signalling server for Unreal Engine 5.1.`); - -let nextPlayerId = 100; // reserve some player ids -const SFUPlayerId = "1"; // sfu is a special kind of player - -let streamer = null; // WebSocket connected to Streamer -let sfu = null; // WebSocket connected to SFU -let players = new Map(); // playerId <-> player, where player is either a web-browser or a native webrtc player - -function sfuIsConnected() { - return sfu && sfu.readyState == 1; -} - -function logIncoming(sourceName, msgType, msg) { - if (config.LogVerbose) - console.logColor(logging.Blue, "\x1b[37m-> %s\x1b[34m: %s", sourceName, msg); - else - console.logColor(logging.Blue, "\x1b[37m-> %s\x1b[34m: %s", sourceName, msgType); -} - -function logOutgoing(destName, msgType, msg) { - if (config.LogVerbose) - console.logColor(logging.Green, "\x1b[37m<- %s\x1b[32m: %s", destName, msg); - else - console.logColor(logging.Green, "\x1b[37m<- %s\x1b[32m: %s", destName, msgType); -} - -// normal peer to peer signalling goes to streamer. SFU streaming signalling goes to the sfu -function sendMessageToController(msg, skipSFU, skipStreamer = false) { - const rawMsg = JSON.stringify(msg); - if (sfu && sfu.readyState == 1 && !skipSFU) { - logOutgoing("SFU", msg.type, rawMsg); - sfu.send(rawMsg); - } - if (streamer && streamer.readyState == 1 && !skipStreamer) { - logOutgoing("Streamer", msg.type, rawMsg); - streamer.send(rawMsg); - } - - if (!sfu && !streamer) { - console.error("sendMessageToController: No streamer or SFU connected!\nMSG: %s", rawMsg); - } -} - -function sendMessageToPlayer(playerId, msg) { - let player = players.get(playerId); - if (!player) { - console.log(`dropped message ${msg.type} as the player ${playerId} is not found`); - return; - } - const playerName = playerId == SFUPlayerId ? "SFU" : `player ${playerId}`; - const rawMsg = JSON.stringify(msg); - logOutgoing(playerName, msg.type, rawMsg); - player.ws.send(rawMsg); -} - -let WebSocket = require('ws'); - -console.logColor(logging.Green, `WebSocket listening for Streamer connections on :${streamerPort}`) -let streamerServer = new WebSocket.Server({ port: streamerPort, backlog: 1 }); -streamerServer.on('connection', function (ws, req) { - - // Check if we have an already existing connection to a streamer, if so, deny a new streamer connecting. - if(streamer != null){ - /* We send a 1008 because that a "policy violation", which similar enough to what is happening here. */ - ws.close(1008, 'Cirrus supports only 1 streamer being connected, already one connected, so dropping this new connection.'); - console.logColor(logging.Yellow, `Dropping new streamer connection, we already have a connected streamer`); - return; - } - - console.logColor(logging.Green, `Streamer connected: ${req.connection.remoteAddress}`); - sendStreamerConnectedToMatchmaker(); - - ws.on('message', (msgRaw) => { - - var msg; - try { - msg = JSON.parse(msgRaw); - } catch(err) { - console.error(`cannot parse Streamer message: ${msgRaw}\nError: ${err}`); - streamer.close(1008, 'Cannot parse'); - return; - } - - logIncoming("Streamer", msg.type, msgRaw); - - try { - // just send pings back to sender - if (msg.type == 'ping') { - const rawMsg = JSON.stringify({ type: "pong", time: msg.time}); - logOutgoing("Streamer", msg.type, rawMsg); - ws.send(rawMsg); - return; - } - - // Convert incoming playerId to a string if it is an integer, if needed. (We support receiving it as an int or string). - let playerId = msg.playerId; - if (playerId && typeof playerId === 'number') - { - playerId = playerId.toString(); - } - delete msg.playerId; // no need to send it to the player - - if (msg.type == 'offer') { - sendMessageToPlayer(playerId, msg); - } else if (msg.type == 'answer') { - sendMessageToPlayer(playerId, msg); - } else if (msg.type == 'iceCandidate') { - sendMessageToPlayer(playerId, msg); - } else if (msg.type == 'disconnectPlayer') { - let player = players.get(playerId); - if (player) { - player.ws.close(1011 /* internal error */, msg.reason); - } - } else { - console.error(`unsupported Streamer message type: ${msg.type}`); - streamer.close(1008, 'Unsupported message type'); - } - } catch(err) { - console.error(`ERROR: ws.on message error: ${err.message}`); - } - }); - - function onStreamerDisconnected() { - sendStreamerDisconnectedToMatchmaker(); - disconnectAllPlayers(); - if (sfuIsConnected()) { - const msg = { type: "streamerDisconnected" }; - sfu.send(JSON.stringify(msg)); - } - streamer = null; - } - - ws.on('close', function(code, reason) { - console.error(`streamer disconnected: ${code} - ${reason}`); - onStreamerDisconnected(); - }); - - ws.on('error', function(error) { - console.error(`streamer connection error: ${error}`); - onStreamerDisconnected(); - try { - ws.close(1006 /* abnormal closure */, error); - } catch(err) { - console.error(`ERROR: ws.on error: ${err.message}`); - } - }); - - streamer = ws; - - streamer.send(JSON.stringify(clientConfig)); - - if (sfuIsConnected()) { - const msg = { type: "playerConnected", playerId: SFUPlayerId, dataChannel: true, sfu: true }; - streamer.send(JSON.stringify(msg)); - } -}); - -console.logColor(logging.Green, `WebSocket listening for SFU connections on :${sfuPort}`); -let sfuServer = new WebSocket.Server({ port: sfuPort}); -sfuServer.on('connection', function (ws, req) { - // reject if we already have an sfu - if (sfuIsConnected()) { - ws.close(1013, 'Already have SFU'); - return; - } - - players.set(SFUPlayerId, { ws: ws, id: SFUPlayerId }); - - ws.on('message', (msgRaw) => { - var msg; - try { - msg = JSON.parse(msgRaw); - } catch (err) { - console.error(`cannot parse SFU message: ${msgRaw}\nError: ${err}`); - ws.close(1008, 'Cannot parse'); - return; - } - - logIncoming("SFU", msg.type, msgRaw); - - if (msg.type == 'offer') { - // offers from the sfu are for players - const playerId = msg.playerId; - delete msg.playerId; - sendMessageToPlayer(playerId, msg); - } - else if (msg.type == 'answer') { - // answers from the sfu are for the streamer - msg.playerId = SFUPlayerId; - const rawMsg = JSON.stringify(msg); - logOutgoing("Streamer", msg.type, rawMsg); - streamer.send(rawMsg); - } - else if (msg.type == 'streamerDataChannels') { - // sfu is asking streamer to open a data channel for a connected peer - msg.sfuId = SFUPlayerId; - const rawMsg = JSON.stringify(msg); - logOutgoing("Streamer", msg.type, rawMsg); - streamer.send(rawMsg); - } - else if (msg.type == 'peerDataChannels') { - // sfu is telling a peer what stream id to use for a data channel - const playerId = msg.playerId; - delete msg.playerId; - sendMessageToPlayer(playerId, msg); - // remember the player has a data channel - const player = players.get(playerId); - player.datachannel = true; - } - }); - - ws.on('close', function(code, reason) { - console.error(`SFU disconnected: ${code} - ${reason}`); - sfu = null; - disconnectSFUPlayer(); - }); - - ws.on('error', function(error) { - console.error(`SFU connection error: ${error}`); - sfu = null; - disconnectSFUPlayer(); - try { - ws.close(1006 /* abnormal closure */, error); - } catch(err) { - console.error(`ERROR: ws.on error: ${err.message}`); - } - }); - - sfu = ws; - console.logColor(logging.Green, `SFU (${req.connection.remoteAddress}) connected `); - - if (streamer && streamer.readyState == 1) { - const msg = { type: "playerConnected", playerId: SFUPlayerId, dataChannel: true, sfu: true }; - streamer.send(JSON.stringify(msg)); - } -}); - -let playerCount = 0; - -console.logColor(logging.Green, `WebSocket listening for Players connections on :${httpPort}`); -let playerServer = new WebSocket.Server({ server: config.UseHTTPS ? https : http}); -playerServer.on('connection', function (ws, req) { - // Reject connection if streamer is not connected - if (!streamer || streamer.readyState != 1 /* OPEN */) { - ws.close(1013 /* Try again later */, 'Streamer is not connected'); - return; - } - - var url = require('url'); - const parsedUrl = url.parse(req.url); - const urlParams = new URLSearchParams(parsedUrl.search); - const preferSFU = urlParams.has('preferSFU') && urlParams.get('preferSFU') !== 'false'; - const skipSFU = !preferSFU; - const skipStreamer = preferSFU && sfu; - - if(preferSFU && !sfu) { - ws.send(JSON.stringify({ type: "warning", warning: "Even though ?preferSFU was specified, there is currently no SFU connected." })); - } - - if(playerCount + 1 > maxPlayerCount && maxPlayerCount !== -1) - { - console.logColor(logging.Red, `new connection would exceed number of allowed concurrent connections. Max: ${maxPlayerCount}, Current ${playerCount}`); - ws.close(1013, `too many connections. max: ${maxPlayerCount}, current: ${playerCount}`); - return; - } - - ++playerCount; - let playerId = (++nextPlayerId).toString(); - console.logColor(logging.Green, `player ${playerId} (${req.connection.remoteAddress}) connected`); - players.set(playerId, { ws: ws, id: playerId }); - - function sendPlayersCount() { - let playerCountMsg = JSON.stringify({ type: 'playerCount', count: players.size }); - for (let p of players.values()) { - p.ws.send(playerCountMsg); - } - } - - ws.on('message', (msgRaw) =>{ - - var msg; - try { - msg = JSON.parse(msgRaw); - } catch (err) { - console.error(`cannot parse player ${playerId} message: ${msgRaw}\nError: ${err}`); - ws.close(1008, 'Cannot parse'); - return; - } - - if(!msg || !msg.type) - { - console.error(`Cannot parse message ${msgRaw}`); - return; - } - - logIncoming(`player ${playerId}`, msg.type, msgRaw); - - if (msg.type == 'offer') { - msg.playerId = playerId; - sendMessageToController(msg, skipSFU); - } else if (msg.type == 'answer') { - msg.playerId = playerId; - sendMessageToController(msg, skipSFU, skipStreamer); - } else if (msg.type == 'iceCandidate') { - msg.playerId = playerId; - sendMessageToController(msg, skipSFU, skipStreamer); - } else if (msg.type == 'stats') { - console.log(`player ${playerId}: stats\n${msg.data}`); - } else if (msg.type == "dataChannelRequest") { - msg.playerId = playerId; - sendMessageToController(msg, skipSFU, true); - } else if (msg.type == "peerDataChannelsReady") { - msg.playerId = playerId; - sendMessageToController(msg, skipSFU, true); - } - else { - console.error(`player ${playerId}: unsupported message type: ${msg.type}`); - ws.close(1008, 'Unsupported message type'); - return; - } - }); - - function onPlayerDisconnected() { - try { - --playerCount; - const player = players.get(playerId); - if (player.datachannel) { - // have to notify the streamer that the datachannel can be closed - sendMessageToController({ type: 'playerDisconnected', playerId: playerId }, true, false); - } - players.delete(playerId); - sendMessageToController({ type: 'playerDisconnected', playerId: playerId }, skipSFU); - sendPlayerDisconnectedToFrontend(); - sendPlayerDisconnectedToMatchmaker(); - sendPlayersCount(); - } catch(err) { - console.logColor(logging.Red, `ERROR:: onPlayerDisconnected error: ${err.message}`); - } - } - - ws.on('close', function(code, reason) { - console.logColor(logging.Yellow, `player ${playerId} connection closed: ${code} - ${reason}`); - onPlayerDisconnected(); - }); - - ws.on('error', function(error) { - console.error(`player ${playerId} connection error: ${error}`); - ws.close(1006 /* abnormal closure */, error); - onPlayerDisconnected(); - - console.logColor(logging.Red, `Trying to reconnect...`); - reconnect(); - }); - - sendPlayerConnectedToFrontend(); - sendPlayerConnectedToMatchmaker(); - - ws.send(JSON.stringify(clientConfig)); - - sendMessageToController({ type: "playerConnected", playerId: playerId, dataChannel: true, sfu: false }, skipSFU, skipStreamer); - sendPlayersCount(); -}); - -function disconnectAllPlayers(code, reason) { - console.log("killing all players"); - let clone = new Map(players); - for (let player of clone.values()) { - if (player.id != SFUPlayerId) { // dont dc the sfu - player.ws.close(code, reason); - } - } -} - -function disconnectSFUPlayer() { - console.log("disconnecting SFU from streamer"); - if(players.has(SFUPlayerId)) { - players.get(SFUPlayerId).ws.close(4000, "SFU Disconnected"); - players.delete(SFUPlayerId); - } - sendMessageToController({ type: 'playerDisconnected', playerId: SFUPlayerId }, true, false); -} - -/** - * Function that handles the connection to the matchmaker. - */ - -if (config.UseMatchmaker) { - var matchmaker = new net.Socket(); - - matchmaker.on('connect', function() { - console.log(`Cirrus connected to Matchmaker ${matchmakerAddress}:${matchmakerPort}`); - - // message.playerConnected is a new variable sent from the SS to help track whether or not a player - // is already connected when a 'connect' message is sent (i.e., reconnect). This happens when the MM - // and the SS get disconnected unexpectedly (was happening often at scale for some reason). - var playerConnected = false; - - // Set the playerConnected flag to tell the MM if there is already a player active (i.e., don't send a new one here) - if( players && players.size > 0) { - playerConnected = true; - } - - // Add the new playerConnected flag to the message body to the MM - message = { - type: 'connect', - address: typeof serverPublicIp === 'undefined' ? '127.0.0.1' : serverPublicIp, - port: httpPort, - ready: streamer && streamer.readyState === 1, - playerConnected: playerConnected - }; - - matchmaker.write(JSON.stringify(message)); - }); - - matchmaker.on('error', (err) => { - console.log(`Matchmaker connection error ${JSON.stringify(err)}`); - }); - - matchmaker.on('end', () => { - console.log('Matchmaker connection ended'); - }); - - matchmaker.on('close', (hadError) => { - console.logColor(logging.Blue, 'Setting Keep Alive to true'); - matchmaker.setKeepAlive(true, 60000); // Keeps it alive for 60 seconds - - console.log(`Matchmaker connection closed (hadError=${hadError})`); - - reconnect(); - }); - - // Attempt to connect to the Matchmaker - function connect() { - matchmaker.connect(matchmakerPort, matchmakerAddress); - } - - // Try to reconnect to the Matchmaker after a given period of time - function reconnect() { - console.log(`Try reconnect to Matchmaker in ${matchmakerRetryInterval} seconds`) - setTimeout(function() { - connect(); - }, matchmakerRetryInterval * 1000); - } - - function registerMMKeepAlive() { - setInterval(function() { - message = { - type: 'ping' - }; - matchmaker.write(JSON.stringify(message)); - }, matchmakerKeepAliveInterval * 1000); - } - - connect(); - registerMMKeepAlive(); -} - -//Keep trying to send gameSessionId in case the server isn't ready yet -function sendGameSessionData() { - //If we are not using the frontend web server don't try and make requests to it - if (!config.UseFrontend) - return; - webRequest.get(`${FRONTEND_WEBSERVER}/server/requestSessionId`, - function (response, body) { - if (response.statusCode === 200) { - gameSessionId = body; - console.log('SessionId: ' + gameSessionId); - } - else { - console.error('Status code: ' + response.statusCode); - console.error(body); - } - }, - function (err) { - //Repeatedly try in cases where the connection timed out or never connected - if (err.code === "ECONNRESET") { - //timeout - sendGameSessionData(); - } else if (err.code === 'ECONNREFUSED') { - console.error('Frontend server not running, unable to setup game session'); - } else { - console.error(err); - } - }); -} - -function sendUserSessionData(serverPort) { - //If we are not using the frontend web server don't try and make requests to it - if (!config.UseFrontend) - return; - webRequest.get(`${FRONTEND_WEBSERVER}/server/requestUserSessionId?gameSessionId=${gameSessionId}&serverPort=${serverPort}&appName=${querystring.escape(clientConfig.AppName)}&appDescription=${querystring.escape(clientConfig.AppDescription)}${(typeof serverPublicIp === 'undefined' ? '' : '&serverHost=' + serverPublicIp)}`, - function (response, body) { - if (response.statusCode === 410) { - sendUserSessionData(serverPort); - } else if (response.statusCode === 200) { - userSessionId = body; - console.log('UserSessionId: ' + userSessionId); - } else { - console.error('Status code: ' + response.statusCode); - console.error(body); - } - }, - function (err) { - //Repeatedly try in cases where the connection timed out or never connected - if (err.code === "ECONNRESET") { - //timeout - sendUserSessionData(serverPort); - } else if (err.code === 'ECONNREFUSED') { - console.error('Frontend server not running, unable to setup user session'); - } else { - console.error(err); - } - }); -} - -function sendServerDisconnect() { - //If we are not using the frontend web server don't try and make requests to it - if (!config.UseFrontend) - return; - try { - webRequest.get(`${FRONTEND_WEBSERVER}/server/serverDisconnected?gameSessionId=${gameSessionId}&appName=${querystring.escape(clientConfig.AppName)}`, - function (response, body) { - if (response.statusCode === 200) { - console.log('serverDisconnected acknowledged by Frontend'); - } else { - console.error('Status code: ' + response.statusCode); - console.error(body); - } - }, - function (err) { - //Repeatedly try in cases where the connection timed out or never connected - if (err.code === "ECONNRESET") { - //timeout - sendServerDisconnect(); - } else if (err.code === 'ECONNREFUSED') { - console.error('Frontend server not running, unable to setup user session'); - } else { - console.error(err); - } - }); - } catch(err) { - console.logColor(logging.Red, `ERROR::: sendServerDisconnect error: ${err.message}`); - } -} - -function sendPlayerConnectedToFrontend() { - //If we are not using the frontend web server don't try and make requests to it - if (!config.UseFrontend) - return; - try { - webRequest.get(`${FRONTEND_WEBSERVER}/server/clientConnected?gameSessionId=${gameSessionId}&appName=${querystring.escape(clientConfig.AppName)}`, - function (response, body) { - if (response.statusCode === 200) { - console.log('clientConnected acknowledged by Frontend'); - } else { - console.error('Status code: ' + response.statusCode); - console.error(body); - } - }, - function (err) { - //Repeatedly try in cases where the connection timed out or never connected - if (err.code === "ECONNRESET") { - //timeout - sendPlayerConnectedToFrontend(); - } else if (err.code === 'ECONNREFUSED') { - console.error('Frontend server not running, unable to setup game session'); - } else { - console.error(err); - } - }); - } catch(err) { - console.logColor(logging.Red, `ERROR::: sendPlayerConnectedToFrontend error: ${err.message}`); - } -} - -function sendPlayerDisconnectedToFrontend() { - //If we are not using the frontend web server don't try and make requests to it - if (!config.UseFrontend) - return; - try { - webRequest.get(`${FRONTEND_WEBSERVER}/server/clientDisconnected?gameSessionId=${gameSessionId}&appName=${querystring.escape(clientConfig.AppName)}`, - function (response, body) { - if (response.statusCode === 200) { - console.log('clientDisconnected acknowledged by Frontend'); - } - else { - console.error('Status code: ' + response.statusCode); - console.error(body); - } - }, - function (err) { - //Repeatedly try in cases where the connection timed out or never connected - if (err.code === "ECONNRESET") { - //timeout - sendPlayerDisconnectedToFrontend(); - } else if (err.code === 'ECONNREFUSED') { - console.error('Frontend server not running, unable to setup game session'); - } else { - console.error(err); - } - }); - } catch(err) { - console.logColor(logging.Red, `ERROR::: sendPlayerDisconnectedToFrontend error: ${err.message}`); - } -} - -function sendStreamerConnectedToMatchmaker() { - if (!config.UseMatchmaker) - return; - try { - message = { - type: 'streamerConnected' - }; - matchmaker.write(JSON.stringify(message)); - } catch (err) { - console.logColor(logging.Red, `ERROR sending streamerConnected: ${err.message}`); - } -} - -function sendStreamerDisconnectedToMatchmaker() { - if (!config.UseMatchmaker) - return; - try { - message = { - type: 'streamerDisconnected' - }; - matchmaker.write(JSON.stringify(message)); - } catch (err) { - console.logColor(logging.Red, `ERROR sending streamerDisconnected: ${err.message}`); - } -} - -// The Matchmaker will not re-direct clients to this Cirrus server if any client -// is connected. -function sendPlayerConnectedToMatchmaker() { - if (!config.UseMatchmaker) - return; - try { - message = { - type: 'clientConnected' - }; - matchmaker.write(JSON.stringify(message)); - } catch (err) { - console.logColor(logging.Red, `ERROR sending clientConnected: ${err.message}`); - } -} - -// The Matchmaker is interested when nobody is connected to a Cirrus server -// because then it can re-direct clients to this re-cycled Cirrus server. -function sendPlayerDisconnectedToMatchmaker() { - if (!config.UseMatchmaker) - return; - try { - message = { - type: 'clientDisconnected' - }; - matchmaker.write(JSON.stringify(message)); - } catch (err) { - console.logColor(logging.Red, `ERROR sending clientDisconnected: ${err.message}`); - } -} diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/config.json b/Samples/PixelStreaming/WebServers/SignallingWebServer/config.json deleted file mode 100644 index 1370d0f5..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/config.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "UseFrontend": false, - "UseMatchmaker": false, - "UseHTTPS": false, - "UseAuthentication": false, - "LogToFile": true, - "LogVerbose": true, - "HomepageFile": "player.html", - "AdditionalRoutes": {}, - "EnableWebserver": true, - "MatchmakerAddress": "", - "MatchmakerPort": 9999, - "PublicIp": "localhost", - "HttpPort": 80, - "HttpsPort": 443, - "StreamerPort": 8888, - "SFUPort": 8889, - "MaxPlayerCount": -1 -} \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/db/index.js b/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/db/index.js deleted file mode 100644 index 5fd0f687..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/db/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. -exports.users = require('./users'); diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/db/store_password.js b/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/db/store_password.js deleted file mode 100644 index f16145b7..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/db/store_password.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. -// -// Usage: npm run store_password -- --username --password -// or from ./modules/authentication/db dir: node store_password.js --username --password -// -// --usersFile is an optional parameter that can be used to specify a different location for the users database file -// use this if running the command from a different working dir. The default location is './users.json' -// e.g. If running from the SignallingWebServer dir use: --usersFile ./modules/authentication/db/users.json - -const argv = require('yargs').argv; -const fs = require('fs'); -const bcrypt = require('bcryptjs'); - -var username, password; -var usersFile = './users.json' - -const STORE_PLAINTEXT_PASSWORD = false; - -try { - if(typeof argv.username != 'undefined'){ - username = argv.username.toString(); - } - - if(typeof argv.password != 'undefined'){ - password = argv.password; - } - - if(typeof argv.usersFile != 'undefined'){ - usersFile = argv.usersFile; - } -} catch (e) { - console.error(e); - process.exit(2); -} - -if(username && password){ - let existingAccounts = []; - if (fs.existsSync(usersFile)) { - console.log(`File '${usersFile}' exists, reading file`) - var content = fs.readFileSync(usersFile, 'utf8'); - try{ - existingAccounts = JSON.parse(content); - } - catch(e){ - console.error(`Existing file '${usersFile}', has invalid JSON: ${e}`); - } - } - - var existingUser = existingAccounts.find( u => u.username == username) - if(existingUser){ - console.log(`User '${username}', already exists, updating password`) - existingUser.passwordHash = generatePasswordHash(password) - if(STORE_PLAINTEXT_PASSWORD) - existingUser.password = password; - else if (existingUser.password) - delete existingUser.password; - - } else { - console.log(`Adding new user '${username}'`) - let newUser = { - id: existingAccounts.length + 1, - username: username, - passwordHash: generatePasswordHash(password) - } - if(STORE_PLAINTEXT_PASSWORD) - newUser.password = password; - - existingAccounts.push(newUser); - } - - console.log(`Writing updated users to '${usersFile}'`); - var newContent = JSON.stringify(existingAccounts); - fs.writeFileSync(usersFile, newContent); -} else { - console.log(`Please pass in both username (${username}) and password (${password}) please`); -} - -function generatePasswordHash(pass){ - return bcrypt.hashSync(pass, 12) -} \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/db/users.js b/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/db/users.js deleted file mode 100644 index 586ccb92..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/db/users.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. -const fs = require('fs'); -const path = require('path'); - -// Read in users from file -let records = []; -let usersFile = path.join(__dirname, './users.json'); -if (fs.existsSync(usersFile)) { - console.log(`Reading users from '${usersFile}'`) - var content = fs.readFileSync(usersFile, 'utf8'); - try { - records = JSON.parse(content); - } catch(e) { - console.log(`ERROR: Failed to parse users from file '${usersFile}'`) - } -} - -exports.findById = function(id, cb) { - var idx = id - 1; - if (records[idx]) { - cb(null, records[idx]); - } else { - cb(new Error('User ' + id + ' does not exist')); - } -} - -exports.findByUsername = function(username, cb) { - for (var i = 0, len = records.length; i < len; i++) { - var record = records[i]; - if (record.username === username) { - return cb(null, record); - } - } - return cb(null, null); -} diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/index.js b/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/index.js deleted file mode 100644 index d19bf66b..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/index.js +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. -module.exports = { - init: require('./init') -} \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/init.js b/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/init.js deleted file mode 100644 index ae34f431..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/authentication/init.js +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. -// Adapted from -// * https://blog.risingstack.com/node-hero-node-js-authentication-passport-js/ -// * https://github.com/RisingStack/nodehero-authentication/tree/master/app -// * https://github.com/passport/express-4.x-local-example - - -const passport = require('passport'); -const session = require('express-session'); -const bcrypt = require('bcryptjs'); -const LocalStrategy = require('passport-local').Strategy; -const path = require('path'); -const fs = require('fs'); -var db = require('./db'); - -function initPassport (app) { - - // Generate session secret if it doesn't already exist and save it to file for use next time - let config = {}; - let configPath = path.join(__dirname, './config.json'); - if (fs.existsSync(configPath)) { - let content = fs.readFileSync(configPath, 'utf8'); - try { - config = JSON.parse(content); - } catch (e) { - console.log(`Error with config file '${configPath}': ${e}`); - } - } - - if(!config.sessionSecret){ - config.sessionSecret = bcrypt.genSaltSync(12); - let content = JSON.stringify(config); - fs.writeFileSync(configPath, content); - } - - // Setup session id settings - app.use(session({ - secret: config.sessionSecret, - resave: false, - saveUninitialized: false, - cookie: { - secure: true, - maxAge: 24 * 60 * 60 * 1000 /* 1 day */ - //maxAge: 5 * 1000 /* 5 seconds */ - } - })); - - app.use(passport.initialize()); - app.use(passport.session()); - - passport.serializeUser(function(user, cb) { - cb(null, user.id); - }); - - passport.deserializeUser(function(id, cb) { - db.users.findById(id, function (err, user) { - if (err) { return cb(err); } - cb(null, user); - }); - }); - - console.log('Setting up auth'); - passport.use(new LocalStrategy( - (username, password, callback) => { - db.users.findByUsername(username, (err, user) => { - if (err) { - console.log(`Unable to login '${username}', error ${err}`); - return callback(err); - } - - // User not found - if (!user) { - console.log(`User '${username}' not found`); - return callback(null, false); - } - - // Always use hashed passwords and fixed time comparison - bcrypt.compare(password, user.passwordHash, (err, isValid) => { - if (err) { - console.log(`Error comparing password for user '${username}': ${err}`); - return callback(err); - } - if (!isValid) { - console.log(`Password incorrect for user '${username}'`) - return callback(null, false); - } - - console.log(`User '${username}' logged in`); - return callback(null, user); - }); - }) - } - )); - - passport.authenticationMiddleware = function authenticationMiddleware (redirectUrl) { - return function (req, res, next) { - if (req.isAuthenticated()) { - return next(); - } - - // Set redirectTo property so that user can be redirected back there after logging in - //console.log(`Original request path '${req.originalUrl}'`); - req.session.redirectTo = req.originalUrl; - res.redirect(redirectUrl); - } - } -} - -module.exports = initPassport; \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/config.js b/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/config.js deleted file mode 100644 index e4f33cad..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/config.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -//-- Provides configuration information from file and combines it with default values and command line arguments --// -//-- Hierachy of values: Default Values < Config File < Command Line arguments --// - -const fs = require('fs'); -const path = require('path'); -const argv = require('yargs').argv; - -function initConfig(configFile, defaultConfig){ - defaultConfig = defaultConfig || {}; - - // Using object spread syntax: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#Spread_in_object_literals - let config = {...defaultConfig}; - try { - let configData = fs.readFileSync(configFile, 'UTF8'); - fileConfig = JSON.parse(configData); - config = {...config, ...fileConfig} - - try { - accessSync('configFile', constants.W_OK); - // Update config file with any additional defaults (does not override existing values if default has changed) - fs.writeFileSync(configFile, JSON.stringify(config, null, '\t'), 'UTF8'); - } catch (err) { - console.log("Config file is readonly, skipping writing config..."); - } - - } catch(err) { - if (err.code === 'ENOENT') { - console.log("No config file found, writing defaults to log file " + configFile); - fs.writeFileSync(configFile, JSON.stringify(config, null, '\t'), 'UTF8'); - } else if (err instanceof SyntaxError) { - console.log(`ERROR: Invalid JSON in ${configFile}, ignoring file config, ${err}`) - } else { - console.log(`ERROR: ${err}`); - } - } - - try { - //Make a copy of the command line args and remove the unneccessary ones - //The _ value is an array of any elements without a key - let commandLineConfig = {...argv} - delete commandLineConfig._; - delete commandLineConfig.help; - delete commandLineConfig.version; - delete commandLineConfig['$0']; - config = {...config, ...commandLineConfig} - } catch(err) { - console.log(`ERROR: ${err}`); - } - return config; -} - -module.exports = { - init: initConfig -} \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/httpsClient.js b/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/httpsClient.js deleted file mode 100644 index 4b1fe009..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/httpsClient.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. -var querystring = require('querystring') -const https = require('https'); -const assert = require('assert'); - -function cleanUrl(aUrl){ - let url = aUrl; - if(url.startsWith("https://")) - url = url.substring("https://".length); - - return url -} - -function createOptions(requestType, url){ - let index = url.indexOf('/'); - - let urlParts = url.split('/', 2) - - return { - hostname: (index === -1) ? url.substring(0) : url.substring(0, index), - port: 443, - path: (index === -1) ? '' : url.substring(index), - method: requestType, - timeout: 30000, - }; -} - -function makeHttpsCall(options, aCallback, aError){ - //console.log(JSON.stringify(options)); - const req = https.request(options, function(response){ - let data = ''; - - //console.log('statusCode:', response.statusCode); - //console.log('headers:', response.headers); - - // A chunk of data has been received. - response.on('data', (chunk) => { - data += chunk; - }); - - // The whole response has been received. Print out the result. - response.on('end', () => { - if(typeof aCallback != "undefined") - aCallback(response, data); - }); - }); - - req.on('timeout', function () { - console.log("Request timed out. " + (options.timeout / 1000) + " seconds expired"); - - // Source: https://github.com/nodejs/node/blob/master/test/parallel/test-http-client-timeout-option.js#L27 - req.destroy(); - }); - - req.on("error", (err) => { - if(typeof aError != "undefined") { - aError(err); - } else { - console.log("Error: " + err.message); - } - }); - - return req; -} - -module.exports = class HttpClient { - get(aUrl, aCallback, aError) { - let url = cleanUrl(aUrl); - - let options = createOptions('GET', url); - - const req = makeHttpsCall(options, aCallback, aError); - - req.end(); - } - - post(aUrl, body, aCallback, aError) { - let url = cleanUrl(aUrl); - - let options = createOptions('POST', url); - - let postBody = querystring.stringify(body); - - //Add extra options for POST request type - options.headers = { - 'Content-Type': 'application/x-www-form-urlencoded', - 'Content-Length': postBody.length - }; - - const req = makeHttpsCall(options, aCallback, aError); - - req.write(postBody); - req.end(); - } -} \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/logging.js b/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/logging.js deleted file mode 100644 index ba3b2e0e..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/modules/logging.js +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -const fs = require('fs'); -const { Console } = require('console'); - -var loggers=[]; -var logFunctions=[]; -var logColorFunctions=[]; - -console.log = function(msg, ...args) { - logFunctions.forEach((logFunction) => { - logFunction(msg, ...args); - }); -} - -console.logColor = function(color, msg, ...args) { - logColorFunctions.forEach((logColorFunction) => { - logColorFunction(color, msg, ...args); - }); -} - -const AllAttributesOff = '\x1b[0m'; -const BoldOn = '\x1b[1m'; -const Black = '\x1b[30m'; -const Red = '\x1b[31m'; -const Green = '\x1b[32m'; -const Yellow = '\x1b[33m'; -const Blue = '\x1b[34m'; -const Magenta = '\x1b[35m'; -const Cyan = '\x1b[36m'; -const White = '\x1b[37m'; - -/** - * Pad the start of the given number with zeros so it takes up the number of digits. - * e.g. zeroPad(5, 3) = '005' and zeroPad(23, 2) = '23'. - */ -function zeroPad(number, digits) { - let string = number.toString(); - while (string.length < digits) { - string = '0' + string; - } - return string; -} - -/** - * Create a string of the form 'YEAR.MONTH.DATE.HOURS.MINUTES.SECONDS'. - */ -function dateTimeToString() { - let date = new Date(); - return `${date.getFullYear()}.${zeroPad(date.getMonth(), 2)}.${zeroPad(date.getDate(), 2)}.${zeroPad(date.getHours(), 2)}.${zeroPad(date.getMinutes(), 2)}.${zeroPad(date.getSeconds(), 2)}`; -} - -/** - * Create a string of the form 'HOURS.MINUTES.SECONDS.MILLISECONDS'. - */ -function timeToString() { - let date = new Date(); - return `${zeroPad(date.getHours(), 2)}:${zeroPad(date.getMinutes(), 2)}:${zeroPad(date.getSeconds(), 2)}.${zeroPad(date.getMilliseconds(), 3)}`; -} - -function RegisterFileLogger(path) { - if(path == null) - path = './logs/'; - - if (!fs.existsSync(path)) - fs.mkdirSync(path); - - var output = fs.createWriteStream(`${path}${dateTimeToString()}.log`); - var fileLogger = new Console(output); - logFunctions.push(function(msg, ...args) { - fileLogger.log(`${timeToString()} ${msg}`, ...args); - }); - - logColorFunctions.push(function(color, msg, ...args) { - fileLogger.log(`${timeToString()} ${msg}`, ...args); - }); - loggers.push(fileLogger); -} - -function RegisterConsoleLogger() { - var consoleLogger = new Console(process.stdout, process.stderr) - logFunctions.push(function(msg, ...args) { - consoleLogger.log(`${timeToString()} ${msg}`, ...args); - }); - - logColorFunctions.push(function(color, msg, ...args) { - consoleLogger.log(`${BoldOn}${color}${timeToString()} ${msg}${AllAttributesOff}`, ...args); - }); - loggers.push(consoleLogger); -} - -module.exports = { - //Functions - RegisterFileLogger, - RegisterConsoleLogger, - - //Variables - AllAttributesOff, - BoldOn, - Black, - Red, - Green, - Yellow, - Blue, - Magenta, - Cyan, - White -} \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/package-lock.json b/Samples/PixelStreaming/WebServers/SignallingWebServer/package-lock.json deleted file mode 100644 index 21885846..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/package-lock.json +++ /dev/null @@ -1,1911 +0,0 @@ -{ - "name": "cirrus-webserver", - "version": "0.0.1", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "cirrus-webserver", - "version": "0.0.1", - "dependencies": { - "bcryptjs": "^2.4.3", - "express": "^4.18.2", - "express-session": "^1.15.6", - "helmet": "^3.21.3", - "passport": "^0.6.0", - "passport-local": "^1.0.0", - "run-script-os": "^1.1.6", - "ws": "^7.1.2", - "y18n": "^5.0.5", - "yargs": "^15.3.0" - } - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "node_modules/bcryptjs": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", - "integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=" - }, - "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/bowser": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.9.0.tgz", - "integrity": "sha512-2ld76tuLBNFekRgmJfT2+3j5MIrP6bFict8WAIT3beq+srz1gcKNAdNKMqHqauQt63NmAa88HfP1/Ypa9Er3HA==" - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/camelize": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", - "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" - }, - "node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-security-policy-builder": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/content-security-policy-builder/-/content-security-policy-builder-2.1.0.tgz", - "integrity": "sha512-/MtLWhJVvJNkA9dVLAp6fg9LxD2gfI6R2Fi1hPmfjYXSahJJzcfvoeDOxSyp4NvxMuwWv3WMssE9o31DoULHrQ==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "node_modules/dasherize": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dasherize/-/dasherize-2.0.0.tgz", - "integrity": "sha1-bYCcnNDPe7iVLYD8hPoT1H3bEwg=" - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/dont-sniff-mimetype": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/dont-sniff-mimetype/-/dont-sniff-mimetype-1.1.0.tgz", - "integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/express-session": { - "version": "1.17.2", - "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.17.2.tgz", - "integrity": "sha512-mPcYcLA0lvh7D4Oqr5aNJFMtBMKPLl++OKKxkHzZ0U0oDq1rpKBnkR5f5vCHR26VeArlTOEF9td4x5IjICksRQ==", - "dependencies": { - "cookie": "0.4.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~2.0.0", - "on-headers": "~1.0.2", - "parseurl": "~1.3.3", - "safe-buffer": "5.2.1", - "uid-safe": "~2.1.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/express-session/node_modules/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/feature-policy": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/feature-policy/-/feature-policy-0.3.0.tgz", - "integrity": "sha512-ZtijOTFN7TzCujt1fnNhfWPFPSHeZkesff9AXZj+UEjYBynWNUIYpC87Ve4wHzyexQsImicLu7WsC2LHq7/xrQ==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/helmet": { - "version": "3.23.3", - "resolved": "https://registry.npmjs.org/helmet/-/helmet-3.23.3.tgz", - "integrity": "sha512-U3MeYdzPJQhtvqAVBPntVgAvNSOJyagwZwyKsFdyRa8TV3pOKVFljalPOCxbw5Wwf2kncGhmP0qHjyazIdNdSA==", - "dependencies": { - "depd": "2.0.0", - "dont-sniff-mimetype": "1.1.0", - "feature-policy": "0.3.0", - "helmet-crossdomain": "0.4.0", - "helmet-csp": "2.10.0", - "hide-powered-by": "1.1.0", - "hpkp": "2.0.0", - "hsts": "2.2.0", - "nocache": "2.1.0", - "referrer-policy": "1.2.0", - "x-xss-protection": "1.3.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/helmet-crossdomain": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/helmet-crossdomain/-/helmet-crossdomain-0.4.0.tgz", - "integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/helmet-csp": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.10.0.tgz", - "integrity": "sha512-Rz953ZNEFk8sT2XvewXkYN0Ho4GEZdjAZy4stjiEQV3eN7GDxg1QKmYggH7otDyIA7uGA6XnUMVSgeJwbR5X+w==", - "dependencies": { - "bowser": "2.9.0", - "camelize": "1.0.0", - "content-security-policy-builder": "2.1.0", - "dasherize": "2.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/hide-powered-by": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/hide-powered-by/-/hide-powered-by-1.1.0.tgz", - "integrity": "sha512-Io1zA2yOA1YJslkr+AJlWSf2yWFkKjvkcL9Ni1XSUqnGLr/qRQe2UI3Cn/J9MsJht7yEVCe0SscY1HgVMujbgg==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/hpkp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hpkp/-/hpkp-2.0.0.tgz", - "integrity": "sha1-EOFCJk52IVpdMMROxD3mTe5tFnI=" - }, - "node_modules/hsts": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/hsts/-/hsts-2.2.0.tgz", - "integrity": "sha512-ToaTnQ2TbJkochoVcdXYm4HOCliNozlviNsg+X2XQLQvZNI/kCHR9rZxVYpJB3UPcHz80PgxRyWQ7PdU1r+VBQ==", - "dependencies": { - "depd": "2.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/nocache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/nocache/-/nocache-2.1.0.tgz", - "integrity": "sha512-0L9FvHG3nfnnmaEQPjT9xhfN4ISk0A8/2j4M37Np4mcDesJjHgEUfgPhdCyZuFI954tjokaIj/A3NdpFNdEh4Q==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/passport": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/passport/-/passport-0.6.0.tgz", - "integrity": "sha512-0fe+p3ZnrWRW74fe8+SvCyf4a3Pb2/h7gFkQ8yTJpAO50gDzlfjZUZTO1k5Eg9kUct22OxHLqDZoKUWRHOh9ug==", - "dependencies": { - "passport-strategy": "1.x.x", - "pause": "0.0.1", - "utils-merge": "^1.0.1" - }, - "engines": { - "node": ">= 0.4.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jaredhanson" - } - }, - "node_modules/passport-local": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/passport-local/-/passport-local-1.0.0.tgz", - "integrity": "sha1-H+YyaMkudWBmJkN+O5BmYsFbpu4=", - "dependencies": { - "passport-strategy": "1.x.x" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/passport-strategy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", - "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "node_modules/pause": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", - "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/random-bytes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", - "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/referrer-policy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/referrer-policy/-/referrer-policy-1.2.0.tgz", - "integrity": "sha512-LgQJIuS6nAy1Jd88DCQRemyE3mS+ispwlqMk3b0yjZ257fI1v9c+/p6SD5gP5FGyXUIgrNOAfmyioHwZtYv2VA==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, - "node_modules/run-script-os": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/run-script-os/-/run-script-os-1.1.6.tgz", - "integrity": "sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==", - "bin": { - "run-os": "index.js", - "run-script-os": "index.js" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/uid-safe": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", - "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", - "dependencies": { - "random-bytes": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" - }, - "node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ws": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", - "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/x-xss-protection": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/x-xss-protection/-/x-xss-protection-1.3.0.tgz", - "integrity": "sha512-kpyBI9TlVipZO4diReZMAHWtS0MMa/7Kgx8hwG/EuZLiA6sg4Ah/4TRdASHhRRN3boobzcYgFRUFSgHRge6Qhg==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" - } - }, - "dependencies": { - "accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "requires": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "bcryptjs": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", - "integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=" - }, - "body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "requires": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - } - }, - "bowser": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.9.0.tgz", - "integrity": "sha512-2ld76tuLBNFekRgmJfT2+3j5MIrP6bFict8WAIT3beq+srz1gcKNAdNKMqHqauQt63NmAa88HfP1/Ypa9Er3HA==" - }, - "bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" - }, - "camelize": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", - "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "requires": { - "safe-buffer": "5.2.1" - } - }, - "content-security-policy-builder": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/content-security-policy-builder/-/content-security-policy-builder-2.1.0.tgz", - "integrity": "sha512-/MtLWhJVvJNkA9dVLAp6fg9LxD2gfI6R2Fi1hPmfjYXSahJJzcfvoeDOxSyp4NvxMuwWv3WMssE9o31DoULHrQ==" - }, - "content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" - }, - "cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "dasherize": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dasherize/-/dasherize-2.0.0.tgz", - "integrity": "sha1-bYCcnNDPe7iVLYD8hPoT1H3bEwg=" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - }, - "destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" - }, - "dont-sniff-mimetype": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/dont-sniff-mimetype/-/dont-sniff-mimetype-1.1.0.tgz", - "integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug==" - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" - }, - "express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "requires": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - } - }, - "express-session": { - "version": "1.17.2", - "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.17.2.tgz", - "integrity": "sha512-mPcYcLA0lvh7D4Oqr5aNJFMtBMKPLl++OKKxkHzZ0U0oDq1rpKBnkR5f5vCHR26VeArlTOEF9td4x5IjICksRQ==", - "requires": { - "cookie": "0.4.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~2.0.0", - "on-headers": "~1.0.2", - "parseurl": "~1.3.3", - "safe-buffer": "5.2.1", - "uid-safe": "~2.1.5" - }, - "dependencies": { - "cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" - } - } - }, - "feature-policy": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/feature-policy/-/feature-policy-0.3.0.tgz", - "integrity": "sha512-ZtijOTFN7TzCujt1fnNhfWPFPSHeZkesff9AXZj+UEjYBynWNUIYpC87Ve4wHzyexQsImicLu7WsC2LHq7/xrQ==" - }, - "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" - }, - "helmet": { - "version": "3.23.3", - "resolved": "https://registry.npmjs.org/helmet/-/helmet-3.23.3.tgz", - "integrity": "sha512-U3MeYdzPJQhtvqAVBPntVgAvNSOJyagwZwyKsFdyRa8TV3pOKVFljalPOCxbw5Wwf2kncGhmP0qHjyazIdNdSA==", - "requires": { - "depd": "2.0.0", - "dont-sniff-mimetype": "1.1.0", - "feature-policy": "0.3.0", - "helmet-crossdomain": "0.4.0", - "helmet-csp": "2.10.0", - "hide-powered-by": "1.1.0", - "hpkp": "2.0.0", - "hsts": "2.2.0", - "nocache": "2.1.0", - "referrer-policy": "1.2.0", - "x-xss-protection": "1.3.0" - } - }, - "helmet-crossdomain": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/helmet-crossdomain/-/helmet-crossdomain-0.4.0.tgz", - "integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA==" - }, - "helmet-csp": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.10.0.tgz", - "integrity": "sha512-Rz953ZNEFk8sT2XvewXkYN0Ho4GEZdjAZy4stjiEQV3eN7GDxg1QKmYggH7otDyIA7uGA6XnUMVSgeJwbR5X+w==", - "requires": { - "bowser": "2.9.0", - "camelize": "1.0.0", - "content-security-policy-builder": "2.1.0", - "dasherize": "2.0.0" - } - }, - "hide-powered-by": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/hide-powered-by/-/hide-powered-by-1.1.0.tgz", - "integrity": "sha512-Io1zA2yOA1YJslkr+AJlWSf2yWFkKjvkcL9Ni1XSUqnGLr/qRQe2UI3Cn/J9MsJht7yEVCe0SscY1HgVMujbgg==" - }, - "hpkp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hpkp/-/hpkp-2.0.0.tgz", - "integrity": "sha1-EOFCJk52IVpdMMROxD3mTe5tFnI=" - }, - "hsts": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/hsts/-/hsts-2.2.0.tgz", - "integrity": "sha512-ToaTnQ2TbJkochoVcdXYm4HOCliNozlviNsg+X2XQLQvZNI/kCHR9rZxVYpJB3UPcHz80PgxRyWQ7PdU1r+VBQ==", - "requires": { - "depd": "2.0.0" - } - }, - "http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "requires": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "requires": { - "mime-db": "1.52.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" - }, - "nocache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/nocache/-/nocache-2.1.0.tgz", - "integrity": "sha512-0L9FvHG3nfnnmaEQPjT9xhfN4ISk0A8/2j4M37Np4mcDesJjHgEUfgPhdCyZuFI954tjokaIj/A3NdpFNdEh4Q==" - }, - "object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" - }, - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - }, - "on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" - }, - "passport": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/passport/-/passport-0.6.0.tgz", - "integrity": "sha512-0fe+p3ZnrWRW74fe8+SvCyf4a3Pb2/h7gFkQ8yTJpAO50gDzlfjZUZTO1k5Eg9kUct22OxHLqDZoKUWRHOh9ug==", - "requires": { - "passport-strategy": "1.x.x", - "pause": "0.0.1", - "utils-merge": "^1.0.1" - } - }, - "passport-local": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/passport-local/-/passport-local-1.0.0.tgz", - "integrity": "sha1-H+YyaMkudWBmJkN+O5BmYsFbpu4=", - "requires": { - "passport-strategy": "1.x.x" - } - }, - "passport-strategy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", - "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=" - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "pause": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", - "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" - }, - "proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "requires": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - } - }, - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "requires": { - "side-channel": "^1.0.4" - } - }, - "random-bytes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", - "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=" - }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" - }, - "raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "requires": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - }, - "referrer-policy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/referrer-policy/-/referrer-policy-1.2.0.tgz", - "integrity": "sha512-LgQJIuS6nAy1Jd88DCQRemyE3mS+ispwlqMk3b0yjZ257fI1v9c+/p6SD5gP5FGyXUIgrNOAfmyioHwZtYv2VA==" - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, - "run-script-os": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/run-script-os/-/run-script-os-1.1.6.tgz", - "integrity": "sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==" - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "requires": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "dependencies": { - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - } - } - }, - "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - } - }, - "statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" - }, - "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" - }, - "type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - } - }, - "uid-safe": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", - "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", - "requires": { - "random-bytes": "~1.0.0" - } - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "ws": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", - "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", - "requires": {} - }, - "x-xss-protection": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/x-xss-protection/-/x-xss-protection-1.3.0.tgz", - "integrity": "sha512-kpyBI9TlVipZO4diReZMAHWtS0MMa/7Kgx8hwG/EuZLiA6sg4Ah/4TRdASHhRRN3boobzcYgFRUFSgHRge6Qhg==" - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "dependencies": { - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" - } - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } -} diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/package.json b/Samples/PixelStreaming/WebServers/SignallingWebServer/package.json deleted file mode 100644 index 8f09512b..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "cirrus-webserver", - "version": "0.0.1", - "description": "cirrus web server", - "scripts": { - "store_password": "run-script-os", - "store_password:default": "./platform_scripts/bash/node/bin/node ./modules/authentication/db/store_password.js --usersFile=./modules/authentication/db/users.json", - "store_password:windows": "platform_scripts\\cmd\\node\\node.exe ./modules/authentication/db/store_password.js --usersFile=./modules/authentication/db/users.json", - "start-local": "run-script-os --", - "start-local:default": "./platform_scripts/bash/Start_Local.sh", - "start-local:windows": ".\\platform_scripts\\cmd\\Start_Local.bat", - "start-signalling-server": "run-script-os --", - "start-signalling-server:default": "./platform_scripts/bash/Start_SignallingServer.sh", - "start-signalling-server:windows": ".\\platform_scripts\\cmd\\Start_SignallingServer.bat", - "start-with-turn-signalling-server": "run-script-os --", - "start-with-turn-signalling-server:default": "./platform_scripts/bash/Start_WithTurn_SignallingServer.sh", - "start-wiht-turn-signalling-server:windows": ".\\platform_scripts\\cmd\\Start_WithTurn_SignallingServer.bat", - "start": "run-script-os", - "start:default": "if [ `id -u` -eq 0 ] || [ ! -z $NO_SUDO ]\nthen\n export process=\"./platform_scripts/bash/node/bin/node cirrus.js\"\nelse\n export process=\"sudo ./platform_scripts/bash/node/bin/node cirrus.js\"\nfi\n$process ", - "start:windows": "platform_scripts\\cmd\\node\\node.exe cirrus.js" - }, - "dependencies": { - "bcryptjs": "^2.4.3", - "express": "^4.18.2", - "express-session": "^1.15.6", - "helmet": "^3.21.3", - "passport": "^0.6.0", - "passport-local": "^1.0.0", - "run-script-os": "^1.1.6", - "ws": "^7.1.2", - "y18n": "^5.0.5", - "yargs": "^15.3.0" - } -} diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Dockerfile b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Dockerfile deleted file mode 100644 index 48b3d23e..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -FROM node:latest - -# Copy the signalling server source code to the Docker build context -COPY . /opt/SignallingWebServer - -# Install the dependencies for the signalling server -WORKDIR /opt/SignallingWebServer -RUN npm install . - -# Expose TCP port 80 for player WebSocket connections and web server HTTP access -EXPOSE 80 - -# Expose TCP port 8888 for streamer WebSocket connections -EXPOSE 8888 -EXPOSE 8888/udp - -# Expose port for SFU connections -EXPOSE 8889 - -# Google stun -EXPOSE 19302 - -# Matchmaker -EXPOSE 9999 - -# Turn coturn -EXPOSE 3478 -EXPOSE 3479 - -# Set the signalling server as the container's entrypoint -ENTRYPOINT ["/usr/local/bin/node", "/opt/SignallingWebServer/cirrus.js"] - diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/README.txt b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/README.txt deleted file mode 100644 index 1797c97f..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/README.txt +++ /dev/null @@ -1,12 +0,0 @@ -How to use files in this directory: -- Make sure that all of your dependencies are installed. Use ./setup.sh what will install whatever is missing as long as you are on a supported operating system. Please note that setup.sh is called from every script designed to run - -- Run a local instance of the Cirrus server by using the ./run_local.sh script - -- Use the following scripts to run locally or in your cloud instance: - - Start_SignallingServer.sh - Start only the Signalling (STUN) server - - Start_TURNServer.sh - Start only the TURN server - - Start_WithTURN_SignallingServer.sh - Start a TURN server and the Cirrus server together - -- Please note that scripts intended to run need to be executable: $ chmod +x *.sh will do that job. -- The local/cloud Start_*.sh shell scripts can be invoked with the --help command line option to see how those can be configured. The following options can be supplied: --publicip, --turn, --stun. Please read the --help diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Start_SignallingServer.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Start_SignallingServer.sh deleted file mode 100644 index af182b26..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Start_SignallingServer.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. -BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -pushd "${BASH_LOCATION}" > /dev/null - -source common_utils.sh - -set_start_default_values "n" "y" # Set STUN server defaults only -use_args "$@" -call_setup_sh -print_parameters - -peerconnectionoptions='{\"iceServers\":[{\"urls\":[\"stun:${stunserver}\"]}]}' - -process="${BASH_LOCATION}/node/lib/node_modules/npm/bin/npm-cli.js run start:default --" -arguments="" - -if [ ! -z $IS_DEBUG ]; then - arguments+=" --inspect" -fi - -arguments+=" --peerConnectionOptions=\"${peerconnectionoptions}\" --PublicIp=${publicip}" -# Add arguments passed to script to arguments for executable -arguments+=" ${cirruscmd}" - -pushd ../.. -echo "Running: $process $arguments" -PATH="${BASH_LOCATION}/node/bin:$PATH" -start_process $process $arguments -popd - -popd \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Start_TURNServer.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Start_TURNServer.sh deleted file mode 100644 index 74c5f742..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Start_TURNServer.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. -BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -pushd "${BASH_LOCATION}" > /dev/null - -source turn_user_pwd.sh -source common_utils.sh - -set_start_default_values "y" "n" # TURN server defaults only -use_args "$@" -call_setup_sh -print_parameters - -localip=$(hostname -I | awk '{print $1}') -echo "Private IP: $localip" - -turnport="${turnserver##*:}" -if [ -z "${turnport}" ]; then - turnport=3478 -fi -echo "TURN port: ${turnport}" -echo "" - - -# Hmm, plain text -realm="PixelStreaming" -process="turnserver" -arguments="-p ${turnport} -r $realm -X $publicip -E $localip -L $localip --no-cli --no-tls --no-dtls --pidfile /var/run/turnserver.pid -f -a -v -n -u ${turnusername}:${turnpassword}" - -# Add arguments passed to script to arguments for executable -arguments+=" ${cirruscmd}" - -pushd ../.. >/dev/null -echo "Running: $process $arguments" -# pause -start_process $process $arguments & -popd >/dev/null # ../.. - -popd >/dev/null # BASH_SOURCE diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Start_WithTURN_SignallingServer.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Start_WithTURN_SignallingServer.sh deleted file mode 100644 index 40f83de1..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/Start_WithTURN_SignallingServer.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. -BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -pushd "${BASH_LOCATION}" > /dev/null - -source common_utils.sh - -set_start_default_values "y" "y" # Set both TURN and STUN server defaults -use_args "$@" -call_setup_sh -print_parameters - -bash Start_TURNServer.sh --turn "${turnserver}" - -peerconnectionoptions='{\"iceServers\":[{\"urls\":[\"stun:$stunserver\",\"turn:$turnserver\"],\"username\":\"PixelStreamingUser\",\"credential\":\"AnotherTURNintheroad\"}]}' - -process="${BASH_LOCATION}/node/lib/node_modules/npm/bin/npm-cli.js run start:default --" -arguments="" - -if [ ! -z $IS_DEBUG ]; then - arguments+=" --inspect" -fi - -arguments+=" --peerConnectionOptions=\"$peerconnectionoptions\" --PublicIp=$publicip" -# Add arguments passed to script to arguments for executable -arguments+=" ${cirruscmd}" - -pushd ../.. -echo "Running: $process $arguments" -PATH="${BASH_LOCATION}/node/bin:$PATH" -start_process $process $arguments -popd - -popd diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/common_utils.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/common_utils.sh deleted file mode 100644 index ab82a777..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/common_utils.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -function log_msg() { #message - if [ ! -z $VERBOSE ]; then - echo $1 - fi -} - -function print_usage() { - echo " - Usage: - ${0} [--help] [--publicip ] [--turn ] [--stun ] [cirrus options...] - Where: - --help will print this message and stop this script. - --debug will run all scripts with --inspect - --nosudo will run all scripts without \`sudo\` command useful for when run in containers. - --verbose will enable additional logging - --package-manager specify an alternative package manager to apt-get - --publicip is used to define public ip address (using default port) for turn server, syntax: --publicip ; it is used for - default value: Retrieved from 'curl https://api.ipify.org' or if unsuccessful then set to 127.0.0.1. It is the IP address of the Cirrus server and the default IP address of the TURN server - --turn defines what TURN server to be used, syntax: --turn 127.0.0.1:19303 - default value: as above, IP address downloaded from https://api.ipify.org; in case if download failure it is set to 127.0.0.1 - --stun defined what STUN server to be used, syntax: --stun stun.l.google.com:19302 - default value as above - --build will force a rebuild of the typescript frontend even if it already exists - Other options: stored and passed to the Cirrus server. All parameters printed once the script values are set. - Command line options might be omitted to run with defaults and it is a good practice to omit specific ones when just starting the TURN or the STUN server alone, not the whole set of scripts. - " - exit 1 -} - -function print_parameters() { - echo "" - echo "${0} is running with the following parameters:" - echo "--------------------------------------" - if [[ -n "${stunserver}" ]]; then echo "STUN server : ${stunserver}" ; fi - if [[ -n "${turnserver}" ]]; then echo "TURN server : ${turnserver}" ; fi - echo "Public IP address : ${publicip}" - echo "Cirrus server command line arguments: ${cirruscmd}" - echo "" -} - -function set_start_default_values() { - # publicip and cirruscmd are always needed - publicip=$(curl -s https://api.ipify.org) - if [[ -z $publicip ]]; then - publicip="127.0.0.1" - fi - cirruscmd="" - - if [ "$1" = "y" ]; then - turnserver="${publicip}:19303" - fi - - if [ "$2" = "y" ]; then - stunserver="stun.l.google.com:19302" - fi -} - -function use_args() { - while(($#)) ; do - case "$1" in - --debug ) IS_DEBUG=1; shift;; - --nosudo ) NO_SUDO=1; shift;; - --verbose ) VERBOSE=1; shift;; - --build ) FORCE_BUILD=1; shift;; - --stun ) stunserver="$2"; shift 2;; - --turn ) turnserver="$2"; shift 2;; - --publicip ) publicip="$2"; turnserver="${publicip}:19303"; shift 2;; - --help ) print_usage;; - * ) echo "Unknown command, adding to cirrus command line: $1"; cirruscmd+=" $1"; shift;; - esac - done -} - -function call_setup_sh() { - bash "setup.sh" -} - -function start_process() { - if [ ! -z $NO_SUDO ]; then - log_msg "running with sudo removed" - eval $(echo "$@" | sed 's/sudo//g') - else - eval $@ - fi -} - -function get_version() { - local version=$1 - - if command -v $version; then - version=$($@) - fi - - echo $version | sed -E 's/[^0-9.]//g' -} diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-build-cirrus.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-build-cirrus.sh deleted file mode 100644 index 6c9d1c96..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-build-cirrus.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -# When run from SignallingWebServer/platform_scripts/bash, this uses the SignallingWebServer directory -# as the build context so the Cirrus files can be successfully copied into the container image -docker build --network=host -t 'cirrus-webserver:latest' -f ./Dockerfile ../.. - diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-cirrus-local.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-cirrus-local.sh deleted file mode 100644 index 959ca430..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-cirrus-local.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -# Start docker container by name using host networking -docker run --name cirrus_latest --network host --rm cirrus-webserver - -# Interactive start example -#docker run --name cirrus_latest --network host --rm -it --entrypoint /bin/bash cirrus-webserver diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-cirrus-with-turn.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-cirrus-with-turn.sh deleted file mode 100644 index e1098039..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-cirrus-with-turn.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -# Suppress printing of directory stack -pushd () { - command pushd "$@" > /dev/null -} -popd () { - command popd "$@" > /dev/null -} - -# Stop both stun and turn -pushd "$(dirname ${BASH_SOURCE[0]})" -./docker-start-cirrus.sh --with-turn & -popd diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-cirrus.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-cirrus.sh deleted file mode 100644 index 7bc6c0a5..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-cirrus.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -source turn_user_pwd.sh - -USETURN="false" - -for arg do - shift - [ "${arg}" = "--with-turn" ] && USETURN="true" && continue - set -- "$@" "${arg}" -done - -# Get stun server data for passing to the container -source common_utils.sh -if [ "${USETURN}" = "true" ]; then - set_start_default_values "y" "y" # Both TURN and STUN server defaults -else - set_start_default_values "n" "y" # Only STUN server defaults -fi -use_args "$@" - -# Start docker container by name using host networking -if [ "${USETURN}" = "true" ]; then - peerConnectionOptions="{\""iceServers\"":[{\""urls\"":[\""stun:"${stunserver}"\"",\""turn":"${turnserver}\""],\""username\"":\""${turnusername}\"",\""credential\"":\""${turnpassword}\""}]}" -else - peerConnectionOptions="{\""iceServers\"":[{\""urls\"":[\""stun:"${stunserver}"\""]}]}" -fi - -docker run --name cirrus_latest --network host --rm --entrypoint /usr/local/bin/node cirrus-webserver /opt/SignallingWebServer/cirrus.js --peerConnectionOptions="${peerConnectionOptions}" --publicIp="${publicip}" - diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-turn.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-turn.sh deleted file mode 100644 index c0fad21d..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-turn.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -# Get stun server data for passing to the container -source common_utils.sh -set_start_default_values "n" "y" # Only STUN server defaults -use_args "$@" - -localip=$(hostname -I | awk '{print $1}') -echo "Private IP: $localip" - -turnport="${turnserver##*:}" -if [ -z "${turnport}" ]; then - turnport=3478 -fi -echo "TURN port: ${turnport}" -echo "" - -turnusername="PixelStreamingUser" -turnpassword="AnotherTURNintheroad" -realm="PixelStreaming" -process="turnserver" -arguments="-p ${turnport} -r $realm -X $publicip -E $localip -L $localip --no-cli --no-tls --no-dtls --pidfile /var/run/turnserver.pid -f -a -v -n -u ${turnusername}:${turnpassword}" - -# Add arguments passed to script to arguments for executable -arguments+=" ${cirruscmd}" - -# Start docker container by name using host networking -echo "Running: ${process} ${arguments}" - -# Get the docker image -docker pull coturn/coturn - -# Start the TURN server -#docker run --name coturn_latest --network host -it --entrypoint /bin/bash coturn/coturn -#docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "sudo mkdir -p /var/run" coturn/coturn "" -#docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "/bin/ls" coturn/coturn "/var/" - -docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "${process}" coturn/coturn "${arguments}" - -#docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "/bin/bash" coturn/coturn "ls -latr /var/run/" -#docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "sudo chown ubuntu:ubuntu /var/run/turnserver.pid | sudo chmod +x /var/run/turnserver.pid | ${process}" coturn/coturn "${arguments}" diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-stop-all.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-stop-all.sh deleted file mode 100644 index 15a3e869..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-stop-all.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -# Suppress printing of directory stack -pushd () { - command pushd "$@" > /dev/null -} -popd () { - command popd "$@" > /dev/null -} - -# Stop both stun and turn -pushd "$(dirname ${BASH_SOURCE[0]})" -./docker-stop-cirrus.sh -./docker-stop-turn.sh -popd diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-stop-cirrus.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-stop-cirrus.sh deleted file mode 100644 index 4f93ac12..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-stop-cirrus.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -# Stop the docker container -PSID=$(docker ps -a -q --filter="name=cirrus_latest") -if [ -z "$PSID" ]; then - echo "Docker stun is not running, no stopping will be done" - exit 1; -fi -echo "Stopping stun server ..." -docker stop cirrus_latest - diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-stop-turn.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-stop-turn.sh deleted file mode 100644 index a928bf54..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-stop-turn.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -# Stop the docker container -PSID=$(docker ps -a -q --filter="name=coturn_latest") -if [ -z "$PSID" ]; then - echo "Docker turn is not running, no stopping will be done" - exit 1; -fi -echo "Stopping turn server..." -docker stop coturn_latest - diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/run_local.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/run_local.sh deleted file mode 100644 index dff8e9d0..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/run_local.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. -BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -pushd "${BASH_LOCATION}" > /dev/null - -source common_utils.sh - -set_start_default_values "n" "n" # No server specific defaults -use_args "$@" -call_setup_sh -print_parameters - -process="${BASH_LOCATION}/node/lib/node_modules/npm/bin/npm-cli.js run start:default --" -arguments="" - -if [ ! -z $IS_DEBUG ]; then - arguments+=" --inspect" -fi - -arguments+=" --publicIp=${publicip}" -arguments+=" ${cirruscmd}" - -pushd ../.. > /dev/null - -echo "" -echo "Starting Cirrus server use ctrl-c to exit" -echo "-----------------------------------------" -echo "" - -PATH="${BASH_LOCATION}/node/bin:$PATH" -start_process $process $arguments - -popd > /dev/null # ../.. - -popd > /dev/null # BASH_SOURCE \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/setup.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/setup.sh deleted file mode 100644 index d7d8dced..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/setup.sh +++ /dev/null @@ -1,158 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. -BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -pushd "${BASH_LOCATION}" > /dev/null - -source common_utils.sh - -use_args $@ -# Azure specific fix to allow installing NodeJS from NodeSource -if test -f "/etc/apt/sources.list.d/azure-cli.list"; then - sudo touch /etc/apt/sources.list.d/nodesource.list - sudo touch /usr/share/keyrings/nodesource.gpg - sudo chmod 644 /etc/apt/sources.list.d/nodesource.list - sudo chmod 644 /usr/share/keyrings/nodesource.gpg - sudo chmod 644 /etc/apt/sources.list.d/azure-cli.list -fi - -function check_version() { #current_version #min_version - #check if same string - if [ -z "$2" ] || [ "$1" = "$2" ]; then - return 0 - fi - - local i current minimum - - IFS="." read -r -a current <<< $1 - IFS="." read -r -a minimum <<< $2 - - # fill empty fields in current with zeros - for ((i=${#current[@]}; i<${#minimum[@]}; i++)) - do - current[i]=0 - done - - for ((i=0; i<${#current[@]}; i++)) - do - if [[ -z ${minimum[i]} ]]; then - # fill empty fields in minimum with zeros - minimum[i]=0 - fi - - if ((10#${current[i]} > 10#${minimum[i]})); then - return 1 - fi - - if ((10#${current[i]} < 10#${minimum[i]})); then - return 2 - fi - done - - # if got this far string is the same once we added missing 0 - return 0 -} - -function check_and_install() { #dep_name #get_version_string #version_min #install_command - local is_installed=0 - - log_msg "Checking for required $1 install" - - local current=$(echo $2 | sed -E 's/[^0-9.]//g') - local minimum=$(echo $3 | sed -E 's/[^0-9.]//g') - - if [ $# -ne 4 ]; then - log_msg "check_and_install expects 4 args (dep_name get_version_string version_min install_command) got $#" - return -1 - fi - - if [ ! -z $current ]; then - log_msg "Current version: $current checking >= $minimum" - check_version "$current" "$minimum" - if [ "$?" -lt 2 ]; then - log_msg "$1 is installed." - return 0 - else - log_msg "Required install of $1 not found installing" - fi - fi - - if [ $is_installed -ne 1 ]; then - echo "$1 installation not found installing..." - - start_process $4 - - if [ $? -ge 1 ]; then - echo "Installation of $1 failed try running `export VERBOSE=1` then run this script again for more details" - fi - fi -} - -function setup_frontend() { - # navigate to root - pushd ${BASH_LOCATION}/../../.. > /dev/null - export PATH="../../SignallingWebServer/platform_scripts/bash/node/bin:$PATH" - # If player.html doesn't exist, or --build passed as arg, rebuild the frontend - if [ ! -f SignallingWebServer/Public/player.html ] || [ ! -z "$FORCE_BUILD" ] ; then - echo "Building Typescript Frontend." - # Using our bundled NodeJS, build the web frontend files - pushd ${BASH_LOCATION}/../../../Frontend/library > /dev/null - ../../SignallingWebServer/platform_scripts/bash/node/bin/npm install - ../../SignallingWebServer/platform_scripts/bash/node/bin/npx webpack - popd - - pushd ${BASH_LOCATION}/../../../Frontend/implementations/EpicGames > /dev/null - ../../../SignallingWebServer/platform_scripts/bash/node/bin/npm install - ../../../SignallingWebServer/platform_scripts/bash/node/bin/npm link ../../library - ../../../SignallingWebServer/platform_scripts/bash/node/bin/npx webpack - popd - else - echo 'Skipping building Frontend because files already exist. Please run with "--build" to force a rebuild' - fi - - popd > /dev/null # root -} - - -echo "Checking Pixel Streaming Server dependencies." - -# navigate to SignallingWebServer root -pushd ${BASH_LOCATION}/../.. > /dev/null - -node_version="" -if [[ -f "${BASH_LOCATION}/node/bin/node" ]]; then - node_version=$("${BASH_LOCATION}/node/bin/node" --version) -fi -check_and_install "node" "$node_version" "v16.4.2" "curl https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.gz --output node.tar.xz - && tar -xf node.tar.xz - && rm node.tar.xz - && mv node-v*-linux-x64 \"${BASH_LOCATION}/node\"" - -PATH="${BASH_LOCATION}/node/bin:$PATH" -"${BASH_LOCATION}/node/lib/node_modules/npm/bin/npm-cli.js" install - -popd > /dev/null # SignallingWebServer - -# Trigger Frontend Build if needed or requested -# This has to be done after check_and_install "node" -setup_frontend - -popd > /dev/null # BASH_SOURCE - -#command #dep_name #get_version_string #version_min #install command -coturn_version=$(if command -v turnserver &> /dev/null; then echo 1; else echo 0; fi) -if [ $coturn_version -eq 0 ]; then - if ! command -v apt-get &> /dev/null; then - echo "Setup for the scripts is designed for use with distros that use the apt-get package manager" \ - "if you are seeing this message you will have to update \"${BASH_LOCATION}/setup.sh\" with\n" \ - "a package manger and the equivalent packages for your distribution. Please follow the\n" \ - "instructions found at https://pkgs.org/search/?q=coturn to install Coturn for your specific distribution" - exit 1 - else - if [ `id -u` -eq 0 ]; then - check_and_install "coturn" "$coturn_version" "1" "apt-get install -y coturn" - else - check_and_install "coturn" "$coturn_version" "1" "sudo apt-get install -y coturn" - fi - fi -fi diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/turn_user_pwd.sh b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/turn_user_pwd.sh deleted file mode 100644 index 77687f2e..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/turn_user_pwd.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -# Plain text TURN setup -turnusername="PixelStreamingUser" -turnpassword="AnotherTURNintheroad" - diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/README.txt b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/README.txt deleted file mode 100644 index 0ad362fa..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/README.txt +++ /dev/null @@ -1,13 +0,0 @@ -How to use files in this directory: -- Files with .ps1 extension can be run with PowerShell[.exe] in Windows. Powershell needs to be started as Administrator to run setup.ps1 so it can run installation / installation check steps -- Make sure that all of your dependencies are installed. Use .\setup.ps1 what will install whatever is missing as long as you are on a supported operating system - -- Run a local instance of the Cirrus server by using the .\run_local.ps1 script - -- Use the following scripts to run locally or in your cloud instance: - - Start_SignallingServer.ps1 - Start only the Signalling (STUN) server - - Start_TURNServer.ps1 - Start only the TURN server - - Start_WithTURN_SignallingServer.ps1 - Start a TURN server and the Cirrus server together -- The Start_Common.ps1 file contains shared functions for other Start_*.ps1 scripts and it is not supposed to run alone - -- The local/cloud Start_*.ps1 powershell scripts can be invoked with the --help command line option to see how those can be configured. The following options can be supplied: --publicip, --turn, --stun. Please read the --help diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_Common.ps1 b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_Common.ps1 deleted file mode 100644 index de48ec98..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_Common.ps1 +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright Epic Games, Inc. All Rights Reserved. - -# Parse $args into a string -$params = $args[0] -if ( $args.Count -gt 1 ) { - $params = $args[1..$($args.Count - 1)] - # Do setup as a common task, it is smart and will not reinstall if not required. - Start-Process -FilePath "$PSScriptRoot\setup.bat" -Wait -NoNewWindow -ArgumentList $params -} -else { - Start-Process -FilePath "$PSScriptRoot\setup.bat" -Wait -NoNewWindow -} -echo $params - -$global:ScriptName = $MyInvocation.MyCommand.Name -$global:PublicIP = $null -$global:StunServer = $null -$global:TurnServer = $null -$global:CirrusCmd = $null -$global:BuildFrontend = $null - -function print_usage { - echo " - Usage (in MS Windows Power Shell): - $global:ScriptName [--help] [--publicip ] [--turn ] [--stun ] [cirrus options...] - Where: - --help will print this message and stop this script. - --publicip is used to define public ip address (using default port) for turn server, syntax: --publicip ; it is used for - default value: Retrieved from 'curl https://api.ipify.org' or if unsuccessful then set to 127.0.0.1. It is the IP address of the Cirrus server and the default IP address of the TURN server - --turn defines what TURN server to be used, syntax: --turn 127.0.0.1:19303 - default value: as above, IP address downloaded from https://api.ipify.org; in case if download failure it is set to 127.0.0.1 - --stun defined what STUN server to be used, syntax: --stun stun.l.google.com:19302 - default value as above - Other options: stored and passed to the Cirrus server. All parameters printed once the script values are set. - Command line options might be omitted to run with defaults and it is a good practice to omit specific ones when just starting the TURN or the STUN server alone, not the whole set of scripts. - " - exit 1 -} - -function print_parameters { - echo "" - echo "$scriptname is running with the following parameters:" - echo "--------------------------------------" - if ($global:StunServer -ne $null) { echo "STUN server : $global:StunServer" } - if ($global:TurnServer -ne $null) { echo "TURN server : $global:TurnServer" } - echo "Public IP address : $global:PublicIP" - echo "Cirrus server command line arguments: $global:CirrusCmd" - echo "" -} - -function set_start_default_values($SetTurnServerVar, $SetStunServerVar) { - # publicip and cirruscmd are always needed - $global:PublicIP = Invoke-WebRequest -Uri "https://api.ipify.org" -UseBasicParsing - if ($global:PublicIP -eq $null -Or $global:PublicIP.length -eq 0) { - $global:PublicIP = "127.0.0.1" - } else { - $global:PublicIP = ($global:PublicIP).Content - } - $global:cirruscmd = "" - - if ($SetTurnServerVar -eq "y") { - $global:TurnServer = $global:PublicIP + ":19303" - } - if ($SetStunServerVar -eq "y") { - $global:StunServer = "stun.l.google.com:19302" - } -} - -function use_args($arg) { - $CmdArgs = $arg -split (" ") - while($CmdArgs.count -gt 0) { - $Cmd, $CmdArgs = $CmdArgs - if ($Cmd -eq "--stun") { - $global:StunServer, $CmdArgs = $CmdArgs - } elseif ($Cmd -eq "--turn") { - $global:TurnServer, $CmdArgs = $CmdArgs - } elseif ($Cmd -eq "--publicip") { - $global:PublicIP, $CmdArgs = $CmdArgs - $global:TurnServer = $global:publicip + ":19303" - } elseif ($Cmd -eq "--build") { - $global:BuildFrontend, $CmdArgs = $CmdArgs - } elseif ($Cmd -eq "--help") { - print_usage - } else { - echo "Unknown command, adding to cirrus command line: $Cmd" - $global:CirrusCmd += " $Cmd" - } - } -} diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_SignallingServer.ps1 b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_SignallingServer.ps1 deleted file mode 100644 index 83c94a8d..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_SignallingServer.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright Epic Games, Inc. All Rights Reserved. - -. "$PSScriptRoot\Start_Common.ps1" $args - -set_start_default_values "n" "y" # Set both TURN and STUN server defaults -use_args($args) -print_parameters - -$peerConnectionOptions = "{ \""iceServers\"": [{\""urls\"": [\""stun:" + $global:StunServer + "\""]}] }" - -$ProcessExe = "platform_scripts\cmd\node\node.exe" -$Arguments = @("cirrus", "--peerConnectionOptions=""$peerConnectionOptions""", "--PublicIp=$global:PublicIp") -# Add arguments passed to script to Arguments for executable -$Arguments += $global:CirrusCmd - -Push-Location $PSScriptRoot\..\..\ -Write-Output "Running: $ProcessExe $Arguments" -Start-Process -FilePath $ProcessExe -ArgumentList "$Arguments" -Wait -NoNewWindow -Pop-Location diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_TURNServer.ps1 b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_TURNServer.ps1 deleted file mode 100644 index 97d1ab61..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_TURNServer.ps1 +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright Epic Games, Inc. All Rights Reserved. - -. "$PSScriptRoot\Start_Common.ps1" $args - -set_start_default_values "y" "n" # Set both TURN and STUN server defaults -use_args($args) -print_parameters -#$LocalIp = Invoke-WebRequest -Uri "http://169.254.169.254/latest/meta-data/local-ipv4" -$LocalIP = (Test-Connection -ComputerName (hostname) -Count 1 | Select IPV4Address).IPV4Address.IPAddressToString - -Write-Output "Private IP: $LocalIp" - -$TurnPort="19303" -$Pos = $global:TurnServer.LastIndexOf(":") -if ($Pos -ne -1) { - $TurnPort = $global:TurnServer.Substring($Pos+ 1) -} -echo "TURN port: ${turnport}" -echo "" - -Push-Location $PSScriptRoot - -$TurnUsername = "PixelStreamingUser" -$TurnPassword = "AnotherTURNintheroad" -$Realm = "PixelStreaming" -$ProcessExe = ".\turnserver.exe" -$Arguments = "-p $TurnPort -r $Realm -X $PublicIP -E $LocalIP -L $LocalIP --no-cli --no-tls --no-dtls --pidfile `"C:\coturn.pid`" -f -a -v -n -u $TurnUsername`:$TurnPassword" - -# Add arguments passed to script to Arguments for executable -$Arguments += $args - -Push-Location $PSScriptRoot\coturn\ -Write-Output "Running: $ProcessExe $Arguments" -# pause -Start-Process -FilePath $ProcessExe -ArgumentList $Arguments -NoNewWindow -Pop-Location - -Pop-Location \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_WithTURN_SignallingServer.ps1 b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_WithTURN_SignallingServer.ps1 deleted file mode 100644 index 395926a9..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/Start_WithTURN_SignallingServer.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright Epic Games, Inc. All Rights Reserved. - -. "$PSScriptRoot\Start_Common.ps1" $args - -set_start_default_values "y" "y" # Set both TURN and STUN server defaults -use_args($args) -print_parameters - -Push-Location $PSScriptRoot - -Start-Process -FilePath "PowerShell" -ArgumentList ".\Start_TURNServer.ps1" -WorkingDirectory "$PSScriptRoot" - -$peerConnectionOptions = "{ \""iceServers\"": [{\""urls\"": [\""stun:" + $global:StunServer + "\"",\""turn:" + $global:TurnServer + "\""], \""username\"": \""PixelStreamingUser\"", \""credential\"": \""AnotherTURNintheroad\""}] }" - -$ProcessExe = "platform_scripts\cmd\node\node.exe" -$Arguments = @("cirrus", "--peerConnectionOptions=""$peerConnectionOptions""", "--PublicIp=$global:PublicIp") -# Add arguments passed to script to Arguments for executable -$Arguments += $args - -Push-Location $PSScriptRoot\..\..\ -Write-Output "Running: $ProcessExe $Arguments" -Start-Process -FilePath $ProcessExe -ArgumentList $Arguments -Wait -NoNewWindow -Pop-Location - -Pop-Location \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/build.bat b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/build.bat deleted file mode 100644 index 12b695f6..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/build.bat +++ /dev/null @@ -1,39 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script directory as working directory. -pushd "%~dp0" - -title Building Cirrus.exe - -@Rem Run setup to ensure we have node and cirrus installed. -call setup.bat %* - -@Rem Look for a `nexe` directory next to this script -if exist nexe\ ( - echo nexe directory found...skipping install. -) else ( - echo nexe directory not found...beginning nexe install. - - @Rem Make `nexe directory` - mkdir nexe - - @Rem npm init and install nexe - pushd nexe - call ..\node\npm init -y - call ..\node\npm install nexe --save - popd -) - -@Rem Move to cirrus directory. -pushd ..\.. - -@Rem Build cirrus.exe using `nexe` using node 14.5.0 (as that is one of the latest prebuilts node versions in the nexe repo) -call platform_scripts\cmd\node\npx nexe cirrus.js --target "x64-14.15.3" -r "Public/*" -r "scripts/*" -r "images/*" -r "config.json" - -@Rem Pop cirrus directory. -popd ..\.. - -@Rem Pop working directory -popd \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/refreshenv.cmd b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/refreshenv.cmd deleted file mode 100644 index b3b35ecd..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/refreshenv.cmd +++ /dev/null @@ -1,66 +0,0 @@ -:: -:: RefreshEnv.cmd -:: -:: Batch file to read environment variables from registry and -:: set session variables to these values. -:: -:: With this batch file, there should be no need to reload command -:: environment every time you want environment changes to propagate - -::echo "RefreshEnv.cmd only works from cmd.exe, please install the Chocolatey Profile to take advantage of refreshenv from PowerShell" -echo | set /p dummy="Refreshing environment variables from registry for cmd.exe. Please wait..." - -goto main - -:: Set one environment variable from registry key -:SetFromReg - "%WinDir%\System32\Reg" QUERY "%~1" /v "%~2" > "%TEMP%\_envset.tmp" 2>NUL - for /f "usebackq skip=2 tokens=2,*" %%A IN ("%TEMP%\_envset.tmp") do ( - echo/set "%~3=%%B" - ) - goto :EOF - -:: Get a list of environment variables from registry -:GetRegEnv - "%WinDir%\System32\Reg" QUERY "%~1" > "%TEMP%\_envget.tmp" - for /f "usebackq skip=2" %%A IN ("%TEMP%\_envget.tmp") do ( - if /I not "%%~A"=="Path" ( - call :SetFromReg "%~1" "%%~A" "%%~A" - ) - ) - goto :EOF - -:main - echo/@echo off >"%TEMP%\_env.cmd" - - :: Slowly generating final file - call :GetRegEnv "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" >> "%TEMP%\_env.cmd" - call :GetRegEnv "HKCU\Environment">>"%TEMP%\_env.cmd" >> "%TEMP%\_env.cmd" - - :: Special handling for PATH - mix both User and System - call :SetFromReg "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" Path Path_HKLM >> "%TEMP%\_env.cmd" - call :SetFromReg "HKCU\Environment" Path Path_HKCU >> "%TEMP%\_env.cmd" - - :: Caution: do not insert space-chars before >> redirection sign - echo/set "Path=%%Path_HKLM%%;%%Path_HKCU%%" >> "%TEMP%\_env.cmd" - - :: Cleanup - del /f /q "%TEMP%\_envset.tmp" 2>nul - del /f /q "%TEMP%\_envget.tmp" 2>nul - - :: capture user / architecture - SET "OriginalUserName=%USERNAME%" - SET "OriginalArchitecture=%PROCESSOR_ARCHITECTURE%" - - :: Set these variables - call "%TEMP%\_env.cmd" - - :: Cleanup - del /f /q "%TEMP%\_env.cmd" 2>nul - - :: reset user / architecture - SET "USERNAME=%OriginalUserName%" - SET "PROCESSOR_ARCHITECTURE=%OriginalArchitecture%" - - echo | set /p dummy="Finished." - echo ... \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/run_local.bat b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/run_local.bat deleted file mode 100644 index d9cba4d1..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/run_local.bat +++ /dev/null @@ -1,25 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script directory as working directory. -pushd "%~dp0" - -title Cirrus - -@Rem Run setup to ensure we have node and cirrus installed. -call setup.bat - -@Rem Move to cirrus directory. -pushd ..\.. - -@Rem Run node server and pass any argument along. -platform_scripts\cmd\node\node.exe cirrus %* - -@Rem Pop cirrus directory. -popd - -@Rem Pop script directory. -popd - -pause \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setenv/License.txt b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setenv/License.txt deleted file mode 100644 index eb2dd4ec..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setenv/License.txt +++ /dev/null @@ -1,24 +0,0 @@ -License -------- - -Copyright (C) 1999-2008 - Jonathan Wilkes -http://www.xanya.net - -Installing and using this software (or source code) signifies acceptance of these terms and the conditions of the license. -This license applies to everything in this package (Including any supplied Source Code), except where otherwise noted. - -License Agreement ------------------ - -This software is provided 'as-is', without any express or implied warranty. -In no event will the author be held liable for any damages arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software/source code. -(If you use the supplied source code (if any) in a product, then an acknowledgment in the product documentation would be appreciated but is not required.) - -2. If you have downloaded the Source Code for this application (where available) then altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any distribution of the software. -(If you use the supplied source code (if any) in a product, including commercial applications, then you do NOT need to distribute this license with your product.) diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setenv/ReadMe.txt b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setenv/ReadMe.txt deleted file mode 100644 index 5c7a0f63..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setenv/ReadMe.txt +++ /dev/null @@ -1,46 +0,0 @@ - -SetEnv -Version 1.09 - ( For Windows 9x/NT/2000/XP/S2K3/Vista ) - -Copyright (C) 2005-2008 - Jonathan Wilkes - All Rights Reserved. -http://www.xanya.net - -================================================================================ - -1. Installation - - Simply download and run the Setup_SetEnv.exe application to install SetEnv. - -2. Using SetEnv - - The SetEnv is a free tool for setting/updating/deleting System Environment Variables. - Type the following at a command prompt (assumes SetEnv.exe is in current path), for command line usage information. - - setenv -? - - See our website for full usage details, http://www.xanya.net/site/utils/setenv.php - -3. Version History - - 1.09 [Fix] - (Feb 9, 2008) - Fixed a problem on Windows 98 where it sometimes failed to open the Autoexec.bat file. - 1.08 [New] - (May 31, 2007) - Added how to delete a USER environment variable to the usage information. - 1.07 [Fix] - (Jan 25, 2007) - Fixed a bug found by depaolim. - 1.06 [New] - (Jan 14, 2007) - Added dynamic expansion support (same as using ~ with setx) - - Originally requested by Andre Amaral, further Request by Synetech - 1.05 [New] - (Sep 06, 2006) - Added support to prepend (rather than append) a value to an expanded string - - Requested by Masuia - 1.04 [New] - (May 30, 2006) - Added support for User environment variables. - 1.03 [Fix] - (Apr 20, 2006) - Bug fix in ProcessWinXP() discovered by attiasr - 1.01 [Fix] - (Nov 15, 2005) - Bug fix in IsWinME() discovered by frankd - 1.00 [New] - (Oct 29, 2005) - Initial Public Release. - -4. License and Terms of Use - - Please see the License.txt file for licensing information. - -5. Reporting Problems - - If you encounter any problems whilst using SetEnv, please try downloading the latest version from http://www.xanya.net to see if the problem has already been resolved. - If this does not help, then please send an e-mail to darka@xanya.net with details describing the problem. - -================================================================================ \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup.bat b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup.bat deleted file mode 100644 index 4767ddc2..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup.bat +++ /dev/null @@ -1,23 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script location as working directory for commands. -pushd "%~dp0" - -@Rem Ensure we have NodeJs available for calling. -call setup_node.bat - -@Rem Ensure we have frontend built. -call setup_frontend.bat %* - -@Rem Ensure we have CoTURN available for calling. -call setup_coturn.bat - -@Rem Move to cirrus.js directory and install its package.json -pushd %~dp0\..\..\ -call platform_scripts\cmd\node\npm install --no-save -popd - -@Rem Pop working directory -popd \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup_coturn.bat b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup_coturn.bat deleted file mode 100644 index fd9f2e7e..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup_coturn.bat +++ /dev/null @@ -1,25 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script location as working directory for commands. -pushd "%~dp0" - -@Rem Look for CoTURN directory next to this script -if exist coturn\ ( - echo CoTURN directory found...skipping install. -) else ( - echo CoTURN directory not found...beginning CoTURN download for Windows. - - @Rem Download nodejs and follow redirects. - curl -L -o ./turnserver.zip "https://github.com/mcottontensor/coturn/releases/download/v4.5.2-windows/turnserver.zip" - - @Rem Unarchive the .zip to a directory called "turnserver" - mkdir coturn & tar -xf turnserver.zip -C coturn - - @Rem Delete the downloaded turnserver.zip - del turnserver.zip -) - -@Rem Pop working directory -popd \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup_frontend.bat b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup_frontend.bat deleted file mode 100644 index 5132480c..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup_frontend.bat +++ /dev/null @@ -1,74 +0,0 @@ -:main - @Rem Copyright Epic Games, Inc. All Rights Reserved. - @echo off - - @Rem Set root directory as working directory for commands. - pushd %~dp0\..\..\..\ - - @Rem By default don't build the frontend files - set "shouldbuild=false" - - @Rem Check if --build is passed as argument and we will always build frontend files. - :parse - IF "%~1"=="" GOTO endparse - IF "%~1"=="--build" set "shouldbuild=true" - SHIFT - GOTO parse - :endparse - - @Rem Look under /Public directory for player.html - if exist SignallingWebServer\Public\player.html ( - @Rem If --build is passed then we should build - if "%shouldbuild%" == "true" ( - call :buildFrontend - ) else ( - echo Skipping rebuilding frontend... SignallingWebServer/Public has content already, use --build to force a frontend rebuild. - ) - ) else ( - call :buildFrontend - ) - - @Rem Pop working directory - popd - - goto :eof - -:buildFrontend - echo Building frontend files... - - @Rem Look for a node directory next to this script - if not exist node call SignallingWebServer\platform_scripts\cmd\setup_node.bat - - @Rem NOTE: We want to use our NodeJS (not system NodeJS!) to build the web frontend files. - @Rem Save our current directory (the NodeJS dir) in a variable - set "NodeDir=%CD%\SignallingWebServer\platform_scripts\cmd\node" - - @Rem Prepend NodeDir to PATH temporarily using a custom tool called SetEnv - call SignallingWebServer\platform_scripts\cmd\setenv\SetEnv.exe -uap PATH %%%%"%NodeDir%" - @Rem Refresh the cmd session with new PATH - call %~dp0\refreshenv.cmd - - @Rem Do npm install in the Frontend\lib directory (note we use start because that loads PATH) - echo ---------------------------- - echo Building frontend library... - pushd %CD%\Frontend\library - call ..\..\SignallingWebServer\platform_scripts\cmd\node\npm install - call ..\..\SignallingWebServer\platform_scripts\cmd\node\npx webpack - popd - echo End of build PS frontend lib step. - - @Rem Do npm install in the Frontend\implementations\EpicGames directory (note we use start because that loads PATH) - echo ---------------------------- - echo Building Epic Games reference frontend... - pushd %CD%\Frontend\implementations\EpicGames - call ..\..\..\SignallingWebServer\platform_scripts\cmd\node\npm install - call ..\..\..\SignallingWebServer\platform_scripts\cmd\node\npm link ../../library - call ..\..\..\SignallingWebServer\platform_scripts\cmd\node\npx webpack - popd - echo End of build reference frontend step. - echo ---------------------------- - - @Rem Remove our NodeJS from the PATH - call SignallingWebServer\platform_scripts\cmd\setenv\SetEnv.exe -ud PATH %%%%"%NodeDir%" - - goto :eof \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup_node.bat b/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup_node.bat deleted file mode 100644 index cc079e57..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd/setup_node.bat +++ /dev/null @@ -1,35 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script location as working directory for commands. -pushd "%~dp0" - -@Rem Name and version of node that we are downloading -SET NodeVersion=v16.4.2 -SET NodeName=node-%NodeVersion%-win-x64 - -@Rem Look for a node directory next to this script -if exist node\ ( - echo Node directory found...skipping install. -) else ( - echo Node directory not found...beginning NodeJS download for Windows. - - @Rem Download nodejs and follow redirects. - curl -L -o ./node.zip "https://nodejs.org/dist/%NodeVersion%/%NodeName%.zip" - - @Rem Unarchive the .zip - tar -xf node.zip - - @Rem Rename the extracted, versioned, directory that contains the NodeJS binaries to simply "node". - ren "%NodeName%\" "node" - - @Rem Delete the downloaded node.zip - del node.zip -) - -@Rem Print node version -echo Node version: & node\node.exe -v - -@Rem Pop working directory -popd \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Bootstrap.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Bootstrap.tps deleted file mode 100644 index 156174c4..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Bootstrap.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - bootstrap v3.x, v4.x - /Samples/PixelStreaming/WebServers/ - This is a requirement to using Bootstrap, providing better UI elements for the client web pages created for demoing pixelstreaming - https://github.com/twitter/bootstrap/blob/master/LICENSE - - Licensees - Git - P4 - - /Engine/Source/ThirdParty/Licenses/Bootstrap_License.txt - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Express.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Express.tps deleted file mode 100644 index 813a5dc6..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Express.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - Express v4.16.2 - /Samples/PixelStreaming/WebServers/ - Express is a web framework for Node.js. - https://github.com/expressjs/express/blob/master/LICENSE - - Licensees - Git - P4 - - /Engine/Plugins/Experimental/PixelStreaming/Source/Express_License.txt - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/FontAwesome.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/FontAwesome.tps deleted file mode 100644 index 0a00d5db..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/FontAwesome.tps +++ /dev/null @@ -1,11 +0,0 @@ - - - FontAwesome Free v5.1 - /Samples/PixelStreaming/WebServers/ - Provides a consistent icon style to use in the sites for demoing pixelstreaming. - https://github.com/FortAwesome/Font-Awesome/blob/master/LICENSE.txt - - P4 - - None - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Helmet.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Helmet.tps deleted file mode 100644 index eb45e856..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Helmet.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - Helmet v.3.21.3 - /Samples/PixelStreaming/WebServers/SignallingWebServer - Helmet helps you secure your Express apps by setting various HTTP headers. - https://github.com/helmetjs/helmet/blob/v3.21.3/LICENSE - - Licensees - Git - P4 - - NONE (but keep license with code) - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/JQuery.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/JQuery.tps deleted file mode 100644 index 0169eb36..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/JQuery.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - JQuery - /Samples/PixelStreaming/WebServers/ - This is a requirement to using Bootstrap, providing access to the DOM in the browser for easier and more advanced client side interactions and UI. Used for Project Cirrus. - https://github.com/jquery/jquery/blob/master/LICENSE.txt; https://js.foundation/pdf/ip-policy.pdf - - Licensees - Git - P4 - - /Engine/Source/ThirdParty/Licenses/JQuery_License.txt - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Popper.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Popper.tps deleted file mode 100644 index 220de47a..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Popper.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - Popper.js v1.14.3 - /Samples/PixelStreaming/WebServers/ - A requirement to using Bootstrap. - https://github.com/FezVrasta/popper.js/blob/master/LICENSE.md - - Licensees - Git - P4 - - /Engine/Source/ThirdParty/Licenses/Popper.js_License.txt - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Socket.io.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Socket.io.tps deleted file mode 100644 index fb8706e9..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Socket.io.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - Socket.io v2.0.4 - /Samples/PixelStreaming/WebServers/ - Enables real-time bidirectional event-based communication. - https://github.com/socketio/socket.io/blob/master/LICENSE - - Licensees - Git - P4 - - /Engine/Plugins/Experimental/PixelStreaming/Source/Socket.io_License.txt - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/WS.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/WS.tps deleted file mode 100644 index 2b6af9f3..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/WS.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - WS - /Samples/PixelStreaming/WebServers/SignallingWebServer/ - It's used by SignallingWebServer (based on Node.js web-server) that is part of our PixelStreaming project.We add a dependency to WS library to Node.js configuration and it's downloaded automatically. - https://github.com/websockets/ws/blob/HEAD/LICENSE - - Licensees - Git - P4 - - //depot/UE4/Engine/Source/ThirdParty/Licenses/WS_License.txt - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/WebRTCadapter.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/WebRTCadapter.tps deleted file mode 100644 index 42025d29..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/WebRTCadapter.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - WebRTC adapter (adapter.js) v6.3.2 - /Samples/PixelStreaming/WebServers/ - Used as a cross browser interface for WebRTC. - https://github.com/webrtc/adapter/blob/master/LICENSE.md - - Licensees - Git - P4 - - /Engine/Source/ThirdParty/Licenses/WebRTCadapter_License.txt - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Yargs.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Yargs.tps deleted file mode 100644 index b7eb1a8e..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/Yargs.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - Yargs v15.3.0 - /Samples/PixelStreaming/WebServers/SignallingWebServer/ - A module for Node.js, used to parse command line arguments, which is downloaded automatically by Node Package Manager. - https://github.com/yargs/yargs/blob/v15.3.0/LICENSE - - Licensees - Git - P4 - - None - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/bcrypt-js.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/bcrypt-js.tps deleted file mode 100644 index ded83c79..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/bcrypt-js.tps +++ /dev/null @@ -1,11 +0,0 @@ - - - Bcrypt.js - /Samples/PixelStreaming/WebServers/SignallingWebServer/ - This is used to verify passwords match the ones stored using the bcrypt algorithm. The passwords are always stored using bcrypt and so we never know the unencrypted password. This allows us to implement a authentication system on the web server so that only people we give accounts to can access the web server. This use is only for prototype stage, production will use the Epic unreal account system - https://github.com/dcodeIO/bcrypt.js/blob/master/LICENSE - - P4 - - /UE4/Main/Engine/Source/ThirdParty/Licenses - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/expression-session.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/expression-session.tps deleted file mode 100644 index fec8e7e5..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/expression-session.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - express-session v1.15.6 - /Samples/PixelStreaming/WebServers/ - Used to create session id's used to remember a person who has logged into a server across page loads so that they don't have to log in every time the reload or navigate to a different page hosted on a webserver - https://github.com/expressjs/session/blob/master/LICENSE - - Licensees - Git - P4 - - /Engine/Source/ThirdParty/Licenses/express-session_license.txt - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/passport-local.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/passport-local.tps deleted file mode 100644 index b47cab7d..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/passport-local.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - passport-local v1.0.0 - /Samples/PixelStreaming/WebServers/ - This is a implementation for the Passport middleware that allows you to store user credentials locally on the machine (passwords are stored with bcrypt and not reversible) to be used to authenticate users on a node.js webserver. This use is only for prototype stage, production will use the Epic unreal account system. - https://github.com/jaredhanson/passport-local/blob/master/LICENSE - - Licensees - Git - P4 - - /Engine/Source/ThirdParty/Licenses/passport-local_license.txt - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/passport.tps b/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/passport.tps deleted file mode 100644 index a2c7b54c..00000000 --- a/Samples/PixelStreaming/WebServers/SignallingWebServer/tps/passport.tps +++ /dev/null @@ -1,13 +0,0 @@ - - - passport v0.4.0 - /Samples/PixelStreaming/WebServers/ - Is the authentication middleware that adds the ability to securely log in a user to the webserver. This is a generic framework that you add specific implementation frameworks (separate TPS's will be provided for these) to to provide authentication on a node.js webserver. - https://github.com/jaredhanson/passport/blob/master/LICENSE - - Licensees - Git - P4 - - /Engine/Source/ThirdParty/Licenses/passport_license.txt - \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/get_ps_servers.bat b/Samples/PixelStreaming/WebServers/get_ps_servers.bat deleted file mode 100644 index d816f11f..00000000 --- a/Samples/PixelStreaming/WebServers/get_ps_servers.bat +++ /dev/null @@ -1,110 +0,0 @@ -@Rem Copyright Epic Games, Inc. All Rights Reserved. - -@echo off - -@Rem Set script location as working directory for commands. -pushd "%~dp0" - -:arg_loop_start -SET ARG=%1 -if DEFINED ARG ( - if "%ARG%"=="/h" ( - goto print_help - ) - if "%ARG%"=="/v" ( - SET UEVersion=%2 - SHIFT - ) - if "%ARG%"=="/b" ( - SET PSInfraTagOrBranch=%2 - SET IsTag=0 - SHIFT - ) - if "%ARG%"=="/t" ( - SET PSInfraTagOrBranch=%2 - SET IsTag=1 - SHIFT - ) - SHIFT - goto arg_loop_start -) - -@Rem Name and version of ps-infra that we are downloading -SET PSInfraOrg=EpicGames -SET PSInfraRepo=PixelStreamingInfrastructure - -@Rem If a UE version is supplied set the right branch or tag to fetch for that version of UE -if DEFINED UEVersion ( - if "%UEVersion%"=="4.26" ( - SET PSInfraTagOrBranch=UE4.26 - SET IsTag=0 - ) - if "%UEVersion%"=="4.27" ( - SET PSInfraTagOrBranch=UE4.27 - SET IsTag=0 - ) - if "%UEVersion%"=="5.0" ( - SET PSInfraTagOrBranch=UE5.0 - SET IsTag=0 - ) -) - -@Rem If no arguments select a specific version, fetch the appropriate default -if NOT DEFINED PSInfraTagOrBranch ( - SET PSInfraTagOrBranch=master - SET IsTag=0 -) - -@Rem Whether the named reference is a tag or a branch affects the URL we fetch it on -if %IsTag%==1 ( - SET RefType=tags -) else ( - SET RefType=heads -) - -@Rem Look for a SignallingWebServer directory next to this script -if exist SignallingWebServer\ ( - echo SignallingWebServer directory found...skipping install. -) else ( - echo SignallingWebServer directory not found...beginning ps-infra download. - - @Rem Download ps-infra and follow redirects. - curl -L https://github.com/%PSInfraOrg%/%PSInfraRepo%/archive/refs/%RefType%/%PSInfraTagOrBranch%.zip > ps-infra.zip - - @Rem Unarchive the .zip - tar -xmf ps-infra.zip || echo bad archive, contents: && type ps-infra.zip && exit 0 - - @Rem Rename the extracted, versioned, directory - for /d %%i in ("PixelStreamingInfrastructure-*") do ( - for /d %%j in ("%%i/*") do ( - echo "%%i\%%j" - move "%%i\%%j" . - ) - for %%j in ("%%i/*") do ( - echo "%%i\%%j" - move "%%i\%%j" . - ) - - echo "%%i" - rmdir /s /q "%%i" - ) - - @Rem Delete the downloaded zip - del ps-infra.zip -) - -exit 0 - -:print_help -echo. -echo Tool for fetching PixelStreaming Infrastructure. If no flags are set specifying a version to fetch, -echo the recommended version will be chosen as a default. -echo. -echo Usage: -echo %~n0%~x0 [^/h] [^/v ^] [^/b ^] [^/t ^] -echo Where: -echo /v Specify a version of Unreal Engine to download the recommended release for -echo /b Specify a specific branch for the tool to download from repo -echo /t Specify a specific tag for the tool to download from repo -echo /h Display this help message -exit 1 \ No newline at end of file diff --git a/Samples/PixelStreaming/WebServers/get_ps_servers.sh b/Samples/PixelStreaming/WebServers/get_ps_servers.sh deleted file mode 100644 index a402611c..00000000 --- a/Samples/PixelStreaming/WebServers/get_ps_servers.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash -# Copyright Epic Games, Inc. All Rights Reserved. - -BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -pushd "${BASH_LOCATION}" > /dev/null - -print_help() { - echo " - Tool for fetching PixelStreaming Infrastructure. If no flags are set specifying a version to fetch, - the recommended version will be chosen as a default. - - Usage: - ${0} [-h] [-v ] [-b ] [-t ] - Where: - -v Specify a version of Unreal Engine to download the recommended - release for - -b Specify a specific branch for the tool to download from repo - -t Specify a specific tag for the tool to download from repo - -h Display this help message -" - exit 1 -} - -while(($#)) ; do - case "$1" in - -h ) print_help;; - -v ) UEVersion="$2"; shift 2;; - -b ) PSInfraTagOrBranch="$2"; IsTag=0; shift 2;; - -t ) PSInfraTagOrBranch="$2"; IsTag=1; shift 2;; - * ) echo "Unknown command: $1"; shift;; - esac - done - -# Name and version of ps-infra that we are downloading -PSInfraOrg=EpicGames -PSInfraRepo=PixelStreamingInfrastructure - -# If a UE version is supplied set the right branch or tag to fetch for that version of UE -if [ ! -z "$UEVersion" ] -then - if [ "$UEVersion" = "4.26" ] - then - PSInfraTagOrBranch=UE4.26 - IsTag=0 - fi - if [ "$UEVersion" = "4.27" ] - then - PSInfraTagOrBranch=UE4.27 - IsTag=0 - fi - if [ "$UEVersion" = "5.0" ] - then - PSInfraTagOrBranch=UE5.0 - IsTag=0 - fi -fi - -# If no arguments select a specific version, fetch the appropriate default -if [ -z "$PSInfraTagOrBranch" ] -then - PSInfraTagOrBranch=master - IsTag=0 -fi - -# Whether the named reference is a tag or a branch affects the URL we fetch it on -if [ "$IsTag" -eq 1 ] -then - RefType=tags -else - RefType=heads -fi - -# Look for a SignallingWebServer directory next to this script -if [ -d SignallingWebServer ] -then - echo "SignallingWebServer directory found...skipping install." -else - echo "SignallingWebServer directory not found...beginning ps-infra download." - - # Download ps-infra and follow redirects. - curl -L https://github.com/$PSInfraOrg/$PSInfraRepo/archive/refs/$RefType/$PSInfraTagOrBranch.tar.gz > ps-infra.tar.gz - - # Unarchive the .tar - tar -xmf ps-infra.tar.gz || $(echo "bad archive, contents:" && head --lines=20 ps-infra.tar.gz && exit 0) - - # Move the server folders into the current directory (WebServers) and delete the original directory - mv PixelStreamingInfrastructure-*/* . - rm -rf PixelStreamingInfrastructure-* - - # Delete the downloaded tar - rm ps-infra.tar.gz -fi \ No newline at end of file diff --git a/plugins/DLSS/Config/FilterPlugin.ini b/plugins/DLSS/Config/FilterPlugin.ini deleted file mode 100644 index 7ace6471..00000000 --- a/plugins/DLSS/Config/FilterPlugin.ini +++ /dev/null @@ -1,12 +0,0 @@ -[FilterPlugin] -; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and -; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. -; -; Examples: -; /README.txt -; /Extras/... -; /Binaries/ThirdParty/*.dll - - -/Config/... - diff --git a/plugins/DLSS/Content/DLSSMacros.uasset b/plugins/DLSS/Content/DLSSMacros.uasset deleted file mode 100644 index d8ed11dd..00000000 Binary files a/plugins/DLSS/Content/DLSSMacros.uasset and /dev/null differ diff --git a/plugins/DLSS/DLSS.uplugin b/plugins/DLSS/DLSS.uplugin deleted file mode 100644 index 00e10fc7..00000000 --- a/plugins/DLSS/DLSS.uplugin +++ /dev/null @@ -1,87 +0,0 @@ -{ - "FileVersion": 3, - "Version": 30, - "VersionName": "2.4.0b", - "FriendlyName": "NVIDIA DLSS/DLAA", - "Description": "NVIDIA Deep Learning Super Sampling", - "Category": "Rendering", - "CreatedBy": "NVIDIA", - "CreatedByURL": "https://developer.nvidia.com/dlss", - "DocsURL": "", - "MarketplaceURL": "https://www.unrealengine.com/marketplace/en-US/product/nvidia-dlss", - "SupportURL": "mailto:DLSS-Support@nvidia.com", - "EngineVersion": "5.1.0", - "CanContainContent": true, - "Installed": true, - "Modules": [ - { - "Name": "DLSSUtility", - "Type": "Runtime", - "LoadingPhase": "PostConfigInit", - "PlatformAllowList": [ - "Win64" - ] - }, - { - "Name": "DLSS", - "Type": "Runtime", - "LoadingPhase": "PostEngineInit", - "PlatformAllowList": [ - "Win64" - ] - }, - { - "Name": "DLSSBlueprint", - "Type": "Runtime", - "LoadingPhase": "PostConfigInit" - }, - { - "Name": "NGXRHI", - "Type": "Runtime", - "LoadingPhase": "PostEngineInit", - "PlatformAllowList": [ - "Win64" - ] - }, - { - "Name": "NGXD3D11RHI", - "Type": "Runtime", - "LoadingPhase": "PostEngineInit", - "PlatformAllowList": [ - "Win64" - ] - }, - { - "Name": "NGXD3D12RHI", - "Type": "Runtime", - "LoadingPhase": "PostEngineInit", - "PlatformAllowList": [ - "Win64" - ] - }, - { - "Name": "NGXVulkanRHIPreInit", - "Type": "Runtime", - "LoadingPhase": "PostConfigInit", - "PlatformAllowList": [ - "Win64" - ] - }, - { - "Name": "NGXVulkanRHI", - "Type": "Runtime", - "LoadingPhase": "PostEngineInit", - "PlatformAllowList": [ - "Win64" - ] - }, - { - "Name": "DLSSEditor", - "Type": "Editor", - "LoadingPhase": "PostEngineInit", - "PlatformAllowList": [ - "Win64" - ] - } - ] -} \ No newline at end of file diff --git a/plugins/DLSS/Resources/Icon128.png b/plugins/DLSS/Resources/Icon128.png deleted file mode 100644 index 8e700abd..00000000 Binary files a/plugins/DLSS/Resources/Icon128.png and /dev/null differ diff --git a/plugins/DLSS/Shaders/Private/VelocityCombine.usf b/plugins/DLSS/Shaders/Private/VelocityCombine.usf deleted file mode 100644 index e5dbc321..00000000 --- a/plugins/DLSS/Shaders/Private/VelocityCombine.usf +++ /dev/null @@ -1,199 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#include "/Engine/Private/Common.ush" -#include "/Engine/Private/FastMath.ush" -#include "/Engine/Private/ScreenPass.ush" - -#ifndef THREADGROUP_SIZEX -#define THREADGROUP_SIZEX 8 -#endif -#ifndef THREADGROUP_SIZEY -#define THREADGROUP_SIZEY 8 -#endif -#define THREADGROUP_TOTALSIZE (THREADGROUP_SIZEX * THREADGROUP_SIZEY) - -#ifndef DILATE_MOTION_VECTORS -#define DILATE_MOTION_VECTORS 0 -#endif - -#if DILATE_MOTION_VECTORS -#define AA_CROSS 1 -float2 TemporalJitterPixels; -#else -#endif - -Texture2D VelocityTexture; -SamplerState VelocityTextureSampler; -SCREEN_PASS_TEXTURE_VIEWPORT(Velocity) - -Texture2D DepthTexture; -SamplerState DepthTextureSampler; - -RWTexture2D OutVelocityCombinedTexture; -SCREEN_PASS_TEXTURE_VIEWPORT(CombinedVelocity) - - - - -[numthreads(THREADGROUP_SIZEX, THREADGROUP_SIZEY, 1)] -void VelocityCombineMain( - uint2 GroupId : SV_GroupID, - uint2 DispatchThreadId : SV_DispatchThreadID, - uint2 GroupThreadId : SV_GroupThreadID, - uint GroupIndex : SV_GroupIndex) -{ - uint2 PixelPos = min(DispatchThreadId + Velocity_ViewportMin, Velocity_ViewportMax - 1); - - // CombinedVelocity_ViewportMin is expected to be 0, but in case it is not - uint2 OutputPixelPos = CombinedVelocity_ViewportMin + DispatchThreadId; - const bool bInsideViewport = all(PixelPos.xy < Velocity_ViewportMax); - - BRANCH - if (!bInsideViewport) - return; - -#if DILATE_MOTION_VECTORS // TODO: 2x2. - - // Screen position of minimum depth. - float2 VelocityOffset = float2(0.0, 0.0); - - float2 NearestBufferUV = (PixelPos + 0.5f) * Velocity_ViewportSizeInverse; - - //float2 ViewportUV = NearestBufferUV; - float2 ViewportUV = (float2(DispatchThreadId) + 0.5f) * CombinedVelocity_ViewportSizeInverse; - - // Pixel coordinate of the center of output pixel O in the input viewport. - float2 PPCo = ViewportUV * Velocity_ViewportSize + TemporalJitterPixels; - - // Pixel coordinate of the center of the nearest input pixel K. - float2 PPCk = floor(PPCo) + 0.5; - - // Pixel coordinate of the center of the nearest top left input pixel T. - float2 PPCt = floor(PPCo - 0.5) + 0.5; - - NearestBufferUV = Velocity_ExtentInverse * (Velocity_ViewportMin + PPCk); - - // FIND MOTION OF PIXEL AND NEAREST IN NEIGHBORHOOD - // ------------------------------------------------ - float3 PosN; // Position of this pixel, possibly later nearest pixel in neighborhood. - PosN.xy = ViewportUVToScreenPos(ViewportUV); - PosN.z = DepthTexture.SampleLevel(DepthTextureSampler, NearestBufferUV, 0).x; - - { - // For motion vector, use camera/dynamic motion from min depth pixel in pattern around pixel. - // This enables better quality outline on foreground against different motion background. - // Larger 2 pixel distance "x" works best (because AA dilates surface). - float4 Depths; - Depths.x = DepthTexture.SampleLevel(DepthTextureSampler, NearestBufferUV, 0, int2(-AA_CROSS, -AA_CROSS)).x; - Depths.y = DepthTexture.SampleLevel(DepthTextureSampler, NearestBufferUV, 0, int2(AA_CROSS, -AA_CROSS)).x; - Depths.z = DepthTexture.SampleLevel(DepthTextureSampler, NearestBufferUV, 0, int2(-AA_CROSS, AA_CROSS)).x; - Depths.w = DepthTexture.SampleLevel(DepthTextureSampler, NearestBufferUV, 0, int2(AA_CROSS, AA_CROSS)).x; - - float2 DepthOffset = float2(AA_CROSS, AA_CROSS); - float DepthOffsetXx = float(AA_CROSS); -#if HAS_INVERTED_Z_BUFFER - // Nearest depth is the largest depth (depth surface 0=far, 1=near). - if (Depths.x > Depths.y) - { - DepthOffsetXx = -AA_CROSS; - } - if (Depths.z > Depths.w) - { - DepthOffset.x = -AA_CROSS; - } - float DepthsXY = max(Depths.x, Depths.y); - float DepthsZW = max(Depths.z, Depths.w); - if (DepthsXY > DepthsZW) - { - DepthOffset.y = -AA_CROSS; - DepthOffset.x = DepthOffsetXx; - } - float DepthsXYZW = max(DepthsXY, DepthsZW); - if (DepthsXYZW > PosN.z) - { - // This is offset for reading from velocity texture. - // This supports half or fractional resolution velocity textures. - // With the assumption that UV position scales between velocity and color. - VelocityOffset = DepthOffset * Velocity_ExtentInverse; - // This is [0 to 1] flipped in Y. - //PosN.xy = ScreenPos + DepthOffset * ViewportSize.zw * 2.0; - PosN.z = DepthsXYZW; - } -#else // !HAS_INVERTED_Z_BUFFER -#error Fix me! -#endif // !HAS_INVERTED_Z_BUFFER - } - // Camera motion for pixel or nearest pixel (in ScreenPos space). - bool OffScreen = false; - float Velocity = 0; - float HistoryBlur = 0; - - float4 ThisClip = float4(PosN.xy, PosN.z, 1); - float4 PrevClip = mul(ThisClip, View.ClipToPrevClip); - float2 PrevScreen = PrevClip.xy / PrevClip.w; - float2 BackN = PosN.xy - PrevScreen; - - float2 BackTemp = BackN * Velocity_ViewportSize; - - float4 VelocityN = VelocityTexture.SampleLevel(VelocityTextureSampler, NearestBufferUV + VelocityOffset, 0); - bool DynamicN = VelocityN.x > 0.0; - if (DynamicN) - { - BackN = DecodeVelocityFromTexture(VelocityN).xy; - } - BackTemp = BackN * CombinedVelocity_ViewportSize; - - OutVelocityCombinedTexture[OutputPixelPos].xy = -BackTemp * float2(0.5, -0.5); - -#else - float4 EncodedVelocity = VelocityTexture[PixelPos]; - float Depth = DepthTexture[PixelPos].x; - - float2 Velocity; - if (all(EncodedVelocity.xy > 0)) - { - Velocity = DecodeVelocityFromTexture(EncodedVelocity).xy; - } - else - { - float4 ClipPos; - ClipPos.xy = SvPositionToScreenPosition(float4(PixelPos.xy, 0, 1)).xy; - ClipPos.z = Depth; - ClipPos.w = 1; - - float4 PrevClipPos = mul(ClipPos, View.ClipToPrevClip); - - if (PrevClipPos.w > 0) - { - float2 PrevScreen = PrevClipPos.xy / PrevClipPos.w; - Velocity = ClipPos.xy - PrevScreen.xy; - } - else - { - Velocity = EncodedVelocity.xy; - } - } - - float2 OutVelocity = Velocity * float2(0.5, -0.5) * View.ViewSizeAndInvSize.xy; - - OutVelocityCombinedTexture[OutputPixelPos].xy = -OutVelocity; -#endif -} \ No newline at end of file diff --git a/plugins/DLSS/Source/DLSS/DLSS.Build.cs b/plugins/DLSS/Source/DLSS/DLSS.Build.cs deleted file mode 100644 index ac5b993c..00000000 --- a/plugins/DLSS/Source/DLSS/DLSS.Build.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -using UnrealBuildTool; -using System.IO; - -public class DLSS : ModuleRules -{ - public virtual string [] SupportedDynamicallyLoadedNGXRHIModules(ReadOnlyTargetRules Target) - { - if(Target.Platform == UnrealTargetPlatform.Win64 ) - { - return new string[] - { - "NGXD3D11RHI", - "NGXD3D12RHI", - "NGXVulkanRHI" - }; - } - return new string[] { "" }; - } - - public DLSS(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicIncludePaths.AddRange( - new string[] { - // ... add public include paths required here ... - } - ); - - - // for ITemporalUpscaler in PostProcess/TemporalAA.h - PrivateIncludePaths.AddRange( - new string[] { - Path.Combine(GetModuleDirectory("Renderer"), "Private"), - // ... add other private include paths required here ... - } - ); - - PublicDependencyModuleNames.AddRange( - new string[] - { - - // ... add other public dependencies that you statically link with here ... - } - ); - - - PrivateDependencyModuleNames.AddRange( - new string[] - { - "Core", - "CoreUObject", - "EngineSettings", - "Engine", - "RenderCore", - "Renderer", - "RHI", - "NGX", - "Projects", - "DeveloperSettings", - "DLSSUtility", - "NGXRHI", - // ... add private dependencies that you statically link with here ... - } - ); - - DynamicallyLoadedModuleNames.AddRange(SupportedDynamicallyLoadedNGXRHIModules(Target)); - } -} diff --git a/plugins/DLSS/Source/DLSS/Private/DLSS.cpp b/plugins/DLSS/Source/DLSS/Private/DLSS.cpp deleted file mode 100644 index 49caae8a..00000000 --- a/plugins/DLSS/Source/DLSS/Private/DLSS.cpp +++ /dev/null @@ -1,474 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ -#include "DLSS.h" -#include "CoreMinimal.h" -#include "DLSSUpscalerPrivate.h" - -#include "DLSSUpscaler.h" -#include "DLSSDenoiser.h" - -#include "NGXRHI.h" - -#include "Modules/ModuleManager.h" -#include "Interfaces/IPluginManager.h" - -#include "GeneralProjectSettings.h" -#include "DLSSSettings.h" - -#include "SceneViewExtension.h" -#include "SceneView.h" -#include "Misc/MessageDialog.h" - - -#define LOCTEXT_NAMESPACE "FDLSSModule" -DEFINE_LOG_CATEGORY(LogDLSS); - -static TAutoConsoleVariable CVarNGXBinarySearchOrder( - TEXT("r.NGX.BinarySearchOrder"), - 0, - TEXT("0: automatic: (default)\n") - TEXT(" use custom binaries from project and launch folder $(ProjectDir)/Binaries/ThirdParty/NVIDIA/NGX/$(Platform) if present\n") - TEXT(" fallback to generic binaries from plugin folder\n") - TEXT("1: force generic binaries from plugin folder, fail if not found\n") - TEXT("2: force custom binaries from project or launch folder, fail if not found\n") - TEXT("3: force generic development binaries from plugin folder, fail if not found. This is only supported in non-shipping build configurations\n"), - ECVF_ReadOnly); - -static TAutoConsoleVariable CVarNGXEnable( - TEXT("r.NGX.Enable"), 1, - TEXT("Whether the NGX library should be loaded. This allow to have the DLSS plugin enabled but avoiding potential ") - TEXT("incompatibilities by skipping the driver side NGX parts of DLSS. Can also be set on the command line via -ngxenable and -ngxdisable"), - ECVF_ReadOnly); - -static TAutoConsoleVariable CVarNGXDLSSMinimumWindowsBuildVersion( - TEXT("r.NGX.DLSS.MinimumWindowsBuildVersion"), 16299, - TEXT("Sets the minimum Windows 10 build version required to enable DLSS. (default: 16299 for v1709, Windows 10 Fall 2017 Creators Update 64-bit)"), - ECVF_Default -); - -static TAutoConsoleVariable CVarNGXProjectIdentifier( - TEXT("r.NGX.ProjectIdentifier"), - 0, - TEXT("0: automatic: (default)\n") - TEXT(" use NVIDIA NGX Application ID if non-zero, otherwise use UE Project ID)\n") - TEXT("1: force UE Project ID\n") - TEXT("2: force NVIDIA NGX Application ID (set via the Project Settings -> NVIDIA DLSS plugin)\n"), - ECVF_ReadOnly); - - -static TAutoConsoleVariable CVarNGXAutomationEnable( - TEXT("r.NGX.Automation.Enable"), - false, - TEXT("Enable automation for NGX DLSS image quality and performance evaluation. (default = 0)\n"), - ECVF_RenderThreadSafe); - -static TAutoConsoleVariable CVarNGXAutomationViewIndex( - TEXT("r.NGX.Automation.ViewIndex"), - 0, - TEXT("Select which view to use with NGX DLSS image quality and performance automation. (default = 0). \n"), - ECVF_RenderThreadSafe); - -static TAutoConsoleVariable CVarNGXAutomationNonGameViews( - TEXT("r.NGX.Automation.NonGameViews"), - 0, - TEXT("Enable NGX DLSS image quality and performance automation for non-game views. (default = 0). \n"), - ECVF_RenderThreadSafe); - - -class FNGXAutomationViewExtension final : public FSceneViewExtensionBase -{ -public: - FNGXAutomationViewExtension(const FAutoRegister& AutoRegister): FSceneViewExtensionBase(AutoRegister) - { - FSceneViewExtensionIsActiveFunctor IsActiveFunctor; - - IsActiveFunctor.IsActiveFunction = [](const ISceneViewExtension* SceneViewExtension, const FSceneViewExtensionContext& Context) - { - return CVarNGXAutomationEnable.GetValueOnAnyThread(); - }; - - IsActiveThisFrameFunctions.Add(IsActiveFunctor); - } - - virtual void SetupViewFamily(FSceneViewFamily& InViewFamily) {} - virtual void SetupView(FSceneViewFamily& InViewFamily, FSceneView& InView) {} - virtual void SetupViewPoint(APlayerController* Player, FMinimalViewInfo& InViewInfo) {} - virtual void BeginRenderViewFamily(FSceneViewFamily& InViewFamily) {} - virtual void PreRenderView_RenderThread(FRDGBuilder& GraphBuilder, FSceneView& InView) final {} - virtual void PreRenderViewFamily_RenderThread(FRDGBuilder& GraphBuilder, FSceneViewFamily& InViewFamily) final - { - int32 ViewIndex = CVarNGXAutomationViewIndex.GetValueOnRenderThread(); - - if (InViewFamily.Views.IsValidIndex(ViewIndex)) - { - const FSceneView* View = InViewFamily.Views[ViewIndex]; - if (View->bIsGameView || CVarNGXAutomationNonGameViews.GetValueOnRenderThread()) - { - const FString AiAgentMarker = FString::Printf(TEXT("{\"camera\":{\"position\":{\"x\": %f, \"y\": %f, \"z\": %f},\"rotation\":{\"pitch\": %f, \"roll\": %f, \"yaw\": %f}}}"), - View->ViewLocation.X, View->ViewLocation.Y, View->ViewLocation.Z, - View->ViewRotation.Pitch, View->ViewRotation.Roll, View->ViewRotation.Yaw); - - static FColor ColorMarker = FColor::FromHex("0xA1A5E87"); - FRHICommandListImmediate& RHICmdList = GraphBuilder.RHICmdList; - RHICmdList.PushEvent(*AiAgentMarker, ColorMarker); - RHICmdList.PopEvent(); - } - } - } -}; - -void FDLSSModule::StartupModule() -{ - // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module - UE_LOG(LogDLSS, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - - if (!GDynamicRHI) - { - UE_LOG(LogDLSS, Log, TEXT("NVIDIA NGX DLSS requires an RHI")); - DLSSSupport = EDLSSSupport::NotSupported; - return; - } - - // Get the base directory of this plugin - const FString PluginBaseDir = IPluginManager::Get().FindPlugin(TEXT("DLSS"))->GetBaseDir(); - const FString NGXBinariesDir = FPaths::Combine(*PluginBaseDir, TEXT("Binaries/ThirdParty/Win64/")); - const FString RHIName = GDynamicRHI->GetName(); - - UE_LOG(LogDLSS, Log, TEXT("PluginBaseDir %s"), *PluginBaseDir); - UE_LOG(LogDLSS, Log, TEXT("NGXBinariesDir %s"), *NGXBinariesDir); - UE_LOG(LogDLSS, Log, TEXT("GDynamicRHIName %s %s"), RHIVendorIdToString(), *RHIName ); - - bool bLoadLibraries = CVarNGXEnable.GetValueOnAnyThread() != 0; - if (FParse::Param(FCommandLine::Get(), TEXT("ngxenable"))) - { - bLoadLibraries = true; - } - else if (FParse::Param(FCommandLine::Get(), TEXT("ngxdisable"))) - { - bLoadLibraries = false; - } - - const int32 NGXDLSSMinimumWindowsBuildVersion = CVarNGXDLSSMinimumWindowsBuildVersion.GetValueOnAnyThread(); - - if (!IsRHIDeviceNVIDIA()) - { - UE_LOG(LogDLSS, Log, TEXT("NVIDIA NGX DLSS requires an NVIDIA RTX series graphics card")); - DLSSSupport = EDLSSSupport::NotSupportedIncompatibleHardware; - } -#if PLATFORM_WINDOWS - else if (NGXDLSSMinimumWindowsBuildVersion > 0 && !FPlatformMisc::VerifyWindowsVersion(10, 0 - #if PLATFORM_DESKTOP - , NGXDLSSMinimumWindowsBuildVersion - #endif - )) - { - // From https://docs.microsoft.com/en-us/windows/release-information/ - UE_LOG(LogDLSS, Log, TEXT("NVIDIA NGX DLSS requires at least Windows 10, build %u "), NGXDLSSMinimumWindowsBuildVersion); - DLSSSupport = EDLSSSupport::NotSupportedOperatingSystemOutOfDate; - } -#endif - else if (!bLoadLibraries) - { - UE_LOG(LogDLSS, Log, TEXT("NVIDIA NGX library loading has been disabled with r.NGX.Enable=0")); - DLSSSupport = EDLSSSupport::NotSupported; - } - else - { - const ERHIInterfaceType RHIType = RHIGetInterfaceType(); - - const bool bIsDX12 = (RHIType == ERHIInterfaceType::D3D12) && GetDefault()->bEnableDLSSD3D12; - const bool bIsDX11 = (RHIType == ERHIInterfaceType::D3D11) && GetDefault()->bEnableDLSSD3D11; - const bool bIsVulkan = (RHIType == ERHIInterfaceType::Vulkan) && GetDefault()->bEnableDLSSVulkan; - const TCHAR* NGXRHIModuleName = nullptr; - - DLSSSupport = (bIsDX11 || bIsDX12 || bIsVulkan) ? EDLSSSupport::Supported : EDLSSSupport::NotSupported; - - if (DLSSSupport == EDLSSSupport::Supported) - { - if (bIsDX11) - { - NGXRHIModuleName = TEXT("NGXD3D11RHI"); - } - else if (bIsDX12) - { - NGXRHIModuleName = TEXT("NGXD3D12RHI"); - } - else if (bIsVulkan) - { - NGXRHIModuleName = TEXT("NGXVulkanRHI"); - } - - - uint32 NGXAppID = GetDefault()->NVIDIANGXApplicationId; - UE_LOG(LogDLSS, Log, TEXT("Plugin settings: NGXAppId = %u"), NGXAppID); - - if (NGXAppID != 0) - { - UE_LOG(LogDLSS, Warning, TEXT("NGX Application ID is specified, overriding the Project ID. Please refer to https://developer.nvidia.com/dlss.")); - } - else - { - UE_LOG(LogDLSS, Warning, TEXT("NGX Application ID not specified, using the Project ID by default.")); - } - - FNGXRHICreateArguments Arguments; - Arguments.PluginBaseDir = PluginBaseDir; - Arguments.DynamicRHI = GDynamicRHI; - Arguments.NGXBinariesSearchOrder = ENGXBinariesSearchOrder(FMath::Clamp(CVarNGXBinarySearchOrder.GetValueOnAnyThread(), int32(ENGXBinariesSearchOrder::MinValue), int32(ENGXBinariesSearchOrder::MaxValue))); - - Arguments.ProjectIdentifier = ENGXProjectIdentifier(FMath::Clamp(CVarNGXProjectIdentifier.GetValueOnAnyThread(), int32(ENGXProjectIdentifier::MinValue), int32(ENGXProjectIdentifier::MaxValue))); - Arguments.NGXAppId = NGXAppID; - Arguments.UnrealEngineVersion = FString::Printf(TEXT("%u.%u"), FEngineVersion::Current().GetMajor(), FEngineVersion::Current().GetMinor()); - Arguments.UnrealProjectID = GetDefault()->ProjectID.ToString(); - - INGXRHIModule* NGXRHIModule = &FModuleManager::LoadModuleChecked(NGXRHIModuleName); - NGXRHIExtensions = NGXRHIModule->CreateNGXRHI(Arguments); - - - const bool bRenderDocPluginFound = FModuleManager::Get().ModuleExists(TEXT("RenderDocPlugin")); - const bool bDLSSUnavailable = (!NGXRHIExtensions || !NGXRHIExtensions->IsDLSSAvailable()); - const bool bIncompatibleAPICaptureToolActive = (bRenderDocPluginFound || NGXRHI::IsIncompatibleAPICaptureToolActive()); - if (bDLSSUnavailable && bIncompatibleAPICaptureToolActive) - { - if (bRenderDocPluginFound) - { - UE_LOG(LogDLSS, Warning, TEXT("DLSS is not compatible with the RenderDoc plugin. To enable DLSS please disable the RenderDoc plugin.")); - } - - if (NGXRHI::IsIncompatibleAPICaptureToolActive()) - { - UE_LOG(LogDLSS, Warning, TEXT("DLSS is not compatible with some API capture tools, such as RenderDoc. To enable DLSS please use an API capture tool such as NVIDIA NSIGHT graphics, which support the APIs required by DLSS.")); - } -// we don't want this ever show up in packaged builds -#if WITH_EDITOR - const bool IsUnattended = FApp::IsUnattended() || IsRunningCommandlet() || GIsRunningUnattendedScript; - auto LocalSettings = GetMutableDefault(); - if (!IsUnattended && LocalSettings->bShowDLSSIncompatiblePluginsToolsWarnings) - { - const FText DialogTitle(LOCTEXT("DLSSIncompatibleWithCaptureToolTitle", "Warning -- DLSS incompatible with plugins and/or API capture tools")); - const FText WarningMessage(LOCTEXT("DLSSIncompatibleWithCaptureTool", - "To enable DLSS, please disable the RenderDoc plugin and/or use an API capture tool such as NVIDIA NSIGHT graphics, which supports the APIs required by DLSS.\n\n" - "Would you like to continue to see this message for this project? It can also be disabled in the NVIDIA DLSS Overrides (Local) plugin settings.")); - - EAppReturnType::Type YesNoCancelReply = FMessageDialog::Open(EAppMsgType::YesNoCancel, EAppReturnType::Yes, WarningMessage, &DialogTitle); - - if(YesNoCancelReply == EAppReturnType::No) - { - LocalSettings->bShowDLSSIncompatiblePluginsToolsWarnings = false; - } - else if (YesNoCancelReply == EAppReturnType::Cancel) - { - FPlatformMisc::RequestExit(true); - } - } -#endif //WITH_EDITOR - } - - if (NGXRHIExtensions) - { - if (NGXRHIExtensions->IsDLSSAvailable()) - { - check(NVSDK_NGX_SUCCEED(NGXRHIExtensions->GetDLSSInitResult())); - DLSSSupport = EDLSSSupport::Supported; - } - else - { - // map some of the NGX error codes to something that the UI/gameplay could suggest the end user to do something about - if (bIncompatibleAPICaptureToolActive) - { - DLSSSupport = EDLSSSupport::NotSupportedIncompatibleAPICaptureToolActive; - } - else if (NVSDK_NGX_Result_FAIL_OutOfDate == NGXRHIExtensions->GetDLSSInitResult()) - { - DLSSSupport = EDLSSSupport::NotSupportedDriverOutOfDate; - } - else if (NVSDK_NGX_Result_FAIL_FeatureNotSupported == NGXRHIExtensions->GetDLSSInitResult()) - { - DLSSSupport = EDLSSSupport::NotSupportedIncompatibleHardware; - } - else - { - DLSSSupport = EDLSSSupport::NotSupported; - } - } - - const FNGXDriverRequirements DriverRequirements = NGXRHIExtensions->GetDLSSDriverRequirements(); - MinDriverVersionMajor = DriverRequirements.MinDriverVersionMajor; - MinDriverVersionMinor = DriverRequirements.MinDriverVersionMinor; - if (DriverRequirements.DriverUpdateRequired) - { - if (DLSSSupport == EDLSSSupport::Supported) - { - UE_LOG(LogDLSS, Log, TEXT("NVIDIA NGX DLSS could be loaded properly. However it is recommended to update the version to at least: %u.%u"), DriverRequirements.MinDriverVersionMajor, DriverRequirements.MinDriverVersionMinor); - } - else - { - UE_LOG(LogDLSS, Log, TEXT("NVIDIA NGX DLSS cannot be loaded properly. Please verify that at least this driver version is installed: %u.%u"), DriverRequirements.MinDriverVersionMajor, DriverRequirements.MinDriverVersionMinor); - DLSSSupport = EDLSSSupport::NotSupportedDriverOutOfDate; - MinDriverVersionMajor = DriverRequirements.MinDriverVersionMajor; - MinDriverVersionMinor = DriverRequirements.MinDriverVersionMinor; - } - - } - } - else - { - UE_LOG(LogDLSS, Log, TEXT("Could not load %s module"), NGXRHIModuleName); - DLSSSupport = EDLSSSupport::NotSupported; - } - - if (DLSSSupport != EDLSSSupport::Supported) - { - UE_LOG(LogDLSS, Log, TEXT("DLSS not supported by the %s %s RHI in the %s module at runtime"), RHIVendorIdToString(), *RHIName, NGXRHIModuleName); - } - } - else - { - UE_LOG(LogDLSS, Log, TEXT("DLSS not implemented for the %s RHI, or disabled in the project settings"), *RHIName); - DLSSSupport = EDLSSSupport::NotSupported; - } - } - - - if (DLSSSupport == EDLSSSupport::Supported) - { - // set the upscaler - { - DLSSUpscaler.Reset(new FDLSSUpscaler(NGXRHIExtensions.Get())); - check(DLSSUpscaler); - if (DLSSUpscaler->GetNumRuntimeQualityModes() == 0) - { - UE_LOG(LogDLSS, Log, TEXT("DLSS not available due to not supporting any quality modes at runtime")); - DLSSSupport = EDLSSSupport::NotSupported; - DLSSUpscaler.Reset(); - NGXRHIExtensions.Reset(); - } - } - } - - UE_LOG(LogDLSS, Log, TEXT("NVIDIA NGX DLSS supported %u"), QueryDLSSSupport() == EDLSSSupport::Supported); - - // and the other related interfaces - - if (DLSSSupport == EDLSSSupport::Supported) - { - // set up the view extension for setting up the FDLSSUpscaler on FSceneViewFamily - { - DLSSUpscalerViewExtension = FSceneViewExtensions::NewExtension(); - } - - // set the denoiser - { - - static const auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Reflections.Denoiser")); - if (CVar && (CVar->GetInt() != 2)) - { - UE_LOG(LogDLSS, Warning, TEXT("For optimal results NVIDIA NGX DLSS requires the use of a custom denoiser plugin, which currently is disabled. To enable, set r.Reflections.Denoiser=2")); - } - - DLSSDenoiser.Reset(new FDLSSDenoiser(GScreenSpaceDenoiser, DLSSUpscaler.Get())); - GScreenSpaceDenoiser = DLSSDenoiser.Get(); - UE_LOG(LogDLSS, Log, TEXT("%s wrapping %s"), DLSSDenoiser->GetDebugName(), DLSSDenoiser->GetWrappedDenoiser()->GetDebugName()); - } - - // set the resource pool - { - checkf(GCustomResourcePool == nullptr, TEXT("GCustomResourcePool is already in use. Please check that only one upscaling plugin is active.")); - GCustomResourcePool = DLSSUpscaler.Get(); - } - } - - // setup DLSS image quality and performance automation hooks - { - NGXAutomationViewExtension = FSceneViewExtensions::NewExtension(); - } - - UE_LOG(LogDLSS, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - -void FDLSSModule::ShutdownModule() -{ - UE_LOG(LogDLSS, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - - // reset DLSS image quality and performance automation hooks - { - NGXAutomationViewExtension = nullptr; - } - - if (QueryDLSSSupport() == EDLSSSupport::Supported) - { - // reset the view extension - { - DLSSUpscalerViewExtension = nullptr; - } - - // reset the resource pool - if (GCustomResourcePool == DLSSUpscaler.Get()) - { - GCustomResourcePool = nullptr; - } - - // reset the denoiser - if (GScreenSpaceDenoiser == DLSSDenoiser.Get()) - { - UE_LOG(LogDLSS, Log, TEXT("%s unwrapping %s"), DLSSDenoiser->GetDebugName(), DLSSDenoiser->GetWrappedDenoiser()->GetDebugName()); - GScreenSpaceDenoiser = DLSSDenoiser->GetWrappedDenoiser(); - DLSSDenoiser.Reset(); - } - - // reset the upscaler - { - FDLSSUpscaler::ReleaseStaticResources(); - DLSSUpscaler.Reset(); - } - - NGXRHIExtensions.Reset(); - } - - UE_LOG(LogDLSS, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - - -EDLSSSupport FDLSSModule::QueryDLSSSupport() const -{ - return DLSSSupport; -} - - -void FDLSSModule::GetDLSSMinDriverVersion(int32& OutMajorVersion, int32& OutMinorVersion) const -{ - OutMajorVersion = MinDriverVersionMajor; - OutMinorVersion = MinDriverVersionMinor; -} - - -float FDLSSModule::GetResolutionFractionForQuality(int32 Quality) const -{ - checkf(QueryDLSSSupport() == EDLSSSupport::Supported,TEXT("GetResolutionFractionForQuality should only be called when DLSS is supported")); - checkf(Quality >= int32(EDLSSQualityMode::MinValue) && Quality <= int32(EDLSSQualityMode::MaxValue),TEXT("The Quality %d argument of GetResolutionFractionForQuality is out of range and/or an unsupported DLSS quality mode"), Quality); - return DLSSUpscaler->GetOptimalResolutionFractionForQuality(EDLSSQualityMode(Quality)); -} - -FDLSSUpscaler* FDLSSModule::GetDLSSUpscaler() const -{ - return DLSSUpscaler.Get(); -} - -TSharedPtr< ISceneViewExtension, ESPMode::ThreadSafe> FDLSSModule::GetDLSSUpscalerViewExtension() const -{ - return StaticCastSharedPtr(DLSSUpscalerViewExtension); -} - -#undef LOCTEXT_NAMESPACE - -IMPLEMENT_MODULE(FDLSSModule, DLSS) - - diff --git a/plugins/DLSS/Source/DLSS/Private/DLSSDenoiser.cpp b/plugins/DLSS/Source/DLSS/Private/DLSSDenoiser.cpp deleted file mode 100644 index b64236f4..00000000 --- a/plugins/DLSS/Source/DLSS/Private/DLSSDenoiser.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#include "DLSSDenoiser.h" -#include "DLSSUpscaler.h" -#include "PostProcess/TemporalAA.h" -#include "SceneTextureParameters.h" -#include "ScenePrivate.h" - - -static TAutoConsoleVariable CVarNGXDLSSReflectionsTemporalAA( - TEXT("r.NGX.DLSS.Reflections.TemporalAA"), - 1, - TEXT("Apply a temporal AA pass on the denoised reflections"), - ECVF_RenderThreadSafe -); - -static TAutoConsoleVariable CVarNGXDLSSWaterReflectionsTemporalAA( - TEXT("r.NGX.DLSS.WaterReflections.TemporalAA"), - 1, - TEXT("Apply a temporal AA pass on the denoised water reflections"), - ECVF_RenderThreadSafe -); - - -FDLSSDenoiser::FDLSSDenoiser(const IScreenSpaceDenoiser* InWrappedDenoiser, const FDLSSUpscaler* InUpscaler) - : WrappedDenoiser(InWrappedDenoiser) - , Upscaler(InUpscaler) -{ - check(Upscaler); - check(WrappedDenoiser); -} - -const TCHAR* FDLSSDenoiser::GetDebugName() const -{ - if (Upscaler->IsDLSSActive()) - { - // we don't have the View here to check whether we have a valid GetTemporalUpscalerInterface, which we'll do when we actually get called to denoise/add TAA - // and this is only for profilegpu anyways so OK if it's not 100% accurate - return TEXT("FDLSSDenoiserWrapper(Active)"); - } - else - { - return TEXT("FDLSSDenoiserWrapper(Inactive)"); - } -} - -IScreenSpaceDenoiser::EShadowRequirements FDLSSDenoiser::GetShadowRequirements(const FViewInfo& View, const FLightSceneInfo& LightSceneInfo, const FShadowRayTracingConfig& RayTracingConfig) const -{ - return WrappedDenoiser->GetShadowRequirements(View, LightSceneInfo, RayTracingConfig); -} - -void FDLSSDenoiser::DenoiseShadowVisibilityMasks(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const TStaticArray& InputParameters, const int32 InputParameterCount, TStaticArray& Outputs) const -{ - WrappedDenoiser->DenoiseShadowVisibilityMasks(GraphBuilder, View, PreviousViewInfos, SceneTextures, InputParameters, InputParameterCount, Outputs); -} - -IScreenSpaceDenoiser::FPolychromaticPenumbraOutputs FDLSSDenoiser::DenoisePolychromaticPenumbraHarmonics(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FPolychromaticPenumbraHarmonics& Inputs) const -{ - return WrappedDenoiser->DenoisePolychromaticPenumbraHarmonics(GraphBuilder, View, PreviousViewInfos, SceneTextures, Inputs); -} - -IScreenSpaceDenoiser::FReflectionsOutputs FDLSSDenoiser::DenoiseReflections(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FReflectionsInputs& Inputs, const FReflectionsRayTracingConfig Config) const -{ - FReflectionsOutputs Outputs = WrappedDenoiser->DenoiseReflections(GraphBuilder, View, PreviousViewInfos, SceneTextures, Inputs, Config); - const bool bIsDLSSActive = View.Family && FDLSSSceneViewFamilyUpscaler::IsDLSSTemporalUpscaler(View.Family->GetTemporalUpscalerInterface()); - const bool bApplyTemporalAA = bIsDLSSActive && CVarNGXDLSSReflectionsTemporalAA.GetValueOnRenderThread() && View.ViewState && IsTemporalAccumulationBasedMethod(View.AntiAliasingMethod); - if(bApplyTemporalAA) - { - check(View.ViewState); - - FTAAPassParameters TAASettings(View); - TAASettings.Pass = ETAAPassConfig::ScreenSpaceReflections; - TAASettings.SceneDepthTexture = SceneTextures.SceneDepthTexture; - TAASettings.SceneVelocityTexture = SceneTextures.GBufferVelocityTexture; - TAASettings.SceneColorInput = Outputs.Color; - TAASettings.bOutputRenderTargetable = true; - - FTAAOutputs TAAOutputs = AddTemporalAAPass( - GraphBuilder, - View, - TAASettings, - View.PrevViewInfo.SSRHistory, - &View.ViewState->PrevFrameViewInfo.SSRHistory); - - Outputs.Color = TAAOutputs.SceneColor; - } - - return Outputs; -} - -IScreenSpaceDenoiser::FReflectionsOutputs FDLSSDenoiser::DenoiseWaterReflections(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FReflectionsInputs& Inputs, const FReflectionsRayTracingConfig Config) const -{ - FReflectionsOutputs Outputs = WrappedDenoiser->DenoiseWaterReflections(GraphBuilder, View, PreviousViewInfos, SceneTextures, Inputs, Config); - const bool bIsDLSSActive = View.Family && FDLSSSceneViewFamilyUpscaler::IsDLSSTemporalUpscaler(View.Family->GetTemporalUpscalerInterface()); - const bool bApplyTemporalAA = bIsDLSSActive && Upscaler->IsDLSSActive() && CVarNGXDLSSWaterReflectionsTemporalAA.GetValueOnRenderThread() && View.ViewState && IsTemporalAccumulationBasedMethod(View.AntiAliasingMethod); - if (bApplyTemporalAA) - { - check(View.ViewState); - - FTAAPassParameters TAASettings(View); - TAASettings.Pass = ETAAPassConfig::ScreenSpaceReflections; - TAASettings.SceneDepthTexture = SceneTextures.SceneDepthTexture; - TAASettings.SceneVelocityTexture = SceneTextures.GBufferVelocityTexture; - TAASettings.SceneColorInput = Outputs.Color; - TAASettings.bOutputRenderTargetable = true; - - FTAAOutputs TAAOutputs = AddTemporalAAPass( - GraphBuilder, - View, - TAASettings, - View.PrevViewInfo.WaterSSRHistory, - &View.ViewState->PrevFrameViewInfo.WaterSSRHistory); - - Outputs.Color = TAAOutputs.SceneColor; - } - - return Outputs; -} - -IScreenSpaceDenoiser::FAmbientOcclusionOutputs FDLSSDenoiser::DenoiseAmbientOcclusion(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FAmbientOcclusionInputs& Inputs, const FAmbientOcclusionRayTracingConfig Config) const -{ - return WrappedDenoiser->DenoiseAmbientOcclusion(GraphBuilder, View, PreviousViewInfos, SceneTextures, Inputs, Config); -} - -FSSDSignalTextures FDLSSDenoiser::DenoiseDiffuseIndirect(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FDiffuseIndirectInputs& Inputs, const FAmbientOcclusionRayTracingConfig Config) const -{ - return WrappedDenoiser->DenoiseDiffuseIndirect(GraphBuilder, View, PreviousViewInfos, SceneTextures, Inputs, Config); -} - -FSSDSignalTextures FDLSSDenoiser::DenoiseScreenSpaceDiffuseIndirect(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FDiffuseIndirectInputs& Inputs, const FAmbientOcclusionRayTracingConfig Config) const -{ - return WrappedDenoiser->DenoiseScreenSpaceDiffuseIndirect(GraphBuilder, View, PreviousViewInfos, SceneTextures, Inputs, Config); -} - -FSSDSignalTextures FDLSSDenoiser::DenoiseDiffuseIndirectHarmonic(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FDiffuseIndirectHarmonic& Inputs, const HybridIndirectLighting::FCommonParameters& CommonDiffuseParameters) const -{ - return WrappedDenoiser->DenoiseDiffuseIndirectHarmonic(GraphBuilder, View, PreviousViewInfos, SceneTextures, Inputs, CommonDiffuseParameters); -} - -IScreenSpaceDenoiser::FDiffuseIndirectOutputs FDLSSDenoiser::DenoiseSkyLight(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FDiffuseIndirectInputs& Inputs, const FAmbientOcclusionRayTracingConfig Config) const -{ - return WrappedDenoiser->DenoiseSkyLight(GraphBuilder, View, PreviousViewInfos, SceneTextures, Inputs, Config); -} - -IScreenSpaceDenoiser::FDiffuseIndirectOutputs FDLSSDenoiser::DenoiseReflectedSkyLight(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FDiffuseIndirectInputs& Inputs, const FAmbientOcclusionRayTracingConfig Config) const -{ - return WrappedDenoiser->DenoiseReflectedSkyLight(GraphBuilder, View, PreviousViewInfos, SceneTextures, Inputs, Config); -} - - -bool FDLSSDenoiser::SupportsScreenSpaceDiffuseIndirectDenoiser(EShaderPlatform Platform) const -{ - return WrappedDenoiser->SupportsScreenSpaceDiffuseIndirectDenoiser(Platform); -} - -const IScreenSpaceDenoiser* FDLSSDenoiser::GetWrappedDenoiser() const -{ - return WrappedDenoiser; -} diff --git a/plugins/DLSS/Source/DLSS/Private/DLSSDenoiser.h b/plugins/DLSS/Source/DLSS/Private/DLSSDenoiser.h deleted file mode 100644 index 63789c44..00000000 --- a/plugins/DLSS/Source/DLSS/Private/DLSSDenoiser.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#pragma once - -#include "CoreMinimal.h" -#include "ScreenSpaceDenoise.h" -class FDLSSUpscaler; - -// wrapper for the default denoiser to add TAA after some passes -class DLSS_API FDLSSDenoiser final : public IScreenSpaceDenoiser -{ - -public: - FDLSSDenoiser(const IScreenSpaceDenoiser* InWrappedDenoiser, const FDLSSUpscaler* InUpscaler); - - // Inherited via IScreenSpaceDenoiser - virtual const TCHAR* GetDebugName() const final; - virtual EShadowRequirements GetShadowRequirements(const FViewInfo& View, const FLightSceneInfo& LightSceneInfo, const FShadowRayTracingConfig& RayTracingConfig) const final; - virtual void DenoiseShadowVisibilityMasks(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const TStaticArray& InputParameters, const int32 InputParameterCount, TStaticArray& Outputs) const final; - virtual FPolychromaticPenumbraOutputs DenoisePolychromaticPenumbraHarmonics(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FPolychromaticPenumbraHarmonics& Inputs) const final; - virtual FReflectionsOutputs DenoiseReflections(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FReflectionsInputs& Inputs, const FReflectionsRayTracingConfig Config) const final; - virtual FReflectionsOutputs DenoiseWaterReflections(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FReflectionsInputs& Inputs, const FReflectionsRayTracingConfig Config) const override; - virtual FAmbientOcclusionOutputs DenoiseAmbientOcclusion(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FAmbientOcclusionInputs& Inputs, const FAmbientOcclusionRayTracingConfig Config) const final; - virtual FSSDSignalTextures DenoiseDiffuseIndirect(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FDiffuseIndirectInputs& Inputs, const FAmbientOcclusionRayTracingConfig Config) const final; - virtual FSSDSignalTextures DenoiseScreenSpaceDiffuseIndirect(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FDiffuseIndirectInputs& Inputs, const FAmbientOcclusionRayTracingConfig Config) const final; - virtual FSSDSignalTextures DenoiseDiffuseIndirectHarmonic(FRDGBuilder& GraphBuilder,const FViewInfo& View,FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FDiffuseIndirectHarmonic& Inputs, const HybridIndirectLighting::FCommonParameters& CommonDiffuseParameters) const final; - virtual FDiffuseIndirectOutputs DenoiseSkyLight(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FDiffuseIndirectInputs& Inputs, const FAmbientOcclusionRayTracingConfig Config) const final; - virtual FDiffuseIndirectOutputs DenoiseReflectedSkyLight(FRDGBuilder& GraphBuilder, const FViewInfo& View, FPreviousViewInfo* PreviousViewInfos, const FSceneTextureParameters& SceneTextures, const FDiffuseIndirectInputs& Inputs, const FAmbientOcclusionRayTracingConfig Config) const final; - - - virtual bool SupportsScreenSpaceDiffuseIndirectDenoiser(EShaderPlatform Platform) const final; - const IScreenSpaceDenoiser* GetWrappedDenoiser() const; -private: - - const IScreenSpaceDenoiser* WrappedDenoiser; - const FDLSSUpscaler* Upscaler; -}; \ No newline at end of file diff --git a/plugins/DLSS/Source/DLSS/Private/DLSSUpscaler.cpp b/plugins/DLSS/Source/DLSS/Private/DLSSUpscaler.cpp deleted file mode 100644 index 73ed14af..00000000 --- a/plugins/DLSS/Source/DLSS/Private/DLSSUpscaler.cpp +++ /dev/null @@ -1,759 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#include "DLSSUpscaler.h" - - -#include "DLSS.h" -#include "DLSSUpscalerPrivate.h" -#include "DLSSUpscalerHistory.h" -#include "DLSSSettings.h" - -#include "VelocityCombinePass.h" - -#include "PostProcess/SceneRenderTargets.h" -#include "PostProcess/PostProcessing.h" -#include "SceneTextureParameters.h" -#include "ScreenPass.h" -#include "DynamicResolutionState.h" - -#include "RayTracing/RaytracingOptions.h" - -#include "LegacyScreenPercentageDriver.h" - - -#define LOCTEXT_NAMESPACE "FDLSSModule" - -static TAutoConsoleVariable CVarNGXDLSSEnable( - TEXT("r.NGX.DLSS.Enable"), 1, - TEXT("Enable/Disable DLSS entirely."), - ECVF_RenderThreadSafe); - -static TAutoConsoleVariable CVarNGXDLAAEnable( - TEXT("r.NGX.DLAA.Enable"), false, - TEXT("Enable/Disable DLAA"), - ECVF_RenderThreadSafe); - -static TAutoConsoleVariable CVarNGXDLSSAutomationTesting( - TEXT("r.NGX.DLSS.AutomationTesting"), 0, - TEXT("Whether the NGX library should be loaded when GIsAutomationTesting is true.(default is false)\n") - TEXT("Must be set to true before startup. This can be enabled for cases where running automation testing with DLSS desired"), - ECVF_ReadOnly); - -static TAutoConsoleVariable CVarNGXDLSSPerfQualitySetting( - TEXT("r.NGX.DLSS.Quality"), - -1, - TEXT("DLSS Performance/Quality setting. Not all modes might be supported at runtime, in this case Balanced mode is used as a fallback\n") - TEXT(" -2: Ultra Performance\n") - TEXT(" -1: Performance (default)\n") - TEXT(" 0: Balanced\n") - TEXT(" 1: Quality\n") - TEXT(" 2: Ultra Quality\n"), - ECVF_RenderThreadSafe); - -static TAutoConsoleVariable CVarNGXDLSSAutoQualitySetting( - TEXT("r.NGX.DLSS.Quality.Auto"), 0, - TEXT("Enable/Disable DLSS automatically selecting the DLSS quality mode based on the render resolution"), - ECVF_RenderThreadSafe); - -static TAutoConsoleVariable CVarNGXDLSSSharpness( - TEXT("r.NGX.DLSS.Sharpness"), - 0.0f, - TEXT("[deprecated] -1.0 to 1.0: Softening/sharpening to apply to the DLSS pass. Negative values soften the image, positive values sharpen. (default: 0.0f)"), - ECVF_RenderThreadSafe); - -static TAutoConsoleVariable CVarNGXDLSSDilateMotionVectors( - TEXT("r.NGX.DLSS.DilateMotionVectors"), - 1, - TEXT(" 0: pass low resolution motion vectors into DLSS\n") - TEXT(" 1: pass dilated high resolution motion vectors into DLSS. This can help with improving image quality of thin details. (default)"), - ECVF_RenderThreadSafe); - -static TAutoConsoleVariable CVarNGXDLSSAutoExposure( - TEXT("r.NGX.DLSS.AutoExposure"), 1, - TEXT("0: Use the engine-computed exposure value for input images to DLSS - in some cases this may reduce artifacts\n") - TEXT("1: Enable DLSS internal auto-exposure instead of the application provided one (default)\n"), - ECVF_RenderThreadSafe); - -static TAutoConsoleVariable CVarNGXDLSSReleaseMemoryOnDelete( - TEXT("r.NGX.DLSS.ReleaseMemoryOnDelete"), - 1, - TEXT("Enabling/disable releasing DLSS related memory on the NGX side when DLSS features get released.(default=1)"), - ECVF_RenderThreadSafe); - - -static TAutoConsoleVariable CVarNGXDLSSFeatureCreationNode( - TEXT("r.NGX.DLSS.FeatureCreationNode"), -1, - TEXT("Determines which GPU the DLSS feature is getting created on\n") - TEXT("-1: Create on the GPU the command list is getting executed on (default)\n") - TEXT(" 0: Create on GPU node 0 \n") - TEXT(" 1: Create on GPU node 1 \n"), - ECVF_RenderThreadSafe); - - -static TAutoConsoleVariable CVarNGXDLSSFeatureVisibilityMask( - TEXT("r.NGX.DLSS.FeatureVisibilityMask"), -1, - TEXT("Determines which GPU the DLSS feature is visible to\n") - TEXT("-1: Visible to the GPU the command list is getting executed on (default)\n") - TEXT(" 1: visible to GPU node 0 \n") - TEXT(" 2: visible to GPU node 1 \n") - TEXT(" 3: visible to GPU node 0 and GPU node 1\n"), - ECVF_RenderThreadSafe); - -DECLARE_GPU_STAT(DLSS) - -static const float kDLSSResolutionFractionError = 0.01f; - -BEGIN_SHADER_PARAMETER_STRUCT(FDLSSShaderParameters, ) - -// Input images -SHADER_PARAMETER_RDG_TEXTURE(Texture2D, SceneColorInput) -SHADER_PARAMETER_RDG_TEXTURE(Texture2D, SceneDepthInput) -SHADER_PARAMETER_RDG_TEXTURE(Texture2D, EyeAdaptation) -SHADER_PARAMETER_RDG_TEXTURE(Texture2D, SceneVelocityInput) - - -// Output images -RDG_TEXTURE_ACCESS(SceneColorOutput, ERHIAccess::UAVCompute) - -END_SHADER_PARAMETER_STRUCT() - -static FDLSSUpscaler* GetGlobalDLSSUpscaler() -{ - IDLSSModuleInterface* DLSSModule = &FModuleManager::LoadModuleChecked("DLSS"); - check(DLSSModule); - - return DLSSModule->GetDLSSUpscaler(); -} - -FIntPoint FDLSSPassParameters::GetOutputExtent() const -{ - check(Validate()); - check(SceneColorInput); - - FIntPoint InputExtent = SceneColorInput->Desc.Extent; - - FIntPoint QuantizedPrimaryUpscaleViewSize; - QuantizeSceneBufferSize(OutputViewRect.Size(), QuantizedPrimaryUpscaleViewSize); - - return FIntPoint( - FMath::Max(InputExtent.X, QuantizedPrimaryUpscaleViewSize.X), - FMath::Max(InputExtent.Y, QuantizedPrimaryUpscaleViewSize.Y)); -} - -bool FDLSSPassParameters::Validate() const -{ - checkf(OutputViewRect.Min == FIntPoint::ZeroValue,TEXT("The DLSS OutputViewRect %dx%d must be non-zero"), OutputViewRect.Min.X, OutputViewRect.Min.Y); - return true; -} - -static NVSDK_NGX_PerfQuality_Value ToNGXQuality(EDLSSQualityMode Quality) -{ - static_assert(int32(EDLSSQualityMode::NumValues) == 5, "dear DLSS plugin NVIDIA developer, please update this code to handle the new EDLSSQualityMode enum values"); - switch (Quality) - { - case EDLSSQualityMode::UltraPerformance: - return NVSDK_NGX_PerfQuality_Value_UltraPerformance; - - default: - checkf(false, TEXT("ToNGXQuality should not be called with an out of range EDLSSQualityMode from the higher level code")); - case EDLSSQualityMode::Performance: - return NVSDK_NGX_PerfQuality_Value_MaxPerf; - - case EDLSSQualityMode::Balanced: - return NVSDK_NGX_PerfQuality_Value_Balanced; - - case EDLSSQualityMode::Quality: - return NVSDK_NGX_PerfQuality_Value_MaxQuality; - - case EDLSSQualityMode::UltraQuality: - return NVSDK_NGX_PerfQuality_Value_UltraQuality; - } -} - -NGXRHI* FDLSSUpscaler::NGXRHIExtensions; -float FDLSSUpscaler::MinDynamicResolutionFraction = TNumericLimits ::Max(); -float FDLSSUpscaler::MaxDynamicResolutionFraction = TNumericLimits ::Min(); -uint32 FDLSSUpscaler::NumRuntimeQualityModes = 0; -TArray FDLSSUpscaler::ResolutionSettings; - -bool FDLSSUpscalerViewExtension::IsActiveThisFrame_Internal(const FSceneViewExtensionContext& Context) const -{ - // Verify this is for a viewport client - if (Context.Viewport == nullptr || !GEngine) - { - return false; - } - - // Do not setup temporal upscaler in automated tests. - const bool bDLSSActiveWithAutomation = !GIsAutomationTesting || (GIsAutomationTesting && (CVarNGXDLSSAutomationTesting.GetValueOnAnyThread() != 0)); - if (!bDLSSActiveWithAutomation) - { - return false; - } - - // Do not setup if not available. - if (!GetGlobalDLSSUpscaler()->IsDLSSActive()) - { - return false; - } - - if (GIsEditor) -#if WITH_EDITOR - { - if (Context.Viewport->IsPlayInEditorViewport()) - { - bool bEnableDLSSInPlayInEditorViewports = false; - if (GetDefault()->EnableDLSSInPlayInEditorViewportsOverride == EDLSSSettingOverride::UseProjectSettings) - { - bEnableDLSSInPlayInEditorViewports = GetDefault()->bEnableDLSSInPlayInEditorViewports; - } - else - { - bEnableDLSSInPlayInEditorViewports = GetDefault()->EnableDLSSInPlayInEditorViewportsOverride == EDLSSSettingOverride::Enabled; - } -#if !NO_LOGGING - static bool bLoggedPIEWarning = false; - if (!bLoggedPIEWarning && GIsPlayInEditorWorld && bEnableDLSSInPlayInEditorViewports) - { - if (FStaticResolutionFractionHeuristic::FUserSettings::EditorOverridePIESettings()) - { - UE_LOG(LogDLSS, Warning, TEXT("r.ScreenPercentage for DLSS quality mode will be ignored because overridden by editor settings (r.Editor.Viewport.OverridePIEScreenPercentage). Change this behavior in Edit -> Editor Preferences -> Performance")); - bLoggedPIEWarning = true; - } - } -#endif - return GIsPlayInEditorWorld && bEnableDLSSInPlayInEditorViewports; - } - else - { - bool bEnableDLSSInEditorViewports = false; - if (GetDefault()->EnableDLSSInEditorViewportsOverride == EDLSSSettingOverride::UseProjectSettings) - { - bEnableDLSSInEditorViewports = GetDefault()->bEnableDLSSInEditorViewports; - } - else - { - bEnableDLSSInEditorViewports = GetDefault()->EnableDLSSInEditorViewportsOverride == EDLSSSettingOverride::Enabled; - } - return bEnableDLSSInEditorViewports; - } - } -#else - { - return false; - } -#endif - else - { - const bool bIsGameViewport = Context.Viewport->GetClient() == GEngine->GameViewport; - return bIsGameViewport; - } -} - -void FDLSSUpscalerViewExtension::BeginRenderViewFamily(FSceneViewFamily& ViewFamily) -{ - if (ViewFamily.ViewMode != EViewModeIndex::VMI_Lit || - ViewFamily.Scene == nullptr || - ViewFamily.Scene->GetShadingPath() != EShadingPath::Deferred || - !ViewFamily.bRealtimeUpdate) - { - return; - } - - // Early returns if none of the view have a view state. - for (const FSceneView* View : ViewFamily.Views) - { - if (View->State == nullptr) - { - return; - } - } - - // Early returns if AA is disabled. - if (!ViewFamily.EngineShowFlags.AntiAliasing) - { - return; - } - - if (!ViewFamily.GetTemporalUpscalerInterface()) - { - GetGlobalDLSSUpscaler()->SetupViewFamily(ViewFamily); - } - else - { - UE_LOG(LogDLSS, Error, TEXT("Another plugin already set FSceneViewFamily::SetTemporalUpscalerInterface()")); - return; - } -} - -bool FDLSSUpscaler::IsDLAAMode() -{ - return CVarNGXDLAAEnable.GetValueOnAnyThread(); -} - -FDLSSUpscaler::FDLSSUpscaler(NGXRHI* InNGXRHIExtensions): PreviousResolutionFraction(-1.0f) -{ - UE_LOG(LogDLSS, VeryVerbose, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - - - checkf(!NGXRHIExtensions, TEXT("static member NGXRHIExtensions should only be assigned once by this ctor when called during module startup") ); - NGXRHIExtensions = InNGXRHIExtensions; - - ResolutionSettings.Init(FDLSSOptimalSettings(), int32(EDLSSQualityMode::NumValues)); - - static_assert(int32(EDLSSQualityMode::NumValues) == 5, "dear DLSS plugin NVIDIA developer, please update this code to handle the new EDLSSQualityMode enum values"); - for (auto QualityMode : { EDLSSQualityMode::UltraPerformance, EDLSSQualityMode::Performance , EDLSSQualityMode::Balanced, EDLSSQualityMode::Quality, EDLSSQualityMode::UltraQuality }) - { - check(ToNGXQuality(QualityMode) < ResolutionSettings.Num()); - check(ToNGXQuality(QualityMode) >= 0); - - FDLSSOptimalSettings OptimalSettings = NGXRHIExtensions->GetDLSSOptimalSettings(ToNGXQuality(QualityMode)); - - ResolutionSettings[ToNGXQuality(QualityMode)] = OptimalSettings; - - // we only consider non-fixed resolutions for the overall min / max resolution fraction - if (OptimalSettings.bIsSupported && !OptimalSettings.IsFixedResolution()) - { - MinDynamicResolutionFraction = FMath::Min(MinDynamicResolutionFraction, OptimalSettings.MinResolutionFraction); - MaxDynamicResolutionFraction = FMath::Max(MaxDynamicResolutionFraction, OptimalSettings.MaxResolutionFraction); - ++NumRuntimeQualityModes; - } - - UE_LOG(LogDLSS, Log, TEXT("QualityMode %d: bSupported = %u, ResolutionFraction = %.4f. MinResolutionFraction=%.4f, MaxResolutionFraction %.4f"), - QualityMode, OptimalSettings.bIsSupported, OptimalSettings.OptimalResolutionFraction, OptimalSettings.MinResolutionFraction, OptimalSettings.MaxResolutionFraction); - } - - // the DLSS module will report DLSS as not supported if there are no supported quality modes at runtime - UE_LOG(LogDLSS, Log, TEXT("NumRuntimeQualityModes=%u, MinDynamicResolutionFraction=%.4f, MaxDynamicResolutionFraction=%.4f"), NumRuntimeQualityModes, MinDynamicResolutionFraction, MaxDynamicResolutionFraction); - - // Higher levels of the code (e.g. UI) should check whether each mode is actually supported - // But for now verify early that the DLSS 2.0 modes are supported. Those checks could be removed in the future - check(IsQualityModeSupported(EDLSSQualityMode::Performance)); - check(IsQualityModeSupported(EDLSSQualityMode::Balanced)); - check(IsQualityModeSupported(EDLSSQualityMode::Quality)); - - - UE_LOG(LogDLSS, VeryVerbose, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - -// this gets explicitly called during module shutdown -void FDLSSUpscaler::ReleaseStaticResources() -{ - UE_LOG(LogDLSS, VeryVerbose, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - ResolutionSettings.Empty(); - UE_LOG(LogDLSS, VeryVerbose, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - -static const TCHAR* const GDLSSSceneViewFamilyUpscalerDebugName = TEXT("FDLSSSceneViewFamilyUpscaler"); - -const TCHAR* FDLSSSceneViewFamilyUpscaler::GetDebugName() const -{ - return GDLSSSceneViewFamilyUpscalerDebugName; -} - -// static -bool FDLSSSceneViewFamilyUpscaler::IsDLSSTemporalUpscaler(const ITemporalUpscaler* TemporalUpscaler) -{ - return TemporalUpscaler != nullptr && TemporalUpscaler->GetDebugName() == GDLSSSceneViewFamilyUpscalerDebugName; -} - -float FDLSSSceneViewFamilyUpscaler::GetMinUpsampleResolutionFraction() const -{ - return Upscaler->GetMinResolutionFractionForQuality(DLSSQualityMode); -} - -float FDLSSSceneViewFamilyUpscaler::GetMaxUpsampleResolutionFraction() const -{ - return Upscaler->GetMaxResolutionFractionForQuality(DLSSQualityMode); -} - -ITemporalUpscaler* FDLSSSceneViewFamilyUpscaler::Fork_GameThread(const class FSceneViewFamily& ViewFamily) const -{ - return new FDLSSSceneViewFamilyUpscaler(Upscaler, DLSSQualityMode); -} - -ITemporalUpscaler::FOutputs FDLSSSceneViewFamilyUpscaler::AddPasses( - FRDGBuilder& GraphBuilder, - const FViewInfo& View, - const FPassInputs& PassInputs -) const -{ - checkf(View.PrimaryScreenPercentageMethod == EPrimaryScreenPercentageMethod::TemporalUpscale, TEXT("DLSS requires TemporalUpscale. If you hit this assert, please set r.TemporalAA.Upscale=1")); - - const FTemporalAAHistory& InputHistory = View.PrevViewInfo.TemporalAAHistory; - const TRefCountPtr InputCustomHistory = View.PrevViewInfo.CustomTemporalAAHistory; - - FTemporalAAHistory* OutputHistory = View.ViewState ? &(View.ViewState->PrevFrameViewInfo.TemporalAAHistory) : nullptr; - TRefCountPtr < ICustomTemporalAAHistory >* OutputCustomHistory = View.ViewState ? &(View.ViewState->PrevFrameViewInfo.CustomTemporalAAHistory) : nullptr; - - - FDLSSPassParameters DLSSParameters(View); - const FIntRect SecondaryViewRect = DLSSParameters.OutputViewRect; - ITemporalUpscaler::FOutputs Outputs; - { - RDG_GPU_STAT_SCOPE(GraphBuilder, DLSS); - RDG_EVENT_SCOPE(GraphBuilder, "DLSS"); - - const bool bDilateMotionVectors = CVarNGXDLSSDilateMotionVectors.GetValueOnRenderThread() != 0; - - FRDGTextureRef CombinedVelocityTexture = AddVelocityCombinePass(GraphBuilder, View, PassInputs.SceneDepthTexture, PassInputs.SceneVelocityTexture, bDilateMotionVectors); - - DLSSParameters.SceneColorInput = PassInputs.SceneColorTexture; - DLSSParameters.SceneVelocityInput = CombinedVelocityTexture; - DLSSParameters.SceneDepthInput = PassInputs.SceneDepthTexture; - DLSSParameters.bHighResolutionMotionVectors = bDilateMotionVectors; - const FDLSSOutputs DLSSOutputs = AddDLSSPass( - GraphBuilder, - View, - DLSSParameters, - InputHistory, - OutputHistory, - InputCustomHistory, - OutputCustomHistory - ); - - Outputs.FullRes.Texture = DLSSOutputs.SceneColor; - Outputs.FullRes.ViewRect = SecondaryViewRect; - } - return Outputs; -} - -FDLSSOutputs FDLSSSceneViewFamilyUpscaler::AddDLSSPass( - FRDGBuilder& GraphBuilder, - const FViewInfo& View, - const FDLSSPassParameters& Inputs, - const FTemporalAAHistory& InputHistory, - FTemporalAAHistory* OutputHistory, - const TRefCountPtr InputCustomHistoryInterface, - TRefCountPtr* OutputCustomHistoryInterface -) const -{ - check(IsInRenderingThread()); - check(Upscaler->IsDLSSActive()); - const FDLSSUpscalerHistory* InputCustomHistory = static_cast(InputCustomHistoryInterface.GetReference()); - - const bool bCameraCut = !InputHistory.IsValid() || View.bCameraCut || !OutputHistory; - const FIntPoint OutputExtent = Inputs.GetOutputExtent(); - - const FIntRect SrcRect = Inputs.InputViewRect; - const FIntRect DestRect = Inputs.OutputViewRect; - - const float ScaleX = float(SrcRect.Width()) / float(DestRect.Width()); - const float ScaleY = float(SrcRect.Height()) / float(DestRect.Height()); - - // FDLSSUpscaler::SetupMainGameViewFamily or FDLSSUpscalerEditor::SetupEditorViewFamily - // set DLSSQualityMode by setting an FDLSSUpscaler on the ViewFamily (from the pool in DLSSUpscalerInstancesPerViewFamily) - - checkf(DLSSQualityMode != EDLSSQualityMode::NumValues, TEXT("Invalid Quality mode, not initialized")); - checkf(Upscaler->IsQualityModeSupported(DLSSQualityMode), TEXT("%u is not a valid Quality mode"), DLSSQualityMode); - - // This assert can accidentally hit with small viewrect dimensions (e.g. when resizing an editor view) due to floating point rounding & quantization issues - // e.g. with 33% screen percentage at 1000 DestRect dimension we get 333/1000 = 0.33 but at 10 DestRect dimension we get 3/10 0.3, thus the assert hits - checkf(DestRect.Width() < 100 || GetMinUpsampleResolutionFraction() - kDLSSResolutionFractionError <= ScaleX && ScaleX <= GetMaxUpsampleResolutionFraction() + kDLSSResolutionFractionError, - TEXT("The current resolution fraction %f is out of the supported DLSS range [%f ... %f] for quality mode %d."), - ScaleX, GetMinUpsampleResolutionFraction(), GetMaxUpsampleResolutionFraction(), DLSSQualityMode); - checkf(DestRect.Height() < 100 || GetMinUpsampleResolutionFraction() - kDLSSResolutionFractionError <= ScaleY && ScaleY <= GetMaxUpsampleResolutionFraction() + kDLSSResolutionFractionError, - TEXT("The current resolution fraction %f is out of the supported DLSS range [%f ... %f] for quality mode %d."), - ScaleY, GetMinUpsampleResolutionFraction(), GetMaxUpsampleResolutionFraction(), DLSSQualityMode); - - const TCHAR* PassName = TEXT("MainUpsampling"); - - // Create outputs - FDLSSOutputs Outputs; - { - FRDGTextureDesc SceneColorDesc = FRDGTextureDesc::Create2D( - OutputExtent, - PF_FloatRGBA, - FClearValueBinding::Black, - TexCreate_ShaderResource | TexCreate_UAV); - - const TCHAR* OutputName = TEXT("DLSSOutputSceneColor"); - - Outputs.SceneColor = GraphBuilder.CreateTexture( - SceneColorDesc, - OutputName); - } - - FDLSSStateRef DLSSState = (InputCustomHistory && InputCustomHistory->DLSSState) ? InputCustomHistory->DLSSState : MakeShared(); - { - FDLSSShaderParameters* PassParameters = GraphBuilder.AllocParameters(); - - // Set up common shader parameters - const FIntPoint InputExtent = Inputs.SceneColorInput->Desc.Extent; - const FIntRect InputViewRect = Inputs.InputViewRect; - const FIntRect OutputViewRect = Inputs.OutputViewRect; - - // Input buffer shader parameters - { - PassParameters->SceneColorInput = Inputs.SceneColorInput; - PassParameters->SceneDepthInput = Inputs.SceneDepthInput; - PassParameters->SceneVelocityInput = Inputs.SceneVelocityInput; - PassParameters->EyeAdaptation = GetEyeAdaptationTexture(GraphBuilder, View); - } - - // Outputs - { - PassParameters->SceneColorOutput = Outputs.SceneColor; - } - - const FVector2D JitterOffset = View.TemporalJitterPixels; - const float DeltaWorldTime = View.Family->Time.GetDeltaWorldTimeSeconds(); - - const float PreExposure = View.PreExposure; - const bool bUseAutoExposure = CVarNGXDLSSAutoExposure.GetValueOnRenderThread() != 0; - const bool bReleaseMemoryOnDelete = CVarNGXDLSSReleaseMemoryOnDelete.GetValueOnRenderThread() != 0; - - const float Sharpness = FMath::Clamp(CVarNGXDLSSSharpness.GetValueOnRenderThread(), -1.0f, 1.0f); -#if !NO_LOGGING - static bool bLoggedSharpnessWarning = false; - if (Sharpness != 0.0f && !bLoggedSharpnessWarning) - { - UE_LOG(LogDLSS, Warning, TEXT("DLSS sharpening is deprecated, recommend using the NIS plugin for sharpening instead")); - bLoggedSharpnessWarning = true; - } -#endif - NGXRHI* LocalNGXRHIExtensions = Upscaler->NGXRHIExtensions; - const int32 NGXPerfQuality = ToNGXQuality(DLSSQualityMode); - GraphBuilder.AddPass( - RDG_EVENT_NAME("DLSS %s%s %dx%d -> %dx%d", - PassName, - Sharpness != 0.0f ? TEXT(" Sharpen") : TEXT(""), - SrcRect.Width(), SrcRect.Height(), - DestRect.Width(), DestRect.Height()), - PassParameters, - ERDGPassFlags::Compute | ERDGPassFlags::Raster | ERDGPassFlags::SkipRenderPass, - // FRHICommandListImmediate forces it to run on render thread, FRHICommandList doesn't - [LocalNGXRHIExtensions, PassParameters, Inputs, bCameraCut, JitterOffset, DeltaWorldTime, PreExposure, Sharpness, NGXPerfQuality, DLSSState, bUseAutoExposure, bReleaseMemoryOnDelete](FRHICommandListImmediate& RHICmdList) - { - FRHIDLSSArguments DLSSArguments; - FMemory::Memzero(&DLSSArguments, sizeof(DLSSArguments)); - - // input parameters - DLSSArguments.SrcRect = Inputs.InputViewRect; - DLSSArguments.DestRect = Inputs.OutputViewRect; - - DLSSArguments.Sharpness = Sharpness; - DLSSArguments.bReset = bCameraCut; - - DLSSArguments.JitterOffset = FVector2f(JitterOffset); // LWC_TODO: Precision loss - DLSSArguments.MotionVectorScale = FVector2f::UnitVector; - - DLSSArguments.bHighResolutionMotionVectors = Inputs.bHighResolutionMotionVectors; - DLSSArguments.DeltaTime = DeltaWorldTime; - DLSSArguments.bReleaseMemoryOnDelete = bReleaseMemoryOnDelete; - - DLSSArguments.PerfQuality = NGXPerfQuality; - - check(PassParameters->SceneColorInput); - PassParameters->SceneColorInput->MarkResourceAsUsed(); - DLSSArguments.InputColor = PassParameters->SceneColorInput->GetRHI(); - - - check(PassParameters->SceneVelocityInput); - PassParameters->SceneVelocityInput->MarkResourceAsUsed(); - DLSSArguments.InputMotionVectors = PassParameters->SceneVelocityInput->GetRHI(); - - check(PassParameters->SceneDepthInput); - PassParameters->SceneDepthInput->MarkResourceAsUsed(); - DLSSArguments.InputDepth = PassParameters->SceneDepthInput->GetRHI(); - - check(PassParameters->EyeAdaptation); - PassParameters->EyeAdaptation->MarkResourceAsUsed(); - DLSSArguments.InputExposure = PassParameters->EyeAdaptation->GetRHI(); - DLSSArguments.PreExposure = PreExposure; - DLSSArguments.bUseAutoExposure = bUseAutoExposure; - - // output images - check(PassParameters->SceneColorOutput); - PassParameters->SceneColorOutput->MarkResourceAsUsed(); - DLSSArguments.OutputColor = PassParameters->SceneColorOutput->GetRHI(); - - RHICmdList.Transition(FRHITransitionInfo(DLSSArguments.OutputColor, ERHIAccess::Unknown, ERHIAccess::UAVMask)); - RHICmdList.EnqueueLambda( - [LocalNGXRHIExtensions, DLSSArguments, DLSSState](FRHICommandListImmediate& Cmd) mutable - { - const uint32 FeatureCreationNode = CVarNGXDLSSFeatureCreationNode.GetValueOnRenderThread(); - const uint32 FeatureVisibilityMask = CVarNGXDLSSFeatureVisibilityMask.GetValueOnRenderThread(); - - DLSSArguments.GPUNode = FeatureCreationNode == -1 ? Cmd.GetGPUMask().ToIndex() : FMath::Clamp(FeatureCreationNode, 0u, GNumExplicitGPUsForRendering - 1); - DLSSArguments.GPUVisibility = FeatureVisibilityMask == -1 ? Cmd.GetGPUMask().GetNative() : (Cmd.GetGPUMask().All().GetNative() & FeatureVisibilityMask) ; - - LocalNGXRHIExtensions->ExecuteDLSS(Cmd, DLSSArguments, DLSSState); - }); - }); - } - - if (!View.bStatePrevViewInfoIsReadOnly && OutputHistory) - { - OutputHistory->SafeRelease(); - - GraphBuilder.QueueTextureExtraction(Outputs.SceneColor, &OutputHistory->RT[0]); - - OutputHistory->ViewportRect = DestRect; - OutputHistory->ReferenceBufferSize = OutputExtent; - } - - - if (!View.bStatePrevViewInfoIsReadOnly && OutputCustomHistoryInterface) - { - if (!OutputCustomHistoryInterface->GetReference()) - { - (*OutputCustomHistoryInterface) = new FDLSSUpscalerHistory(DLSSState); - } - } - return Outputs; -} - -void FDLSSUpscaler::Tick(FRHICommandListImmediate& RHICmdList) -{ - check(NGXRHIExtensions); - check(IsInRenderingThread()); - // Pass it over to the RHI thread which handles the lifetime of the NGX DLSS resources - RHICmdList.EnqueueLambda( - [this](FRHICommandListImmediate& Cmd) - { - NGXRHIExtensions->TickPoolElements(); - }); -} - -bool FDLSSUpscaler::IsQualityModeSupported(EDLSSQualityMode InQualityMode) const -{ - return ResolutionSettings[ToNGXQuality(InQualityMode)].bIsSupported; -} - -bool FDLSSUpscaler::IsDLSSActive() const -{ - static const auto CVarTemporalAAUpscaler = IConsoleManager::Get().FindConsoleVariable(TEXT("r.TemporalAA.Upscaler")); - static const IDLSSModuleInterface* DLSSModule = &FModuleManager::LoadModuleChecked(TEXT("DLSS")); - check(DLSSModule); - check(CVarTemporalAAUpscaler); - const bool bDLSSActive = - DLSSModule->QueryDLSSSupport() == EDLSSSupport::Supported && - CVarTemporalAAUpscaler && (CVarTemporalAAUpscaler->GetInt() != 0) && - ((CVarNGXDLSSEnable.GetValueOnAnyThread() != 0) || CVarNGXDLAAEnable.GetValueOnAnyThread()); - return bDLSSActive; -} - - -void FDLSSUpscaler::SetupViewFamily(FSceneViewFamily& ViewFamily) -{ - const ISceneViewFamilyScreenPercentage* ScreenPercentageInterface = ViewFamily.GetScreenPercentageInterface(); - float DesiredResolutionFraction = ScreenPercentageInterface->GetResolutionFractionsUpperBound()[GDynamicPrimaryResolutionFraction]; - - TOptional SelectedDLSSQualityMode; - - static_assert(int32(EDLSSQualityMode::NumValues) == 5, "dear DLSS plugin NVIDIA developer, please update this code to handle the new EDLSSQualityMode enum values"); - for (EDLSSQualityMode DLSSQualityMode : { EDLSSQualityMode::UltraPerformance, EDLSSQualityMode::Performance , EDLSSQualityMode::Balanced, EDLSSQualityMode::Quality, EDLSSQualityMode::UltraQuality }) - { - bool bIsSupported = FDLSSUpscaler::IsQualityModeSupported(DLSSQualityMode); - if (!bIsSupported) - { - continue; - } - - float MinResolutionFraction = FDLSSUpscaler::GetMinResolutionFractionForQuality(DLSSQualityMode); - float MaxResolutionFraction = FDLSSUpscaler::GetMaxResolutionFractionForQuality(DLSSQualityMode); - float TargetResolutionFraction = FDLSSUpscaler::GetOptimalResolutionFractionForQuality(DLSSQualityMode); - - bool bIsCompatible = DesiredResolutionFraction <= 1.0 && - DesiredResolutionFraction >= (MinResolutionFraction - kDLSSResolutionFractionError) && - DesiredResolutionFraction <= (MaxResolutionFraction + kDLSSResolutionFractionError); - bool bIsClosestYet = false; - if (SelectedDLSSQualityMode.IsSet()) - { - float SelectedTargetResolutionFraction = FDLSSUpscaler::GetOptimalResolutionFractionForQuality(SelectedDLSSQualityMode.GetValue()); - bIsClosestYet = FMath::Abs(TargetResolutionFraction - DesiredResolutionFraction) < FMath::Abs(SelectedTargetResolutionFraction - DesiredResolutionFraction); - } - else if (bIsCompatible) - { - bIsClosestYet = true; - } - - if (bIsCompatible && bIsClosestYet) - { - SelectedDLSSQualityMode = DLSSQualityMode; - } - } - - if (SelectedDLSSQualityMode.IsSet()) - { - ViewFamily.SetTemporalUpscalerInterface(new FDLSSSceneViewFamilyUpscaler(this, SelectedDLSSQualityMode.GetValue())); - } - else if (DesiredResolutionFraction != PreviousResolutionFraction) - { - UE_LOG(LogDLSS, Warning, TEXT("Could not setup DLSS upscaler for screen percentage = %f"), DesiredResolutionFraction * 100.0f); - } - PreviousResolutionFraction = DesiredResolutionFraction; -} - -TOptional FDLSSUpscaler::GetAutoQualityModeFromPixels(int PixelCount) const -{ - if (PixelCount >= 8'300'000 && IsQualityModeSupported(EDLSSQualityMode::UltraPerformance)) - { - return EDLSSQualityMode::UltraPerformance; - } - else if (PixelCount >= 3'690'000 && IsQualityModeSupported(EDLSSQualityMode::Performance)) - { - return EDLSSQualityMode::Performance; - } - else if (PixelCount >= 2'030'000 && IsQualityModeSupported(EDLSSQualityMode::Quality)) - { - return EDLSSQualityMode::Quality; - } - - return TOptional {}; -} - - -bool FDLSSUpscaler::EnableDLSSInPlayInEditorViewports() const -{ - if (GetDefault()->EnableDLSSInPlayInEditorViewportsOverride == EDLSSSettingOverride::UseProjectSettings) - { - return GetDefault()->bEnableDLSSInPlayInEditorViewports; - } - else - { - return GetDefault()->EnableDLSSInPlayInEditorViewportsOverride == EDLSSSettingOverride::Enabled; - } -} - -float FDLSSUpscaler::GetOptimalResolutionFractionForQuality(EDLSSQualityMode Quality) const -{ - checkf(IsQualityModeSupported(Quality),TEXT("%u is not a valid Quality mode"), Quality); - return ResolutionSettings[ToNGXQuality(Quality)].OptimalResolutionFraction; -} - -float FDLSSUpscaler::GetOptimalSharpnessForQuality(EDLSSQualityMode Quality) const -{ - checkf(IsQualityModeSupported(Quality), TEXT("%u is not a valid Quality mode"), Quality); - return ResolutionSettings[ToNGXQuality(Quality)].Sharpness; -} - -float FDLSSUpscaler::GetMinResolutionFractionForQuality(EDLSSQualityMode Quality) const -{ - checkf(IsQualityModeSupported(Quality), TEXT("%u is not a valid Quality mode"), Quality); - return ResolutionSettings[ToNGXQuality(Quality)].MinResolutionFraction; -} - -float FDLSSUpscaler::GetMaxResolutionFractionForQuality(EDLSSQualityMode Quality) const -{ - checkf(IsQualityModeSupported(Quality), TEXT("%u is not a valid Quality mode"), Quality); - return ResolutionSettings[ToNGXQuality(Quality)].MaxResolutionFraction; -} - -bool FDLSSUpscaler::IsFixedResolutionFraction(EDLSSQualityMode Quality) const -{ - checkf(IsQualityModeSupported(Quality), TEXT("%u is not a valid Quality mode"), Quality); - return ResolutionSettings[ToNGXQuality(Quality)].IsFixedResolution(); -} - -#undef LOCTEXT_NAMESPACE diff --git a/plugins/DLSS/Source/DLSS/Private/DLSSUpscaler.h b/plugins/DLSS/Source/DLSS/Private/DLSSUpscaler.h deleted file mode 100644 index f3cbc9a9..00000000 --- a/plugins/DLSS/Source/DLSS/Private/DLSSUpscaler.h +++ /dev/null @@ -1,186 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#pragma once - -#include "CoreMinimal.h" -#include "SceneViewExtension.h" -#include "RendererInterface.h" -#include "PostProcess/TemporalAA.h" -#include "ScreenPass.h" -#include "NGXRHI.h" - -#include "CustomResourcePool.h" - -class FSceneTextureParameters; - -struct FTemporalAAHistory; - -class FRHITexture; -class NGXRHI; -struct FDLSSOptimalSettings; -class FDLSSUpscaler; - -struct FDLSSPassParameters -{ - FIntRect InputViewRect; - FIntRect OutputViewRect; - bool bHighResolutionMotionVectors = false; - - FRDGTexture* SceneColorInput = nullptr; - FRDGTexture* SceneVelocityInput = nullptr; - FRDGTexture* SceneDepthInput = nullptr; - - FDLSSPassParameters(const FViewInfo& View) - : InputViewRect(View.ViewRect) - , OutputViewRect(FIntPoint::ZeroValue, View.GetSecondaryViewRectSize()) - { - } - - /** Returns the texture resolution that will be output. */ - FIntPoint GetOutputExtent() const; - - /** Validate the settings of TAA, to make sure there is no issue. */ - bool Validate() const; -}; - -struct FDLSSOutputs -{ - FRDGTexture* SceneColor = nullptr; -}; - -enum class EDLSSQualityMode -{ - MinValue = -2, - UltraPerformance = -2, - Performance = -1, - Balanced = 0, - Quality = 1, - UltraQuality = 2, - MaxValue = UltraQuality, - NumValues = 5 -}; - -class DLSS_API FDLSSUpscalerViewExtension final : public FSceneViewExtensionBase -{ -public: - FDLSSUpscalerViewExtension(const FAutoRegister& AutoRegister) : FSceneViewExtensionBase(AutoRegister) - { } - - virtual void SetupViewFamily(FSceneViewFamily& InViewFamily) override {} - virtual void SetupView(FSceneViewFamily& InViewFamily, FSceneView& InView) override {} - virtual void BeginRenderViewFamily(FSceneViewFamily& InViewFamily) override; - virtual void PreRenderView_RenderThread(FRDGBuilder& GraphBuilder, FSceneView& InView) final override {} - virtual void PreRenderViewFamily_RenderThread(FRDGBuilder& GraphBuilder, FSceneViewFamily& InViewFamily) final override {} - virtual bool IsActiveThisFrame_Internal(const FSceneViewExtensionContext& Context) const override; -}; - -class DLSS_API FDLSSSceneViewFamilyUpscaler final : public ITemporalUpscaler -{ -public: - FDLSSSceneViewFamilyUpscaler(const FDLSSUpscaler* InUpscaler, EDLSSQualityMode InDLSSQualityMode) - : Upscaler(InUpscaler) - , DLSSQualityMode(InDLSSQualityMode) - { } - - virtual const TCHAR* GetDebugName() const final override; - virtual float GetMinUpsampleResolutionFraction() const final override; - virtual float GetMaxUpsampleResolutionFraction() const final override; - virtual ITemporalUpscaler* Fork_GameThread(const class FSceneViewFamily& ViewFamily) const final override; - virtual ITemporalUpscaler::FOutputs AddPasses( - FRDGBuilder& GraphBuilder, - const FViewInfo& View, - const FPassInputs& PassInputs) const final override; - - static bool IsDLSSTemporalUpscaler(const ITemporalUpscaler* TemporalUpscaler); - -private: - const FDLSSUpscaler* Upscaler; - const EDLSSQualityMode DLSSQualityMode; - - FDLSSOutputs AddDLSSPass( - FRDGBuilder& GraphBuilder, - const FViewInfo& View, - const FDLSSPassParameters& Inputs, - const FTemporalAAHistory& InputHistory, - FTemporalAAHistory* OutputHistory, - const TRefCountPtr InputCustomHistoryInterface, - TRefCountPtr* OutputCustomHistoryInterface - ) const; -}; - -class DLSS_API FDLSSUpscaler final : public ICustomResourcePool -{ - - friend class FDLSSModule; -public: - - void SetupViewFamily(FSceneViewFamily& ViewFamily); - - float GetOptimalResolutionFractionForQuality(EDLSSQualityMode Quality) const; - float GetOptimalSharpnessForQuality(EDLSSQualityMode Quality) const; - float GetMinResolutionFractionForQuality(EDLSSQualityMode Quality) const; - float GetMaxResolutionFractionForQuality(EDLSSQualityMode Quality) const; - bool IsFixedResolutionFraction(EDLSSQualityMode Quality) const; - - const NGXRHI* GetNGXRHI() const - { - return NGXRHIExtensions; - } - - // Inherited via ICustomResourcePool - virtual void Tick(FRHICommandListImmediate& RHICmdList) override; - - bool IsQualityModeSupported(EDLSSQualityMode InQualityMode) const; - uint32 GetNumRuntimeQualityModes() const - { - return NumRuntimeQualityModes; - } - - bool IsDLSSActive() const; - - static bool IsDLAAMode(); - - // Give the suggested EDLSSQualityMode if one is appropriate for the given pixel count, or nothing if DLSS should be disabled - TOptional GetAutoQualityModeFromPixels(int PixelCount) const; - - static void ReleaseStaticResources(); - - static float GetMinUpsampleResolutionFraction() - { - return MinDynamicResolutionFraction; - } - - static float GetMaxUpsampleResolutionFraction() - { - return MaxDynamicResolutionFraction; - } - -private: - FDLSSUpscaler(NGXRHI* InNGXRHIExtensions); - FDLSSUpscaler(const FDLSSUpscaler&) = default; - - - bool EnableDLSSInPlayInEditorViewports() const; - - // The FDLSSUpscaler(NGXRHI*) will update those once - static NGXRHI* NGXRHIExtensions; - static float MinDynamicResolutionFraction; - static float MaxDynamicResolutionFraction; - - static uint32 NumRuntimeQualityModes; - static TArray ResolutionSettings; - float PreviousResolutionFraction; - - friend class FDLSSUpscalerViewExtension; - friend class FDLSSSceneViewFamilyUpscaler; -}; - diff --git a/plugins/DLSS/Source/DLSS/Private/DLSSUpscalerHistory.cpp b/plugins/DLSS/Source/DLSS/Private/DLSSUpscalerHistory.cpp deleted file mode 100644 index d3f4826c..00000000 --- a/plugins/DLSS/Source/DLSS/Private/DLSSUpscalerHistory.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#include "DLSSUpscalerHistory.h" -#include "DLSSUpscalerPrivate.h" -#include "NGXRHI.h" - - -#include "PostProcess/SceneRenderTargets.h" -#include "PostProcess/PostProcessing.h" - - - -#define LOCTEXT_NAMESPACE "FDLSSModule" - - -FDLSSUpscalerHistory::FDLSSUpscalerHistory(FDLSSStateRef InDLSSState) - : DLSSState(InDLSSState) -{ -} - -FDLSSUpscalerHistory::~FDLSSUpscalerHistory() -{ -} - - -#undef LOCTEXT_NAMESPACE \ No newline at end of file diff --git a/plugins/DLSS/Source/DLSS/Private/DLSSUpscalerHistory.h b/plugins/DLSS/Source/DLSS/Private/DLSSUpscalerHistory.h deleted file mode 100644 index e4d6d977..00000000 --- a/plugins/DLSS/Source/DLSS/Private/DLSSUpscalerHistory.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#pragma once - -#include "CoreMinimal.h" -#include "SceneRendering.h" -#include "NGXRHI.h" - -class DLSS_API FDLSSUpscalerHistory final : public ICustomTemporalAAHistory, public FRefCountBase -{ - friend class FDLSSSceneViewFamilyUpscaler; - - FDLSSStateRef DLSSState; - - - - virtual uint32 AddRef() const final - { - return FRefCountBase::AddRef(); - } - - virtual uint32 Release() const final - { - return FRefCountBase::Release(); - } - - virtual uint32 GetRefCount() const final - { - return FRefCountBase::GetRefCount(); - } - - FDLSSUpscalerHistory(FDLSSStateRef InDLSSState); - ~FDLSSUpscalerHistory(); - -}; diff --git a/plugins/DLSS/Source/DLSS/Private/DLSSUpscalerPrivate.h b/plugins/DLSS/Source/DLSS/Private/DLSSUpscalerPrivate.h deleted file mode 100644 index 20971272..00000000 --- a/plugins/DLSS/Source/DLSS/Private/DLSSUpscalerPrivate.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#pragma once - -#include "CoreMinimal.h" - -DECLARE_LOG_CATEGORY_EXTERN(LogDLSS, Verbose, All); - diff --git a/plugins/DLSS/Source/DLSS/Public/DLSS.h b/plugins/DLSS/Source/DLSS/Public/DLSS.h deleted file mode 100644 index e414e31d..00000000 --- a/plugins/DLSS/Source/DLSS/Public/DLSS.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#pragma once - -#include "Modules/ModuleManager.h" - -class FDLSSUpscaler; -class FDLSSDenoiser; -class ISceneViewExtension; -class FDLSSUpscalerViewExtension; -class FNGXAutomationViewExtension; -class NGXRHI; - - -enum class EDLSSSupport : uint8 -{ - Supported, - NotSupported, - NotSupportedIncompatibleHardware, - NotSupportedDriverOutOfDate, - NotSupportedOperatingSystemOutOfDate, - NotSupportedIncompatibleAPICaptureToolActive, -}; - - -class IDLSSModuleInterface : public IModuleInterface -{ - public: - virtual EDLSSSupport QueryDLSSSupport() const = 0; - virtual void GetDLSSMinDriverVersion(int32& MajorVersion, int32& MinorVersion) const = 0; - virtual float GetResolutionFractionForQuality(int32 Quality) const = 0; - virtual FDLSSUpscaler* GetDLSSUpscaler() const = 0; - virtual TSharedPtr< ISceneViewExtension, ESPMode::ThreadSafe> GetDLSSUpscalerViewExtension() const = 0; -}; - -class FDLSSModule final: public IDLSSModuleInterface -{ -public: - - /** IModuleInterface implementation */ - virtual void StartupModule(); - virtual void ShutdownModule(); - - // Inherited via IDLSSModuleInterface - virtual EDLSSSupport QueryDLSSSupport() const; - virtual void GetDLSSMinDriverVersion(int32& MajorVersion, int32& MinorVersion) const; - virtual float GetResolutionFractionForQuality(int32 Quality) const; - virtual FDLSSUpscaler* GetDLSSUpscaler() const; - - virtual TSharedPtr< ISceneViewExtension, ESPMode::ThreadSafe> GetDLSSUpscalerViewExtension() const; - -private: - - TUniquePtr DLSSUpscaler; - TUniquePtr DLSSDenoiser; - TUniquePtr NGXRHIExtensions; - TSharedPtr< FDLSSUpscalerViewExtension, ESPMode::ThreadSafe> DLSSUpscalerViewExtension; - TSharedPtr< FNGXAutomationViewExtension, ESPMode::ThreadSafe> NGXAutomationViewExtension; - EDLSSSupport DLSSSupport = EDLSSSupport::NotSupported; - int32 MinDriverVersionMinor; - int32 MinDriverVersionMajor; -}; diff --git a/plugins/DLSS/Source/DLSS/Public/DLSSSettings.h b/plugins/DLSS/Source/DLSS/Public/DLSSSettings.h deleted file mode 100644 index 2cb51881..00000000 --- a/plugins/DLSS/Source/DLSS/Public/DLSSSettings.h +++ /dev/null @@ -1,103 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ -#pragma once - -#include "UObject/ObjectMacros.h" -#include "UObject/Object.h" -#include "Engine/DeveloperSettings.h" -#include "SceneView.h" - -#include "DLSSSettings.generated.h" - -UENUM() -enum class EDLSSSettingOverride : uint8 -{ - Enabled UMETA(DisplayName = "True"), - Disabled UMETA(DisplayName = "False"), - UseProjectSettings UMETA(DisplayName = "Use project settings"), -}; - -UCLASS(Config = Engine, ProjectUserConfig) -class DLSS_API UDLSSOverrideSettings : public UObject -{ -public: - - GENERATED_BODY() - - /** This enables DLSS/DLAA in editor viewports. Saved to local user config only.*/ - UPROPERTY(Config, EditAnywhere, Category = "Level Editor - Viewport (Local)", DisplayName = "Enable DLSS/DLAA to be turned on in Editor viewports") - EDLSSSettingOverride EnableDLSSInEditorViewportsOverride = EDLSSSettingOverride::UseProjectSettings; - - /** This enables DLSS/DLAA in play in editor viewports. Saved to local user config only. */ - UPROPERTY(Config, EditAnywhere, Category = "Level Editor - Viewport (Local)", DisplayName = "Enable DLSS/DLAA in Play In Editor viewports") - EDLSSSettingOverride EnableDLSSInPlayInEditorViewportsOverride = EDLSSSettingOverride::UseProjectSettings; - - /** This enables warnings about plugins & tools that are incompatible with DLSS/DLAA in the editor. Saved to local user config only. */ - UPROPERTY(Config, EditAnywhere, Category = "Editor (Local)", DisplayName = "Warn about incompatible plugins and tools") - bool bShowDLSSIncompatiblePluginsToolsWarnings = true; - - /** This enables on screen warnings and errors about DLSS/DLAA */ - UPROPERTY(Config, EditAnywhere, Category = "Editor (Local)", DisplayName = "Show various DLSS/DLAA on screen debug messages") - EDLSSSettingOverride ShowDLSSSDebugOnScreenMessages = EDLSSSettingOverride::UseProjectSettings; - -}; - -UCLASS(Config = Engine, DefaultConfig, DisplayName="NVIDIA DLSS") -class DLSS_API UDLSSSettings: public UObject -{ - GENERATED_BODY() - -private: - -public: - - /** Enable DLSS/DLAA for D3D12, if the driver supports it at runtime */ - UPROPERTY(Config, EditAnywhere, Category = "Platforms", DisplayName = "Enable DLSS/DLAA for the D3D12RHI") - bool bEnableDLSSD3D12 = PLATFORM_WINDOWS; - - /** Enable DLSS/DLAA for D3D11, if the driver supports it at runtime */ - UPROPERTY(Config, EditAnywhere, Category = "Platforms", DisplayName = "Enable DLSS/DLAA for the D3D11RHI") - bool bEnableDLSSD3D11 = PLATFORM_WINDOWS; - - /** Enable DLSS/DLAA for Vulkan, if the driver supports it at runtime */ - UPROPERTY(Config, EditAnywhere, Category = "Platforms", DisplayName = "Enable DLSS/DLAA for the VulkanRHI") - bool bEnableDLSSVulkan = PLATFORM_WINDOWS; - - /** This enables DLSS/DLAA in editor viewports. This project wide setting can be locally overridden in the NVIDIA DLSS (Local) settings.*/ - UPROPERTY(Config, EditAnywhere, Category = "Level Editor - Viewport", DisplayName = "Enable DLSS/DLAA to be turned on in Editor viewports") - bool bEnableDLSSInEditorViewports = false; - - /** This enables DLSS/DLAA in play in editor viewports. This project wide setting can be locally overridden in in the NVIDIA DLSS (Local) settings.*/ - UPROPERTY(Config, EditAnywhere, Category = "Level Editor - Viewport", DisplayName = "Enable DLSS/DLAA in Play In Editor viewports") - bool bEnableDLSSInPlayInEditorViewports = true; - - /** This enables on screen warnings and errors about DLSS/DLAA. This project wide setting can be locally overridden in the NVIDIA DLSS (Local) settings. */ - UPROPERTY(Config, EditAnywhere, Category = "Level Editor - Viewport", DisplayName = "Show various DLSS/DLAA on screen debug messages") - bool bShowDLSSSDebugOnScreenMessages = true; - - /** This is part of the DLSS plugin and used by most projects*/ - UPROPERTY(VisibleAnywhere, Config, Category = "General Settings", DisplayName = "Generic DLSS Binary Path") - FString GenericDLSSBinaryPath; - - UPROPERTY(VisibleAnywhere, Config, Category = "General Settings", DisplayName = "Exists") - bool bGenericDLSSBinaryExists; - - /** By default the DLSS plugin uses the UE Project ID to initialize DLSS. In some cases NVIDIA might provide a separate NVIDIA Application ID, which should be put here. Please refer to https://developer.nvidia.com/dlss for details*/ - UPROPERTY(Config, EditAnywhere, Category = "General Settings", DisplayName = "NVIDIA NGX Application ID", AdvancedDisplay) - uint32 NVIDIANGXApplicationId; - - /** In some cases NVIDIA might provide a project specific DLSS binary for your project. Please refer to https://developer.nvidia.com/dlss for details*/ - UPROPERTY(VisibleAnywhere, Config, Category = "General Settings", DisplayName = "Custom DLSS Binary Path", AdvancedDisplay) - FString CustomDLSSBinaryPath; - UPROPERTY(VisibleAnywhere, Config, Category = "General Settings", DisplayName = "Exists", AdvancedDisplay) - bool bCustomDLSSBinaryExists; -}; - diff --git a/plugins/DLSS/Source/DLSSBlueprint/DLSSBlueprint.Build.cs b/plugins/DLSS/Source/DLSSBlueprint/DLSSBlueprint.Build.cs deleted file mode 100644 index 0c1f8179..00000000 --- a/plugins/DLSS/Source/DLSSBlueprint/DLSSBlueprint.Build.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -using UnrealBuildTool; -using System.IO; - -public class DLSSBlueprint : ModuleRules -{ - protected virtual bool IsSupportedPlatform(ReadOnlyTargetRules Target) - { - return Target.Platform == UnrealTargetPlatform.Win64; - } - - public DLSSBlueprint(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - PrivateDependencyModuleNames.AddRange( - new string[] - { - "Core", - "CoreUObject", - "Engine", - "RenderCore", - "Renderer", - "Projects", - } - ); - - - PrivateIncludePaths.AddRange( - new string[] { - Path.Combine(GetModuleDirectory("Renderer"), "Private"), - } - ); - - bool bPlatformSupportsDLSS = IsSupportedPlatform(Target); - - PublicDefinitions.Add("WITH_DLSS=" + (bPlatformSupportsDLSS ? '1' : '0')); - - if (bPlatformSupportsDLSS) - { - PublicIncludePaths.AddRange( - new string[] - { - Path.Combine(GetModuleDirectory("DLSS"), "Public"), - } - ); - - PrivateIncludePaths.AddRange( - new string[] - { - Path.Combine(GetModuleDirectory("DLSS"), "Private"), - } - ); - - PublicDependencyModuleNames.AddRange( - new string[] - { - } - ); - - PrivateDependencyModuleNames.AddRange( - new string[] - { - "NGX", - "NGXRHI", - "DLSS", - } - ); - } - } - - -} diff --git a/plugins/DLSS/Source/DLSSBlueprint/Private/DLSSLibrary.cpp b/plugins/DLSS/Source/DLSSBlueprint/Private/DLSSLibrary.cpp deleted file mode 100644 index 608ee2f5..00000000 --- a/plugins/DLSS/Source/DLSSBlueprint/Private/DLSSLibrary.cpp +++ /dev/null @@ -1,783 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#include "DLSSLibrary.h" - -#if WITH_DLSS -#include "DLSS.h" -#include "DLSSSettings.h" -#include "DLSSUpscaler.h" -#include "NGXRHI.h" -#endif - -#include "PostProcess/TemporalAA.h" -#include "Modules/ModuleManager.h" -#include "Interfaces/IPluginManager.h" -#include "ShaderCore.h" - -#include UE_INLINE_GENERATED_CPP_BY_NAME(DLSSLibrary) - -#define LOCTEXT_NAMESPACE "FDLSSBlueprintModule" -DEFINE_LOG_CATEGORY_STATIC(LogDLSSBlueprint, Log, All); - -static TAutoConsoleVariable CVarNGXDLSSPreferNISSharpen( - TEXT("r.NGX.DLSS.PreferNISSharpen"), - 2, - TEXT("Prefer sharpening with an extra NIS plugin sharpening pass instead of DLSS sharpening if the NIS plugin is also enabled for the project. (default: 1)\n") - TEXT("Requires the NIS plugin to be enabled\n") - TEXT(" 0: Softening/sharpening with the DLSS pass.\n") - TEXT(" 1: Sharpen with the NIS plugin. Softening is not supported. Requires the NIS plugin to be enabled.\n") - TEXT(" 2: Sharpen with the NIS plugin. Softening (i.e. negative sharpness) with the DLSS plugin. Requires the NIS plugin to be enabled.\n") - TEXT("Note: This cvar is only evaluated when using the deprecated `SetDLSSSharpness` Blueprint function, from either C++ or a Blueprint event graph!") - TEXT("Note: DLSS sharpening is deprecated, future plugin versions will remove DLSS sharpening. Use the NIS plugin for sharpening instead\n"), - ECVF_RenderThreadSafe); - -static const FName SetDLSSModeInvalidEnumValueError= FName("SetDLSSModeInvalidEnumValueError"); -static const FName IsDLSSModeSupportedInvalidEnumValueError = FName("IsDLSSModeSupportedInvalidEnumValueError"); - -UDLSSSupport UDLSSLibrary::DLSSSupport = UDLSSSupport::NotSupportedByPlatformAtBuildTime; -#if WITH_DLSS -int32 UDLSSLibrary::MinDLSSDriverVersionMajor = 0; -int32 UDLSSLibrary::MinDLSSDriverVersionMinor = 0; - -FDLSSUpscaler* UDLSSLibrary::DLSSUpscaler = nullptr; -bool UDLSSLibrary::bDLSSLibraryInitialized = false; - -static bool ShowDLSSSDebugOnScreenMessages() -{ - - if (GetDefault()->ShowDLSSSDebugOnScreenMessages == EDLSSSettingOverride::UseProjectSettings) - { - return GetDefault()->bShowDLSSSDebugOnScreenMessages; - } - else - { - return GetDefault()->ShowDLSSSDebugOnScreenMessages == EDLSSSettingOverride::Enabled; - } -} - - -#if !UE_BUILD_SHIPPING - -UDLSSLibrary::FDLSSErrorState UDLSSLibrary::DLSSErrorState; -FDelegateHandle UDLSSLibrary::DLSSOnScreenMessagesDelegateHandle; -void UDLSSLibrary::GetDLSSOnScreenMessages(TMultiMap& OutMessages) -{ - check(IsInGameThread()); - - // We need a valid DLSSSupport, so calling this here in case other UDLSSLibrary functions which call TryInitDLSSLibrary() haven't been called - if (!TryInitDLSSLibrary()) - { - return; - } - - if(ShowDLSSSDebugOnScreenMessages()) - { - - if (DLSSErrorState.bIsDLSSModeUnsupported) - { - const FTextFormat Format(LOCTEXT("DLSSOnScreenDebugSetModeUnsupportedDLSSMode", - "DLSS Error: The DLSS mode \"{0}\" is not supported. This error can be avoided by calling SetDLSSMode({0}) only if IsDLSSModeSupported({0}) returns true.")); - const FText Message = FText::Format(Format, StaticEnum()->GetDisplayNameTextByValue(int64(DLSSErrorState.InvalidDLSSMode))); - OutMessages.Add(FCoreDelegates::EOnScreenMessageSeverity::Error, Message); - } - - // Checking for "contains" in case virtualization is changing the GPU string - const bool bIsNVIDIA = FWindowsPlatformMisc::GetPrimaryGPUBrand().Contains(TEXT("NVIDIA")); - - bool bShowNotSupportedMessage = bIsNVIDIA && (UDLSSSupport::Supported != DLSSSupport); - - if ((UDLSSSupport::NotSupportedIncompatibleAPICaptureToolActive == DLSSSupport) && !GetMutableDefault()->bShowDLSSIncompatiblePluginsToolsWarnings ) - { - bShowNotSupportedMessage = false; - } - - if (bShowNotSupportedMessage) - { - const FTextFormat Format(LOCTEXT("DLSSOnScreenDebugDLSSNotSupported", - "DLSS Information: DLSS is not supported due to {0}.Please see the various LogDLSS* categories in the Developer Tools -> Output Log for further detail.")); - const FText Message = FText::Format(Format, StaticEnum()->GetDisplayNameTextByValue(int64(DLSSSupport))); - OutMessages.Add(FCoreDelegates::EOnScreenMessageSeverity::Warning, Message); - } - } -} -#endif - - -static EDLSSQualityMode ToEDLSSQualityMode(UDLSSMode InDLSSQualityMode) -{ - static_assert(int32(EDLSSQualityMode::NumValues) == 5, "dear DLSS plugin NVIDIA developer, please update this code to translate the new EDLSSQualityMode enum values to UDLSSMode"); - - switch (InDLSSQualityMode) - { - - case UDLSSMode::UltraPerformance: - return EDLSSQualityMode::UltraPerformance; - - // the higher level code should catch this... - case UDLSSMode::Off: - checkf(InDLSSQualityMode != UDLSSMode::Off, TEXT("ToEDLSSQualityMode should not be called with an InDLSSQualityMode of UDLSSMode::Off from the higher level code")); - default: - checkf(false, TEXT("ToEDLSSQualityMode should not be called with an out of range InDLSSQualityMode %d InDLSSQualityMode from the higher level code"), InDLSSQualityMode); - - case UDLSSMode::Performance: - return EDLSSQualityMode::Performance; - - case UDLSSMode::Balanced: - return EDLSSQualityMode::Balanced; - - case UDLSSMode::Quality: - return EDLSSQualityMode::Quality; - - case UDLSSMode::UltraQuality: - return EDLSSQualityMode::UltraQuality; - } -} - -int32 UDLSSLibrary::ToDLSSQualityCVarValue(UDLSSMode DLSSMode) -{ - return static_cast(ToEDLSSQualityMode(DLSSMode)); -} - -#endif - -bool UDLSSLibrary::IsDLSSModeSupported(UDLSSMode DLSSMode) -{ - const UEnum* Enum = StaticEnum(); - - // UEnums are strongly typed, but then one can also cast a byte to an UEnum ... - if (Enum->IsValidEnumValue(int64(DLSSMode)) && (Enum->GetMaxEnumValue() != int64(DLSSMode))) - { - if (DLSSMode == UDLSSMode::Off) - { - return true; - } -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("IsDLSSModeSupported should not be called before PostEngineInit")); - return false; - } - if (!IsDLSSSupported()) - { - return false; - } - else if (DLSSMode == UDLSSMode::Auto) - { - // support for auto quality mode was dropped with UE 5.1 - return false; - } - else - { - return DLSSUpscaler->IsQualityModeSupported(ToEDLSSQualityMode(DLSSMode)); - } -#else - return false; -#endif - } - else - { -#if !UE_BUILD_SHIPPING - FFrame::KismetExecutionMessage(*FString::Printf( - TEXT("IsDLSSModeSupported should not be called with an invalid DLSSMode enum value (%d) \"%s\""), - int64(DLSSMode), *StaticEnum()->GetDisplayNameTextByValue(int64(DLSSMode)).ToString()), - ELogVerbosity::Error, IsDLSSModeSupportedInvalidEnumValueError); -#endif - return false; - } - -} - -void UDLSSLibrary::GetDLSSModeInformation(UDLSSMode DLSSMode, FVector2D ScreenResolution, bool& bIsSupported, float& OptimalScreenPercentage, bool& bIsFixedScreenPercentage, float& MinScreenPercentage, float& MaxScreenPercentage, float& OptimalSharpness) -{ - // fall back to TAA for unsupported or DLSS off - OptimalScreenPercentage = 0.0f; - bIsFixedScreenPercentage = false; - MinScreenPercentage = 100.0f * ITemporalUpscaler::GetDefaultTemporalUpscaler()->GetMinUpsampleResolutionFraction(); - MaxScreenPercentage = 100.0f * ITemporalUpscaler::GetDefaultTemporalUpscaler()->GetMaxUpsampleResolutionFraction(); - OptimalSharpness = 0.0f; -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("GetDLSSModeInformation should not be called before PostEngineInit")); - bIsSupported = false; - return; - } -#endif - bIsSupported = IsDLSSModeSupported(DLSSMode); - -#if WITH_DLSS - if ((DLSSMode != UDLSSMode::Off) && bIsSupported || (DLSSMode == UDLSSMode::Auto)) - { - EDLSSQualityMode EDLSSMode; - if (DLSSMode != UDLSSMode::Auto) - { - EDLSSMode = ToEDLSSQualityMode(DLSSMode); - } - else - { - // Auto DLSS mode is based on total pixels - float PixelsFloat = ScreenResolution.X * ScreenResolution.Y; - int32 PixelsInt = (PixelsFloat < static_cast(MAX_int32)) ? static_cast(PixelsFloat) : MAX_int32; - TOptional MaybeDLSSMode = DLSSUpscaler->GetAutoQualityModeFromPixels(PixelsInt); - if (!MaybeDLSSMode.IsSet()) - { - // DLSS Off - return; - } - EDLSSMode = MaybeDLSSMode.GetValue(); - } - bIsFixedScreenPercentage = DLSSUpscaler->IsFixedResolutionFraction(EDLSSMode); - - OptimalScreenPercentage = 100.0f * DLSSUpscaler->GetOptimalResolutionFractionForQuality(EDLSSMode); - MinScreenPercentage = 100.0f * DLSSUpscaler->GetMinResolutionFractionForQuality(EDLSSMode); - MaxScreenPercentage = 100.0f * DLSSUpscaler->GetMaxResolutionFractionForQuality(EDLSSMode); - - OptimalSharpness = DLSSUpscaler->GetOptimalSharpnessForQuality(EDLSSMode); - } -#endif -} - -void UDLSSLibrary::GetDLSSScreenPercentageRange(float& MinScreenPercentage, float& MaxScreenPercentage) -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("GetDLSSScreenPercentageRange should not be called before PostEngineInit")); - MinScreenPercentage = 100.0f; - MaxScreenPercentage = 100.0f; - return; - } - - if (IsDLSSSupported()) - { - MinScreenPercentage = 100.0f * DLSSUpscaler->GetMinUpsampleResolutionFraction(); - MaxScreenPercentage = 100.0f * DLSSUpscaler->GetMaxUpsampleResolutionFraction(); - } - else -#endif - { - MinScreenPercentage = 100.0f; - MaxScreenPercentage = 100.0f; - } -} - -TArray UDLSSLibrary::GetSupportedDLSSModes() -{ - TArray SupportedQualityModes; -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("GetSupportedDLSSModes should not be called before PostEngineInit")); - return SupportedQualityModes; - } -#endif - { - const UEnum* Enum = StaticEnum(); - for (int32 EnumIndex = 0; EnumIndex < Enum->NumEnums(); ++EnumIndex) - { - const int64 EnumValue = Enum->GetValueByIndex(EnumIndex); - if (EnumValue != Enum->GetMaxEnumValue()) - { - const UDLSSMode QualityMode = UDLSSMode(EnumValue); - if (IsDLSSModeSupported(QualityMode)) - { - SupportedQualityModes.Add(QualityMode); - } - } - } - } - return SupportedQualityModes; -} - -bool UDLSSLibrary::IsDLSSSupported() -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("IsDLSSSupported should not be called before PostEngineInit")); - return false; - } - - return QueryDLSSSupport() == UDLSSSupport::Supported; -#else - return false; -#endif -} - -UDLSSSupport UDLSSLibrary::QueryDLSSSupport() -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("QueryDLSSSupport should not be called before PostEngineInit")); - return UDLSSSupport::NotSupported; - } -#endif - return DLSSSupport; -} - -void UDLSSLibrary::GetDLSSMinimumDriverVersion(int32& MinDriverVersionMajor, int32& MinDriverVersionMinor) -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("GetDLSSMinimumDriverVersion should not be called before PostEngineInit")); - } - MinDriverVersionMajor = MinDLSSDriverVersionMajor; - MinDriverVersionMinor = MinDLSSDriverVersionMinor; -#else - MinDriverVersionMajor = 0; - MinDriverVersionMinor = 0; -#endif -} - -void UDLSSLibrary::EnableDLSS(bool bEnabled) -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("EnableDLSS should not be called before PostEngineInit")); - return; - } - - const bool bDLSSSupported = (DLSSSupport == UDLSSSupport::Supported); - if (!bDLSSSupported) - { - return; - } - - static IConsoleVariable* CVarDLSSEnable = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NGX.DLSS.Enable")); - if (CVarDLSSEnable) - { - CVarDLSSEnable->Set(bEnabled ? 1 : 0, ECVF_SetByCommandline); - - // Spatial upscalers such as NIS might set this to 0, but we need r.TemporalAA.Upscaler to be 1 for DLSS to work. - // but we don't want to change the Cvar if DLSS is not active as to avoid impacting other code paths - // we don't need to set r.TemporalAA.Upsampling since r.TemporalAA.Upscaler implies that - if (bEnabled) - { - static const auto CVarTemporalAAUpscaler = IConsoleManager::Get().FindConsoleVariable(TEXT("r.TemporalAA.Upscaler")); - CVarTemporalAAUpscaler->Set(1, ECVF_SetByCommandline); - } - } -#endif -} - -bool UDLSSLibrary::IsDLSSEnabled() -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("IsDLSSEnabled should not be called before PostEngineInit")); - return false; - } - - // if NGX library loading was disabled, DLSS will be unsupported - const bool bDLSSSupported = (DLSSSupport == UDLSSSupport::Supported); - - static const IConsoleVariable* CVarDLSSEnable = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NGX.DLSS.Enable")); - const bool bDLSSEnabled = CVarDLSSEnable && (CVarDLSSEnable->GetInt() != 0); - - return bDLSSSupported && bDLSSEnabled; -#else - return false; -#endif -} - -// deprecated -void UDLSSLibrary::EnableDLAA(bool bEnabled) -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("EnableDLAA should not be called before PostEngineInit")); - return; - } - - const bool bDLAASupported = (DLSSSupport == UDLSSSupport::Supported); - - static auto CVarDLAAEnable = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NGX.DLAA.Enable")); - if (CVarDLAAEnable) - { - bool bDLAAEnabled = bDLAASupported && bEnabled; - CVarDLAAEnable->Set(bDLAAEnabled, ECVF_SetByCommandline); - if (bDLAAEnabled) - { - // DLAA needs to override the temporal upscaler - static const auto CVarUseTemporalAAUpscaler = IConsoleManager::Get().FindConsoleVariable(TEXT("r.TemporalAA.Upscaler")); - CVarUseTemporalAAUpscaler->SetWithCurrentPriority(1); - } - } -#endif -} - -// deprecated -bool UDLSSLibrary::IsDLAAEnabled() -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("IsDLAAEnabled should not be called before PostEngineInit")); - return false; - } - - const bool bDLAASupported = (DLSSSupport == UDLSSSupport::Supported); - - const bool bDLAAEnabled = (DLSSUpscaler != nullptr) && DLSSUpscaler->IsDLAAMode(); - - return bDLAASupported && bDLAAEnabled; -#else - return false; -#endif -} - -// deprecated -void UDLSSLibrary::SetDLSSMode(UObject* WorldContextObject, UDLSSMode DLSSMode) -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("SetDLSSMode should not be called before PostEngineInit")); - return; - } - - const UEnum* Enum = StaticEnum(); - - // UEnums are strongly typed, but then one can also cast a byte to an UEnum ... - if(Enum->IsValidEnumValue(int64(DLSSMode)) && (Enum->GetMaxEnumValue() != int64(DLSSMode))) - { - const bool bDLSSSupported = (DLSSSupport == UDLSSSupport::Supported); - - TOptional MaybeQualityMode{}; - if (bDLSSSupported) - { - if ((DLSSMode != UDLSSMode::Off) && (DLSSMode != UDLSSMode::Auto)) - { - MaybeQualityMode = ToEDLSSQualityMode(DLSSMode); - } - } - - static IConsoleVariable* CVarScreenPercentage = IConsoleManager::Get().FindConsoleVariable(TEXT("r.ScreenPercentage")); - if (MaybeQualityMode.IsSet() && DLSSUpscaler->IsQualityModeSupported(*MaybeQualityMode)) - { - // enable DLSS, and set screen percentage for backward compatibility with earlier plugin versions - float OptimalScreenPercentage = 100.0f * DLSSUpscaler->GetOptimalResolutionFractionForQuality(*MaybeQualityMode); - if (CVarScreenPercentage != nullptr) - { - EConsoleVariableFlags Priority = static_cast(CVarScreenPercentage->GetFlags() & ECVF_SetByMask); - CVarScreenPercentage->Set(OptimalScreenPercentage, Priority); - } - EnableDLSS(true); - } - else - { - // disable DLSS, and set screen percentage to 100 for backward compatibility with earlier plugin versions - if (CVarScreenPercentage != nullptr) - { - EConsoleVariableFlags Priority = static_cast(CVarScreenPercentage->GetFlags() & ECVF_SetByMask); - CVarScreenPercentage->Set(100.0f, Priority); - } - EnableDLSS(false); - } - - // TODO: this cvar does nothing - static auto CVarDLSSQuality = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NGX.DLSS.Quality")); - - if (CVarDLSSQuality && (DLSSMode != UDLSSMode::Off) && (DLSSMode != UDLSSMode::Auto)) - { -#if !UE_BUILD_SHIPPING - check(IsInGameThread()); - DLSSErrorState.bIsDLSSModeUnsupported = !IsDLSSModeSupported(DLSSMode); - DLSSErrorState.InvalidDLSSMode = DLSSMode; -#endif - CVarDLSSQuality->Set(ToDLSSQualityCVarValue(DLSSMode), ECVF_SetByCommandline); - } - } - else - { -#if !UE_BUILD_SHIPPING - FFrame::KismetExecutionMessage(*FString::Printf( - TEXT("SetDLSSMode should not be called with an invalid DLSSMode enum value (%d) \"%s\""), - int64(DLSSMode), *StaticEnum()->GetDisplayNameTextByValue(int64(DLSSMode)).ToString()), - ELogVerbosity::Error, SetDLSSModeInvalidEnumValueError); -#endif - } -#endif // WITH_DLSS -} - -// deprecated -UDLSSMode UDLSSLibrary::GetDLSSMode() -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("GetDLSSMode should not be called before PostEngineInit")); - return UDLSSMode::Off; - } - - static const auto CVarTemporalAAUpscaler = IConsoleManager::Get().FindConsoleVariable(TEXT("r.TemporalAA.Upscaler")); - const bool bTemporalUpscalerActive = CVarTemporalAAUpscaler && CVarTemporalAAUpscaler->GetInt() != 0; - - const bool bDLSSSupported = (DLSSSupport == UDLSSSupport::Supported); - - static const auto CVarDLSSEnable = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NGX.DLSS.Enable")); - const bool bDLSSEnabled = CVarDLSSEnable && CVarDLSSEnable->GetInt(); - - static const auto CVarDLSSQuality = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NGX.DLSS.Quality")); - const int32 DLSSQuality = CVarDLSSQuality ? CVarDLSSQuality->GetInt() : 0; - - static const auto CVarDLSSAutoQualityMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NGX.DLSS.Quality.Auto")); - const bool bIsAutoQualityMode = CVarDLSSAutoQualityMode ? CVarDLSSAutoQualityMode->GetBool() : false; - const bool bDLAAEnabled = (DLSSUpscaler != nullptr) && DLSSUpscaler->IsDLAAMode(); - - if (bDLAAEnabled) - { - // DLSS is mutually exclusive with DLAA, DLAA wins - return UDLSSMode::Off; - } - else if (bTemporalUpscalerActive && bDLSSSupported && bDLSSEnabled && bIsAutoQualityMode) - { - return UDLSSMode::Auto; - } - else if (bTemporalUpscalerActive && bDLSSSupported && bDLSSEnabled && CVarDLSSQuality) - { - static_assert(int32(EDLSSQualityMode::NumValues) == 5, "dear DLSS plugin NVIDIA developer, please update this code to handle the new enum values"); - - switch (EDLSSQualityMode(DLSSQuality)) - { - case EDLSSQualityMode::UltraPerformance: - return UDLSSMode::UltraPerformance; - - default: - UE_LOG(LogDLSSBlueprint , Error, TEXT("r.NGX.DLSS.Quality is set to %d, which is outside of the valid range [%d, %d])"), DLSSQuality, EDLSSQualityMode::MinValue, EDLSSQualityMode::MaxValue); - - case EDLSSQualityMode::Performance: - return UDLSSMode::Performance; - - case EDLSSQualityMode::Balanced: - return UDLSSMode::Balanced; - - case EDLSSQualityMode::Quality: - return UDLSSMode::Quality; - - case EDLSSQualityMode::UltraQuality: - return UDLSSMode::UltraQuality; - }; - } -#endif - return UDLSSMode::Off; -} - -#ifndef ENGINE_CAN_SUPPORT_NIS_PLUGIN -#define ENGINE_CAN_SUPPORT_NIS_PLUGIN 1 -#endif - -// deprecated -void UDLSSLibrary::SetDLSSSharpness(float Sharpness) -{ -#if WITH_DLSS - - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("SetDLSSSharpness should not be called before PostEngineInit")); - return; - } - static const auto CVarNGXDLSSharpness = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NGX.DLSS.Sharpness")); - if (CVarNGXDLSSharpness) - { -#if ENGINE_CAN_SUPPORT_NIS_PLUGIN - static const auto CVarNISSharpness = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NIS.Sharpness")); - static const auto CVarNISEnable = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NIS.Enable")); - const bool bHasNISPlugin = CVarNISSharpness != nullptr && CVarNISEnable != nullptr; - const bool bIsNISEnabled = bHasNISPlugin && CVarNISEnable->GetBool(); - - if (bHasNISPlugin && bIsNISEnabled) - { - const int32 PreferNISSharpen = CVarNGXDLSSPreferNISSharpen.GetValueOnAnyThread(); - const bool bUseNISSharpen = PreferNISSharpen == 1 || (PreferNISSharpen == 2 && Sharpness > 0); - if (bUseNISSharpen) - { - Sharpness = FMath::Clamp(Sharpness, 0.0f, 1.0f); - } - // Quantize here so we can have sharpness snap to 0, which downstream is used to turn off the NGX sharpening flag - // CVarNGXDLSSharpness->Set(Sharpness, ECVF_SetByCommandline) internally uses Set(*FString::Printf(TEXT("%g"), InValue), SetBy); - CVarNGXDLSSharpness->Set(*FString::Printf(TEXT("%2.2f"), bUseNISSharpen ? 0.0f : Sharpness), ECVF_SetByCommandline); - CVarNISSharpness->Set( *FString::Printf(TEXT("%2.2f"), bUseNISSharpen ? Sharpness : 0.0f), ECVF_SetByCommandline); - } - else -#endif // ENGINE_CAN_SUPPORT_NIS_PLUGIN - { - // Quantize here so we can have sharpness snap to 0, which downstream is used to turn off the NGX sharpening flag - // CVarNGXDLSSharpness->Set(Sharpness, ECVF_SetByCommandline) internally uses Set(*FString::Printf(TEXT("%g"), InValue), SetBy); - CVarNGXDLSSharpness->Set(*FString::Printf(TEXT("%2.2f"), Sharpness), ECVF_SetByCommandline); - } - } -#endif -} - -// deprecated -float UDLSSLibrary::GetDLSSSharpness() -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("GetDLSSSharpness should not be called before PostEngineInit")); - return 0.0f; - } - - static const auto CVarNGXDLSSharpness = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NGX.DLSS.Sharpness")); - - if (CVarNGXDLSSharpness) - { -#if ENGINE_CAN_SUPPORT_NIS_PLUGIN - static const auto CVarNISSharpness = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NIS.Sharpness")); - static const auto CVarNISEnable = IConsoleManager::Get().FindConsoleVariable(TEXT("r.NIS.Enable")); - const bool bHasNISPlugin = CVarNISSharpness != nullptr && CVarNISEnable != nullptr; - const bool bIsNISEnabled = bHasNISPlugin && CVarNISEnable->GetBool(); - const int32 PreferNISSharpen = CVarNGXDLSSPreferNISSharpen.GetValueOnAnyThread(); - if (bHasNISPlugin && bIsNISEnabled && (PreferNISSharpen == 1)) - { - return CVarNISSharpness->GetFloat(); - } - else if (bHasNISPlugin && bIsNISEnabled && (PreferNISSharpen == 2)) - { - const float DLSSSharpness = CVarNGXDLSSharpness->GetFloat(); - if (DLSSSharpness < 0) - { - return DLSSSharpness; - } - else - { - return CVarNISSharpness->GetFloat(); - } - } - else -#endif - { - return CVarNGXDLSSharpness->GetFloat(); - } - } -#endif - - return 0.0f; -} - -UDLSSMode UDLSSLibrary::GetDefaultDLSSMode() -{ -#if WITH_DLSS - if (!TryInitDLSSLibrary()) - { - UE_LOG(LogDLSSBlueprint, Error, TEXT("GetDefaultDLSSMode should not be called before PostEngineInit")); - return UDLSSMode::Off; - } -#endif - if (UDLSSLibrary::IsDLSSSupported()) - { - return UDLSSMode::Quality; - } - else - { - return UDLSSMode::Off; - } -} - -#if WITH_DLSS -static UDLSSSupport ToUDLSSSupport(EDLSSSupport InDLSSSupport) -{ - switch (InDLSSSupport) - { - - case EDLSSSupport::Supported: - return UDLSSSupport::Supported; - - // this should be resolved at development time - default: - checkf(false, TEXT("ToUDLSSSupport should not be called with an out of range InDLSSSupport from the higher level code")); - case EDLSSSupport::NotSupported: - return UDLSSSupport::NotSupported; - - case EDLSSSupport::NotSupportedIncompatibleHardware: - return UDLSSSupport::NotSupportedIncompatibleHardware; - - - case EDLSSSupport::NotSupportedDriverOutOfDate: - return UDLSSSupport::NotSupportedDriverOutOfDate; - - case EDLSSSupport::NotSupportedOperatingSystemOutOfDate: - return UDLSSSupport::NotSupportedOperatingSystemOutOfDate; - - case EDLSSSupport::NotSupportedIncompatibleAPICaptureToolActive: - return UDLSSSupport::NotSupportedIncompatibleAPICaptureToolActive; - } -} - -// Delayed initialization, which allows this module to be available early so blueprints can be loaded before DLSS is available in PostEngineInit -bool UDLSSLibrary::TryInitDLSSLibrary() -{ - if (bDLSSLibraryInitialized) - { - return true; - } - - // Register this before we bail out so we can show error messages -#if !UE_BUILD_SHIPPING - if (!DLSSOnScreenMessagesDelegateHandle.IsValid()) - { - DLSSOnScreenMessagesDelegateHandle = FCoreDelegates::OnGetOnScreenMessages.AddStatic(&GetDLSSOnScreenMessages); - } -#endif - - IDLSSModuleInterface* DLSSModule = FModuleManager::GetModulePtr(TEXT("DLSS")); - if (DLSSModule == nullptr) - { - return false; - } - - DLSSUpscaler = DLSSModule->GetDLSSUpscaler(); - DLSSSupport = ToUDLSSSupport(DLSSModule->QueryDLSSSupport()); - DLSSModule->GetDLSSMinDriverVersion(MinDLSSDriverVersionMajor, MinDLSSDriverVersionMinor); - - checkf((DLSSModule->GetDLSSUpscaler() != nullptr) || (DLSSModule->QueryDLSSSupport() != EDLSSSupport::Supported), TEXT("mismatch between not having a valid DLSSModule->GetDLSSUpscaler() while also reporting DLSS as being supported by DLSSModule->QueryDLSSSupport() %u "), DLSSModule->QueryDLSSSupport()); - - bDLSSLibraryInitialized = true; - - return true; -} -#endif // WITH_DLSS - -void FDLSSBlueprintModule::StartupModule() -{ -#if WITH_DLSS - // This initialization will likely not succeed unless this module has been moved to PostEngineInit, and that's ok - UDLSSLibrary::TryInitDLSSLibrary(); -#else - UE_LOG(LogDLSSBlueprint, Log, TEXT("DLSS is not supported on this platform at build time. The DLSS Blueprint library however is supported and stubbed out to ignore any calls to enable DLSS and will always return UDLSSSupport::NotSupportedByPlatformAtBuildTime, regardless of the underlying hardware. This can be used to e.g. to turn off DLSS related UI elements.")); - UDLSSLibrary::DLSSSupport = UDLSSSupport::NotSupportedByPlatformAtBuildTime; -#endif -} - -void FDLSSBlueprintModule::ShutdownModule() -{ -#if WITH_DLSS && !UE_BUILD_SHIPPING - if (UDLSSLibrary::DLSSOnScreenMessagesDelegateHandle.IsValid()) - { - FCoreDelegates::OnGetOnScreenMessages.Remove(UDLSSLibrary::DLSSOnScreenMessagesDelegateHandle); - UDLSSLibrary::DLSSOnScreenMessagesDelegateHandle.Reset(); - } -#endif -} - - -#undef LOCTEXT_NAMESPACE - -IMPLEMENT_MODULE(FDLSSBlueprintModule, DLSSBlueprint) - diff --git a/plugins/DLSS/Source/DLSSBlueprint/Public/DLSSLibrary.h b/plugins/DLSS/Source/DLSSBlueprint/Public/DLSSLibrary.h deleted file mode 100644 index d2fe6288..00000000 --- a/plugins/DLSS/Source/DLSSBlueprint/Public/DLSSLibrary.h +++ /dev/null @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ -#pragma once - -#include "Modules/ModuleManager.h" - -#include "UObject/ObjectMacros.h" -#include "UObject/Object.h" -#include "Kismet/BlueprintFunctionLibrary.h" -#include "Misc/CoreDelegates.h" - -#include "DLSSLibrary.generated.h" - -class FDLSSUpscaler; -class FDelegateHandle; - -#ifndef WITH_DLSS -#define WITH_DLSS 0 -#endif - -UENUM(BlueprintType) -enum class UDLSSSupport : uint8 -{ - Supported UMETA(DisplayName = "Supported"), - - NotSupported UMETA(DisplayName = "Not Supported"), - NotSupportedIncompatibleHardware UMETA(DisplayName = "Incompatible Hardware", ToolTip = "DLSS requires an NVIDIA RTX GPU"), - NotSupportedDriverOutOfDate UMETA(DisplayName = "Driver Out of Date", ToolTip = "The driver is outdated. Also see GetDLSSMinimumDriverVersion"), - NotSupportedOperatingSystemOutOfDate UMETA(DisplayName = "Operating System Out of Date", ToolTip = "DLSS requires at least Windows 10 Fall 2017 Creators Update 64-bit, (v1709, build 16299)"), - NotSupportedByPlatformAtBuildTime UMETA(DisplayName = "Platform Not Supported At Build Time", ToolTip = "This platform doesn't not support DLSS at build time. Currently DLSS is only supported on Windows 64"), - NotSupportedIncompatibleAPICaptureToolActive UMETA(DisplayName = "Incompatible API Capture Tool Active", ToolTip = "DLSS is not compatible with an active API capture tool such as RenderDoc.") -}; - - -UENUM(BlueprintType) -enum class UDLSSMode : uint8 -{ - Off UMETA(DisplayName = "Off"), - Auto UMETA(DisplayName = "Auto", ToolTip = "Not a real quality mode. Use Auto to query best settings for a given resolution with GetDLSSModeInformation"), - UltraQuality UMETA(DisplayName = "Ultra Quality"), - Quality UMETA(DisplayName = "Quality"), - Balanced UMETA(DisplayName = "Balanced"), - Performance UMETA(DisplayName = "Performance"), - UltraPerformance UMETA(DisplayName = "Ultra Performance") -}; - -UCLASS(MinimalAPI) -class UDLSSLibrary : public UBlueprintFunctionLibrary -{ - friend class FDLSSBlueprintModule; - GENERATED_BODY() -public: - - /** Checks whether DLSS/DLAA is supported by the current GPU. Further details can be retrieved via QueryDLSSSupport*/ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Is NVIDIA DLSS Supported")) - static DLSSBLUEPRINT_API bool IsDLSSSupported(); - - /** Checks whether DLSS/DLAA is supported by the current GPU */ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Query NVIDIA DLSS Support")) - static DLSSBLUEPRINT_API UDLSSSupport QueryDLSSSupport(); - - /** If QueryDLSSSupport returns "NotSupportedDriverOutOfDate", then MinDriverVersionMajor and MinDriverVersionMinor contains the required driver version.*/ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Get DLSS Minimum DriverVersion")) - static DLSSBLUEPRINT_API void GetDLSSMinimumDriverVersion(int32& MinDriverVersionMajor, int32& MinDriverVersionMinor); - - /** - * Enable/disable DLSS/DLAA - * To select a DLSS quality mode, set an appropriate upscale screen percentage with r.ScreenPercentage. Use GetDlssModeInformation to find optimal screen percentage - * To select DLAA, set the upscale screen percentage to 100 (r.ScreenPercentage=100) - */ - UFUNCTION(BlueprintCallable, Category = "DLSS", meta = (DisplayName = "Enable DLSS")) - static DLSSBLUEPRINT_API void EnableDLSS(bool bEnabled); - - /** Checks whether DLSS/DLAA is enabled */ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Is DLSS Enabled")) - static DLSSBLUEPRINT_API bool IsDLSSEnabled(); - - /** Enable/disable DLAA. Note that while DLAA is enabled, DLSS will be automatically disabled */ - UFUNCTION(BlueprintCallable, Category = "DLSS", meta = (DisplayName = "Enable DLAA", DeprecatedFunction, DeprecationMessage = "Use EnableDLSS instead")) - static DLSSBLUEPRINT_API void EnableDLAA(bool bEnabled); - - /** Checks whether DLAA is enabled */ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Is DLAA Enabled", DeprecatedFunction, DeprecationMessage = "Use IsDLSSEnabled instead")) - static DLSSBLUEPRINT_API bool IsDLAAEnabled(); - - /** Checks whether a DLSS mode is supported */ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Is DLSS Mode Supported")) - static DLSSBLUEPRINT_API bool IsDLSSModeSupported(UDLSSMode DLSSMode); - - /** Retrieves all supported DLSS modes. Can be used to populate UI */ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Get Supported DLSS Modes")) - static DLSSBLUEPRINT_API TArray GetSupportedDLSSModes(); - - /** Provides additional details (such as screen percentage ranges) about a DLSS mode. Screen Resolution is required for Auto mode */ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Get DLSS Mode Information")) - static DLSSBLUEPRINT_API void GetDLSSModeInformation(UDLSSMode DLSSMode, FVector2D ScreenResolution, bool& bIsSupported, float& OptimalScreenPercentage, bool& bIsFixedScreenPercentage, float& MinScreenPercentage, float& MaxScreenPercentage, float& OptimalSharpness); - - /** The global screen percentage range that DLSS supports. Excludes DLSS modes with fixed screen percentage. Also see GetDLSSModeInformation*/ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Get DLSS Screenpercentage Range")) - static DLSSBLUEPRINT_API void GetDLSSScreenPercentageRange(float& MinScreenPercentage, float& MaxScreenPercentage); - - /** Sets the console variables to enable/disable DLSS (r.NGX.DLSS.Enable, r.NGX.DLSS.Quality)*/ - UFUNCTION(BlueprintCallable, Category = "DLSS", meta=(WorldContext="WorldContextObject", DisplayName = "Set DLSS Mode", DeprecatedFunction, DeprecationMessage = "Use EnableDLSS instead")) - static DLSSBLUEPRINT_API void SetDLSSMode(UObject* WorldContextObject, UDLSSMode DLSSMode); - - /* Reads the console variables to infer the current DLSS mode (r.NGX.DLSS.Enable, r.NGX.DLSS.Quality, r.TemporalAA.Upscaler)*/ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Get DLSS Mode", DeprecatedFunction, DeprecationMessage = "Use IsDLSSEnabled instead")) - static DLSSBLUEPRINT_API UDLSSMode GetDLSSMode(); - - /* Sets the console variables to enable additional DLSS sharpening. Set to 0 to disable (r.NGX.DLSS.Sharpness) */ - UFUNCTION(BlueprintCallable, Category = "DLSS", meta = (DisplayName = "Set DLSS Sharpness", DeprecatedFunction, DeprecationMessage = "Use NIS sharpening instead")) - static DLSSBLUEPRINT_API void SetDLSSSharpness(float Sharpness); - - /*Reads the console variables to infer the current DLSS sharpness (r.NGX.DLSS.Sharpness) */ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Get DLSS Sharpness", DeprecatedFunction, DeprecationMessage = "Use NIS sharpening instead")) - static DLSSBLUEPRINT_API float GetDLSSSharpness(); - - /* Find a reasonable default DLSS mode based on current hardware */ - UFUNCTION(BlueprintPure, Category = "DLSS", meta = (DisplayName = "Get Default DLSS Mode")) - static DLSSBLUEPRINT_API UDLSSMode GetDefaultDLSSMode(); - - /* Allows conversion from BlueprintType enums. */ - static DLSSBLUEPRINT_API int32 ToDLSSQualityCVarValue(UDLSSMode InDLSSQualityMode); - -private: - static UDLSSSupport DLSSSupport; - -#if WITH_DLSS - static int32 MinDLSSDriverVersionMinor; - static int32 MinDLSSDriverVersionMajor; - static FDLSSUpscaler* DLSSUpscaler; - static bool bDLSSLibraryInitialized; - - static bool TryInitDLSSLibrary(); - -#if !UE_BUILD_SHIPPING - struct FDLSSErrorState - { - bool bIsDLSSModeUnsupported = false; - UDLSSMode InvalidDLSSMode = UDLSSMode::Off; - }; - - static FDLSSErrorState DLSSErrorState; - - static void GetDLSSOnScreenMessages(TMultiMap& OutMessages); - static FDelegateHandle DLSSOnScreenMessagesDelegateHandle; -#endif - -#endif -}; - -class FDLSSBlueprintModule final : public IModuleInterface -{ -public: - - /** IModuleInterface implementation */ - virtual void StartupModule() override; - virtual void ShutdownModule() override; - -private: -}; diff --git a/plugins/DLSS/Source/DLSSEditor/DLSSEditor.Build.cs b/plugins/DLSS/Source/DLSSEditor/DLSSEditor.Build.cs deleted file mode 100644 index cca8078b..00000000 --- a/plugins/DLSS/Source/DLSSEditor/DLSSEditor.Build.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - - -using UnrealBuildTool; -using System.IO; - -public class DLSSEditor : ModuleRules -{ - public DLSSEditor(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicIncludePaths.AddRange( - new string[] { - } - ); - - - PrivateIncludePaths.AddRange( - new string[] { - Path.Combine(GetModuleDirectory("DLSS"), "Private"), - Path.Combine(GetModuleDirectory("Renderer"), "Private"), - } - ); - - PublicDependencyModuleNames.AddRange( - new string[] - { - } - ); - - PrivateDependencyModuleNames.AddRange( - new string[] - { - "Core", - "CoreUObject", - "Engine", - "Settings", - - "NGX", - "DLSS", - "NGXRHI", - } - ); - } -} diff --git a/plugins/DLSS/Source/DLSSEditor/Private/DLSSEditor.cpp b/plugins/DLSS/Source/DLSSEditor/Private/DLSSEditor.cpp deleted file mode 100644 index e9308535..00000000 --- a/plugins/DLSS/Source/DLSSEditor/Private/DLSSEditor.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#include "DLSSEditor.h" - -#include "DLSSUpscaler.h" -#include "DLSS.h" -#include "DLSSSettings.h" -#include "NGXRHI.h" - -#include "CoreMinimal.h" -#include "ISettingsModule.h" -#include "ISettingsSection.h" -#include "UObject/Class.h" -#include "UObject/WeakObjectPtr.h" - - - -#define LOCTEXT_NAMESPACE "FDLSSEditorModule" - -DEFINE_LOG_CATEGORY(LogDLSSEditor); - -void FDLSSEditorModule::StartupModule() -{ - UE_LOG(LogDLSSEditor, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - - check(GIsEditor); - - // verify that the other DLSS modules are correctly hooked up - { - IDLSSModuleInterface* DLSSModule = &FModuleManager::LoadModuleChecked(TEXT("DLSS")); - UE_LOG(LogDLSSEditor, Log, TEXT("DLSS module %p, QueryDLSSSupport = %u DLSSUpscaler = %p"), DLSSModule, DLSSModule->QueryDLSSSupport(), DLSSModule->GetDLSSUpscaler()); - - bIsDLSSAvailable = DLSSModule->QueryDLSSSupport() == EDLSSSupport::Supported; - } - - // register settings - { - ISettingsModule* SettingsModule = FModuleManager::GetModulePtr("Settings"); - if (SettingsModule != nullptr) - { - { - auto Settings = GetMutableDefault(); - if(bIsDLSSAvailable) - { - IDLSSModuleInterface* DLSSModule = &FModuleManager::LoadModuleChecked(TEXT("DLSS")); - const NGXRHI* NGXRHIExtensions = DLSSModule->GetDLSSUpscaler()->GetNGXRHI(); - Settings->GenericDLSSBinaryPath = NGXRHIExtensions->GetDLSSGenericBinaryInfo().Get<0>(); - Settings->bGenericDLSSBinaryExists = NGXRHIExtensions->GetDLSSGenericBinaryInfo().Get<1>(); - - Settings->CustomDLSSBinaryPath = NGXRHIExtensions->GetDLSSCustomBinaryInfo().Get<0>(); - Settings->bCustomDLSSBinaryExists = NGXRHIExtensions->GetDLSSCustomBinaryInfo().Get<1>(); - } - - ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings("Project", "Plugins", "DLSS", - LOCTEXT("DLSSSettingsName", "NVIDIA DLSS"), - LOCTEXT("DLSSSettingsDescription", "Configure the NVIDIA DLSS plug-in."), - Settings - ); - } - - { - auto Settings = GetMutableDefault(); - - ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings("Project", "Plugins", "DLSSOverride", - LOCTEXT("DLSSOverrideSettingsName", "NVIDIA DLSS Overrides (Local)"), - LOCTEXT("DLSSOverrideSettingsDescription", "Configure the local settings for the NVIDIA DLSS plug-in."), - Settings - ); - } - } - } - - UE_LOG(LogDLSSEditor, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - -void FDLSSEditorModule::ShutdownModule() -{ - UE_LOG(LogDLSSEditor, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - - UE_LOG(LogDLSSEditor, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - -#undef LOCTEXT_NAMESPACE - -IMPLEMENT_MODULE(FDLSSEditorModule, DLSSEditor) - diff --git a/plugins/DLSS/Source/DLSSEditor/Public/DLSSEditor.h b/plugins/DLSS/Source/DLSSEditor/Public/DLSSEditor.h deleted file mode 100644 index 90b5365e..00000000 --- a/plugins/DLSS/Source/DLSSEditor/Public/DLSSEditor.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#pragma once - -#include "Modules/ModuleManager.h" - -DECLARE_LOG_CATEGORY_EXTERN(LogDLSSEditor, Log, All); - -class FDLSSEditorModule final : public IModuleInterface -{ -public: - - /** IModuleInterface implementation */ - virtual void StartupModule() final; - virtual void ShutdownModule() final; - -private: - bool bIsDLSSAvailable = false; -}; - - diff --git a/plugins/DLSS/Source/DLSSUtility/DLSSUtility.Build.cs b/plugins/DLSS/Source/DLSSUtility/DLSSUtility.Build.cs deleted file mode 100644 index beddeed2..00000000 --- a/plugins/DLSS/Source/DLSSUtility/DLSSUtility.Build.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -using UnrealBuildTool; -using System.IO; - -public class DLSSUtility : ModuleRules -{ - public DLSSUtility(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicIncludePaths.AddRange( - new string[] { - } - ); - - PrivateIncludePaths.AddRange( - new string[] { - Path.Combine(GetModuleDirectory("Renderer"), "Private"), - } - ); - - - PublicDependencyModuleNames.AddRange( - new string[] - { - "Core", - "RenderCore", - "Renderer", - } - ); - - - PrivateDependencyModuleNames.AddRange( - new string[] - { - "Engine", - "RHI", - "Projects" - } - ); - } -} diff --git a/plugins/DLSS/Source/DLSSUtility/Private/DLSSUtility.cpp b/plugins/DLSS/Source/DLSSUtility/Private/DLSSUtility.cpp deleted file mode 100644 index 0600b19c..00000000 --- a/plugins/DLSS/Source/DLSSUtility/Private/DLSSUtility.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#include "DLSSUtility.h" -#include "Modules/ModuleManager.h" -#include "Interfaces/IPluginManager.h" -#include "ShaderCore.h" - -#define LOCTEXT_NAMESPACE "FDLSSUtilityModule" - -void FDLSSUtilityModule::StartupModule() -{ - FString PluginShaderDir = FPaths::Combine(IPluginManager::Get().FindPlugin(TEXT("DLSS"))->GetBaseDir(), TEXT("Shaders")); - AddShaderSourceDirectoryMapping(TEXT("/Plugin/DLSS"), PluginShaderDir); - -} - -void FDLSSUtilityModule::ShutdownModule() -{ - -} - -#undef LOCTEXT_NAMESPACE - -IMPLEMENT_MODULE(FDLSSUtilityModule, DLSSUtility) diff --git a/plugins/DLSS/Source/DLSSUtility/Private/VelocityCombinePass.cpp b/plugins/DLSS/Source/DLSSUtility/Private/VelocityCombinePass.cpp deleted file mode 100644 index a158d9ac..00000000 --- a/plugins/DLSS/Source/DLSSUtility/Private/VelocityCombinePass.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#include "VelocityCombinePass.h" -#include "Runtime/Launch/Resources/Version.h" - - -const int32 kVelocityCombineComputeTileSizeX = FComputeShaderUtils::kGolden2DGroupSize; -const int32 kVelocityCombineComputeTileSizeY = FComputeShaderUtils::kGolden2DGroupSize; - - -class FDilateMotionVectorsDim : SHADER_PERMUTATION_BOOL("DILATE_MOTION_VECTORS"); - -class FVelocityCombineCS : public FGlobalShader -{ -public: - static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters& Parameters) - { - // Only cook for the platforms/RHIs where DLSS is supported, which is DX11,DX12 and Vulkan [on Win64] - return IsFeatureLevelSupported(Parameters.Platform, ERHIFeatureLevel::SM5) && - IsPCPlatform(Parameters.Platform) && ( - IsVulkanSM5Platform(Parameters.Platform) || - IsD3DPlatform(Parameters.Platform)); - } - - static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters& Parameters, FShaderCompilerEnvironment& OutEnvironment) - { - FGlobalShader::ModifyCompilationEnvironment(Parameters, OutEnvironment); - OutEnvironment.SetDefine(TEXT("THREADGROUP_SIZEX"), kVelocityCombineComputeTileSizeX); - OutEnvironment.SetDefine(TEXT("THREADGROUP_SIZEY"), kVelocityCombineComputeTileSizeY); - } - using FPermutationDomain = TShaderPermutationDomain; - - DECLARE_GLOBAL_SHADER(FVelocityCombineCS); - SHADER_USE_PARAMETER_STRUCT(FVelocityCombineCS, FGlobalShader); - - BEGIN_SHADER_PARAMETER_STRUCT(FParameters, ) - // Input images - SHADER_PARAMETER_RDG_TEXTURE(Texture2D, VelocityTexture) - SHADER_PARAMETER_SAMPLER(SamplerState, VelocityTextureSampler) - SHADER_PARAMETER_STRUCT(FScreenPassTextureViewportParameters, Velocity) - - SHADER_PARAMETER_RDG_TEXTURE(Texture2D, DepthTexture) - SHADER_PARAMETER_SAMPLER(SamplerState, DepthTextureSampler) - - SHADER_PARAMETER(FVector2f, TemporalJitterPixels) - - SHADER_PARAMETER_STRUCT_REF(FViewUniformShaderParameters, View) - - // Output images - SHADER_PARAMETER_RDG_TEXTURE_UAV(RWTexture2D, OutVelocityCombinedTexture) - SHADER_PARAMETER_STRUCT(FScreenPassTextureViewportParameters, CombinedVelocity) - - END_SHADER_PARAMETER_STRUCT() -}; - - -IMPLEMENT_GLOBAL_SHADER(FVelocityCombineCS, "/Plugin/DLSS/Private/VelocityCombine.usf", "VelocityCombineMain", SF_Compute); - -FRDGTextureRef AddVelocityCombinePass( - FRDGBuilder& GraphBuilder, - const FViewInfo& View, - FRDGTextureRef InSceneDepthTexture, - FRDGTextureRef InVelocityTexture, - bool bDilateMotionVectors -) -{ - const FIntRect InputViewRect = View.ViewRect; - const FIntRect OutputViewRect = FIntRect( FIntPoint::ZeroValue, bDilateMotionVectors ? View.GetSecondaryViewRectSize() : View.ViewRect.Size()); - - FRDGTextureDesc CombinedVelocityDesc = FRDGTextureDesc::Create2D( - OutputViewRect.Size(), - PF_G16R16F, - FClearValueBinding::Black, - TexCreate_ShaderResource | TexCreate_UAV); - const TCHAR* OutputName = TEXT("DLSSCombinedVelocity"); - - FRDGTextureRef CombinedVelocityTexture = GraphBuilder.CreateTexture( - CombinedVelocityDesc, - OutputName); - - FVelocityCombineCS::FParameters* PassParameters = GraphBuilder.AllocParameters(); - - // input velocity - { - PassParameters->VelocityTexture = InVelocityTexture; - PassParameters->VelocityTextureSampler = TStaticSamplerState::GetRHI(); - - // we use InSceneDepthTexture here and not InVelocityTexture since the latter can be a 1x1 black texture - check(InVelocityTexture->Desc.Extent == FIntPoint(1, 1) || InVelocityTexture->Desc.Extent == InSceneDepthTexture->Desc.Extent); - FScreenPassTextureViewport velocityViewport(InSceneDepthTexture, InputViewRect); - FScreenPassTextureViewportParameters velocityViewportParameters = GetScreenPassTextureViewportParameters(velocityViewport); - PassParameters->Velocity = velocityViewportParameters; - } - // input depth - { - PassParameters->DepthTexture = InSceneDepthTexture; - PassParameters->DepthTextureSampler = TStaticSamplerState::GetRHI(); - } - // output combined velocity - { - PassParameters->OutVelocityCombinedTexture = GraphBuilder.CreateUAV(CombinedVelocityTexture); - - FScreenPassTextureViewport CombinedVelocityViewport(CombinedVelocityTexture, OutputViewRect); - FScreenPassTextureViewportParameters CombinedVelocityViewportParameters = GetScreenPassTextureViewportParameters(CombinedVelocityViewport); - PassParameters->CombinedVelocity = CombinedVelocityViewportParameters; - } - - // various state - { - PassParameters->TemporalJitterPixels = FVector2f(View.TemporalJitterPixels); // LWC_TODO: Precision loss - PassParameters->View = View.ViewUniformBuffer; - } - - FVelocityCombineCS::FPermutationDomain PermutationVector; - PermutationVector.Set(bDilateMotionVectors); - - TShaderMapRef ComputeShader(View.ShaderMap, PermutationVector); - - FComputeShaderUtils::AddPass( - GraphBuilder, - RDG_EVENT_NAME("Velocity Combine%s (%dx%d -> %dx%d)", - bDilateMotionVectors ? TEXT(" Dilate") : TEXT(""), - InputViewRect.Width(), InputViewRect.Height(), - OutputViewRect.Width(), OutputViewRect.Height() - ), - ComputeShader, - PassParameters, - FComputeShaderUtils::GetGroupCount(OutputViewRect.Size(), FComputeShaderUtils::kGolden2DGroupSize)); - - return CombinedVelocityTexture; -} \ No newline at end of file diff --git a/plugins/DLSS/Source/DLSSUtility/Public/DLSSUtility.h b/plugins/DLSS/Source/DLSSUtility/Public/DLSSUtility.h deleted file mode 100644 index 040e9a17..00000000 --- a/plugins/DLSS/Source/DLSSUtility/Public/DLSSUtility.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#pragma once - -#include "Modules/ModuleManager.h" - - -class FDLSSUtilityModule final : public IModuleInterface -{ -public: - - /** IModuleInterface implementation */ - virtual void StartupModule() override; - virtual void ShutdownModule() override; - -private: -}; diff --git a/plugins/DLSS/Source/DLSSUtility/Public/VelocityCombinePass.h b/plugins/DLSS/Source/DLSSUtility/Public/VelocityCombinePass.h deleted file mode 100644 index 667cf241..00000000 --- a/plugins/DLSS/Source/DLSSUtility/Public/VelocityCombinePass.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#pragma once - -#include "CoreMinimal.h" -#include "RendererInterface.h" -#include "ScreenPass.h" - - -extern DLSSUTILITY_API FRDGTextureRef AddVelocityCombinePass( - FRDGBuilder& GraphBuilder, - const FViewInfo& View, - FRDGTextureRef InSceneDepthTexture, - FRDGTextureRef InVelocityTexture, - bool bDilateMotionVectors -); diff --git a/plugins/DLSS/Source/NGXD3D11RHI/NGXD3D11RHI.Build.cs b/plugins/DLSS/Source/NGXD3D11RHI/NGXD3D11RHI.Build.cs deleted file mode 100644 index 0439dd12..00000000 --- a/plugins/DLSS/Source/NGXD3D11RHI/NGXD3D11RHI.Build.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -using UnrealBuildTool; - -public class NGXD3D11RHI : ModuleRules -{ - public NGXD3D11RHI(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicIncludePaths.AddRange( - new string[] { - } - ); - - - PrivateIncludePaths.AddRange( - new string[] { - } - ); - - - PublicDependencyModuleNames.AddRange( - new string[] - { - } - ); - - - PrivateDependencyModuleNames.AddRange( - new string[] - { - "Core", - "Engine", - "RenderCore", - "RHI", - "D3D11RHI", - - "NGX", - "NGXRHI", - } - ); - - // those come from the D3D11RHI - AddEngineThirdPartyPrivateStaticDependencies(Target, "DX11"); - } -} diff --git a/plugins/DLSS/Source/NGXD3D11RHI/Private/NGXD3D11RHI.cpp b/plugins/DLSS/Source/NGXD3D11RHI/Private/NGXD3D11RHI.cpp deleted file mode 100644 index 5d0a1d07..00000000 --- a/plugins/DLSS/Source/NGXD3D11RHI/Private/NGXD3D11RHI.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#include "NGXD3D11RHI.h" - -#include "nvsdk_ngx.h" -#include "nvsdk_ngx_helpers.h" - -#include "ID3D11DynamicRHI.h" -#include "GenericPlatform/GenericPlatformFile.h" - -DEFINE_LOG_CATEGORY_STATIC(LogDLSSNGXD3D11RHI, Log, All); - -#define LOCTEXT_NAMESPACE "FNGXD3D11RHIModule" - -class FD3D11NGXFeatureHandle final : public NGXDLSSFeature -{ - -public: - - using NGXDLSSFeature::NGXDLSSFeature; - - virtual ~FD3D11NGXFeatureHandle() - { - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - check(NGXRHI::NGXInitialized()); - NVSDK_NGX_Result ResultReleaseFeature = NVSDK_NGX_D3D11_ReleaseFeature(Feature); - checkf(NVSDK_NGX_SUCCEED(ResultReleaseFeature), TEXT("NVSDK_NGX_D3D11_ReleaseFeature failed! (%u %s), %s"), ResultReleaseFeature, GetNGXResultAsString(ResultReleaseFeature), *Desc.GetDebugDescription()); - - if (Parameter != nullptr) - { - NVSDK_NGX_Result ResultDestroyParameter = NVSDK_NGX_D3D11_DestroyParameters(Parameter); - checkf(NVSDK_NGX_SUCCEED(ResultDestroyParameter), TEXT("NVSDK_NGX_D3D11_DestroyParameters failed! (%u %s), %s"), ResultDestroyParameter, GetNGXResultAsString(ResultDestroyParameter), *Desc.GetDebugDescription()); - } - } -}; - -class FNGXD3D11RHI final : public NGXRHI -{ -public: - FNGXD3D11RHI(const FNGXRHICreateArguments& Arguments); - - virtual void ExecuteDLSS(FRHICommandList& CmdList, const FRHIDLSSArguments& InArguments, FDLSSStateRef InDLSSState) final; - virtual ~FNGXD3D11RHI(); -private: - - ID3D11DynamicRHI* D3D11RHI = nullptr; - ID3D11Device* Direct3DDevice = nullptr; - ID3D11DeviceContext* Direct3DDeviceIMContext = nullptr; - - NVSDK_NGX_Result Init_NGX_D3D11(const FNGXRHICreateArguments& InArguments, const wchar_t* InApplicationDataPath, ID3D11Device* InHandle, const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo); - static bool IsIncompatibleAPICaptureToolActive(ID3D11Device* InDirect3DDevice); - -}; - -bool FNGXD3D11RHI::IsIncompatibleAPICaptureToolActive(ID3D11Device* InDirect3DDevice) -{ - // RenderDoc - { - IID RenderDocID; - if (SUCCEEDED(IIDFromString(L"{A7AA6116-9C8D-4BBA-9083-B4D816B71B78}", &RenderDocID))) - { - TRefCountPtr RenderDoc; - if (SUCCEEDED(InDirect3DDevice->QueryInterface(RenderDocID, (void**)RenderDoc.GetInitReference()))) - { - return true; - } - } - } - return false; -} - -NVSDK_NGX_Result FNGXD3D11RHI::Init_NGX_D3D11(const FNGXRHICreateArguments& InArguments, const wchar_t* InApplicationDataPath, ID3D11Device* InHandle, const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo) -{ - NVSDK_NGX_Result Result = NVSDK_NGX_Result_Fail; - int32 APIVersion = NVSDK_NGX_VERSION_API_MACRO; - do - { - if (InArguments.InitializeNGXWithNGXApplicationID()) - { - Result = NVSDK_NGX_D3D11_Init(InArguments.NGXAppId, InApplicationDataPath, InHandle, InFeatureInfo, static_cast(APIVersion)); - UE_LOG(LogDLSSNGXD3D11RHI, Log, TEXT("NVSDK_NGX_D3D11_Init(AppID= %u, APIVersion = 0x%x) -> (%u %s)"), InArguments.NGXAppId, APIVersion, Result, GetNGXResultAsString(Result)); - } - else - { - Result = NVSDK_NGX_D3D11_Init_with_ProjectID(TCHAR_TO_UTF8(*InArguments.UnrealProjectID), NVSDK_NGX_ENGINE_TYPE_UNREAL, TCHAR_TO_UTF8(*InArguments.UnrealEngineVersion), InApplicationDataPath, InHandle, InFeatureInfo, static_cast(APIVersion)); - UE_LOG(LogDLSSNGXD3D11RHI, Log, TEXT("NVSDK_NGX_D3D11_Init_with_ProjectID(ProjectID = %s, EngineVersion=%s, APIVersion = 0x%x) -> (%u %s)"), *InArguments.UnrealProjectID, *InArguments.UnrealEngineVersion, APIVersion, Result, GetNGXResultAsString(Result)); - } - - if (NVSDK_NGX_FAILED(Result)) - { - NVSDK_NGX_D3D11_Shutdown(); - } - - --APIVersion; - } while (NVSDK_NGX_FAILED(Result) && APIVersion >= NVSDK_NGX_VERSION_API_MACRO_BASE_LINE); - - if (!NVSDK_NGX_FAILED(Result) && (APIVersion + 1 < NVSDK_NGX_VERSION_API_MACRO_WITH_LOGGING)) - { - UE_LOG(LogDLSSNGXD3D11RHI, Log, TEXT("Warning: NVSDK_NGX_D3D11_Init succeeded, but the driver installed on this system is too old the support the NGX logging API. The console variables r.NGX.LogLevel and r.NGX.EnableOtherLoggingSinks will have no effect and NGX logs will only show up in their own log files, and not in UE's log files.")); - } - - return Result; -} - -FNGXD3D11RHI::FNGXD3D11RHI(const FNGXRHICreateArguments& Arguments) - : NGXRHI(Arguments) - , D3D11RHI(CastDynamicRHI(Arguments.DynamicRHI)) - , Direct3DDevice(D3D11RHI->RHIGetDevice()) - , Direct3DDeviceIMContext(D3D11RHI->RHIGetDeviceContext()) -{ - ensure(D3D11RHI); - ensure(Direct3DDevice); - - bIsIncompatibleAPICaptureToolActive = IsIncompatibleAPICaptureToolActive(Direct3DDevice); - - const FString NGXLogDir = GetNGXLogDirectory(); - IPlatformFile::GetPlatformPhysical().CreateDirectoryTree(*NGXLogDir); - - NVSDK_NGX_Result ResultInit = Init_NGX_D3D11(Arguments, *NGXLogDir, Direct3DDevice, CommonFeatureInfo()); - UE_LOG(LogDLSSNGXD3D11RHI, Log, TEXT("NVSDK_NGX_D3D11_Init (Log %s) -> (%u %s)"), *NGXLogDir, ResultInit, GetNGXResultAsString(ResultInit)); - - // store for the higher level code interpret - DLSSQueryFeature.DLSSInitResult = ResultInit; - - if (NVSDK_NGX_Result_FAIL_OutOfDate == ResultInit) - { - DLSSQueryFeature.DriverRequirements.DriverUpdateRequired = true; - } - else if (NVSDK_NGX_SUCCEED(ResultInit)) - { - bNGXInitialized = true; - - NVSDK_NGX_Result ResultGetParameters = NVSDK_NGX_D3D11_GetCapabilityParameters(&DLSSQueryFeature.CapabilityParameters); - - UE_LOG(LogDLSSNGXD3D11RHI, Log, TEXT("NVSDK_NGX_D3D11_GetCapabilityParameters -> (%u %s)"), ResultGetParameters, GetNGXResultAsString(ResultGetParameters)); - - if (NVSDK_NGX_Result_FAIL_OutOfDate == ResultGetParameters) - { - DLSSQueryFeature.DriverRequirements.DriverUpdateRequired = true; - } - - if (NVSDK_NGX_SUCCEED(ResultGetParameters)) - { - DLSSQueryFeature.QueryDLSSSupport(); - } - } -} - -FNGXD3D11RHI::~FNGXD3D11RHI() -{ - UE_LOG(LogDLSSNGXD3D11RHI, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - if(bNGXInitialized) - { - // Destroy the parameters and features before we call NVSDK_NGX_D3D11_Shutdown - ReleaseAllocatedFeatures(); - - NVSDK_NGX_Result Result; - if (DLSSQueryFeature.CapabilityParameters != nullptr) - { - Result = NVSDK_NGX_D3D11_DestroyParameters(DLSSQueryFeature.CapabilityParameters); - UE_LOG(LogDLSSNGXD3D11RHI, Log, TEXT("NVSDK_NGX_D3D11_DestroyParameters -> (%u %s)"), Result, GetNGXResultAsString(Result)); - } - Result = NVSDK_NGX_D3D11_Shutdown(); - UE_LOG(LogDLSSNGXD3D11RHI, Log, TEXT("NVSDK_NGX_D3D11_Shutdown -> (%u %s)"), Result, GetNGXResultAsString(Result)); - bNGXInitialized = false; - } - UE_LOG(LogDLSSNGXD3D11RHI, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - - -void FNGXD3D11RHI::ExecuteDLSS(FRHICommandList& CmdList, const FRHIDLSSArguments& InArguments, FDLSSStateRef InDLSSState) -{ - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - check(IsDLSSAvailable()); - if (!IsDLSSAvailable()) - return; - InArguments.Validate(); - - if (InDLSSState->RequiresFeatureRecreation(InArguments)) - { - check(!InDLSSState->DLSSFeature || InDLSSState->HasValidFeature()); - InDLSSState->DLSSFeature = nullptr; - } - - if (InArguments.bReset) - { - check(!InDLSSState->DLSSFeature); - InDLSSState->DLSSFeature = FindFreeFeature(InArguments); - } - - if (!InDLSSState->DLSSFeature) - { - NVSDK_NGX_Parameter* NewNGXParameterHandle = nullptr; - - NVSDK_NGX_Result Result = NVSDK_NGX_D3D11_AllocateParameters(&NewNGXParameterHandle); - checkf(NVSDK_NGX_SUCCEED(Result), TEXT("NVSDK_NGX_D3D11_AllocateParameters failed! (%u %s)"), Result, GetNGXResultAsString(Result)); - - ApplyCommonNGXParameterSettings(NewNGXParameterHandle, InArguments); - - NVSDK_NGX_DLSS_Create_Params DlssCreateParams = InArguments.GetNGXDLSSCreateParams(); - NVSDK_NGX_Handle* NewNGXHandle = nullptr; - NVSDK_NGX_Result ResultCreate = NGX_D3D11_CREATE_DLSS_EXT( - Direct3DDeviceIMContext, - &NewNGXHandle, - NewNGXParameterHandle, - &DlssCreateParams); - checkf(NVSDK_NGX_SUCCEED(ResultCreate), TEXT("NGX_D3D11_CREATE_DLSS failed! (%u %s), %s"), ResultCreate, GetNGXResultAsString(ResultCreate), *InArguments.GetFeatureDesc().GetDebugDescription()); - - InDLSSState->DLSSFeature = MakeShared(NewNGXHandle, NewNGXParameterHandle, InArguments.GetFeatureDesc(), FrameCounter); - RegisterFeature(InDLSSState->DLSSFeature); - } - - check(InDLSSState->HasValidFeature()); - - // execute - - D3D11RHI->RHIRegisterWork(1); - - NVSDK_NGX_D3D11_DLSS_Eval_Params DlssEvalParams; - FMemory::Memzero(DlssEvalParams); - - DlssEvalParams.Feature.pInOutput = D3D11RHI->RHIGetResource(InArguments.OutputColor); - DlssEvalParams.InOutputSubrectBase.X = InArguments.DestRect.Min.X; - DlssEvalParams.InOutputSubrectBase.Y = InArguments.DestRect.Min.Y; - - DlssEvalParams.InRenderSubrectDimensions.Width = InArguments.SrcRect.Width(); - DlssEvalParams.InRenderSubrectDimensions.Height = InArguments.SrcRect.Height(); - - DlssEvalParams.Feature.pInColor = D3D11RHI->RHIGetResource(InArguments.InputColor); - DlssEvalParams.InColorSubrectBase.X = InArguments.SrcRect.Min.X; - DlssEvalParams.InColorSubrectBase.Y = InArguments.SrcRect.Min.Y; - - DlssEvalParams.pInDepth = D3D11RHI->RHIGetResource(InArguments.InputDepth); - DlssEvalParams.InDepthSubrectBase.X = InArguments.SrcRect.Min.X; - DlssEvalParams.InDepthSubrectBase.Y = InArguments.SrcRect.Min.Y; - - // The VelocityCombine pass puts the motion vectors into the top left corner - DlssEvalParams.pInMotionVectors = D3D11RHI->RHIGetResource(InArguments.InputMotionVectors); - DlssEvalParams.InMVSubrectBase.X = 0; - DlssEvalParams.InMVSubrectBase.Y = 0; - - DlssEvalParams.pInExposureTexture = InArguments.bUseAutoExposure ? nullptr : D3D11RHI->RHIGetResource(InArguments.InputExposure); - DlssEvalParams.InPreExposure = InArguments.PreExposure; - - DlssEvalParams.Feature.InSharpness = InArguments.Sharpness; - DlssEvalParams.InJitterOffsetX = InArguments.JitterOffset.X; - DlssEvalParams.InJitterOffsetY = InArguments.JitterOffset.Y; - - DlssEvalParams.InMVScaleX = InArguments.MotionVectorScale.X; - DlssEvalParams.InMVScaleY = InArguments.MotionVectorScale.Y; - DlssEvalParams.InReset = InArguments.bReset; - - DlssEvalParams.InFrameTimeDeltaInMsec = InArguments.DeltaTime; - - - NVSDK_NGX_Result ResultEvaluate = NGX_D3D11_EVALUATE_DLSS_EXT( - Direct3DDeviceIMContext, - InDLSSState->DLSSFeature->Feature, - InDLSSState->DLSSFeature->Parameter, - &DlssEvalParams - ); - checkf(NVSDK_NGX_SUCCEED(ResultEvaluate), TEXT("NGX_D3D11_EVALUATE_DLSS_EXT failed! (%u %s), %s"), ResultEvaluate, GetNGXResultAsString(ResultEvaluate), *InDLSSState->DLSSFeature->Desc.GetDebugDescription()); - - InDLSSState->DLSSFeature->Tick(FrameCounter); -} - -/** IModuleInterface implementation */ - -void FNGXD3D11RHIModule::StartupModule() -{ - // NGXRHI module should be loaded to ensure logging state is initialized - FModuleManager::LoadModuleChecked(TEXT("NGXRHI")); -} - -void FNGXD3D11RHIModule::ShutdownModule() -{ -} - -TUniquePtr FNGXD3D11RHIModule::CreateNGXRHI(const FNGXRHICreateArguments& Arguments) -{ - TUniquePtr Result(new FNGXD3D11RHI(Arguments)); - return Result; -} - -IMPLEMENT_MODULE(FNGXD3D11RHIModule, NGXD3D11RHI) - -#undef LOCTEXT_NAMESPACE - - diff --git a/plugins/DLSS/Source/NGXD3D11RHI/Public/NGXD3D11RHI.h b/plugins/DLSS/Source/NGXD3D11RHI/Public/NGXD3D11RHI.h deleted file mode 100644 index a60075e5..00000000 --- a/plugins/DLSS/Source/NGXD3D11RHI/Public/NGXD3D11RHI.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#pragma once -#include "Modules/ModuleManager.h" - -#include "NGXRHI.h" - -class FNGXD3D11RHIModule final : public INGXRHIModule -{ -public: - - /** IModuleInterface implementation */ - virtual void StartupModule(); - virtual void ShutdownModule(); - - /** INGXRHIModule implementation */ - virtual TUniquePtr CreateNGXRHI(const FNGXRHICreateArguments& Arguments); -}; \ No newline at end of file diff --git a/plugins/DLSS/Source/NGXD3D12RHI/NGXD3D12RHI.Build.cs b/plugins/DLSS/Source/NGXD3D12RHI/NGXD3D12RHI.Build.cs deleted file mode 100644 index 99202dd5..00000000 --- a/plugins/DLSS/Source/NGXD3D12RHI/NGXD3D12RHI.Build.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -using UnrealBuildTool; -using System.IO; -public class NGXD3D12RHI : ModuleRules -{ - public NGXD3D12RHI(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicIncludePaths.AddRange( - new string[] { - } - ); - - PrivateIncludePaths.AddRange( - new string[] { - } - ); - - PublicDependencyModuleNames.AddRange( - new string[] - { - } - ); - - - PrivateDependencyModuleNames.AddRange( - new string[] - { - "Core", - "Engine", - "RenderCore", - "RHI", - "D3D12RHI", - - "NGX", - "NGXRHI", - } - ); - - // those come from the D3D12RHI - AddEngineThirdPartyPrivateStaticDependencies(Target, "DX12"); - } -} diff --git a/plugins/DLSS/Source/NGXD3D12RHI/Private/NGXD3D12RHI.cpp b/plugins/DLSS/Source/NGXD3D12RHI/Private/NGXD3D12RHI.cpp deleted file mode 100644 index eb8e3f6b..00000000 --- a/plugins/DLSS/Source/NGXD3D12RHI/Private/NGXD3D12RHI.cpp +++ /dev/null @@ -1,314 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#include "NGXD3D12RHI.h" - -#include "nvsdk_ngx.h" -#include "nvsdk_ngx_helpers.h" - -#include "ID3D12DynamicRHI.h" -#include "GenericPlatform/GenericPlatformFile.h" - - - -DEFINE_LOG_CATEGORY_STATIC(LogDLSSNGXD3D12RHI, Log, All); - -#define LOCTEXT_NAMESPACE "FNGXD3D12RHIModule" - -class FD3D12NGXDLSSFeature final : public NGXDLSSFeature -{ - -public: - using NGXDLSSFeature::NGXDLSSFeature; - - virtual ~FD3D12NGXDLSSFeature() - { - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - check(NGXRHI::NGXInitialized()); - NVSDK_NGX_Result ResultReleaseFeature = NVSDK_NGX_D3D12_ReleaseFeature(Feature); - checkf(NVSDK_NGX_SUCCEED(ResultReleaseFeature), TEXT("NVSDK_NGX_D3D12_ReleaseFeature failed! (%u %s), %s"), ResultReleaseFeature, GetNGXResultAsString(ResultReleaseFeature), *Desc.GetDebugDescription()); - - if (Parameter != nullptr) - { - NVSDK_NGX_Result ResultDestroyParameter = NVSDK_NGX_D3D12_DestroyParameters(Parameter); - checkf(NVSDK_NGX_SUCCEED(ResultDestroyParameter), TEXT("NVSDK_NGX_D3D12_DestroyParameters failed! (%u %s), %s"), ResultDestroyParameter, GetNGXResultAsString(ResultDestroyParameter), *Desc.GetDebugDescription()); - } - } -}; - -class FNGXD3D12RHI final : public NGXRHI -{ - -public: - FNGXD3D12RHI(const FNGXRHICreateArguments& Arguments); - virtual void ExecuteDLSS(FRHICommandList& CmdList, const FRHIDLSSArguments& InArguments, FDLSSStateRef InDLSSState) final; - virtual ~FNGXD3D12RHI(); -private: - NVSDK_NGX_Result Init_NGX_D3D12(const FNGXRHICreateArguments& InArguments, const wchar_t* InApplicationDataPath, ID3D12Device* InHandle, const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo); - static bool IsIncompatibleAPICaptureToolActive(ID3D12Device* InDirect3DDevice); - - ID3D12DynamicRHI* D3D12RHI = nullptr; - -}; - -bool FNGXD3D12RHI::IsIncompatibleAPICaptureToolActive(ID3D12Device* InDirect3DDevice) -{ - // RenderDoc - { - IID RenderDocID; - if (SUCCEEDED(IIDFromString(L"{A7AA6116-9C8D-4BBA-9083-B4D816B71B78}", &RenderDocID))) - { - TRefCountPtr RenderDoc; - if (SUCCEEDED(InDirect3DDevice->QueryInterface(RenderDocID, (void**)RenderDoc.GetInitReference()))) - { - return true; - } - } - } - return false; -} - -NVSDK_NGX_Result FNGXD3D12RHI::Init_NGX_D3D12(const FNGXRHICreateArguments& InArguments, const wchar_t* InApplicationDataPath, ID3D12Device* InHandle, const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo) -{ - NVSDK_NGX_Result Result = NVSDK_NGX_Result_Fail; - int32 APIVersion = NVSDK_NGX_VERSION_API_MACRO; - do - { - if (InArguments.InitializeNGXWithNGXApplicationID()) - { - Result = NVSDK_NGX_D3D12_Init(InArguments.NGXAppId, InApplicationDataPath, InHandle, InFeatureInfo, static_cast(APIVersion)); - UE_LOG(LogDLSSNGXD3D12RHI, Log, TEXT("NVSDK_NGX_D3D12_Init(AppID= %u, APIVersion = 0x%x, Device=%p) -> (%u %s)"), InArguments.NGXAppId, APIVersion, InHandle, Result, GetNGXResultAsString(Result)); - } - else - { - Result = NVSDK_NGX_D3D12_Init_with_ProjectID(TCHAR_TO_UTF8(*InArguments.UnrealProjectID), NVSDK_NGX_ENGINE_TYPE_UNREAL, TCHAR_TO_UTF8(*InArguments.UnrealEngineVersion), InApplicationDataPath, InHandle, InFeatureInfo, static_cast(APIVersion)); - UE_LOG(LogDLSSNGXD3D12RHI, Log, TEXT("NVSDK_NGX_D3D12_Init_with_ProjectID(ProjectID = %s, EngineVersion=%s, APIVersion = 0x%x, Device=%p) -> (%u %s)"), *InArguments.UnrealProjectID, *InArguments.UnrealEngineVersion, APIVersion, InHandle, Result, GetNGXResultAsString(Result)); - } - - if (NVSDK_NGX_FAILED(Result)) - { - NVSDK_NGX_D3D12_Shutdown(); - } - - --APIVersion; - } while (NVSDK_NGX_FAILED(Result) && APIVersion >= NVSDK_NGX_VERSION_API_MACRO_BASE_LINE); - - if (NVSDK_NGX_SUCCEED(Result) && (APIVersion + 1 < NVSDK_NGX_VERSION_API_MACRO_WITH_LOGGING)) - { - UE_LOG(LogDLSSNGXD3D12RHI, Log, TEXT("Warning: NVSDK_NGX_D3D12_Init succeeded, but the driver installed on this system is too old the support the NGX logging API. The console variables r.NGX.LogLevel and r.NGX.EnableOtherLoggingSinks will have no effect and NGX logs will only show up in their own log files, and not in UE's log files.")); - } - - return Result; -} - - - -FNGXD3D12RHI::FNGXD3D12RHI(const FNGXRHICreateArguments& Arguments) - : NGXRHI(Arguments) - , D3D12RHI(CastDynamicRHI(Arguments.DynamicRHI)) - -{ - // TODO: adapter index - ID3D12Device* Direct3DDevice = D3D12RHI->RHIGetDevice(0); - - ensure(D3D12RHI); - ensure(Direct3DDevice); - bIsIncompatibleAPICaptureToolActive = IsIncompatibleAPICaptureToolActive(Direct3DDevice); - - const FString NGXLogDir = GetNGXLogDirectory(); - IPlatformFile::GetPlatformPhysical().CreateDirectoryTree(*NGXLogDir); - - NVSDK_NGX_Result ResultInit = Init_NGX_D3D12(Arguments, *NGXLogDir, Direct3DDevice, CommonFeatureInfo()); - UE_LOG(LogDLSSNGXD3D12RHI, Log, TEXT("NVSDK_NGX_D3D12_Init (Log %s) -> (%u %s)"), *NGXLogDir, ResultInit, GetNGXResultAsString(ResultInit)); - - // store for the higher level code interpret - DLSSQueryFeature.DLSSInitResult = ResultInit; - - if (NVSDK_NGX_Result_FAIL_OutOfDate == ResultInit) - { - DLSSQueryFeature.DriverRequirements.DriverUpdateRequired = true; - } - else if (NVSDK_NGX_SUCCEED(ResultInit)) - { - bNGXInitialized = true; - - NVSDK_NGX_Result ResultGetParameters = NVSDK_NGX_D3D12_GetCapabilityParameters(&DLSSQueryFeature.CapabilityParameters); - - UE_LOG(LogDLSSNGXD3D12RHI, Log, TEXT("NVSDK_NGX_D3D12_GetCapabilityParameters -> (%u %s)"), ResultGetParameters, GetNGXResultAsString(ResultGetParameters)); - - if (NVSDK_NGX_Result_FAIL_OutOfDate == ResultGetParameters) - { - DLSSQueryFeature.DriverRequirements.DriverUpdateRequired = true; - } - - if (NVSDK_NGX_SUCCEED(ResultGetParameters)) - { - DLSSQueryFeature.QueryDLSSSupport(); - } - } -} - -FNGXD3D12RHI::~FNGXD3D12RHI() -{ - UE_LOG(LogDLSSNGXD3D12RHI, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - if (bNGXInitialized) - { - // Destroy the parameters and features before we call NVSDK_NGX_D3D11_Shutdown - ReleaseAllocatedFeatures(); - - NVSDK_NGX_Result Result; - if (DLSSQueryFeature.CapabilityParameters != nullptr) - { - Result = NVSDK_NGX_D3D12_DestroyParameters(DLSSQueryFeature.CapabilityParameters); - UE_LOG(LogDLSSNGXD3D12RHI, Log, TEXT("NVSDK_NGX_D3D12_DestroyParameters -> (%u %s)"), Result, GetNGXResultAsString(Result)); - } - Result = NVSDK_NGX_D3D12_Shutdown(); - UE_LOG(LogDLSSNGXD3D12RHI, Log, TEXT("NVSDK_NGX_D3D12_Shutdown -> (%u %s)"), Result, GetNGXResultAsString(Result)); - bNGXInitialized = false; - } - UE_LOG(LogDLSSNGXD3D12RHI, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - -void FNGXD3D12RHI::ExecuteDLSS(FRHICommandList& CmdList, const FRHIDLSSArguments& InArguments, FDLSSStateRef InDLSSState) -{ - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - check(IsDLSSAvailable()); - if (!IsDLSSAvailable()) return; - - InArguments.Validate(); - - const uint32 DeviceIndex = D3D12RHI->RHIGetResourceDeviceIndex(InArguments.InputColor); - ID3D12GraphicsCommandList* D3DGraphicsCommandList = D3D12RHI->RHIGetGraphicsCommandList(DeviceIndex); - - if (InDLSSState->RequiresFeatureRecreation(InArguments)) - { - check(!InDLSSState->DLSSFeature || InDLSSState->HasValidFeature()); - InDLSSState->DLSSFeature = nullptr; - } - - if (InArguments.bReset) - { - check(!InDLSSState->DLSSFeature); - InDLSSState->DLSSFeature = FindFreeFeature(InArguments); - } - - if (!InDLSSState->DLSSFeature) - { - NVSDK_NGX_Parameter* NewNGXParameterHandle = nullptr; - NVSDK_NGX_Result Result = NVSDK_NGX_D3D12_AllocateParameters(&NewNGXParameterHandle); - checkf(NVSDK_NGX_SUCCEED(Result), TEXT("NVSDK_NGX_D3D12_AllocateParameters failed! (%u %s)"), Result, GetNGXResultAsString(Result)); - - ApplyCommonNGXParameterSettings(NewNGXParameterHandle, InArguments); - - NVSDK_NGX_DLSS_Create_Params DlssCreateParams = InArguments.GetNGXDLSSCreateParams(); - NVSDK_NGX_Handle* NewNGXFeatureHandle = nullptr; - - const uint32 CreationNodeMask = 1 << InArguments.GPUNode; - const uint32 VisibilityNodeMask = InArguments.GPUVisibility; - - NVSDK_NGX_Result ResultCreate = NGX_D3D12_CREATE_DLSS_EXT( - D3DGraphicsCommandList, - CreationNodeMask, - VisibilityNodeMask, - &NewNGXFeatureHandle, - NewNGXParameterHandle, - &DlssCreateParams - ); - checkf(NVSDK_NGX_SUCCEED(ResultCreate), TEXT("NGX_D3D12_CREATE_DLSS_EXT (CreationNodeMask=0x%x VisibilityNodeMask=0x%x) failed! (%u %s), %s"), CreationNodeMask, VisibilityNodeMask, ResultCreate, GetNGXResultAsString(ResultCreate), *InArguments.GetFeatureDesc().GetDebugDescription()); - InDLSSState->DLSSFeature = MakeShared(NewNGXFeatureHandle, NewNGXParameterHandle, InArguments.GetFeatureDesc(), FrameCounter); - RegisterFeature(InDLSSState->DLSSFeature); - } - - check(InDLSSState->HasValidFeature()); - - // execute - //TODO: replaced with what in 5.1? will something be missing from gpu profiling? see commit 305e264e -#if 0 - if (Device->GetCommandContext().IsDefaultContext()) - { - Device->RegisterGPUWork(1); - } -#endif - - NVSDK_NGX_D3D12_DLSS_Eval_Params DlssEvalParams; - FMemory::Memzero(DlssEvalParams); - - //TODO: does RHIGetResource do the right thing with multiple GPUs? - DlssEvalParams.Feature.pInOutput = D3D12RHI->RHIGetResource(InArguments.OutputColor); - DlssEvalParams.InOutputSubrectBase.X = InArguments.DestRect.Min.X; - DlssEvalParams.InOutputSubrectBase.Y = InArguments.DestRect.Min.Y; - - DlssEvalParams.InRenderSubrectDimensions.Width = InArguments.SrcRect.Width(); - DlssEvalParams.InRenderSubrectDimensions.Height = InArguments.SrcRect.Height(); - - DlssEvalParams.Feature.pInColor = D3D12RHI->RHIGetResource(InArguments.InputColor); - DlssEvalParams.InColorSubrectBase.X = InArguments.SrcRect.Min.X; - DlssEvalParams.InColorSubrectBase.Y = InArguments.SrcRect.Min.Y; - - DlssEvalParams.pInDepth = D3D12RHI->RHIGetResource(InArguments.InputDepth); - DlssEvalParams.InDepthSubrectBase.X = InArguments.SrcRect.Min.X; - DlssEvalParams.InDepthSubrectBase.Y = InArguments.SrcRect.Min.Y; - - DlssEvalParams.pInMotionVectors = D3D12RHI->RHIGetResource(InArguments.InputMotionVectors); - // The VelocityCombine pass puts the motion vectors into the top left corner - DlssEvalParams.InMVSubrectBase.X = 0; - DlssEvalParams.InMVSubrectBase.Y = 0; - - DlssEvalParams.pInExposureTexture = InArguments.bUseAutoExposure ? nullptr : D3D12RHI->RHIGetResource(InArguments.InputExposure); - DlssEvalParams.InPreExposure = InArguments.PreExposure; - - DlssEvalParams.Feature.InSharpness = InArguments.Sharpness; - DlssEvalParams.InJitterOffsetX = InArguments.JitterOffset.X; - DlssEvalParams.InJitterOffsetY = InArguments.JitterOffset.Y; - - DlssEvalParams.InMVScaleX = InArguments.MotionVectorScale.X; - DlssEvalParams.InMVScaleY = InArguments.MotionVectorScale.Y; - DlssEvalParams.InReset = InArguments.bReset; - - DlssEvalParams.InFrameTimeDeltaInMsec = InArguments.DeltaTime; - - NVSDK_NGX_Result ResultEvaluate = NGX_D3D12_EVALUATE_DLSS_EXT( - D3DGraphicsCommandList, - InDLSSState->DLSSFeature->Feature, - InDLSSState->DLSSFeature->Parameter, - &DlssEvalParams - ); - checkf(NVSDK_NGX_SUCCEED(ResultEvaluate), TEXT("NGX_D3D12_EVALUATE_DLSS_EXT failed! (%u %s), %s"), ResultEvaluate, GetNGXResultAsString(ResultEvaluate), *InDLSSState->DLSSFeature->Desc.GetDebugDescription()); - InDLSSState->DLSSFeature->Tick(FrameCounter); - - D3D12RHI->RHIFinishExternalComputeWork(DeviceIndex, D3DGraphicsCommandList); -} - -/** IModuleInterface implementation */ - -void FNGXD3D12RHIModule::StartupModule() -{ - // NGXRHI module should be loaded to ensure logging state is initialized - FModuleManager::LoadModuleChecked(TEXT("NGXRHI")); -} - -void FNGXD3D12RHIModule::ShutdownModule() -{ -} - -TUniquePtr FNGXD3D12RHIModule::CreateNGXRHI(const FNGXRHICreateArguments& Arguments) -{ - TUniquePtr Result(new FNGXD3D12RHI(Arguments)); - return Result; -} - -IMPLEMENT_MODULE(FNGXD3D12RHIModule, NGXD3D12RHI) - -#undef LOCTEXT_NAMESPACE - - - - diff --git a/plugins/DLSS/Source/NGXD3D12RHI/Public/NGXD3D12RHI.h b/plugins/DLSS/Source/NGXD3D12RHI/Public/NGXD3D12RHI.h deleted file mode 100644 index 4631420d..00000000 --- a/plugins/DLSS/Source/NGXD3D12RHI/Public/NGXD3D12RHI.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#pragma once - -#include "Modules/ModuleManager.h" -#include "NGXRHI.h" - -class FNGXD3D12RHIModule final : public INGXRHIModule -{ -public: - - /** IModuleInterface implementation */ - virtual void StartupModule(); - virtual void ShutdownModule(); - - /** INGXRHIModule implementation */ - - virtual TUniquePtr CreateNGXRHI(const FNGXRHICreateArguments& Arguments); -}; \ No newline at end of file diff --git a/plugins/DLSS/Source/NGXRHI/NGXRHI.Build.cs b/plugins/DLSS/Source/NGXRHI/NGXRHI.Build.cs deleted file mode 100644 index 3b06dfb5..00000000 --- a/plugins/DLSS/Source/NGXRHI/NGXRHI.Build.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - - -using UnrealBuildTool; -using System.IO; -public class NGXRHI : ModuleRules -{ - public NGXRHI(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - - PublicIncludePaths.AddRange( - new string[] { - } - ); - - - PrivateIncludePaths.AddRange( - new string[] { - } - ); - - - PublicDependencyModuleNames.AddRange( - new string[] - { - } - ); - - - PrivateDependencyModuleNames.AddRange( - new string[] - { - - "Core", - "Engine", - "RenderCore", - "RHI", - - "NGX", - } - ); - DynamicallyLoadedModuleNames.AddRange( - new string[] - { - } - ); - } -} diff --git a/plugins/DLSS/Source/NGXRHI/Private/NGXRHI.cpp b/plugins/DLSS/Source/NGXRHI/Private/NGXRHI.cpp deleted file mode 100644 index 53461ee8..00000000 --- a/plugins/DLSS/Source/NGXRHI/Private/NGXRHI.cpp +++ /dev/null @@ -1,507 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#include "NGXRHI.h" - -#include "Misc/Paths.h" -#include "GenericPlatform/GenericPlatformFile.h" - -#include "nvsdk_ngx.h" -#include "nvsdk_ngx_params.h" -#include "nvsdk_ngx_helpers.h" - -// NGX software stack -DEFINE_LOG_CATEGORY_STATIC(LogDLSSNGX, Log, All); -// The UE module -DEFINE_LOG_CATEGORY_STATIC(LogDLSSNGXRHI, Log, All); - - - -DECLARE_STATS_GROUP(TEXT("DLSS"), STATGROUP_DLSS, STATCAT_Advanced); -DECLARE_MEMORY_STAT_POOL(TEXT("DLSS: Video memory"), STAT_DLSSInternalGPUMemory, STATGROUP_DLSS, FPlatformMemory::MCR_GPU); -DECLARE_DWORD_COUNTER_STAT(TEXT("DLSS: Num DLSS features"), STAT_DLSSNumFeatures, STATGROUP_DLSS); - -#define LOCTEXT_NAMESPACE "NGXRHI" - -static TAutoConsoleVariable CVarNGXLogLevel( - TEXT("r.NGX.LogLevel"), 1, - TEXT("Determines the minimal amount of logging the NGX implementation pipes into LogDLSSNGX. Can be overridden by the -NGXLogLevel= command line option\n") - TEXT("Please refer to the DLSS plugin documentation on other ways to change the logging level.\n") - TEXT("0: off \n") - TEXT("1: on (default)\n") - TEXT("2: verbose "), - ECVF_ReadOnly); - -static TAutoConsoleVariable CVarNGXEnableOtherLoggingSinks( - TEXT("r.NGX.EnableOtherLoggingSinks"), 0, - TEXT("Determines whether the NGX implementation will write logs to files. Can also be set on the command line via -NGXLogFileEnable and -NGXLogFileDisable\n") - TEXT("0: off (default)\n") - TEXT("1: on \n"), - ECVF_ReadOnly); - - -static TAutoConsoleVariable CVarNGXFramesUntilFeatureDestruction( - TEXT("r.NGX.FramesUntilFeatureDestruction"), 3, - TEXT("Number of frames until an unused NGX feature gets destroyed. (default=3)"), - ECVF_RenderThreadSafe); - -static TAutoConsoleVariable CVarNGXRenameLogSeverities( - TEXT("r.NGX.RenameNGXLogSeverities"), 1, - TEXT("Renames 'error' and 'warning' in messages returned by the NGX log callback to 'e_rror' and 'w_arning' before passing them to the UE log system\n") - TEXT("0: off \n") - TEXT("1: on, for select messages during initalization (default)\n") - TEXT("2: on, for all messages\n"), - ECVF_Default); - -void FRHIDLSSArguments::Validate() const -{ - check(InputColor); - check(InputDepth); - check(InputMotionVectors); - check(InputExposure); - check(OutputColor); -} - -NGXDLSSFeature::~NGXDLSSFeature() -{ - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - UE_LOG(LogDLSSNGXRHI, Log, TEXT("Destroying NGX DLSS Feature %s "), *Desc.GetDebugDescription()); -} - -void NVSDK_CONV NGXLogSink(const char* InNGXMessage, NVSDK_NGX_Logging_Level InLoggingLevel, NVSDK_NGX_Feature InSourceComponent) -{ - FString Message(FString(UTF8_TO_TCHAR(InNGXMessage)).TrimEnd()); - const TCHAR* NGXComponent = TEXT("Unknown"); - - switch (InSourceComponent) - { - case NVSDK_NGX_Feature_SuperSampling: NGXComponent = TEXT("DLSS"); break; - case NVSDK_NGX_Feature_Reserved_SDK : NGXComponent = TEXT("SDK"); break; - case NVSDK_NGX_Feature_Reserved_Core: NGXComponent = TEXT("Core"); break; - } - - const bool bIsVerboseStartupMessage = - (Message.Contains(TEXT(" doesn't exist in any of the search paths")) && !Message.Contains(TEXT("nvngx_dlss.dll"))) || // we want to know if the DLSS binary is missing - Message.Contains(TEXT("warning: UWP compliant mode enabled")); - - - - if ((CVarNGXRenameLogSeverities.GetValueOnAnyThread() == 2) || ((CVarNGXRenameLogSeverities.GetValueOnAnyThread() == 1) && bIsVerboseStartupMessage)) - { - Message = Message.Replace(TEXT("error:"), TEXT("e_rror:")); - Message = Message.Replace(TEXT("Warning:"), TEXT("w_arning:")); - UE_LOG(LogDLSSNGX, Verbose, TEXT("[%s]: %s"), NGXComponent, *Message); - } - else - { - UE_LOG(LogDLSSNGX, Log, TEXT("[%s]: %s"), NGXComponent, *Message); - } - -} - - -bool NGXRHI::bNGXInitialized = false; - -// the derived RHIs will set this to true during their initialization -bool NGXRHI::bIsIncompatibleAPICaptureToolActive = false; - -NGXRHI::NGXRHI(const FNGXRHICreateArguments& Arguments) - : DynamicRHI(Arguments.DynamicRHI) -{ - FString PluginNGXProductionBinariesDir = FPaths::Combine(Arguments.PluginBaseDir, TEXT("Binaries/ThirdParty/Win64/")); - FString PluginNGXDevelopmentBinariesDir = FPaths::Combine(Arguments.PluginBaseDir, TEXT("Binaries/ThirdParty/Win64/Development/")); - FString PluginNGXBinariesDir = PluginNGXProductionBinariesDir; - - // Thee paths can be different depending on the project type (source, no source) and how the project is packaged, thus we have both - FString ProjectNGXBinariesDir = FPaths::Combine(FPaths::ProjectDir(), TEXT("Binaries/ThirdParty/NVIDIA/NGX/Win64/")); - FString LaunchNGXBinariesDir = FPaths::Combine(FPaths::LaunchDir(), TEXT("Binaries/ThirdParty/NVIDIA/NGX/Win64/")); - - switch (Arguments.NGXBinariesSearchOrder) - { - default: - case ENGXBinariesSearchOrder::CustomThenGeneric: - { - UE_LOG(LogDLSSNGXRHI, Log, TEXT("Searching for custom and generic DLSS binaries")); - NGXDLLSearchPaths.Append({ ProjectNGXBinariesDir, LaunchNGXBinariesDir, PluginNGXProductionBinariesDir }); - break; - } - case ENGXBinariesSearchOrder::ForceGeneric: - { - UE_LOG(LogDLSSNGXRHI, Log, TEXT("Searching only for generic binaries from the plugin folder")); - NGXDLLSearchPaths.Append({ PluginNGXProductionBinariesDir }); - break; - } - case ENGXBinariesSearchOrder::ForceCustom: - { - UE_LOG(LogDLSSNGXRHI, Log, TEXT("Searching only for custom DLSS binaries from the DLSS plugin")); - NGXDLLSearchPaths.Append({ ProjectNGXBinariesDir, LaunchNGXBinariesDir }); - break; - } - case ENGXBinariesSearchOrder::ForceDevelopmentGeneric: - { - UE_LOG(LogDLSSNGXRHI, Log, TEXT("Searching only for generic development DLSS binaries from the DLSS plugin. This binary is only packaged for non-shipping build configurations")); - NGXDLLSearchPaths.Append({ PluginNGXDevelopmentBinariesDir }); - PluginNGXBinariesDir = PluginNGXDevelopmentBinariesDir; - break; - } - } - - for (int32 i = 0; i < NGXDLLSearchPaths.Num(); ++i) - { - NGXDLLSearchPaths[i] = FPaths::ConvertRelativePathToFull(NGXDLLSearchPaths[i]); - FPaths::RemoveDuplicateSlashes(NGXDLLSearchPaths[i]); - FPaths::MakePlatformFilename(NGXDLLSearchPaths[i]); - - // After this we should not touch NGXDLLSearchPaths since that provides the backing store for NGXDLLSearchPathRawStrings - NGXDLLSearchPathRawStrings.Add(*NGXDLLSearchPaths[i]); - const bool bHasDLSSBinary = IPlatformFile::GetPlatformPhysical().FileExists(*FPaths::Combine(NGXDLLSearchPaths[i], NGX_DLSS_BINARY_NAME)); - UE_LOG(LogDLSSNGXRHI, Log, TEXT("NVIDIA NGX DLSS binary %s %s in search path %s"), NGX_DLSS_BINARY_NAME, bHasDLSSBinary ? TEXT("found") : TEXT("not found"), *NGXDLLSearchPaths[i]); - } - - // we do this separately here so we can show relative paths in the UI later - DLSSGenericBinaryInfo.Get<0>() = FPaths::Combine(PluginNGXBinariesDir, NGX_DLSS_BINARY_NAME); - DLSSGenericBinaryInfo.Get<1>() = IPlatformFile::GetPlatformPhysical().FileExists(*DLSSGenericBinaryInfo.Get<0>()); - - DLSSCustomBinaryInfo.Get<0>() = FPaths::Combine(ProjectNGXBinariesDir, NGX_DLSS_BINARY_NAME); - DLSSCustomBinaryInfo.Get<1>() = IPlatformFile::GetPlatformPhysical().FileExists(*DLSSCustomBinaryInfo.Get<0>()); - - FeatureInfo.PathListInfo.Path = const_cast(NGXDLLSearchPathRawStrings.GetData()); - FeatureInfo.PathListInfo.Length = NGXDLLSearchPathRawStrings.Num(); - - // logging - { - FeatureInfo.LoggingInfo.DisableOtherLoggingSinks = 1 != CVarNGXEnableOtherLoggingSinks.GetValueOnAnyThread(); - FeatureInfo.LoggingInfo.LoggingCallback = &NGXLogSink; - - switch (CVarNGXLogLevel.GetValueOnAnyThread()) - { - case 0: - FeatureInfo.LoggingInfo.MinimumLoggingLevel = NVSDK_NGX_LOGGING_LEVEL_OFF; - break; - // should match the CVarNGXLogLevel default value - default: - case 1: - FeatureInfo.LoggingInfo.MinimumLoggingLevel = NVSDK_NGX_LOGGING_LEVEL_ON; - break; - case 2: - FeatureInfo.LoggingInfo.MinimumLoggingLevel = NVSDK_NGX_LOGGING_LEVEL_VERBOSE; - break; - } - } -} - -TTuple NGXRHI::GetDLSSGenericBinaryInfo() const -{ - return DLSSGenericBinaryInfo; -} - -TTuple NGXRHI::GetDLSSCustomBinaryInfo() const -{ - return DLSSCustomBinaryInfo; -} - -NGXRHI::~NGXRHI() -{ - UE_LOG(LogDLSSNGXRHI, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - UE_LOG(LogDLSSNGXRHI, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - - -void NGXRHI::FDLSSQueryFeature::QueryDLSSSupport() -{ - int32 bNeedsUpdatedDriver = 0; - int32 MinDriverVersionMajor = 0; - int32 MinDriverVersionMinor = 0; - - // Centralize this here instead during NGXRHI init. This should not happen but if we don't have a a valid CapabilityParameters, then we also don't have DLSS. - if (!CapabilityParameters) - { - UE_LOG(LogDLSSNGXRHI, Log, TEXT("NVIDIA NGX DLSS cannot be loaded possibly due to issues initializing NGX.")); - DLSSInitResult = NVSDK_NGX_Result_Fail; - bIsAvailable = false; - return; - } - - check(CapabilityParameters); - - NVSDK_NGX_Result ResultUpdatedDriver = CapabilityParameters->Get(NVSDK_NGX_Parameter_SuperSampling_NeedsUpdatedDriver, &bNeedsUpdatedDriver); - NVSDK_NGX_Result ResultMinDriverVersionMajor = CapabilityParameters->Get(NVSDK_NGX_Parameter_SuperSampling_MinDriverVersionMajor, &MinDriverVersionMajor); - NVSDK_NGX_Result ResultMinDriverVersionMinor = CapabilityParameters->Get(NVSDK_NGX_Parameter_SuperSampling_MinDriverVersionMinor, &MinDriverVersionMinor); - - UE_LOG(LogDLSSNGXRHI, Log, TEXT("Get NVSDK_NGX_Parameter_SuperSampling_NeedsUpdatedDriver -> (%u %s), bNeedsUpdatedDriver = %d"), ResultUpdatedDriver, GetNGXResultAsString(ResultUpdatedDriver), bNeedsUpdatedDriver); - UE_LOG(LogDLSSNGXRHI, Log, TEXT("Get NVSDK_NGX_Parameter_SuperSampling_MinDriverVersionMajor -> (%u %s), MinDriverVersionMajor = %d"), ResultMinDriverVersionMajor, GetNGXResultAsString(ResultMinDriverVersionMajor), MinDriverVersionMajor); - UE_LOG(LogDLSSNGXRHI, Log, TEXT("Get NVSDK_NGX_Parameter_SuperSampling_MinDriverVersionMinor -> (%u %s), MinDriverVersionMinor = %d"), ResultMinDriverVersionMinor, GetNGXResultAsString(ResultMinDriverVersionMinor), MinDriverVersionMinor); - - if (NVSDK_NGX_SUCCEED(ResultUpdatedDriver)) - { - DriverRequirements.DriverUpdateRequired = DriverRequirements.DriverUpdateRequired || bNeedsUpdatedDriver != 0; - - // ignore 0.0 and fall back to the what's baked into FNGXDriverRequirements; - if (NVSDK_NGX_SUCCEED(ResultMinDriverVersionMajor) && NVSDK_NGX_SUCCEED(ResultMinDriverVersionMinor) && MinDriverVersionMajor != 0) - { - DriverRequirements.MinDriverVersionMajor = MinDriverVersionMajor; - DriverRequirements.MinDriverVersionMinor = MinDriverVersionMinor; - } - - if (bNeedsUpdatedDriver) - { - UE_LOG(LogDLSSNGXRHI, Log, TEXT("NVIDIA NGX DLSS cannot be loaded due to an outdated driver. Minimum Driver Version required : %u.%u"), MinDriverVersionMajor, MinDriverVersionMinor); - } - else - { - UE_LOG(LogDLSSNGXRHI, Log, TEXT("NVIDIA NGX DLSS is supported by the currently installed driver. Minimum driver version was reported as: %u.%u"), MinDriverVersionMajor, MinDriverVersionMinor); - } - } - else - { - UE_LOG(LogDLSSNGXRHI, Log, TEXT("NVIDIA NGX DLSS Minimum driver version was not reported")); - } - - // determine if DLSS is available - int DlssAvailable = 0; - NVSDK_NGX_Result ResultAvailable = CapabilityParameters->Get(NVSDK_NGX_EParameter_SuperSampling_Available, &DlssAvailable); - UE_LOG(LogDLSSNGXRHI, Log, TEXT("Get NVSDK_NGX_EParameter_SuperSampling_Available -> (%u %s), DlssAvailable = %d"), ResultAvailable, GetNGXResultAsString(ResultAvailable), DlssAvailable); - - if (NVSDK_NGX_SUCCEED(ResultAvailable) && DlssAvailable) - { - bIsAvailable = true; - - // store for the higher level code interpret - DLSSInitResult = ResultAvailable; - } - - // DLSS_TODO verify this - if(!DlssAvailable) - { - // and try to find out more details on why it might have failed - NVSDK_NGX_Result DlssFeatureInitResult = NVSDK_NGX_Result_Fail; - NVSDK_NGX_Result ResultDlssFeatureInitResult = CapabilityParameters->Get(NVSDK_NGX_Parameter_SuperSampling_FeatureInitResult, (int*)&DlssFeatureInitResult); - UE_LOG(LogDLSSNGXRHI, Log, TEXT("Get NVSDK_NGX_Parameter_SuperSampling_FeatureInitResult -> (%u %s), NVSDK_NGX_Parameter_SuperSampling_FeatureInitResult = (%u %s)"), ResultDlssFeatureInitResult, GetNGXResultAsString(ResultDlssFeatureInitResult), DlssFeatureInitResult, GetNGXResultAsString(DlssFeatureInitResult)); - - // store for the higher level code interpret - DLSSInitResult = NVSDK_NGX_SUCCEED(ResultDlssFeatureInitResult) ? DlssFeatureInitResult : NVSDK_NGX_Result_Fail; - } -} - -FDLSSOptimalSettings NGXRHI::FDLSSQueryFeature::GetDLSSOptimalSettings(const FDLSSResolutionParameters& InResolution) const -{ - check(CapabilityParameters); - - FDLSSOptimalSettings OptimalSettings; - - const NVSDK_NGX_Result ResultGetOptimalSettings = NGX_DLSS_GET_OPTIMAL_SETTINGS( - CapabilityParameters, - InResolution.Width, - InResolution.Height, - InResolution.PerfQuality, - reinterpret_cast(&OptimalSettings.RenderSize.X), - reinterpret_cast(&OptimalSettings.RenderSize.Y), - reinterpret_cast(&OptimalSettings.RenderSizeMax.X), - reinterpret_cast(&OptimalSettings.RenderSizeMax.Y), - reinterpret_cast(&OptimalSettings.RenderSizeMin.X), - reinterpret_cast(&OptimalSettings.RenderSizeMin.Y), - &OptimalSettings.Sharpness - ); - UE_LOG(LogDLSSNGXRHI, Log, TEXT("NGX_DLSS_GET_OPTIMAL_SETTINGS -> (%u %s)"), ResultGetOptimalSettings, GetNGXResultAsString(ResultGetOptimalSettings)); - checkf(NVSDK_NGX_SUCCEED(ResultGetOptimalSettings), TEXT("failed to query supported DLSS modes")); - - OptimalSettings.bIsSupported = (OptimalSettings.RenderSize.X > 0) && (OptimalSettings.RenderSize.Y > 0); - auto ComputeResolutionFraction = [&InResolution](int32 RenderSizeX, int32 RenderSizeY) - { - float XScale = float(RenderSizeX) / float(InResolution.Width); - float YScale = float(RenderSizeY) / float(InResolution.Height); - return FMath::Min(XScale, YScale); - }; - - - OptimalSettings.MinResolutionFraction = ComputeResolutionFraction(OptimalSettings.RenderSizeMin.X, OptimalSettings.RenderSizeMin.Y); - OptimalSettings.MaxResolutionFraction = ComputeResolutionFraction(OptimalSettings.RenderSizeMax.X, OptimalSettings.RenderSizeMax.Y); - - // restrict to range since floating point numbers are gonna floating point - OptimalSettings.OptimalResolutionFraction = FMath::Clamp(ComputeResolutionFraction(OptimalSettings.RenderSize.X, OptimalSettings.RenderSize.Y), OptimalSettings.MinResolutionFraction, OptimalSettings.MaxResolutionFraction); - - - return OptimalSettings; -} - - FString NGXRHI::GetNGXLogDirectory() -{ - // encode the time and instance id to handle cases like PIE standalone game where multiple processe are running at the same time. - FString AbsoluteProjectLogDir = FPaths::ConvertRelativePathToFull(FPaths::ProjectLogDir()); - FString NGXLogDir = FPaths::Combine(AbsoluteProjectLogDir, TEXT("NGX"), FString::Printf(TEXT("NGX_%s_%s"), *FDateTime::Now().ToString(), *FApp::GetInstanceId().ToString())); - return NGXLogDir; -} - -uint32 FRHIDLSSArguments::GetNGXCommonDLSSFeatureFlags() const -{ - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - uint32 DLSSFeatureFlags = NVSDK_NGX_DLSS_Feature_Flags_None; - DLSSFeatureFlags |= NVSDK_NGX_DLSS_Feature_Flags_IsHDR; - DLSSFeatureFlags |= bool(ERHIZBuffer::IsInverted) ? NVSDK_NGX_DLSS_Feature_Flags_DepthInverted : 0; - DLSSFeatureFlags |= !bHighResolutionMotionVectors ? NVSDK_NGX_DLSS_Feature_Flags_MVLowRes : 0; - DLSSFeatureFlags |= Sharpness != 0.0f ? NVSDK_NGX_DLSS_Feature_Flags_DoSharpening : 0; - DLSSFeatureFlags |= bUseAutoExposure ? NVSDK_NGX_DLSS_Feature_Flags_AutoExposure : 0; - return DLSSFeatureFlags; -} - -NVSDK_NGX_DLSS_Create_Params FRHIDLSSArguments::GetNGXDLSSCreateParams() const -{ - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - NVSDK_NGX_DLSS_Create_Params Result; - FMemory::Memzero(Result); - Result.Feature.InWidth = SrcRect.Width(); - Result.Feature.InHeight = SrcRect.Height(); - Result.Feature.InTargetWidth = DestRect.Width(); - Result.Feature.InTargetHeight = DestRect.Height(); - Result.Feature.InPerfQualityValue = static_cast(PerfQuality); - check((Result.Feature.InPerfQualityValue >= NVSDK_NGX_PerfQuality_Value_MaxPerf) && (Result.Feature.InPerfQualityValue <= NVSDK_NGX_PerfQuality_Value_UltraQuality)); - - Result.InFeatureCreateFlags = GetNGXCommonDLSSFeatureFlags(); - Result.InEnableOutputSubrects = OutputColor->GetTexture2D()->GetSizeXY() != DestRect.Size(); - return Result; -} - - - -// this is used by the RHIs to see whether they need to recreate the NGX feature -bool FDLSSState::RequiresFeatureRecreation(const FRHIDLSSArguments& InArguments) -{ - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - return !DLSSFeature || DLSSFeature->Desc != InArguments.GetFeatureDesc(); -} - -void NGXRHI::RegisterFeature(TSharedPtr InFeature) -{ - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - UE_LOG(LogDLSSNGXRHI, Log, TEXT("Creating NGX DLSS Feature %s "), *InFeature->Desc.GetDebugDescription()); - AllocatedDLSSFeatures.Add(InFeature); -} - -TSharedPtr NGXRHI::FindFreeFeature(const FRHIDLSSArguments& InArguments) -{ - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - TSharedPtr OutFeature; - for (int FeatureIndex = 0; FeatureIndex < AllocatedDLSSFeatures.Num(); ++FeatureIndex) - { - // another view already uses this (1 reference from AllocatedDLSSFeatures, another refernces held by FDLSState - if (AllocatedDLSSFeatures[FeatureIndex].GetSharedReferenceCount() > 1) - { - continue; - } - - if (AllocatedDLSSFeatures[FeatureIndex]->Desc == InArguments.GetFeatureDesc()) - { - OutFeature = AllocatedDLSSFeatures[FeatureIndex]; - OutFeature->LastUsedFrame = FrameCounter; - break; - - } - } - return OutFeature; -} - -void NGXRHI::ReleaseAllocatedFeatures() -{ - UE_LOG(LogDLSSNGXRHI, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - - // There should be no FDLSSState::DLSSFeature anymore when we shut down - for (int FeatureIndex = 0; FeatureIndex < AllocatedDLSSFeatures.Num(); ++FeatureIndex) - { - checkf(AllocatedDLSSFeatures[FeatureIndex].GetSharedReferenceCount() == 1,TEXT("There should be no FDLSSState::DLSSFeature references elsewhere.")); - } - - AllocatedDLSSFeatures.Empty(); - SET_DWORD_STAT(STAT_DLSSNumFeatures, AllocatedDLSSFeatures.Num()); - UE_LOG(LogDLSSNGXRHI, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - -void NGXRHI::ApplyCommonNGXParameterSettings(NVSDK_NGX_Parameter* InOutParameter, const FRHIDLSSArguments& InArguments) -{ - NVSDK_NGX_Parameter_SetI(InOutParameter, NVSDK_NGX_Parameter_FreeMemOnReleaseFeature, InArguments.bReleaseMemoryOnDelete ? 1 : 0); -} - -void NGXRHI::TickPoolElements() -{ - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - const uint32 kFramesUntilRelease = CVarNGXFramesUntilFeatureDestruction.GetValueOnAnyThread(); - - int32 FeatureIndex = 0; - - while (FeatureIndex < AllocatedDLSSFeatures.Num()) - { - TSharedPtr& Feature = AllocatedDLSSFeatures[FeatureIndex]; - - const bool bIsUnused = Feature.GetSharedReferenceCount() == 1; - const bool bNotRequestedRecently = (FrameCounter - Feature->LastUsedFrame) > kFramesUntilRelease; - - if (bIsUnused && bNotRequestedRecently) - { - Swap(Feature, AllocatedDLSSFeatures.Last()); - AllocatedDLSSFeatures.Pop(); - } - else - { - ++FeatureIndex; - } - } - - SET_DWORD_STAT(STAT_DLSSNumFeatures, AllocatedDLSSFeatures.Num()); - - if(DLSSQueryFeature.CapabilityParameters) - { - unsigned long long VRAM = 0; - - NVSDK_NGX_Result ResultGetStats = NGX_DLSS_GET_STATS(DLSSQueryFeature.CapabilityParameters, &VRAM); - - checkf(NVSDK_NGX_SUCCEED(ResultGetStats), TEXT("Failed to retrieve DLSS memory statistics via NGX_DLSS_GET_STATS -> (%u %s)"), ResultGetStats, GetNGXResultAsString(ResultGetStats)); - if (NVSDK_NGX_SUCCEED(ResultGetStats)) - { - SET_DWORD_STAT(STAT_DLSSInternalGPUMemory, VRAM); - } - } - - ++FrameCounter; -} - -IMPLEMENT_MODULE(FNGXRHIModule, NGXRHI) - -#undef LOCTEXT_NAMESPACE - -/** IModuleInterface implementation */ - -void FNGXRHIModule::StartupModule() -{ - UE_LOG(LogDLSSNGXRHI, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - - int32 NGXLogLevel = CVarNGXLogLevel.GetValueOnAnyThread(); - if (FParse::Value(FCommandLine::Get(), TEXT("ngxloglevel="), NGXLogLevel)) - { - CVarNGXLogLevel->Set(NGXLogLevel, ECVF_SetByCommandline); - } - - if (FParse::Param(FCommandLine::Get(), TEXT("ngxlogfileenable"))) - { - CVarNGXEnableOtherLoggingSinks->Set(1, ECVF_SetByCommandline); - } - else if (FParse::Param(FCommandLine::Get(), TEXT("ngxlogfiledisable"))) - { - CVarNGXEnableOtherLoggingSinks->Set(0, ECVF_SetByCommandline); - } - - UE_LOG(LogDLSSNGXRHI, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - -void FNGXRHIModule::ShutdownModule() -{ - UE_LOG(LogDLSSNGXRHI, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - UE_LOG(LogDLSSNGXRHI, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - diff --git a/plugins/DLSS/Source/NGXRHI/Public/NGXRHI.h b/plugins/DLSS/Source/NGXRHI/Public/NGXRHI.h deleted file mode 100644 index a0b09a8b..00000000 --- a/plugins/DLSS/Source/NGXRHI/Public/NGXRHI.h +++ /dev/null @@ -1,388 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#pragma once - -#include "Modules/ModuleManager.h" - -#include "CoreMinimal.h" -#include "RendererInterface.h" - -#include "nvsdk_ngx_params.h" - -#define NVSDK_NGX_VERSION_API_MACRO_BASE_LINE (0x0000013) -#define NVSDK_NGX_VERSION_API_MACRO_WITH_LOGGING (0x0000014) - -struct FDLSSState; - -struct FDLSSFeatureDesc -{ - bool operator != (const FDLSSFeatureDesc& Other) const - { - return DestRect.Size() != Other.DestRect.Size() - || PerfQuality != Other.PerfQuality - || bHighResolutionMotionVectors != Other.bHighResolutionMotionVectors - || bNonZeroSharpness != Other.bNonZeroSharpness - || bUseAutoExposure != Other.bUseAutoExposure - || bReleaseMemoryOnDelete != Other.bReleaseMemoryOnDelete - || GPUNode != Other.GPUNode - || GPUVisibility != Other.GPUVisibility; - } - - bool operator == (const FDLSSFeatureDesc& Other) const - { - return !operator !=(Other); - } - - FIntRect SrcRect = FIntRect(FIntPoint::NoneValue, FIntPoint::NoneValue); - FIntRect DestRect = FIntRect(FIntPoint::NoneValue, FIntPoint::NoneValue); - int32 PerfQuality = -1; - bool bHighResolutionMotionVectors = false; - bool bNonZeroSharpness = false; - bool bUseAutoExposure = false; - bool bReleaseMemoryOnDelete = false; - uint32 GPUNode = 0; - uint32 GPUVisibility = 0; - FString GetDebugDescription() const - { - auto NGXPerfQualityString = [] (int NGXPerfQuality) - { - switch (NGXPerfQuality) - { - case NVSDK_NGX_PerfQuality_Value_MaxPerf:return TEXT("MaxPerf"); - case NVSDK_NGX_PerfQuality_Value_Balanced:return TEXT("Balanced"); - case NVSDK_NGX_PerfQuality_Value_MaxQuality:return TEXT("MaxQuality"); - case NVSDK_NGX_PerfQuality_Value_UltraPerformance:return TEXT("UltraPerformance"); - case NVSDK_NGX_PerfQuality_Value_UltraQuality:return TEXT("UltraQuality"); - default:return TEXT("Invalid NVSDK_NGX_PerfQuality_Value"); - } - }; - return FString::Printf(TEXT("SrcRect=[%dx%d->%dx%d], DestRect=[%dx%d->%dx%d], ScaleX=%f, ScaleY=%f, NGXPerfQuality=%s(%d), bHighResolutionMotionVectors=%d, bNonZeroSharpness=%d, bUseAutoExposure=%d, bReleaseMemoryOnDelete=%d, GPUNode=%u, GPUVisibility=0x%x"), - SrcRect.Min.X, SrcRect.Min.Y, SrcRect.Max.X, SrcRect.Max.Y, - DestRect.Min.X, DestRect.Min.Y, DestRect.Max.X, DestRect.Max.Y, - float(SrcRect.Width()) / float(DestRect.Width()), - float(SrcRect.Height()) / float(DestRect.Height()), - NGXPerfQualityString(PerfQuality), - PerfQuality, - bHighResolutionMotionVectors, - bNonZeroSharpness, - bUseAutoExposure, - bReleaseMemoryOnDelete, - GPUNode, - GPUVisibility); - - } -}; - -struct NGXRHI_API FRHIDLSSArguments -{ - FRHITexture* InputColor = nullptr; - FRHITexture* InputDepth = nullptr; - FRHITexture* InputMotionVectors = nullptr; - FRHITexture* InputExposure = nullptr; - - FRHITexture* OutputColor = nullptr; - - FIntRect SrcRect = FIntRect(FIntPoint::ZeroValue, FIntPoint::ZeroValue); - FIntRect DestRect = FIntRect(FIntPoint::ZeroValue, FIntPoint::ZeroValue); - FVector2f JitterOffset = FVector2f::ZeroVector; - FVector2f MotionVectorScale = FVector2f::UnitVector; - bool bHighResolutionMotionVectors = false; - - float Sharpness = 0.0f; - bool bReset = false; - - int32 PerfQuality = 0; - float DeltaTime = 0.0f; - - float PreExposure = 1.0f; - bool bUseAutoExposure = false; - - - bool bReleaseMemoryOnDelete = false; - uint32 GPUNode = 0; - uint32 GPUVisibility = 0; - void Validate() const; - - inline FDLSSFeatureDesc GetFeatureDesc() const - { - return FDLSSFeatureDesc{ SrcRect, DestRect, PerfQuality, bHighResolutionMotionVectors, Sharpness != 0.0f, bUseAutoExposure, bReleaseMemoryOnDelete, GPUNode, GPUVisibility}; - } - - uint32 GetNGXCommonDLSSFeatureFlags() const; - NVSDK_NGX_DLSS_Create_Params GetNGXDLSSCreateParams() const; -}; - -struct FNGXDriverRequirements -{ - bool DriverUpdateRequired = false; - int32 MinDriverVersionMajor = 470; - int32 MinDriverVersionMinor = 0; -}; - -// the API specic RHI extensions derive from this to handle the lifetime -class NGXRHI_API NGXDLSSFeature -{ -public: - virtual ~NGXDLSSFeature() = 0; - - FDLSSFeatureDesc Desc; - NVSDK_NGX_Handle* Feature = nullptr; - NVSDK_NGX_Parameter* Parameter = nullptr; - uint32 LastUsedFrame = 0; - - void Tick(uint32 InFrameNumber) - { - check(Feature); - check(Parameter); - LastUsedFrame = InFrameNumber; - } - - NGXDLSSFeature(NVSDK_NGX_Handle* InFeature, NVSDK_NGX_Parameter* InParameter, const FDLSSFeatureDesc& InFeatureDesc, uint32 InLastUsedEvaluation) - : Desc(InFeatureDesc) - , Feature(InFeature) - , Parameter(InParameter) - , LastUsedFrame(InLastUsedEvaluation) - { - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - check(Feature); - check(Parameter); - } - bool IsValid() const - { - return Feature && Parameter; - } -}; - -struct NGXRHI_API FDLSSState -{ - // this is used by the RHIs to see whether they need to recreate the NGX feature - - bool RequiresFeatureRecreation(const FRHIDLSSArguments& InArguments); - - bool HasValidFeature() const - { - return DLSSFeature && DLSSFeature->IsValid(); - } - - // this is stored via pointer to allow the NGXRHIs use the API specific functions to create & release - TSharedPtr DLSSFeature; -}; - -using FDLSSStateRef = TSharedPtr; - -enum class ENGXBinariesSearchOrder -{ - MinValue = 0, - CustomThenGeneric = 0, - ForceGeneric = 1, - ForceCustom = 2, - ForceDevelopmentGeneric = 3, - MaxValue = ForceDevelopmentGeneric -}; - -enum class ENGXProjectIdentifier -{ - MinValue = 0, - NGXApplicationIDThenUEProjectID = 0, - ForceUEProjectID = 1, - ForceNGXApplicationID = 2, - MaxValue = ForceNGXApplicationID -}; - -struct FNGXRHICreateArguments -{ - FString PluginBaseDir; - FDynamicRHI* DynamicRHI = nullptr; - ENGXBinariesSearchOrder NGXBinariesSearchOrder = ENGXBinariesSearchOrder::CustomThenGeneric; - - ENGXProjectIdentifier ProjectIdentifier = ENGXProjectIdentifier::NGXApplicationIDThenUEProjectID; - uint32 NGXAppId = 0; - FString UnrealEngineVersion; - FString UnrealProjectID; - - // centralize that logic here for the derived NGXRHIs - bool InitializeNGXWithNGXApplicationID() const - { - if ((ProjectIdentifier == ENGXProjectIdentifier::NGXApplicationIDThenUEProjectID) && (NGXAppId != 0)) - { - return true; - } - else if (ProjectIdentifier == ENGXProjectIdentifier::ForceNGXApplicationID) - { - return true; - } - else - { - return false; - } - } -}; - -struct FDLSSOptimalSettings -{ - FIntPoint RenderSize; - - FIntPoint RenderSizeMin; - FIntPoint RenderSizeMax; - float Sharpness; - - bool bIsSupported; - float OptimalResolutionFraction; - - float MinResolutionFraction; - float MaxResolutionFraction; - - bool IsFixedResolution() const - { - return MinResolutionFraction == MaxResolutionFraction; - } -}; - -class NGXRHI_API NGXRHI -{ - struct NGXRHI_API FDLSSQueryFeature - { - struct FDLSSResolutionParameters - { - uint32 Width = 0; - uint32 Height = 0; - NVSDK_NGX_PerfQuality_Value PerfQuality = NVSDK_NGX_PerfQuality_Value_MaxPerf; - - - FDLSSResolutionParameters(uint32 InWidth, uint32 InHeight, NVSDK_NGX_PerfQuality_Value InPerfQuality) - : Width(InWidth) - , Height(InHeight) - , PerfQuality(InPerfQuality) - {} - }; - - void QueryDLSSSupport(); - FDLSSOptimalSettings GetDLSSOptimalSettings(const FDLSSResolutionParameters& InResolution) const; - - // the lifetime of this is managed directly by the encompassing derived RHI - NVSDK_NGX_Parameter* CapabilityParameters = nullptr; - - bool bIsAvailable = false; - FNGXDriverRequirements DriverRequirements; - - NVSDK_NGX_Result DLSSInitResult = NVSDK_NGX_Result_Fail; - }; - - -public: - - - virtual ~NGXRHI(); - - virtual void ExecuteDLSS(FRHICommandList& CmdList, const FRHIDLSSArguments& InArguments, FDLSSStateRef InDLSSState) = 0; - - bool IsDLSSAvailable() const - { - return DLSSQueryFeature.bIsAvailable; - } - - NVSDK_NGX_Result GetDLSSInitResult() const - { - return DLSSQueryFeature.DLSSInitResult; - } - - const FNGXDriverRequirements& GetDLSSDriverRequirements() const - { - return DLSSQueryFeature.DriverRequirements; - } - - FDLSSOptimalSettings GetDLSSOptimalSettings(const FDLSSQueryFeature::FDLSSResolutionParameters& InResolution) const - { - return DLSSQueryFeature.GetDLSSOptimalSettings(InResolution); - } - - FDLSSOptimalSettings GetDLSSOptimalSettings(NVSDK_NGX_PerfQuality_Value QualityLevel) const - { - return DLSSQueryFeature.GetDLSSOptimalSettings(FDLSSQueryFeature::FDLSSResolutionParameters(1000, 1000, QualityLevel)); - } - - float GetDLSSResolutionFraction(NVSDK_NGX_PerfQuality_Value QualityLevel) const - { - return GetDLSSOptimalSettings(QualityLevel).OptimalResolutionFraction; - } - - TPair GetDLSSGenericBinaryInfo() const; - TPair GetDLSSCustomBinaryInfo() const; - - void TickPoolElements(); - - static bool NGXInitialized() - { - return bNGXInitialized; - } - - static bool IsIncompatibleAPICaptureToolActive() - { - return bIsIncompatibleAPICaptureToolActive; - } - - -protected: - - NGXRHI(const FNGXRHICreateArguments& Arguments); - - const NVSDK_NGX_FeatureCommonInfo* CommonFeatureInfo() const - { - return &FeatureInfo; - } - - void RegisterFeature(TSharedPtr InFeature); - TSharedPtr FindFreeFeature(const FRHIDLSSArguments& InArguments); - - void ReleaseAllocatedFeatures(); - void ApplyCommonNGXParameterSettings(NVSDK_NGX_Parameter* Parameter, const FRHIDLSSArguments& InArguments); - static FString GetNGXLogDirectory(); - - - - - FDynamicRHI* DynamicRHI = nullptr; - - FDLSSQueryFeature DLSSQueryFeature; - - uint32 FrameCounter = 1; - - static bool bNGXInitialized; - static bool bIsIncompatibleAPICaptureToolActive; -private: - TArray< TSharedPtr> AllocatedDLSSFeatures; - - TTuple DLSSGenericBinaryInfo; - TTuple DLSSCustomBinaryInfo; - - TArray NGXDLLSearchPaths; - TArray NGXDLLSearchPathRawStrings; - - NVSDK_NGX_FeatureCommonInfo FeatureInfo = {{0}}; -}; - - -// Implemented by the API specific modules -class INGXRHIModule : public IModuleInterface -{ -public: - virtual TUniquePtr CreateNGXRHI(const FNGXRHICreateArguments& Arguments) = 0; -}; - -class FNGXRHIModule final : public IModuleInterface -{ -public: - - /** IModuleInterface implementation */ - virtual void StartupModule(); - virtual void ShutdownModule(); -}; diff --git a/plugins/DLSS/Source/NGXVulkanRHI/NGXVulkanRHI.Build.cs b/plugins/DLSS/Source/NGXVulkanRHI/NGXVulkanRHI.Build.cs deleted file mode 100644 index 84f2c93b..00000000 --- a/plugins/DLSS/Source/NGXVulkanRHI/NGXVulkanRHI.Build.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -using UnrealBuildTool; - -public class NGXVulkanRHI : ModuleRules -{ - public NGXVulkanRHI(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicIncludePaths.AddRange( - new string[] { - } - ); - - - PrivateIncludePaths.AddRange( - new string[] { - } - ); - - - PublicDependencyModuleNames.AddRange( - new string[] - { - } - ); - - - PrivateDependencyModuleNames.AddRange( - new string[] - { - "Core", - "Engine", - "RenderCore", - "RHI", - "VulkanRHI", - - "NGX", - "NGXRHI", - } - ); - - // those come from the VulkanRHI - AddEngineThirdPartyPrivateStaticDependencies(Target, "Vulkan"); - - } -} diff --git a/plugins/DLSS/Source/NGXVulkanRHI/Private/NGXVulkanRHI.cpp b/plugins/DLSS/Source/NGXVulkanRHI/Private/NGXVulkanRHI.cpp deleted file mode 100644 index 78bc493f..00000000 --- a/plugins/DLSS/Source/NGXVulkanRHI/Private/NGXVulkanRHI.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#include "NGXVulkanRHI.h" - -#include "IVulkanDynamicRHI.h" - -#include "nvsdk_ngx_vk.h" -#include "nvsdk_ngx_helpers_vk.h" - -#include "GenericPlatform/GenericPlatformFile.h" - -DEFINE_LOG_CATEGORY_STATIC(LogDLSSNGXVulkanRHI, Log, All); - -#define LOCTEXT_NAMESPACE "FNGXVulkanRHIModule" - -class FVulkanNGXDLSSFeature final : public NGXDLSSFeature -{ - -public: - using NGXDLSSFeature::NGXDLSSFeature; - - virtual ~FVulkanNGXDLSSFeature() - { - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - check(NGXRHI::NGXInitialized()); - NVSDK_NGX_Result ResultReleaseFeature = NVSDK_NGX_VULKAN_ReleaseFeature(Feature); - checkf(NVSDK_NGX_SUCCEED(ResultReleaseFeature), TEXT("NVSDK_NGX_VULKAN_ReleaseFeature failed! (%u %s), %s"), ResultReleaseFeature, GetNGXResultAsString(ResultReleaseFeature), *Desc.GetDebugDescription()); - - if (Parameter != nullptr) - { - NVSDK_NGX_Result ResultDestroyParameter = NVSDK_NGX_VULKAN_DestroyParameters(Parameter); - checkf(NVSDK_NGX_SUCCEED(ResultDestroyParameter), TEXT("NVSDK_NGX_VULKAN_DestroyParameters failed! (%u %s), %s"), ResultDestroyParameter, GetNGXResultAsString(ResultDestroyParameter), *Desc.GetDebugDescription()); - } - } -}; - - -class FNGXVulkanRHI final : public NGXRHI -{ - -public: - FNGXVulkanRHI(const FNGXRHICreateArguments& Arguments); - virtual void ExecuteDLSS(FRHICommandList& CmdList, const FRHIDLSSArguments& InArguments, FDLSSStateRef InDLSSState) final; - virtual ~FNGXVulkanRHI(); -private: - - IVulkanDynamicRHI* VulkanRHI = nullptr; - - NVSDK_NGX_Result Init_NGX_VK(const FNGXRHICreateArguments& InArguments, const wchar_t* InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo); - static bool IsIncompatibleAPICaptureToolActive(); -}; - - -bool FNGXVulkanRHI::IsIncompatibleAPICaptureToolActive() -{ - // TODO figure out whether the renderdoc layer is active, either here or in the PreInit module - return false; -} - -NVSDK_NGX_Result FNGXVulkanRHI::Init_NGX_VK(const FNGXRHICreateArguments& InArguments, const wchar_t* InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo) -{ - NVSDK_NGX_Result Result = NVSDK_NGX_Result_Fail; - int32 APIVersion = NVSDK_NGX_VERSION_API_MACRO; - do - { - if (InArguments.InitializeNGXWithNGXApplicationID()) - { - Result = NVSDK_NGX_VULKAN_Init(InArguments.NGXAppId, InApplicationDataPath, InInstance, InPD, InDevice, InFeatureInfo, static_cast(APIVersion)); - UE_LOG(LogDLSSNGXVulkanRHI, Log, TEXT("NVSDK_NGX_VULKAN_Init(AppID= %u, APIVersion = 0x%x) -> (%u %s)"), InArguments.NGXAppId, APIVersion, Result, GetNGXResultAsString(Result)); - } - else - { - Result = NVSDK_NGX_VULKAN_Init_with_ProjectID(TCHAR_TO_UTF8(*InArguments.UnrealProjectID), NVSDK_NGX_ENGINE_TYPE_UNREAL, TCHAR_TO_UTF8(*InArguments.UnrealEngineVersion), InApplicationDataPath, InInstance, InPD, InDevice, InFeatureInfo, static_cast(APIVersion)); - UE_LOG(LogDLSSNGXVulkanRHI, Log, TEXT("NVSDK_NGX_VULKAN_Init(ProjectID = %s, EngineVersion=%s, APIVersion = 0x%x) -> (%u %s)"), *InArguments.UnrealProjectID, *InArguments.UnrealEngineVersion, APIVersion, Result, GetNGXResultAsString(Result)); - } - - if (NVSDK_NGX_FAILED(Result)) - { - NVSDK_NGX_VULKAN_Shutdown(); - } - - --APIVersion; - } while (NVSDK_NGX_FAILED(Result) && APIVersion >= NVSDK_NGX_VERSION_API_MACRO_BASE_LINE); - - if (NVSDK_NGX_SUCCEED(Result) && (APIVersion + 1 < NVSDK_NGX_VERSION_API_MACRO_WITH_LOGGING)) - { - UE_LOG(LogDLSSNGXVulkanRHI, Log, TEXT("Warning: NVSDK_NGX_VULKAN_Init succeeded, but the driver installed on this system is too old the support the NGX logging API. The console variables r.NGX.LogLevel and r.NGX.EnableOtherLoggingSinks will have no effect and NGX logs will only show up in their own log files, and not in UE's log files.")); - } - - return Result; -} - - -FNGXVulkanRHI::FNGXVulkanRHI(const FNGXRHICreateArguments& Arguments) - : NGXRHI(Arguments) - , VulkanRHI(CastDynamicRHI(Arguments.DynamicRHI)) -{ - check(VulkanRHI); - - const FString NGXLogDir = GetNGXLogDirectory(); - IPlatformFile::GetPlatformPhysical().CreateDirectoryTree(*NGXLogDir); - - bIsIncompatibleAPICaptureToolActive = IsIncompatibleAPICaptureToolActive(); - - VkInstance VulkanInstance = VulkanRHI->RHIGetVkInstance(); - VkPhysicalDevice VulkanPhysicalDevice = VulkanRHI->RHIGetVkPhysicalDevice(); - VkDevice VulkanLogicalDevice = VulkanRHI->RHIGetVkDevice(); - - NVSDK_NGX_Result ResultInit = Init_NGX_VK(Arguments, *NGXLogDir, VulkanInstance, VulkanPhysicalDevice, VulkanLogicalDevice, CommonFeatureInfo()); - UE_LOG(LogDLSSNGXVulkanRHI, Log, TEXT("NVSDK_NGX_VULKAN_Init (Log %s) -> (%u %s)"), *NGXLogDir, ResultInit, GetNGXResultAsString(ResultInit)); - - // store for the higher level code interpret - DLSSQueryFeature.DLSSInitResult = ResultInit; - - if (NVSDK_NGX_Result_FAIL_OutOfDate == ResultInit) - { - DLSSQueryFeature.DriverRequirements.DriverUpdateRequired = true; - } - else if (NVSDK_NGX_SUCCEED(ResultInit)) - { - bNGXInitialized = true; - - NVSDK_NGX_Result ResultGetParameters = NVSDK_NGX_VULKAN_GetCapabilityParameters(&DLSSQueryFeature.CapabilityParameters); - UE_LOG(LogDLSSNGXVulkanRHI, Log, TEXT("NVSDK_NGX_VULKAN_GetCapabilityParameters -> (%u %s)"), ResultGetParameters, GetNGXResultAsString(ResultGetParameters)); - - if (NVSDK_NGX_Result_FAIL_OutOfDate == ResultGetParameters) - { - DLSSQueryFeature.DriverRequirements.DriverUpdateRequired = true; - } - - if (NVSDK_NGX_SUCCEED(ResultGetParameters)) - { - DLSSQueryFeature.QueryDLSSSupport(); - } - } -} - -FNGXVulkanRHI::~FNGXVulkanRHI() -{ - UE_LOG(LogDLSSNGXVulkanRHI, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - if (bNGXInitialized) - { - // Destroy the parameters and features before we call NVSDK_NGX_D3D11_Shutdown - ReleaseAllocatedFeatures(); - - NVSDK_NGX_Result Result; - if (DLSSQueryFeature.CapabilityParameters != nullptr) - { - Result = NVSDK_NGX_VULKAN_DestroyParameters(DLSSQueryFeature.CapabilityParameters); - UE_LOG(LogDLSSNGXVulkanRHI, Log, TEXT("NVSDK_NGX_VULKAN_DestroyParameters -> (%u %s)"), Result, GetNGXResultAsString(Result)); - } - Result = NVSDK_NGX_VULKAN_Shutdown(); - UE_LOG(LogDLSSNGXVulkanRHI, Log, TEXT("NVSDK_NGX_VULKAN_Shutdown -> (%u %s)"), Result, GetNGXResultAsString(Result)); - bNGXInitialized = false; - } - UE_LOG(LogDLSSNGXVulkanRHI, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - -void FNGXVulkanRHI::ExecuteDLSS(FRHICommandList& CmdList, const FRHIDLSSArguments& InArguments, FDLSSStateRef InDLSSState) -{ - check(!IsRunningRHIInSeparateThread() || IsInRHIThread()); - check(IsDLSSAvailable()); - if (!IsDLSSAvailable()) return; - - InArguments.Validate(); - - VkCommandBuffer VulkanCommandBuffer = VulkanRHI->RHIGetActiveVkCommandBuffer(); - - if (InDLSSState->RequiresFeatureRecreation(InArguments)) - { - check(!InDLSSState->DLSSFeature || InDLSSState->HasValidFeature()); - InDLSSState->DLSSFeature = nullptr; - } - - if (InArguments.bReset) - { - check(!InDLSSState->DLSSFeature); - InDLSSState->DLSSFeature = FindFreeFeature(InArguments); - } - - if (!InDLSSState->DLSSFeature) - { - NVSDK_NGX_Parameter* NewNGXParameterHandle = nullptr; - NVSDK_NGX_Result Result = NVSDK_NGX_VULKAN_AllocateParameters(&NewNGXParameterHandle); - checkf(NVSDK_NGX_SUCCEED(Result), TEXT("NVSDK_NGX_VULKAN_AllocateParameters failed! (%u %s)"), Result, GetNGXResultAsString(Result)); - - ApplyCommonNGXParameterSettings(NewNGXParameterHandle, InArguments); - - NVSDK_NGX_DLSS_Create_Params DlssCreateParams = InArguments.GetNGXDLSSCreateParams(); - NVSDK_NGX_Handle* NewNGXHandle = nullptr; - - const uint32 CreationNodeMask = 1 << InArguments.GPUNode; - const uint32 VisibilityNodeMask = InArguments.GPUVisibility; - - NVSDK_NGX_Result ResultCreate = NGX_VULKAN_CREATE_DLSS_EXT( - VulkanCommandBuffer, - CreationNodeMask, - VisibilityNodeMask, - &NewNGXHandle, - NewNGXParameterHandle, - &DlssCreateParams); - - checkf(NVSDK_NGX_SUCCEED(ResultCreate), TEXT("NGX_VULKAN_CREATE_DLSS failed! (CreationNodeMask=0x%x VisibilityNodeMask=0x%x) (%u %s), %s"), CreationNodeMask, VisibilityNodeMask, ResultCreate, GetNGXResultAsString(ResultCreate), *InArguments.GetFeatureDesc().GetDebugDescription()); - InDLSSState->DLSSFeature = MakeShared(NewNGXHandle, NewNGXParameterHandle, InArguments.GetFeatureDesc(), FrameCounter); - RegisterFeature(InDLSSState->DLSSFeature); - } - - check(InDLSSState->HasValidFeature()); - - // execute - NVSDK_NGX_VK_DLSS_Eval_Params DlssEvalParams; - FMemory::Memzero(DlssEvalParams); - auto NGXVulkanResourceFromRHITexture = [VulkanRHI=VulkanRHI](FRHITexture* InRHITexture) - { - check(InRHITexture); - if (FRHITextureReference* TexRef = InRHITexture->GetTextureReference()) - { - InRHITexture = TexRef->GetReferencedTexture(); - check(InRHITexture); - } - - const FVulkanRHIImageViewInfo ImageViewInfo = VulkanRHI->RHIGetImageViewInfo(InRHITexture); - - NVSDK_NGX_Resource_VK NGXTexture; - FMemory::Memzero(NGXTexture); - - NGXTexture.Type = NVSDK_NGX_RESOURCE_VK_TYPE_VK_IMAGEVIEW; - - // Check for VK_IMAGE_USAGE_STORAGE_BIT. Those are not directly stored but FVulkanSurface::GenerateImageCreateInfo sets the VK flag based on those UEFlags - NGXTexture.ReadWrite = EnumHasAnyFlags(ImageViewInfo.UEFlags, TexCreate_Presentable | TexCreate_UAV); - - NGXTexture.Resource.ImageViewInfo.ImageView = ImageViewInfo.ImageView; - NGXTexture.Resource.ImageViewInfo.Image = ImageViewInfo.Image; - NGXTexture.Resource.ImageViewInfo.Format = ImageViewInfo.Format; - - NGXTexture.Resource.ImageViewInfo.Width = ImageViewInfo.Width; - NGXTexture.Resource.ImageViewInfo.Height = ImageViewInfo.Height; - check(ImageViewInfo.Depth == 1); - - NGXTexture.Resource.ImageViewInfo.SubresourceRange = ImageViewInfo.SubresourceRange; - - // DLSS_TODO Figure out where to get those from if the textures are arrayed or mipped. - check(NGXTexture.Resource.ImageViewInfo.SubresourceRange.layerCount == 1); - check(NGXTexture.Resource.ImageViewInfo.SubresourceRange.levelCount == 1); - - return NGXTexture; - }; - - NVSDK_NGX_Resource_VK InOutput = NGXVulkanResourceFromRHITexture(InArguments.OutputColor); - DlssEvalParams.Feature.pInOutput = &InOutput; - check(InArguments.OutputColor->GetFlags() & ( TexCreate_UAV | TexCreate_Presentable)); - check(InOutput.ReadWrite == true); - DlssEvalParams.InOutputSubrectBase.X = InArguments.DestRect.Min.X; - DlssEvalParams.InOutputSubrectBase.Y = InArguments.DestRect.Min.Y; - - DlssEvalParams.InRenderSubrectDimensions.Width = InArguments.SrcRect.Width(); - DlssEvalParams.InRenderSubrectDimensions.Height = InArguments.SrcRect.Height(); - - NVSDK_NGX_Resource_VK InColor = NGXVulkanResourceFromRHITexture(InArguments.InputColor); - DlssEvalParams.Feature.pInColor = &InColor; - DlssEvalParams.InColorSubrectBase.X = InArguments.SrcRect.Min.X; - DlssEvalParams.InColorSubrectBase.Y = InArguments.SrcRect.Min.Y; - - NVSDK_NGX_Resource_VK InDepth = NGXVulkanResourceFromRHITexture(InArguments.InputDepth); - DlssEvalParams.pInDepth = &InDepth; - DlssEvalParams.InDepthSubrectBase.X = InArguments.SrcRect.Min.X; - DlssEvalParams.InDepthSubrectBase.Y = InArguments.SrcRect.Min.Y; - - NVSDK_NGX_Resource_VK InMotionVectors = NGXVulkanResourceFromRHITexture(InArguments.InputMotionVectors); - DlssEvalParams.pInMotionVectors = &InMotionVectors; - // The VelocityCombine pass puts the motion vectors into the top left corner - DlssEvalParams.InMVSubrectBase.X = 0; - DlssEvalParams.InMVSubrectBase.Y = 0; - - NVSDK_NGX_Resource_VK InExposureTexture = NGXVulkanResourceFromRHITexture(InArguments.InputExposure); - DlssEvalParams.pInExposureTexture = InArguments.bUseAutoExposure ? nullptr : &InExposureTexture; - DlssEvalParams.InPreExposure = InArguments.PreExposure; - - DlssEvalParams.Feature.InSharpness = InArguments.Sharpness; - DlssEvalParams.InJitterOffsetX = InArguments.JitterOffset.X; - DlssEvalParams.InJitterOffsetY = InArguments.JitterOffset.Y; - - DlssEvalParams.InMVScaleX = InArguments.MotionVectorScale.X; - DlssEvalParams.InMVScaleY = InArguments.MotionVectorScale.Y; - DlssEvalParams.InReset = InArguments.bReset; - - - DlssEvalParams.InFrameTimeDeltaInMsec = InArguments.DeltaTime; - - NVSDK_NGX_Result ResultEvaluate = NGX_VULKAN_EVALUATE_DLSS_EXT( - VulkanCommandBuffer, - InDLSSState->DLSSFeature->Feature, - InDLSSState->DLSSFeature->Parameter, - &DlssEvalParams - ); - - checkf(NVSDK_NGX_SUCCEED(ResultEvaluate), TEXT("NGX_Vulkan_EVALUATE_DLSS_EXT failed! (%u %s), %s"), ResultEvaluate, GetNGXResultAsString(ResultEvaluate), *InDLSSState->DLSSFeature->Desc.GetDebugDescription()); - InDLSSState->DLSSFeature->Tick(FrameCounter); - - VulkanRHI->RHIRegisterWork(1); - VulkanRHI->RHIFinishExternalComputeWork(VulkanCommandBuffer); -} - - -/** IModuleInterface implementation */ - -void FNGXVulkanRHIModule::StartupModule() -{ - // NGXRHI module should be loaded to ensure logging state is initialized - FModuleManager::LoadModuleChecked(TEXT("NGXRHI")); -} - -void FNGXVulkanRHIModule::ShutdownModule() -{ -} - -TUniquePtr FNGXVulkanRHIModule::CreateNGXRHI(const FNGXRHICreateArguments& Arguments) -{ - TUniquePtr Result(new FNGXVulkanRHI(Arguments)); - return Result; -} - -IMPLEMENT_MODULE(FNGXVulkanRHIModule, NGXVulkanRHI) - -#undef LOCTEXT_NAMESPACE - - diff --git a/plugins/DLSS/Source/NGXVulkanRHI/Public/NGXVulkanRHI.h b/plugins/DLSS/Source/NGXVulkanRHI/Public/NGXVulkanRHI.h deleted file mode 100644 index 2fd74353..00000000 --- a/plugins/DLSS/Source/NGXVulkanRHI/Public/NGXVulkanRHI.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#pragma once -#include "Modules/ModuleManager.h" - -#include "NGXRHI.h" - -class FNGXVulkanRHIModule final : public INGXRHIModule -{ -public: - - /** IModuleInterface implementation */ - virtual void StartupModule(); - virtual void ShutdownModule(); - - /** INGXRHIModule implementation */ - virtual TUniquePtr CreateNGXRHI(const FNGXRHICreateArguments& Arguments); -}; diff --git a/plugins/DLSS/Source/NGXVulkanRHIPreInit/NGXVulkanRHIPreInit.Build.cs b/plugins/DLSS/Source/NGXVulkanRHIPreInit/NGXVulkanRHIPreInit.Build.cs deleted file mode 100644 index 2b645a62..00000000 --- a/plugins/DLSS/Source/NGXVulkanRHIPreInit/NGXVulkanRHIPreInit.Build.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -using UnrealBuildTool; - -public class NGXVulkanRHIPreInit : ModuleRules -{ - public NGXVulkanRHIPreInit(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicIncludePaths.AddRange( - new string[] { - // ... add public include paths required here ... - } - ); - - - PrivateIncludePaths.AddRange( - new string[] { - } - ); - - - PublicDependencyModuleNames.AddRange( - new string[] - { - } - ); - - - PrivateDependencyModuleNames.AddRange( - new string[] - { - "Core", - "Engine", - "RenderCore", - "RHI", - - "VulkanRHI", - "NGX", - } - ); - - // those come from the VulkanRHI - AddEngineThirdPartyPrivateStaticDependencies(Target, "Vulkan"); - } -} diff --git a/plugins/DLSS/Source/NGXVulkanRHIPreInit/Private/NGXVulkanRHIPreInit.cpp b/plugins/DLSS/Source/NGXVulkanRHIPreInit/Private/NGXVulkanRHIPreInit.cpp deleted file mode 100644 index de40a4cd..00000000 --- a/plugins/DLSS/Source/NGXVulkanRHIPreInit/Private/NGXVulkanRHIPreInit.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -#include "NGXVulkanRHIPreInit.h" - -#include "IVulkanDynamicRHI.h" - -#include "DynamicRHI.h" - -#include "nvsdk_ngx_vk.h" - -DEFINE_LOG_CATEGORY_STATIC(LogDLSSNGXVulkanRHIPreInit, Log, All); - -#define LOCTEXT_NAMESPACE "FNGXVulkanRHIPreInitModule" - - -void FNGXVulkanRHIPreInitModule::StartupModule() -{ - UE_LOG(LogDLSSNGXVulkanRHIPreInit, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - if(FApp::CanEverRender()) - { - const TCHAR* VulkanRHIModuleName = TEXT("VulkanRHI"); - - // don't cleanup since the same module gets loaded shortly thereafter anyways - const TCHAR* DynamicRHIModuleName = GetSelectedDynamicRHIModuleName(false); - UE_LOG(LogDLSSNGXVulkanRHIPreInit, Log, TEXT("GetSelectedDynamicRHIModuleName = %s"), DynamicRHIModuleName); - - if(FString(VulkanRHIModuleName) == FString(DynamicRHIModuleName)) - { - IDynamicRHIModule* VulkanRHIModule = FModuleManager::GetModulePtr(VulkanRHIModuleName); - - if(VulkanRHIModule && VulkanRHIModule->IsSupported()) - { - unsigned int NumInstanceExtensions = 0 ; - const char** InstanceExtensions = nullptr; - unsigned int NumDeviceExtensions = 0; - const char** DeviceExtensions = nullptr; - - const NVSDK_NGX_Result ResultRequiredExtensions = NVSDK_NGX_VULKAN_RequiredExtensions(&NumInstanceExtensions, &InstanceExtensions, &NumDeviceExtensions, &DeviceExtensions); - UE_LOG(LogDLSSNGXVulkanRHIPreInit, Log, TEXT("NVSDK_NGX_VULKAN_RequiredExtensions -> (%u %s)"), ResultRequiredExtensions, GetNGXResultAsString(ResultRequiredExtensions)); - - const TArrayView RHIBridgeInstanceExtensions(InstanceExtensions, NumInstanceExtensions); - IVulkanDynamicRHI::AddEnabledInstanceExtensionsAndLayers(RHIBridgeInstanceExtensions, TArrayView()); - - const TArrayView RHIBridgeDeviceExtensions(DeviceExtensions, NumDeviceExtensions); - IVulkanDynamicRHI::AddEnabledDeviceExtensionsAndLayers(RHIBridgeDeviceExtensions, TArrayView()); - - UE_LOG(LogDLSSNGXVulkanRHIPreInit, Log, TEXT("Preregistered the required NGX DLSS Vulkan device extensions (%u) and instance extensions (%u) via the VulkanRHIBridge"), NumDeviceExtensions, NumInstanceExtensions); - } - else - { - UE_LOG(LogDLSSNGXVulkanRHIPreInit, Log, TEXT("Failed to load the VulkanRHI module and/or Vulkan is not supported; skipping of pregistering the required NGX DLSS Vulkan device and instance extensions via the VulkanRHIBridge")); - } - } - else - { - UE_LOG(LogDLSSNGXVulkanRHIPreInit, Log, TEXT("VulkanRHI is not the active DynamicRHI; skipping of pregistering the required NGX DLSS Vulkan device and instance extensions via the VulkanRHIBridge")); - } - } - else - { - UE_LOG(LogDLSSNGXVulkanRHIPreInit, Log, TEXT("This UE instance does not render; skipping of pregistering the required NGX DLSS Vulkan device and instance extensions via the VulkanRHIBridge")); - } - UE_LOG(LogDLSSNGXVulkanRHIPreInit, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); - -} - -void FNGXVulkanRHIPreInitModule::ShutdownModule() -{ - UE_LOG(LogDLSSNGXVulkanRHIPreInit, Log, TEXT("%s Enter"), ANSI_TO_TCHAR(__FUNCTION__)); - UE_LOG(LogDLSSNGXVulkanRHIPreInit, Log, TEXT("%s Leave"), ANSI_TO_TCHAR(__FUNCTION__)); -} - -IMPLEMENT_MODULE(FNGXVulkanRHIPreInitModule, NGXVulkanRHIPreInit) - -#undef LOCTEXT_NAMESPACE - - diff --git a/plugins/DLSS/Source/NGXVulkanRHIPreInit/Public/NGXVulkanRHIPreInit.h b/plugins/DLSS/Source/NGXVulkanRHIPreInit/Public/NGXVulkanRHIPreInit.h deleted file mode 100644 index 0bc279da..00000000 --- a/plugins/DLSS/Source/NGXVulkanRHIPreInit/Public/NGXVulkanRHIPreInit.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#pragma once -#include "Modules/ModuleManager.h" - -class FNGXVulkanRHIPreInitModule final : public IModuleInterface -{ -public: - - /** IModuleInterface implementation */ - virtual void StartupModule(); - virtual void ShutdownModule(); -}; \ No newline at end of file diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx.h b/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx.h deleted file mode 100644 index f65b2218..00000000 --- a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx.h +++ /dev/null @@ -1,439 +0,0 @@ -/* -* Copyright (c) 2018 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -/* -* HOW TO USE: -* -* IMPORTANT: FOR DLSS/DLISP PLEASE SEE THE PROGRAMMING GUIDE -* -* IMPORTANT: Methods in this library are NOT thread safe. It is up to the -* client to ensure that thread safety is enforced as needed. -* -* 1) Call NVSDK_CONV NVSDK_NGX_D3D11/D3D12/CUDA_Init and pass your app Id -* and other parameters. This will initialize SDK or return an error code -* if SDK cannot run on target machine. Depending on error user might -* need to update drivers. Please note that application Id is provided -* by NVIDIA so if you do not have one please contact us. -* -* 2) Call NVSDK_NGX_D3D11/D3D12/CUDA_GetCapabilityParameters to obtain pointer -* to interface used to pass parameters to SDK. Interface instance is -* allocated and released by SDK so there is no need to do any memory -* management on client side. -* -* 3) Set key parameters for the feature you want to use. For example, -* width and height are required for all features and they can be -* set like this: -* Params->Set(NVSDK_NGX_Parameter_Width,MY_WIDTH); -* Params->Set(NVSDK_NGX_Parameter_Height,MY_HEIGHT); -* -* You can also provide hints like NVSDK_NGX_Parameter_Hint_HDR to tell -* SDK that it should expect HDR color space is needed. Please refer to -* samples since different features need different parameters and hints. -* -* 4) Call NVSDK_NGX_D3D11/D3D12/CUDA_GetScratchBufferSize to obtain size of -* the scratch buffer needed by specific feature. This D3D or CUDA buffer -* should be allocated by client and passed as: -* Params->Set(NVSDK_NGX_Parameter_Scratch,MY_SCRATCH_POINTER) -* Params->Set(NVSDK_NGX_Parameter_Scratch_SizeInBytes,MY_SCRATCH_SIZE_IN_BYTES) -* NOTE: Returned size can be 0 if feature does not use any scratch buffer. -* It is OK to use bigger buffer or reuse buffers across features as long -* as minimum size requirement is met. -* -* 5) Call NVSDK_NGX_D3D11/D3D12/CUDA_CreateFeature to create feature you need. -* On success SDK will return a handle which must be used in any successive -* calls to SDK which require feature handle. SDK will use all parameters -* and hints provided by client to generate feature. If feature with the same -* parameters already exists and error code will be returned. -* -* 6) Call NVSDK_NGX_D3D11/D3D12/CUDA_EvaluateFeature to invoke execution of -* specific feature. Before feature can be evaluated input parameters must -* be specified (like for example color/albedo buffer, motion vectors etc) -* -* 6) Call NVSDK_NGX_D3D11/D3D12/CUDA_ReleaseFeature when feature is no longer -* needed. After this call feature handle becomes invalid and cannot be used. -* -* 7) Call NVSDK_NGX_D3D11/D3D12/CUDA_Shutdown when SDK is no longer needed to -* release all resources. - -* Contact: ngxsupport@nvidia.com -*/ - - -#ifndef NVSDK_NGX_H -#define NVSDK_NGX_H - -#include // For size_t - -#include "nvsdk_ngx_defs.h" -#include "nvsdk_ngx_params.h" -#ifndef __cplusplus -#include -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -typedef struct IUnknown IUnknown; - -typedef struct ID3D11Device ID3D11Device; -typedef struct ID3D11Resource ID3D11Resource; -typedef struct ID3D11DeviceContext ID3D11DeviceContext; -typedef struct D3D11_TEXTURE2D_DESC D3D11_TEXTURE2D_DESC; -typedef struct D3D11_BUFFER_DESC D3D11_BUFFER_DESC; -typedef struct ID3D11Buffer ID3D11Buffer; -typedef struct ID3D11Texture2D ID3D11Texture2D; - -typedef struct ID3D12Device ID3D12Device; -typedef struct ID3D12Resource ID3D12Resource; -typedef struct ID3D12GraphicsCommandList ID3D12GraphicsCommandList; -typedef struct D3D12_RESOURCE_DESC D3D12_RESOURCE_DESC; -typedef struct CD3DX12_HEAP_PROPERTIES CD3DX12_HEAP_PROPERTIES; - -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_D3D12_ResourceAllocCallback)(D3D12_RESOURCE_DESC *InDesc, int InState, CD3DX12_HEAP_PROPERTIES *InHeap, ID3D12Resource **OutResource); -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_D3D11_BufferAllocCallback)(D3D11_BUFFER_DESC *InDesc, ID3D11Buffer **OutResource); -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_D3D11_Tex2DAllocCallback)(D3D11_TEXTURE2D_DESC *InDesc, ID3D11Texture2D **OutResource); -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_ResourceReleaseCallback)(IUnknown *InResource); - -typedef unsigned long long CUtexObject; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_Init -// ------------------------------------- -// -// InApplicationId: -// Unique Id provided by NVIDIA -// -// InApplicationDataPath: -// Folder to store logs and other temporary files (write access required), -// Normally this would be a location in Documents or ProgramData. -// -// InDevice: [d3d11/12 only] -// DirectX device to use -// -// InFeatureInfo: -// Contains information common to all features, presently only a list of all paths -// feature dlls can be located in, other than the default path - application directory. -// -// DESCRIPTION: -// Initializes new SDK instance. -// -#ifdef __cplusplus -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API); -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API); -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API); -#else -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion); -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion); -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion); -#endif - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_Init_with_ProjectID -// ------------------------------------- -// -// InProjectId: -// Unique Id provided by the rendering engine used -// -// InEngineType: -// Rendering engine used by the application / plugin. -// Use NVSDK_NGX_ENGINE_TYPE_CUSTOM if the specific engine type is not supported explicitly -// -// InEngineVersion: -// Version number of the rendering engine used by the application / plugin. -// -// InApplicationDataPath: -// Folder to store logs and other temporary files (write access required), -// Normally this would be a location in Documents or ProgramData. -// -// InDevice: [d3d11/12 only] -// DirectX device to use -// -// InFeatureInfo: -// Contains information common to all features, presently only a list of all paths -// feature dlls can be located in, other than the default path - application directory. -// -// DESCRIPTION: -// Initializes new SDK instance. -// -#ifdef __cplusplus -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API); -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API); -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API); -#else -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion); -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion); -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion); -#endif - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_Shutdown -// ------------------------------------- -// -// DESCRIPTION: -// Shuts down the current SDK instance and releases all resources. -// Shutdown1(Device) only affects specified device -// Shutdown1(nullptr) = Shutdown() and shuts down all devices -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Shutdown(void); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Shutdown1(ID3D11Device *InDevice); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Shutdown(void); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Shutdown1(ID3D12Device *InDevice); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Shutdown(void); - -#ifdef NGX_ENABLE_DEPRECATED_GET_PARAMETERS -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_GetParameters -// ---------------------------------------------------------- -// -// OutParameters: -// Parameters interface used to set any parameter needed by the SDK -// -// DESCRIPTION: -// This interface allows simple parameter setup using named fields. -// For example one can set width by calling Set(NVSDK_NGX_Parameter_Denoiser_Width,100) or -// provide CUDA buffer pointer by calling Set(NVSDK_NGX_Parameter_Denoiser_Color,cudaBuffer) -// For more details please see sample code. Please note that allocated memory -// will be freed by NGX so free/delete operator should NOT be called. -// Parameter maps output by NVSDK_NGX_GetParameters are also pre-populated -// with NGX capabilities and available features. -// Unlike with NVSDK_NGX_AllocateParameters, parameter maps output by NVSDK_NGX_GetParameters -// have their lifetimes managed by NGX, and must not -// be destroyed by the app using NVSDK_NGX_DestroyParameters. -// NVSDK_NGX_GetParameters is deprecated and apps should move to using -// NVSDK_NGX_AllocateParameters and NVSDK_NGX_GetCapabilityParameters when possible. -// Nevertheless, due to the possibility that the user will be using an older driver version, -// NVSDK_NGX_GetParameters may still be used as a fallback if NVSDK_NGX_AllocateParameters -// or NVSDK_NGX_GetCapabilityParameters return NVSDK_NGX_Result_FAIL_OutOfDate. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_GetParameters(NVSDK_NGX_Parameter **OutParameters); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_GetParameters(NVSDK_NGX_Parameter **OutParameters); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_GetParameters(NVSDK_NGX_Parameter **OutParameters); -#endif // NGX_ENABLE_DEPRECATED_GET_PARAMETERS - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_AllocateParameters -// ---------------------------------------------------------- -// -// OutParameters: -// Parameters interface used to set any parameter needed by the SDK -// -// DESCRIPTION: -// This interface allows allocating a simple parameter setup using named fields, whose -// lifetime the app must manage. -// For example one can set width by calling Set(NVSDK_NGX_Parameter_Denoiser_Width,100) or -// provide CUDA buffer pointer by calling Set(NVSDK_NGX_Parameter_Denoiser_Color,cudaBuffer) -// For more details please see sample code. -// Parameter maps output by NVSDK_NGX_AllocateParameters must NOT be freed using -// the free/delete operator; to free a parameter map -// output by NVSDK_NGX_AllocateParameters, NVSDK_NGX_DestroyParameters should be used. -// Unlike with NVSDK_NGX_GetParameters, parameter maps allocated with NVSDK_NGX_AllocateParameters -// must be destroyed by the app using NVSDK_NGX_DestroyParameters. -// Also unlike with NVSDK_NGX_GetParameters, parameter maps output by NVSDK_NGX_AllocateParameters -// do not come pre-populated with NGX capabilities and available features. -// To create a new parameter map pre-populated with such information, NVSDK_NGX_GetCapabilityParameters -// should be used. -// This function may return NVSDK_NGX_Result_FAIL_OutOfDate if an older driver, which -// does not support this API call is being used. In such a case, NVSDK_NGX_GetParameters -// may be used as a fallback. -// This function may only be called after a successful call into NVSDK_NGX_Init. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_AllocateParameters(NVSDK_NGX_Parameter** OutParameters); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_AllocateParameters(NVSDK_NGX_Parameter** OutParameters); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_AllocateParameters(NVSDK_NGX_Parameter** OutParameters); - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_GetCapabilityParameters -// ---------------------------------------------------------- -// -// OutParameters: -// The parameters interface populated with NGX and feature capabilities -// -// DESCRIPTION: -// This interface allows the app to create a new parameter map -// pre-populated with NGX capabilities and available features. -// The output parameter map can also be used for any purpose -// parameter maps output by NVSDK_NGX_AllocateParameters can be used for -// but it is not recommended to use NVSDK_NGX_GetCapabilityParameters -// unless querying NGX capabilities and available features -// due to the overhead associated with pre-populating the parameter map. -// Parameter maps output by NVSDK_NGX_GetCapabilityParameters must NOT be freed using -// the free/delete operator; to free a parameter map -// output by NVSDK_NGX_GetCapabilityParameters, NVSDK_NGX_DestroyParameters should be used. -// Unlike with NVSDK_NGX_GetParameters, parameter maps allocated with NVSDK_NGX_GetCapabilityParameters -// must be destroyed by the app using NVSDK_NGX_DestroyParameters. -// This function may return NVSDK_NGX_Result_FAIL_OutOfDate if an older driver, which -// does not support this API call is being used. This function may only be called -// after a successful call into NVSDK_NGX_Init. -// If NVSDK_NGX_GetCapabilityParameters fails with NVSDK_NGX_Result_FAIL_OutOfDate, -// NVSDK_NGX_GetParameters may be used as a fallback, to get a parameter map pre-populated -// with NGX capabilities and available features. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters); - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_DestroyParameters -// ---------------------------------------------------------- -// -// InParameters: -// The parameters interface to be destroyed -// -// DESCRIPTION: -// This interface allows the app to destroy the parameter map passed in. Once -// NVSDK_NGX_DestroyParameters is called on a parameter map, it -// must not be used again. -// NVSDK_NGX_DestroyParameters must not be called on any parameter map returned -// by NVSDK_NGX_GetParameters; NGX will manage the lifetime of those -// parameter maps. -// This function may return NVSDK_NGX_Result_FAIL_OutOfDate if an older driver, which -// does not support this API call is being used. This function may only be called -// after a successful call into NVSDK_NGX_Init. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_DestroyParameters(NVSDK_NGX_Parameter* InParameters); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_DestroyParameters(NVSDK_NGX_Parameter* InParameters); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_DestroyParameters(NVSDK_NGX_Parameter* InParameters); - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_GetScratchBufferSize -// ---------------------------------------------------------- -// -// InFeatureId: -// AI feature in question -// -// InParameters: -// Parameters used by the feature to help estimate scratch buffer size -// -// OutSizeInBytes: -// Number of bytes needed for the scratch buffer for the specified feature. -// -// DESCRIPTION: -// SDK needs a buffer of a certain size provided by the client in -// order to initialize AI feature. Once feature is no longer -// needed buffer can be released. It is safe to reuse the same -// scratch buffer for different features as long as minimum size -// requirement is met for all features. Please note that some -// features might not need a scratch buffer so return size of 0 -// is completely valid. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter *InParameters, size_t *OutSizeInBytes); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter *InParameters, size_t *OutSizeInBytes); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter *InParameters, size_t *OutSizeInBytes); - -///////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_CreateFeature -// ------------------------------------- -// -// InCmdList:[d3d12 only] -// Command list to use to execute GPU commands. Must be: -// - Open and recording -// - With node mask including the device provided in NVSDK_NGX_D3D12_Init -// - Execute on non-copy command queue. -// InDevCtx: [d3d11 only] -// Device context to use to execute GPU commands -// -// InFeatureID: -// AI feature to initialize -// -// InParameters: -// List of parameters -// -// OutHandle: -// Handle which uniquely identifies the feature. If feature with -// provided parameters already exists the "already exists" error code is returned. -// -// DESCRIPTION: -// Each feature needs to be created before it can be used. -// Refer to the sample code to find out which input parameters -// are needed to create specific feature. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_CreateFeature(ID3D11DeviceContext *InDevCtx, NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_CreateFeature(ID3D12GraphicsCommandList *InCmdList, NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_CreateFeature(NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle); - -///////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_Release -// ------------------------------------- -// -// InHandle: -// Handle to feature to be released -// -// DESCRIPTION: -// Releases feature with a given handle. -// Handles are not reference counted so -// after this call it is invalid to use provided handle. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_ReleaseFeature(NVSDK_NGX_Handle *InHandle); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_ReleaseFeature(NVSDK_NGX_Handle *InHandle); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_ReleaseFeature(NVSDK_NGX_Handle *InHandle); - -///////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_EvaluateFeature -// ------------------------------------- -// -// InCmdList:[d3d12 only] -// Command list to use to execute GPU commands. Must be: -// - Open and recording -// - With node mask including the device provided in NVSDK_NGX_D3D12_Init -// - Execute on non-copy command queue. -// InDevCtx: [d3d11 only] -// Device context to use to execute GPU commands -// -// InFeatureHandle: -// Handle representing feature to be evaluated -// -// InParameters: -// List of parameters required to evaluate feature -// -// InCallback: -// Optional callback for features which might take longer -// to execture. If specified SDK will call it with progress -// values in range 0.0f - 1.0f -// -// DESCRIPTION: -// Evaluates given feature using the provided parameters and -// pre-trained NN. Please note that for most features -// it can be benefitials to pass as many input buffers and parameters -// as possible (for example provide all render targets like color, albedo, normals, depth etc) -// - -#ifdef __cplusplus -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_ProgressCallback)(float InCurrentProgress, bool &OutShouldCancel); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_EvaluateFeature(ID3D11DeviceContext *InDevCtx, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback = NULL); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCommandList *InCmdList, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback = NULL); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_EvaluateFeature(const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback = NULL); -#endif - -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_ProgressCallback_C)(float InCurrentProgress, bool *OutShouldCancel); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_EvaluateFeature_C(ID3D11DeviceContext *InDevCtx, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback_C InCallback); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_EvaluateFeature_C(ID3D12GraphicsCommandList *InCmdList, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback_C InCallback); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_EvaluateFeature_C(const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback_C InCallback); - -// NGX return-code conversion-to-string utility only as a helper for debugging/logging - not for official use. -const wchar_t* NVSDK_CONV GetNGXResultAsString(NVSDK_NGX_Result InNGXResult); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // #define NVSDK_NGX_H diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_defs.h b/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_defs.h deleted file mode 100644 index f88c0c84..00000000 --- a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_defs.h +++ /dev/null @@ -1,610 +0,0 @@ -/* -* Copyright (c) 2018 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#ifndef NVSDK_NGX_DEFS_H -#define NVSDK_NGX_DEFS_H -#pragma once - -#ifndef __cplusplus -#include // For size_t -#include -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifdef __cplusplus -#if defined(NVSDK_NGX) && defined(NV_WINDOWS) -#define NVSDK_NGX_API extern "C" __declspec(dllexport) -#else -#define NVSDK_NGX_API extern "C" -#endif -#else -#if defined(NVSDK_NGX) && defined(NV_WINDOWS) -#define NVSDK_NGX_API __declspec(dllexport) -#else -#define NVSDK_NGX_API -#endif -#endif - -#ifdef __GNUC__ -#define NVSDK_CONV -#else -#define NVSDK_CONV __cdecl -#endif - -#define NVSDK_NGX_ARRAY_LEN(a) (sizeof(a) / sizeof((a)[0])) - -// Version Notes: -// Version 0x0000014: -// * Added a logging callback that the app may pass in on init -// * Added ability for the app to override the logging level -// Version 0x0000015: -// * Support multiple GPUs (bug 3270533) -#define NVSDK_NGX_VERSION_API_MACRO 0x0000014 // NGX_VERSION_DOT 1.4.0 - -typedef struct NVSDK_NGX_FeatureCommonInfo_Internal NVSDK_NGX_FeatureCommonInfo_Internal; - -typedef enum NVSDK_NGX_Version { NVSDK_NGX_Version_API = NVSDK_NGX_VERSION_API_MACRO } NVSDK_NGX_Version; - -typedef enum NVSDK_NGX_Result -{ - NVSDK_NGX_Result_Success = 0x1, - - NVSDK_NGX_Result_Fail = 0xBAD00000, - - // Feature is not supported on current hardware - NVSDK_NGX_Result_FAIL_FeatureNotSupported = NVSDK_NGX_Result_Fail | 1, - - // Platform error - for example - check d3d12 debug layer log for more information - NVSDK_NGX_Result_FAIL_PlatformError = NVSDK_NGX_Result_Fail | 2, - - // Feature with given parameters already exists - NVSDK_NGX_Result_FAIL_FeatureAlreadyExists = NVSDK_NGX_Result_Fail | 3, - - // Feature with provided handle does not exist - NVSDK_NGX_Result_FAIL_FeatureNotFound = NVSDK_NGX_Result_Fail | 4, - - // Invalid parameter was provided - NVSDK_NGX_Result_FAIL_InvalidParameter = NVSDK_NGX_Result_Fail | 5, - - // Provided buffer is too small, please use size provided by NVSDK_NGX_GetScratchBufferSize - NVSDK_NGX_Result_FAIL_ScratchBufferTooSmall = NVSDK_NGX_Result_Fail | 6, - - // SDK was not initialized properly - NVSDK_NGX_Result_FAIL_NotInitialized = NVSDK_NGX_Result_Fail | 7, - - // Unsupported format used for input/output buffers - NVSDK_NGX_Result_FAIL_UnsupportedInputFormat = NVSDK_NGX_Result_Fail | 8, - - // Feature input/output needs RW access (UAV) (d3d11/d3d12 specific) - NVSDK_NGX_Result_FAIL_RWFlagMissing = NVSDK_NGX_Result_Fail | 9, - - // Feature was created with specific input but none is provided at evaluation - NVSDK_NGX_Result_FAIL_MissingInput = NVSDK_NGX_Result_Fail | 10, - - // Feature is not available on the system - NVSDK_NGX_Result_FAIL_UnableToInitializeFeature = NVSDK_NGX_Result_Fail | 11, - - // NGX system libraries are old and need an update - NVSDK_NGX_Result_FAIL_OutOfDate = NVSDK_NGX_Result_Fail | 12, - - // Feature requires more GPU memory than it is available on system - NVSDK_NGX_Result_FAIL_OutOfGPUMemory = NVSDK_NGX_Result_Fail | 13, - - // Format used in input buffer(s) is not supported by feature - NVSDK_NGX_Result_FAIL_UnsupportedFormat = NVSDK_NGX_Result_Fail | 14, - - // Path provided in InApplicationDataPath cannot be written to - NVSDK_NGX_Result_FAIL_UnableToWriteToAppDataPath = NVSDK_NGX_Result_Fail | 15, - - // Unsupported parameter was provided (e.g. specific scaling factor is unsupported) - NVSDK_NGX_Result_FAIL_UnsupportedParameter = NVSDK_NGX_Result_Fail | 16, - - // The feature or application was denied (contact NVIDIA for further details) - NVSDK_NGX_Result_FAIL_Denied = NVSDK_NGX_Result_Fail | 17 -} NVSDK_NGX_Result; - -#define NVSDK_NGX_SUCCEED(value) (((value) & 0xFFF00000) != NVSDK_NGX_Result_Fail) -#define NVSDK_NGX_FAILED(value) (((value) & 0xFFF00000) == NVSDK_NGX_Result_Fail) - -typedef enum NVSDK_NGX_Feature -{ - NVSDK_NGX_Feature_Reserved0, - - NVSDK_NGX_Feature_SuperSampling, - - NVSDK_NGX_Feature_InPainting, - - NVSDK_NGX_Feature_ImageSuperResolution, - - NVSDK_NGX_Feature_SlowMotion, - - NVSDK_NGX_Feature_VideoSuperResolution, - - NVSDK_NGX_Feature_Reserved1, - - NVSDK_NGX_Feature_Reserved2, - - NVSDK_NGX_Feature_Reserved3, - - NVSDK_NGX_Feature_ImageSignalProcessing, - - NVSDK_NGX_Feature_DeepResolve, - - NVSDK_NGX_Feature_Reserved4, - - // New features go here - NVSDK_NGX_Feature_Count, - - // These members are not strictly NGX features, but are - // components of the NGX system, and it may sometimes - // be useful to identify them using the same enum - NVSDK_NGX_Feature_Reserved_SDK = 32764, - - NVSDK_NGX_Feature_Reserved_Core, - - NVSDK_NGX_Feature_Reserved_Unknown -} NVSDK_NGX_Feature; - -//TODO create grayscale format (R32F?) -typedef enum NVSDK_NGX_Buffer_Format -{ - NVSDK_NGX_Buffer_Format_Unknown, - NVSDK_NGX_Buffer_Format_RGB8UI, - NVSDK_NGX_Buffer_Format_RGB16F, - NVSDK_NGX_Buffer_Format_RGB32F, - NVSDK_NGX_Buffer_Format_RGBA8UI, - NVSDK_NGX_Buffer_Format_RGBA16F, - NVSDK_NGX_Buffer_Format_RGBA32F, -} NVSDK_NGX_Buffer_Format; - -typedef enum NVSDK_NGX_PerfQuality_Value -{ - NVSDK_NGX_PerfQuality_Value_MaxPerf, - NVSDK_NGX_PerfQuality_Value_Balanced, - NVSDK_NGX_PerfQuality_Value_MaxQuality, - // Extended PerfQuality modes - NVSDK_NGX_PerfQuality_Value_UltraPerformance, - NVSDK_NGX_PerfQuality_Value_UltraQuality, -} NVSDK_NGX_PerfQuality_Value; - -typedef enum NVSDK_NGX_RTX_Value -{ - NVSDK_NGX_RTX_Value_Off, - NVSDK_NGX_RTX_Value_On, -} NVSDK_NGX_RTX_Value; - -typedef enum NVSDK_NGX_DLSS_Mode -{ - NVSDK_NGX_DLSS_Mode_Off, // use existing in-engine AA + upscale solution - NVSDK_NGX_DLSS_Mode_DLSS_DLISP, - NVSDK_NGX_DLSS_Mode_DLISP_Only, // use existing in-engine AA solution - NVSDK_NGX_DLSS_Mode_DLSS, // DLSS will apply AA and upsample at the same time -} NVSDK_NGX_DLSS_Mode; - -typedef struct NVSDK_NGX_Handle { unsigned int Id; } NVSDK_NGX_Handle; - -typedef enum NSDK_NGX_GPU_Arch -{ - NVSDK_NGX_GPU_Arch_NotSupported = 0, - - // Match NvAPI's NV_GPU_ARCHITECTURE_ID values for GV100 and TU100 for - // backwards compatibility with snippets built against NvAPI - NVSDK_NGX_GPU_Arch_Volta = 0x0140, - NVSDK_NGX_GPU_Arch_Turing = 0x0160, - - // Presumably something newer - NVSDK_NGX_GPU_Arch_Unknown = 0x7FFFFFF -} NVSDK_NGX_GPU_Arch; - -typedef enum NVSDK_NGX_DLSS_Feature_Flags -{ - NVSDK_NGX_DLSS_Feature_Flags_IsInvalid = 1 << 31, - - NVSDK_NGX_DLSS_Feature_Flags_None = 0, - NVSDK_NGX_DLSS_Feature_Flags_IsHDR = 1 << 0, - NVSDK_NGX_DLSS_Feature_Flags_MVLowRes = 1 << 1, - NVSDK_NGX_DLSS_Feature_Flags_MVJittered = 1 << 2, - NVSDK_NGX_DLSS_Feature_Flags_DepthInverted = 1 << 3, - NVSDK_NGX_DLSS_Feature_Flags_Reserved_0 = 1 << 4, - NVSDK_NGX_DLSS_Feature_Flags_DoSharpening = 1 << 5, - NVSDK_NGX_DLSS_Feature_Flags_AutoExposure = 1 << 6, -} NVSDK_NGX_DLSS_Feature_Flags; - -typedef enum NVSDK_NGX_ToneMapperType -{ - NVSDK_NGX_TONEMAPPER_STRING = 0, - NVSDK_NGX_TONEMAPPER_REINHARD, - NVSDK_NGX_TONEMAPPER_ONEOVERLUMA, - NVSDK_NGX_TONEMAPPER_ACES, - NVSDK_NGX_TONEMAPPERTYPE_NUM -} NVSDK_NGX_ToneMapperType; - -typedef enum NVSDK_NGX_GBufferType -{ - NVSDK_NGX_GBUFFER_ALBEDO = 0, - NVSDK_NGX_GBUFFER_ROUGHNESS, - NVSDK_NGX_GBUFFER_METALLIC, - NVSDK_NGX_GBUFFER_SPECULAR, - NVSDK_NGX_GBUFFER_SUBSURFACE, - NVSDK_NGX_GBUFFER_NORMALS, - NVSDK_NGX_GBUFFER_SHADINGMODELID, /* unique identifier for drawn object or how the object is drawn */ - NVSDK_NGX_GBUFFER_MATERIALID, /* unique identifier for material */ - NVSDK_NGX_GBUFFER_SPECULAR_ALBEDO, - NVSDK_NGX_GBUFFER_INDIRECT_ALBEDO, - NVSDK_NGX_GBUFFER_SPECULAR_MVEC, - NVSDK_NGX_GBUFFER_DISOCCL_MASK, - NVSDK_NGX_GBUFFERTYPE_NUM = 16 -} NVSDK_NGX_GBufferType; - -typedef struct NVSDK_NGX_Coordinates -{ - unsigned int X; - unsigned int Y; -} NVSDK_NGX_Coordinates; - -typedef struct NVSDK_NGX_Dimensions -{ - unsigned int Width; - unsigned int Height; -} NVSDK_NGX_Dimensions; - -typedef struct NVSDK_NGX_PathListInfo -{ -#ifdef NV_WINDOWS - wchar_t **Path; -#else //NV_WINDOWS - char **Path; -#endif //NV_WINDOWS - // Path-list length - unsigned int Length; -} NVSDK_NGX_PathListInfo; - -typedef enum NVSDK_NGX_Logging_Level -{ - NVSDK_NGX_LOGGING_LEVEL_OFF = 0, - NVSDK_NGX_LOGGING_LEVEL_ON, - NVSDK_NGX_LOGGING_LEVEL_VERBOSE, - NVSDK_NGX_LOGGING_LEVEL_NUM -} NVSDK_NGX_Logging_Level; - -// A logging callback provided by the app to allow piping log lines back to the app. -// Please take careful note of the signature and calling convention. -// The callback must be able to be called from any thread. -// It must also be fully thread-safe and any number of threads may call into it concurrently. -// It must fully process message by the time it returns, and there is no guarantee that -// message will still be valid or allocated after it returns. -// message will be a null-terminated string and may contain multibyte characters. -#if defined(__GNUC__) || defined(__clang__) -typedef void NVSDK_CONV(*NVSDK_NGX_AppLogCallback)(const char* message, NVSDK_NGX_Logging_Level loggingLevel, NVSDK_NGX_Feature sourceComponent); -#else -typedef void(NVSDK_CONV* NVSDK_NGX_AppLogCallback)(const char* message, NVSDK_NGX_Logging_Level loggingLevel, NVSDK_NGX_Feature sourceComponent); -#endif - -typedef struct NGSDK_NGX_LoggingInfo -{ - // Fields below were introduced in SDK version 0x0000014 - - // App-provided logging callback - NVSDK_NGX_AppLogCallback LoggingCallback; - - // The minimum logging level to use. If this is higher - // than the logging level otherwise configured, this will override - // that logging level. Otherwise, that logging level will be used. - NVSDK_NGX_Logging_Level MinimumLoggingLevel; - - // Whether or not to disable writing log lines to sinks other than the app log callback. This - // may be useful if the app provides a logging callback. LoggingCallback must be non-null and point - // to a valid logging callback if this is set to true. - bool DisableOtherLoggingSinks; - -} NGSDK_NGX_LoggingInfo; - -typedef struct NVSDK_NGX_FeatureCommonInfo -{ - // List of all paths in descending order of search sequence to locate a feature dll in, other than the default path - application folder. - NVSDK_NGX_PathListInfo PathListInfo; - // Used internally by NGX - NVSDK_NGX_FeatureCommonInfo_Internal* InternalData; // Introduced in SDK version 0x0000013 - - // Fields below were introduced in SDK version 0x0000014 - - NGSDK_NGX_LoggingInfo LoggingInfo; -} NVSDK_NGX_FeatureCommonInfo; - -typedef enum NVSDK_NGX_Resource_VK_Type -{ - NVSDK_NGX_RESOURCE_VK_TYPE_VK_IMAGEVIEW, - NVSDK_NGX_RESOURCE_VK_TYPE_VK_BUFFER -} NVSDK_NGX_Resource_VK_Type; - -typedef enum NVSDK_NGX_Opt_Level -{ - NVSDK_NGX_OPT_LEVEL_UNDEFINED = 0, - NVSDK_NGX_OPT_LEVEL_DEBUG = 20, - NVSDK_NGX_OPT_LEVEL_DEVELOP = 30, - NVSDK_NGX_OPT_LEVEL_RELEASE = 40 -} NVSDK_NGX_Opt_Level; - -typedef enum NVSDK_NGX_EngineType -{ - NVSDK_NGX_ENGINE_TYPE_CUSTOM = 0, - NVSDK_NGX_ENGINE_TYPE_UNREAL, - NVSDK_NGX_ENGINE_TYPE_UNITY, - NVSDK_NGX_ENGINE_TYPE_OMNIVERSE, - NVSDK_NGX_ENGINE_COUNT -} NVSDK_NGX_EngineType; - -// Read-only parameters provided by NGX -#define NVSDK_NGX_EParameter_Reserved00 "#\x00" -#define NVSDK_NGX_EParameter_SuperSampling_Available "#\x01" -#define NVSDK_NGX_EParameter_InPainting_Available "#\x02" -#define NVSDK_NGX_EParameter_ImageSuperResolution_Available "#\x03" -#define NVSDK_NGX_EParameter_SlowMotion_Available "#\x04" -#define NVSDK_NGX_EParameter_VideoSuperResolution_Available "#\x05" -#define NVSDK_NGX_EParameter_Reserved06 "#\x06" -#define NVSDK_NGX_EParameter_Reserved07 "#\x07" -#define NVSDK_NGX_EParameter_Reserved08 "#\x08" -#define NVSDK_NGX_EParameter_ImageSignalProcessing_Available "#\x09" -#define NVSDK_NGX_EParameter_ImageSuperResolution_ScaleFactor_2_1 "#\x0a" -#define NVSDK_NGX_EParameter_ImageSuperResolution_ScaleFactor_3_1 "#\x0b" -#define NVSDK_NGX_EParameter_ImageSuperResolution_ScaleFactor_3_2 "#\x0c" -#define NVSDK_NGX_EParameter_ImageSuperResolution_ScaleFactor_4_3 "#\x0d" -#define NVSDK_NGX_EParameter_NumFrames "#\x0e" -#define NVSDK_NGX_EParameter_Scale "#\x0f" -#define NVSDK_NGX_EParameter_Width "#\x10" -#define NVSDK_NGX_EParameter_Height "#\x11" -#define NVSDK_NGX_EParameter_OutWidth "#\x12" -#define NVSDK_NGX_EParameter_OutHeight "#\x13" -#define NVSDK_NGX_EParameter_Sharpness "#\x14" -#define NVSDK_NGX_EParameter_Scratch "#\x15" -#define NVSDK_NGX_EParameter_Scratch_SizeInBytes "#\x16" -#define NVSDK_NGX_EParameter_EvaluationNode "#\x17" // valid since API 0x13 (replaced a deprecated param) -#define NVSDK_NGX_EParameter_Input1 "#\x18" -#define NVSDK_NGX_EParameter_Input1_Format "#\x19" -#define NVSDK_NGX_EParameter_Input1_SizeInBytes "#\x1a" -#define NVSDK_NGX_EParameter_Input2 "#\x1b" -#define NVSDK_NGX_EParameter_Input2_Format "#\x1c" -#define NVSDK_NGX_EParameter_Input2_SizeInBytes "#\x1d" -#define NVSDK_NGX_EParameter_Color "#\x1e" -#define NVSDK_NGX_EParameter_Color_Format "#\x1f" -#define NVSDK_NGX_EParameter_Color_SizeInBytes "#\x20" -#define NVSDK_NGX_EParameter_Albedo "#\x21" -#define NVSDK_NGX_EParameter_Output "#\x22" -#define NVSDK_NGX_EParameter_Output_Format "#\x23" -#define NVSDK_NGX_EParameter_Output_SizeInBytes "#\x24" -#define NVSDK_NGX_EParameter_Reset "#\x25" -#define NVSDK_NGX_EParameter_BlendFactor "#\x26" -#define NVSDK_NGX_EParameter_MotionVectors "#\x27" -#define NVSDK_NGX_EParameter_Rect_X "#\x28" -#define NVSDK_NGX_EParameter_Rect_Y "#\x29" -#define NVSDK_NGX_EParameter_Rect_W "#\x2a" -#define NVSDK_NGX_EParameter_Rect_H "#\x2b" -#define NVSDK_NGX_EParameter_MV_Scale_X "#\x2c" -#define NVSDK_NGX_EParameter_MV_Scale_Y "#\x2d" -#define NVSDK_NGX_EParameter_Model "#\x2e" -#define NVSDK_NGX_EParameter_Format "#\x2f" -#define NVSDK_NGX_EParameter_SizeInBytes "#\x30" -#define NVSDK_NGX_EParameter_ResourceAllocCallback "#\x31" -#define NVSDK_NGX_EParameter_BufferAllocCallback "#\x32" -#define NVSDK_NGX_EParameter_Tex2DAllocCallback "#\x33" -#define NVSDK_NGX_EParameter_ResourceReleaseCallback "#\x34" -#define NVSDK_NGX_EParameter_CreationNodeMask "#\x35" -#define NVSDK_NGX_EParameter_VisibilityNodeMask "#\x36" -#define NVSDK_NGX_EParameter_PreviousOutput "#\x37" -#define NVSDK_NGX_EParameter_MV_Offset_X "#\x38" -#define NVSDK_NGX_EParameter_MV_Offset_Y "#\x39" -#define NVSDK_NGX_EParameter_Hint_UseFireflySwatter "#\x3a" -#define NVSDK_NGX_EParameter_Resource_Width "#\x3b" -#define NVSDK_NGX_EParameter_Resource_Height "#\x3c" -#define NVSDK_NGX_EParameter_Depth "#\x3d" -#define NVSDK_NGX_EParameter_DLSSOptimalSettingsCallback "#\x3e" -#define NVSDK_NGX_EParameter_PerfQualityValue "#\x3f" -#define NVSDK_NGX_EParameter_RTXValue "#\x40" -#define NVSDK_NGX_EParameter_DLSSMode "#\x41" -#define NVSDK_NGX_EParameter_DeepResolve_Available "#\x42" -#define NVSDK_NGX_EParameter_Deprecated_43 "#\x43" -#define NVSDK_NGX_EParameter_OptLevel "#\x44" -#define NVSDK_NGX_EParameter_IsDevSnippetBranch "#\x45" - -#define NVSDK_NGX_Parameter_OptLevel "Snippet.OptLevel" -#define NVSDK_NGX_Parameter_IsDevSnippetBranch "Snippet.IsDevBranch" -#define NVSDK_NGX_Parameter_SuperSampling_ScaleFactor "SuperSampling.ScaleFactor" -#define NVSDK_NGX_Parameter_ImageSignalProcessing_ScaleFactor "ImageSignalProcessing.ScaleFactor" -#define NVSDK_NGX_Parameter_SuperSampling_Available "SuperSampling.Available" -#define NVSDK_NGX_Parameter_InPainting_Available "InPainting.Available" -#define NVSDK_NGX_Parameter_ImageSuperResolution_Available "ImageSuperResolution.Available" -#define NVSDK_NGX_Parameter_SlowMotion_Available "SlowMotion.Available" -#define NVSDK_NGX_Parameter_VideoSuperResolution_Available "VideoSuperResolution.Available" -#define NVSDK_NGX_Parameter_ImageSignalProcessing_Available "ImageSignalProcessing.Available" -#define NVSDK_NGX_Parameter_DeepResolve_Available "DeepResolve.Available" -#define NVSDK_NGX_Parameter_SuperSampling_NeedsUpdatedDriver "SuperSampling.NeedsUpdatedDriver" -#define NVSDK_NGX_Parameter_InPainting_NeedsUpdatedDriver "InPainting.NeedsUpdatedDriver" -#define NVSDK_NGX_Parameter_ImageSuperResolution_NeedsUpdatedDriver "ImageSuperResolution.NeedsUpdatedDriver" -#define NVSDK_NGX_Parameter_SlowMotion_NeedsUpdatedDriver "SlowMotion.NeedsUpdatedDriver" -#define NVSDK_NGX_Parameter_VideoSuperResolution_NeedsUpdatedDriver "VideoSuperResolution.NeedsUpdatedDriver" -#define NVSDK_NGX_Parameter_ImageSignalProcessing_NeedsUpdatedDriver "ImageSignalProcessing.NeedsUpdatedDriver" -#define NVSDK_NGX_Parameter_DeepResolve_NeedsUpdatedDriver "DeepResolve.NeedsUpdatedDriver" -#define NVSDK_NGX_Parameter_FrameInterpolation_NeedsUpdatedDriver "FrameInterpolation.NeedsUpdatedDriver" -#define NVSDK_NGX_Parameter_SuperSampling_MinDriverVersionMajor "SuperSampling.MinDriverVersionMajor" -#define NVSDK_NGX_Parameter_InPainting_MinDriverVersionMajor "InPainting.MinDriverVersionMajor" -#define NVSDK_NGX_Parameter_ImageSuperResolution_MinDriverVersionMajor "ImageSuperResolution.MinDriverVersionMajor" -#define NVSDK_NGX_Parameter_SlowMotion_MinDriverVersionMajor "SlowMotion.MinDriverVersionMajor" -#define NVSDK_NGX_Parameter_VideoSuperResolution_MinDriverVersionMajor "VideoSuperResolution.MinDriverVersionMajor" -#define NVSDK_NGX_Parameter_ImageSignalProcessing_MinDriverVersionMajor "ImageSignalProcessing.MinDriverVersionMajor" -#define NVSDK_NGX_Parameter_DeepResolve_MinDriverVersionMajor "DeepResolve.MinDriverVersionMajor" -#define NVSDK_NGX_Parameter_FrameInterpolation_MinDriverVersionMajor "FrameInterpolation.MinDriverVersionMajor" -#define NVSDK_NGX_Parameter_SuperSampling_MinDriverVersionMinor "SuperSampling.MinDriverVersionMinor" -#define NVSDK_NGX_Parameter_InPainting_MinDriverVersionMinor "InPainting.MinDriverVersionMinor" -#define NVSDK_NGX_Parameter_ImageSuperResolution_MinDriverVersionMinor "ImageSuperResolution.MinDriverVersionMinor" -#define NVSDK_NGX_Parameter_SlowMotion_MinDriverVersionMinor "SlowMotion.MinDriverVersionMinor" -#define NVSDK_NGX_Parameter_VideoSuperResolution_MinDriverVersionMinor "VideoSuperResolution.MinDriverVersionMinor" -#define NVSDK_NGX_Parameter_ImageSignalProcessing_MinDriverVersionMinor "ImageSignalProcessing.MinDriverVersionMinor" -#define NVSDK_NGX_Parameter_DeepResolve_MinDriverVersionMinor "DeepResolve.MinDriverVersionMinor" -#define NVSDK_NGX_Parameter_SuperSampling_FeatureInitResult "SuperSampling.FeatureInitResult" -#define NVSDK_NGX_Parameter_InPainting_FeatureInitResult "InPainting.FeatureInitResult" -#define NVSDK_NGX_Parameter_ImageSuperResolution_FeatureInitResult "ImageSuperResolution.FeatureInitResult" -#define NVSDK_NGX_Parameter_SlowMotion_FeatureInitResult "SlowMotion.FeatureInitResult" -#define NVSDK_NGX_Parameter_VideoSuperResolution_FeatureInitResult "VideoSuperResolution.FeatureInitResult" -#define NVSDK_NGX_Parameter_ImageSignalProcessing_FeatureInitResult "ImageSignalProcessing.FeatureInitResult" -#define NVSDK_NGX_Parameter_DeepResolve_FeatureInitResult "DeepResolve.FeatureInitResult" -#define NVSDK_NGX_Parameter_FrameInterpolation_FeatureInitResult "FrameInterpolation.FeatureInitResult" -#define NVSDK_NGX_Parameter_ImageSuperResolution_ScaleFactor_2_1 "ImageSuperResolution.ScaleFactor.2.1" -#define NVSDK_NGX_Parameter_ImageSuperResolution_ScaleFactor_3_1 "ImageSuperResolution.ScaleFactor.3.1" -#define NVSDK_NGX_Parameter_ImageSuperResolution_ScaleFactor_3_2 "ImageSuperResolution.ScaleFactor.3.2" -#define NVSDK_NGX_Parameter_ImageSuperResolution_ScaleFactor_4_3 "ImageSuperResolution.ScaleFactor.4.3" -#define NVSDK_NGX_Parameter_NumFrames "NumFrames" -#define NVSDK_NGX_Parameter_Scale "Scale" -#define NVSDK_NGX_Parameter_Width "Width" -#define NVSDK_NGX_Parameter_Height "Height" -#define NVSDK_NGX_Parameter_OutWidth "OutWidth" -#define NVSDK_NGX_Parameter_OutHeight "OutHeight" -#define NVSDK_NGX_Parameter_Sharpness "Sharpness" -#define NVSDK_NGX_Parameter_Scratch "Scratch" -#define NVSDK_NGX_Parameter_Scratch_SizeInBytes "Scratch.SizeInBytes" -#define NVSDK_NGX_Parameter_Input1 "Input1" -#define NVSDK_NGX_Parameter_Input1_Format "Input1.Format" -#define NVSDK_NGX_Parameter_Input1_SizeInBytes "Input1.SizeInBytes" -#define NVSDK_NGX_Parameter_Input2 "Input2" -#define NVSDK_NGX_Parameter_Input2_Format "Input2.Format" -#define NVSDK_NGX_Parameter_Input2_SizeInBytes "Input2.SizeInBytes" -#define NVSDK_NGX_Parameter_Color "Color" -#define NVSDK_NGX_Parameter_Color_Format "Color.Format" -#define NVSDK_NGX_Parameter_Color_SizeInBytes "Color.SizeInBytes" -#define NVSDK_NGX_Parameter_FI_Color1 "Color1" -#define NVSDK_NGX_Parameter_FI_Color2 "Color2" -#define NVSDK_NGX_Parameter_Albedo "Albedo" -#define NVSDK_NGX_Parameter_Output "Output" -#define NVSDK_NGX_Parameter_Output_SizeInBytes "Output.SizeInBytes" -#define NVSDK_NGX_Parameter_FI_Output1 "Output1" -#define NVSDK_NGX_Parameter_FI_Output2 "Output2" -#define NVSDK_NGX_Parameter_FI_Output3 "Output3" -#define NVSDK_NGX_Parameter_Reset "Reset" -#define NVSDK_NGX_Parameter_BlendFactor "BlendFactor" -#define NVSDK_NGX_Parameter_MotionVectors "MotionVectors" -#define NVSDK_NGX_Parameter_FI_MotionVectors1 "MotionVectors1" -#define NVSDK_NGX_Parameter_FI_MotionVectors2 "MotionVectors2" -#define NVSDK_NGX_Parameter_Rect_X "Rect.X" -#define NVSDK_NGX_Parameter_Rect_Y "Rect.Y" -#define NVSDK_NGX_Parameter_Rect_W "Rect.W" -#define NVSDK_NGX_Parameter_Rect_H "Rect.H" -#define NVSDK_NGX_Parameter_MV_Scale_X "MV.Scale.X" -#define NVSDK_NGX_Parameter_MV_Scale_Y "MV.Scale.Y" -#define NVSDK_NGX_Parameter_Model "Model" -#define NVSDK_NGX_Parameter_Format "Format" -#define NVSDK_NGX_Parameter_SizeInBytes "SizeInBytes" -#define NVSDK_NGX_Parameter_ResourceAllocCallback "ResourceAllocCallback" -#define NVSDK_NGX_Parameter_BufferAllocCallback "BufferAllocCallback" -#define NVSDK_NGX_Parameter_Tex2DAllocCallback "Tex2DAllocCallback" -#define NVSDK_NGX_Parameter_ResourceReleaseCallback "ResourceReleaseCallback" -#define NVSDK_NGX_Parameter_CreationNodeMask "CreationNodeMask" -#define NVSDK_NGX_Parameter_VisibilityNodeMask "VisibilityNodeMask" -#define NVSDK_NGX_Parameter_MV_Offset_X "MV.Offset.X" -#define NVSDK_NGX_Parameter_MV_Offset_Y "MV.Offset.Y" -#define NVSDK_NGX_Parameter_Hint_UseFireflySwatter "Hint.UseFireflySwatter" -#define NVSDK_NGX_Parameter_Resource_Width "ResourceWidth" -#define NVSDK_NGX_Parameter_Resource_Height "ResourceHeight" -#define NVSDK_NGX_Parameter_Resource_OutWidth "ResourceOutWidth" -#define NVSDK_NGX_Parameter_Resource_OutHeight "ResourceOutHeight" -#define NVSDK_NGX_Parameter_Depth "Depth" -#define NVSDK_NGX_Parameter_FI_Depth1 "Depth1" -#define NVSDK_NGX_Parameter_FI_Depth2 "Depth2" -#define NVSDK_NGX_Parameter_DLSSOptimalSettingsCallback "DLSSOptimalSettingsCallback" -#define NVSDK_NGX_Parameter_DLSSGetStatsCallback "DLSSGetStatsCallback" -#define NVSDK_NGX_Parameter_PerfQualityValue "PerfQualityValue" -#define NVSDK_NGX_Parameter_RTXValue "RTXValue" -#define NVSDK_NGX_Parameter_DLSSMode "DLSSMode" -#define NVSDK_NGX_Parameter_FI_Mode "FIMode" -#define NVSDK_NGX_Parameter_FI_OF_Preset "FIOFPreset" -#define NVSDK_NGX_Parameter_FI_OF_GridSize "FIOFGridSize" -#define NVSDK_NGX_Parameter_Jitter_Offset_X "Jitter.Offset.X" -#define NVSDK_NGX_Parameter_Jitter_Offset_Y "Jitter.Offset.Y" -#define NVSDK_NGX_Parameter_Denoise "Denoise" -#define NVSDK_NGX_Parameter_TransparencyMask "TransparencyMask" -#define NVSDK_NGX_Parameter_ExposureTexture "ExposureTexture" // a 1x1 texture containing the final exposure scale -#define NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags "DLSS.Feature.Create.Flags" -#define NVSDK_NGX_Parameter_DLSS_Checkerboard_Jitter_Hack "DLSS.Checkerboard.Jitter.Hack" -#define NVSDK_NGX_Parameter_GBuffer_Normals "GBuffer.Normals" -#define NVSDK_NGX_Parameter_GBuffer_Albedo "GBuffer.Albedo" -#define NVSDK_NGX_Parameter_GBuffer_Roughness "GBuffer.Roughness" -#define NVSDK_NGX_Parameter_GBuffer_DiffuseAlbedo "GBuffer.DiffuseAlbedo" -#define NVSDK_NGX_Parameter_GBuffer_SpecularAlbedo "GBuffer.SpecularAlbedo" -#define NVSDK_NGX_Parameter_GBuffer_IndirectAlbedo "GBuffer.IndirectAlbedo" -#define NVSDK_NGX_Parameter_GBuffer_SpecularMvec "GBuffer.SpecularMvec" -#define NVSDK_NGX_Parameter_GBuffer_DisocclusionMask "GBuffer.DisocclusionMask" -#define NVSDK_NGX_Parameter_GBuffer_Metallic "GBuffer.Metallic" -#define NVSDK_NGX_Parameter_GBuffer_Specular "GBuffer.Specular" -#define NVSDK_NGX_Parameter_GBuffer_Subsurface "GBuffer.Subsurface" -#define NVSDK_NGX_Parameter_GBuffer_Normals "GBuffer.Normals" -#define NVSDK_NGX_Parameter_GBuffer_ShadingModelId "GBuffer.ShadingModelId" -#define NVSDK_NGX_Parameter_GBuffer_MaterialId "GBuffer.MaterialId" -#define NVSDK_NGX_Parameter_GBuffer_Atrrib_8 "GBuffer.Attrib.8" -#define NVSDK_NGX_Parameter_GBuffer_Atrrib_9 "GBuffer.Attrib.9" -#define NVSDK_NGX_Parameter_GBuffer_Atrrib_10 "GBuffer.Attrib.10" -#define NVSDK_NGX_Parameter_GBuffer_Atrrib_11 "GBuffer.Attrib.11" -#define NVSDK_NGX_Parameter_GBuffer_Atrrib_12 "GBuffer.Attrib.12" -#define NVSDK_NGX_Parameter_GBuffer_Atrrib_13 "GBuffer.Attrib.13" -#define NVSDK_NGX_Parameter_GBuffer_Atrrib_14 "GBuffer.Attrib.14" -#define NVSDK_NGX_Parameter_GBuffer_Atrrib_15 "GBuffer.Attrib.15" -#define NVSDK_NGX_Parameter_TonemapperType "TonemapperType" -#define NVSDK_NGX_Parameter_FreeMemOnReleaseFeature "FreeMemOnReleaseFeature" -#define NVSDK_NGX_Parameter_MotionVectors3D "MotionVectors3D" -#define NVSDK_NGX_Parameter_IsParticleMask "IsParticleMask" -#define NVSDK_NGX_Parameter_AnimatedTextureMask "AnimatedTextureMask" -#define NVSDK_NGX_Parameter_DepthHighRes "DepthHighRes" -#define NVSDK_NGX_Parameter_Position_ViewSpace "Position.ViewSpace" -#define NVSDK_NGX_Parameter_FrameTimeDeltaInMsec "FrameTimeDeltaInMsec" -#define NVSDK_NGX_Parameter_RayTracingHitDistance "RayTracingHitDistance" -#define NVSDK_NGX_Parameter_MotionVectorsReflection "MotionVectorsReflection" -#define NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects "DLSS.Enable.Output.Subrects" -#define NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X "DLSS.Input.Color.Subrect.Base.X" -#define NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y "DLSS.Input.Color.Subrect.Base.Y" -#define NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X "DLSS.Input.Depth.Subrect.Base.X" -#define NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y "DLSS.Input.Depth.Subrect.Base.Y" -#define NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X "DLSS.Input.MV.Subrect.Base.X" -#define NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y "DLSS.Input.MV.Subrect.Base.Y" -#define NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X "DLSS.Input.Translucency.Subrect.Base.X" -#define NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y "DLSS.Input.Translucency.Subrect.Base.Y" -#define NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X "DLSS.Output.Subrect.Base.X" -#define NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y "DLSS.Output.Subrect.Base.Y" -#define NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width "DLSS.Render.Subrect.Dimensions.Width" -#define NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height "DLSS.Render.Subrect.Dimensions.Height" -#define NVSDK_NGX_Parameter_DLSS_Pre_Exposure "DLSS.Pre.Exposure" -#define NVSDK_NGX_Parameter_DLSS_Exposure_Scale "DLSS.Exposure.Scale" -#define NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask "DLSS.Input.Bias.Current.Color.Mask" -#define NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X "DLSS.Input.Bias.Current.Color.Subrect.Base.X" -#define NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y "DLSS.Input.Bias.Current.Color.Subrect.Base.Y" -#define NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis "DLSS.Indicator.Invert.Y.Axis" -#define NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis "DLSS.Indicator.Invert.X.Axis" - -#define NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Width "DLSS.Get.Dynamic.Max.Render.Width" -#define NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Height "DLSS.Get.Dynamic.Max.Render.Height" -#define NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Width "DLSS.Get.Dynamic.Min.Render.Width" -#define NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Height "DLSS.Get.Dynamic.Min.Render.Height" - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_helpers.h b/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_helpers.h deleted file mode 100644 index 3956911e..00000000 --- a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_helpers.h +++ /dev/null @@ -1,630 +0,0 @@ -/* -* Copyright (c) 2018 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#ifndef NVSDK_NGX_HELPERS_H -#define NVSDK_NGX_HELPERS_H -#pragma once - -#include "nvsdk_ngx.h" -#include "nvsdk_ngx_defs.h" - -typedef NVSDK_NGX_Result(NVSDK_CONV *PFN_NVSDK_NGX_DLSS_GetStatsCallback)(NVSDK_NGX_Parameter *InParams); - -static inline NVSDK_NGX_Result NGX_DLSS_GET_STATS_2( - NVSDK_NGX_Parameter *pInParams, - unsigned long long *pVRAMAllocatedBytes, - unsigned int *pOptLevel, unsigned int *IsDevSnippetBranch) -{ - void *Callback = NULL; - NVSDK_NGX_Parameter_GetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSGetStatsCallback, &Callback); - if (!Callback) - { - // Possible reasons for this: - // - Installed DLSS is out of date and does not support the feature we need - // - You used NVSDK_NGX_AllocateParameters() for creating InParams. Try using NVSDK_NGX_GetCapabilityParameters() instead - return NVSDK_NGX_Result_FAIL_OutOfDate; - } - - NVSDK_NGX_Result Res = NVSDK_NGX_Result_Success; - PFN_NVSDK_NGX_DLSS_GetStatsCallback PFNCallback = (PFN_NVSDK_NGX_DLSS_GetStatsCallback)Callback; - Res = PFNCallback(pInParams); - if (NVSDK_NGX_FAILED(Res)) - { - return Res; - } - NVSDK_NGX_Parameter_GetULL(pInParams, NVSDK_NGX_Parameter_SizeInBytes, pVRAMAllocatedBytes); - NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_EParameter_OptLevel, pOptLevel); - NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_EParameter_IsDevSnippetBranch, IsDevSnippetBranch); - return Res; -} - -static inline NVSDK_NGX_Result NGX_DLSS_GET_STATS_1( - NVSDK_NGX_Parameter *pInParams, - unsigned long long *pVRAMAllocatedBytes, - unsigned int *pOptLevel) -{ - unsigned int dummy = 0; - return NGX_DLSS_GET_STATS_2(pInParams, pVRAMAllocatedBytes, pOptLevel, &dummy); -} - -static inline NVSDK_NGX_Result NGX_DLSS_GET_STATS( - NVSDK_NGX_Parameter *pInParams, - unsigned long long *pVRAMAllocatedBytes) -{ - unsigned int dummy = 0; - return NGX_DLSS_GET_STATS_2(pInParams, pVRAMAllocatedBytes, &dummy, &dummy); -} - -typedef NVSDK_NGX_Result(NVSDK_CONV *PFN_NVSDK_NGX_DLSS_GetOptimalSettingsCallback)(NVSDK_NGX_Parameter *InParams); - -static inline NVSDK_NGX_Result NGX_DLSS_GET_OPTIMAL_SETTINGS( - NVSDK_NGX_Parameter *pInParams, - unsigned int InUserSelectedWidth, - unsigned int InUserSelectedHeight, - NVSDK_NGX_PerfQuality_Value InPerfQualityValue, - unsigned int *pOutRenderOptimalWidth, - unsigned int *pOutRenderOptimalHeight, - unsigned int *pOutRenderMaxWidth, - unsigned int *pOutRenderMaxHeight, - unsigned int *pOutRenderMinWidth, - unsigned int *pOutRenderMinHeight, - float *pOutSharpness) -{ - void *Callback = NULL; - NVSDK_NGX_Parameter_GetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSOptimalSettingsCallback, &Callback); - if (!Callback) - { - // Possible reasons for this: - // - Installed DLSS is out of date and does not support the feature we need - // - You used NVSDK_NGX_AllocateParameters() for creating InParams. Try using NVSDK_NGX_GetCapabilityParameters() instead - return NVSDK_NGX_Result_FAIL_OutOfDate; - } - - // These are selections made by user in UI - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, InUserSelectedWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, InUserSelectedHeight); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, InPerfQualityValue); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_RTXValue, false); // Some older DLSS dlls still expect this value to be set - - NVSDK_NGX_Result Res = NVSDK_NGX_Result_Success; - PFN_NVSDK_NGX_DLSS_GetOptimalSettingsCallback PFNCallback = (PFN_NVSDK_NGX_DLSS_GetOptimalSettingsCallback)Callback; - Res = PFNCallback(pInParams); - if (NVSDK_NGX_FAILED(Res)) - { - return Res; - } - NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pOutRenderOptimalWidth); - NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pOutRenderOptimalHeight); - // If we have an older DLSS Dll those might need to be set to the optimal dimensions instead - *pOutRenderMaxWidth = *pOutRenderOptimalWidth; - *pOutRenderMaxHeight = *pOutRenderOptimalHeight; - *pOutRenderMinWidth = *pOutRenderOptimalWidth; - *pOutRenderMinHeight = *pOutRenderOptimalHeight; - NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Width, pOutRenderMaxWidth); - NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Height, pOutRenderMaxHeight); - NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Width, pOutRenderMinWidth); - NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Height, pOutRenderMinHeight); - NVSDK_NGX_Parameter_GetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pOutSharpness); - return Res; -} - -/*** D3D11 ***/ -typedef struct NVSDK_NGX_D3D11_Feature_Eval_Params -{ - ID3D11Resource* pInColor; - ID3D11Resource* pInOutput; - /*** OPTIONAL for DLSS ***/ - float InSharpness; -} NVSDK_NGX_D3D11_Feature_Eval_Params; - -typedef struct NVSDK_NGX_CUDA_Feature_Eval_Params -{ - CUtexObject* pInColor; - CUtexObject* pInOutput; - /*** OPTIONAL for DLSS ***/ - float InSharpness; -} NVSDK_NGX_CUDA_Feature_Eval_Params; - -typedef struct NVSDK_NGX_D3D11_GBuffer -{ - ID3D11Resource* pInAttrib[NVSDK_NGX_GBUFFERTYPE_NUM]; -} NVSDK_NGX_D3D11_GBuffer; - -typedef struct NVSDK_NGX_D3D11_DLSS_Eval_Params -{ - NVSDK_NGX_D3D11_Feature_Eval_Params Feature; - ID3D11Resource* pInDepth; - ID3D11Resource* pInMotionVectors; - float InJitterOffsetX; /* Jitter offset must be in input/render pixel space */ - float InJitterOffsetY; - NVSDK_NGX_Dimensions InRenderSubrectDimensions; - /*** OPTIONAL - leave to 0/0.0f if unused ***/ - int InReset; /* Set to 1 when scene changes completely (new level etc) */ - float InMVScaleX; /* If MVs need custom scaling to convert to pixel space */ - float InMVScaleY; - ID3D11Resource* pInTransparencyMask; /* Unused/Reserved for future use */ - ID3D11Resource* pInExposureTexture; - ID3D11Resource* pInBiasCurrentColorMask; - NVSDK_NGX_Coordinates InColorSubrectBase; - NVSDK_NGX_Coordinates InDepthSubrectBase; - NVSDK_NGX_Coordinates InMVSubrectBase; - NVSDK_NGX_Coordinates InTranslucencySubrectBase; - NVSDK_NGX_Coordinates InBiasCurrentColorSubrectBase; - NVSDK_NGX_Coordinates InOutputSubrectBase; - float InPreExposure; - float InExposureScale; - int InIndicatorInvertXAxis; - int InIndicatorInvertYAxis; - /*** OPTIONAL - only for research purposes ***/ - NVSDK_NGX_D3D11_GBuffer GBufferSurface; - NVSDK_NGX_ToneMapperType InToneMapperType; - ID3D11Resource* pInMotionVectors3D; - ID3D11Resource* pInIsParticleMask; /* to identify which pixels contains particles, essentially that are not drawn as part of base pass */ - ID3D11Resource* pInAnimatedTextureMask; /* a binary mask covering pixels occupied by animated textures */ - ID3D11Resource* pInDepthHighRes; - ID3D11Resource* pInPositionViewSpace; - float InFrameTimeDeltaInMsec; /* helps in determining the amount to denoise or anti-alias based on the speed of the object from motion vector magnitudes and fps as determined by this delta */ - ID3D11Resource* pInRayTracingHitDistance; /* for each effect - approximation to the amount of noise in a ray-traced color */ - ID3D11Resource* pInMotionVectorsReflections; /* motion vectors of reflected objects like for mirrored surfaces */ -} NVSDK_NGX_D3D11_DLSS_Eval_Params; - -typedef struct NVSDK_NGX_D3D11_DLISP_Eval_Params -{ - NVSDK_NGX_D3D11_Feature_Eval_Params Feature; - /*** OPTIONAL - leave to 0/0.0f if unused ***/ - unsigned int InRectX; - unsigned int InRectY; - unsigned int InRectW; - unsigned int InRectH; - float InDenoise; -} NVSDK_NGX_D3D11_DLISP_Eval_Params; - -typedef struct NVSDK_NGX_CUDA_DLISP_Eval_Params -{ - NVSDK_NGX_CUDA_Feature_Eval_Params Feature; - /*** OPTIONAL - leave to 0/0.0f if unused ***/ - unsigned int InRectX; - unsigned int InRectY; - unsigned int InRectW; - unsigned int InRectH; - float InDenoise; -} NVSDK_NGX_CUDA_DLISP_Eval_Params; - -static inline NVSDK_NGX_Result NGX_D3D11_CREATE_DLSS_EXT( - ID3D11DeviceContext *pInCtx, - NVSDK_NGX_Handle **ppOutHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_DLSS_Create_Params *pInDlssCreateParams) -{ - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssCreateParams->Feature.InWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssCreateParams->Feature.InHeight); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlssCreateParams->Feature.InTargetWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlssCreateParams->Feature.InTargetHeight); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlssCreateParams->Feature.InPerfQualityValue); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, pInDlssCreateParams->InFeatureCreateFlags); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects, pInDlssCreateParams->InEnableOutputSubrects ? 1 : 0); - - return NVSDK_NGX_D3D11_CreateFeature(pInCtx, NVSDK_NGX_Feature_SuperSampling, pInParams, ppOutHandle); -} - -static inline NVSDK_NGX_Result NGX_D3D11_EVALUATE_DLSS_EXT( - ID3D11DeviceContext *pInCtx, - NVSDK_NGX_Handle *pInHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_D3D11_DLSS_Eval_Params *pInDlssEvalParams) -{ - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Color, pInDlssEvalParams->Feature.pInColor); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Output, pInDlssEvalParams->Feature.pInOutput); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Depth, pInDlssEvalParams->pInDepth); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors, pInDlssEvalParams->pInMotionVectors); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_X, pInDlssEvalParams->InJitterOffsetX); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_Y, pInDlssEvalParams->InJitterOffsetY); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pInDlssEvalParams->Feature.InSharpness); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_Reset, pInDlssEvalParams->InReset); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_X, pInDlssEvalParams->InMVScaleX == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleX); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_Y, pInDlssEvalParams->InMVScaleY == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleY); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_TransparencyMask, pInDlssEvalParams->pInTransparencyMask); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_ExposureTexture, pInDlssEvalParams->pInExposureTexture); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, pInDlssEvalParams->pInBiasCurrentColorMask); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Albedo, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ALBEDO]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ROUGHNESS]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Metallic, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_METALLIC]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Specular, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SPECULAR]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Subsurface, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SUBSURFACE]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_NORMALS]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_ShadingModelId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SHADINGMODELID]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_MaterialId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_MATERIALID]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_8, pInDlssEvalParams->GBufferSurface.pInAttrib[8]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_9, pInDlssEvalParams->GBufferSurface.pInAttrib[9]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_10, pInDlssEvalParams->GBufferSurface.pInAttrib[10]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_11, pInDlssEvalParams->GBufferSurface.pInAttrib[11]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_12, pInDlssEvalParams->GBufferSurface.pInAttrib[12]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_13, pInDlssEvalParams->GBufferSurface.pInAttrib[13]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_14, pInDlssEvalParams->GBufferSurface.pInAttrib[14]); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_15, pInDlssEvalParams->GBufferSurface.pInAttrib[15]); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_TonemapperType, pInDlssEvalParams->InToneMapperType); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors3D, pInDlssEvalParams->pInMotionVectors3D); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_IsParticleMask, pInDlssEvalParams->pInIsParticleMask); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_AnimatedTextureMask, pInDlssEvalParams->pInAnimatedTextureMask); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DepthHighRes, pInDlssEvalParams->pInDepthHighRes); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Position_ViewSpace, pInDlssEvalParams->pInPositionViewSpace); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, pInDlssEvalParams->InFrameTimeDeltaInMsec); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_RayTracingHitDistance, pInDlssEvalParams->pInRayTracingHitDistance); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_MotionVectorsReflection, pInDlssEvalParams->pInMotionVectorsReflections); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X, pInDlssEvalParams->InColorSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y, pInDlssEvalParams->InColorSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X, pInDlssEvalParams->InDepthSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y, pInDlssEvalParams->InDepthSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X, pInDlssEvalParams->InMVSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y, pInDlssEvalParams->InMVSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X, pInDlssEvalParams->InTranslucencySubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y, pInDlssEvalParams->InTranslucencySubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X, pInDlssEvalParams->InBiasCurrentColorSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y, pInDlssEvalParams->InBiasCurrentColorSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X, pInDlssEvalParams->InOutputSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y, pInDlssEvalParams->InOutputSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width , pInDlssEvalParams->InRenderSubrectDimensions.Width); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height, pInDlssEvalParams->InRenderSubrectDimensions.Height); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Pre_Exposure, pInDlssEvalParams->InPreExposure == 0.0f ? 1.0f : pInDlssEvalParams->InPreExposure); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Exposure_Scale, pInDlssEvalParams->InExposureScale == 0.0f ? 1.0f : pInDlssEvalParams->InExposureScale); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis, pInDlssEvalParams->InIndicatorInvertXAxis); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, pInDlssEvalParams->InIndicatorInvertYAxis); - - return NVSDK_NGX_D3D11_EvaluateFeature_C(pInCtx, pInHandle, pInParams, NULL); -} - -static inline NVSDK_NGX_Result NGX_D3D11_CREATE_DLISP_EXT( - ID3D11DeviceContext *pInCtx, - NVSDK_NGX_Handle **ppOutHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_Feature_Create_Params *pDlispCreateParams) -{ - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pDlispCreateParams->InWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pDlispCreateParams->InHeight); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pDlispCreateParams->InTargetWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pDlispCreateParams->InTargetHeight); - - return NVSDK_NGX_D3D11_CreateFeature(pInCtx, NVSDK_NGX_Feature_ImageSignalProcessing, pInParams, ppOutHandle); -} - -static inline NVSDK_NGX_Result NGX_CUDA_CREATE_DLISP_EXT( - NVSDK_NGX_Handle** ppOutHandle, - NVSDK_NGX_Parameter* pInParams, - NVSDK_NGX_Feature_Create_Params* pDlispCreateParams) -{ - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pDlispCreateParams->InWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pDlispCreateParams->InHeight); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pDlispCreateParams->InTargetWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pDlispCreateParams->InTargetHeight); - - return NVSDK_NGX_CUDA_CreateFeature(NVSDK_NGX_Feature_ImageSignalProcessing, pInParams, ppOutHandle); -} - -static inline NVSDK_NGX_Result NGX_D3D11_EVALUATE_DLISP_EXT( - ID3D11DeviceContext *pInCtx, - NVSDK_NGX_Handle *pInHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_D3D11_DLISP_Eval_Params *pDlispEvalParams) -{ - if (pDlispEvalParams->Feature.InSharpness < 0.0f || pDlispEvalParams->Feature.InSharpness > 1.0f || pDlispEvalParams->InDenoise < 0.0f || pDlispEvalParams->InDenoise > 1.0f) - { - return NVSDK_NGX_Result_FAIL_InvalidParameter; - } - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Color, pDlispEvalParams->Feature.pInColor); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Output, pDlispEvalParams->Feature.pInOutput); - // Both sharpness and denoise in range [0.0f,1.0f] - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pDlispEvalParams->Feature.InSharpness); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Denoise, pDlispEvalParams->InDenoise); - // If input is atlas - use RECT to upscale only the required area - if (pDlispEvalParams->InRectW) - { - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_X, pDlispEvalParams->InRectX); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_Y, pDlispEvalParams->InRectY); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_W, pDlispEvalParams->InRectW); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_H, pDlispEvalParams->InRectH); - } - - return NVSDK_NGX_D3D11_EvaluateFeature_C(pInCtx, pInHandle, pInParams, NULL); -} - -static inline NVSDK_NGX_Result NGX_CUDA_EVALUATE_DLISP_EXT( - NVSDK_NGX_Handle *pInHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_CUDA_DLISP_Eval_Params *pDlispEvalParams) -{ - if (pDlispEvalParams->Feature.InSharpness < 0.0f || pDlispEvalParams->Feature.InSharpness > 1.0f || pDlispEvalParams->InDenoise < 0.0f || pDlispEvalParams->InDenoise > 1.0f) - { - return NVSDK_NGX_Result_FAIL_InvalidParameter; - } - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Color, pDlispEvalParams->Feature.pInColor); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Output, pDlispEvalParams->Feature.pInOutput); - // Both sharpness and denoise in range [0.0f,1.0f] - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pDlispEvalParams->Feature.InSharpness); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Denoise, pDlispEvalParams->InDenoise); - // If input is atlas - use RECT to upscale only the required area - if (pDlispEvalParams->InRectW) - { - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_X, pDlispEvalParams->InRectX); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_Y, pDlispEvalParams->InRectY); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_W, pDlispEvalParams->InRectW); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_H, pDlispEvalParams->InRectH); - } - - return NVSDK_NGX_CUDA_EvaluateFeature_C(pInHandle, pInParams, NULL); -} - -static inline NVSDK_NGX_Result NGX_D3D11_CREATE_DLRESOLVE_EXT( - ID3D11DeviceContext *pInCtx, - NVSDK_NGX_Handle **ppOutHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_Feature_Create_Params *pDlresolveCreateParams) -{ - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pDlresolveCreateParams->InWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pDlresolveCreateParams->InHeight); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pDlresolveCreateParams->InTargetWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pDlresolveCreateParams->InTargetHeight); - - return NVSDK_NGX_D3D11_CreateFeature(pInCtx, NVSDK_NGX_Feature_DeepResolve, pInParams, ppOutHandle); -} - -static inline NVSDK_NGX_Result NGX_D3D11_EVALUATE_DLRESOLVE_EXT( - ID3D11DeviceContext *pInCtx, - NVSDK_NGX_Handle *InHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_D3D11_Feature_Eval_Params *pDlresolveEvalParams) -{ - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Color, pDlresolveEvalParams->pInColor); - NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Output, pDlresolveEvalParams->pInOutput); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pDlresolveEvalParams->InSharpness); - - return NVSDK_NGX_D3D11_EvaluateFeature_C(pInCtx, InHandle, pInParams, NULL); -} - -/*** D3D12 ***/ -typedef struct NVSDK_NGX_D3D12_Feature_Eval_Params -{ - ID3D12Resource* pInColor; - ID3D12Resource* pInOutput; - /*** OPTIONAL for DLSS ***/ - float InSharpness; -} NVSDK_NGX_D3D12_Feature_Eval_Params; - -typedef struct NVSDK_NGX_D3D12_GBuffer -{ - ID3D12Resource* pInAttrib[NVSDK_NGX_GBUFFERTYPE_NUM]; -} NVSDK_NGX_D3D12_GBuffer; - -typedef struct NVSDK_NGX_D3D12_DLSS_Eval_Params -{ - NVSDK_NGX_D3D12_Feature_Eval_Params Feature; - ID3D12Resource* pInDepth; - ID3D12Resource* pInMotionVectors; - float InJitterOffsetX; /* Jitter offset must be in input/render pixel space */ - float InJitterOffsetY; - NVSDK_NGX_Dimensions InRenderSubrectDimensions; - /*** OPTIONAL - leave to 0/0.0f if unused ***/ - int InReset; /* Set to 1 when scene changes completely (new level etc) */ - float InMVScaleX; /* If MVs need custom scaling to convert to pixel space */ - float InMVScaleY; - ID3D12Resource* pInTransparencyMask; /* Unused/Reserved for future use */ - ID3D12Resource* pInExposureTexture; - ID3D12Resource* pInBiasCurrentColorMask; - NVSDK_NGX_Coordinates InColorSubrectBase; - NVSDK_NGX_Coordinates InDepthSubrectBase; - NVSDK_NGX_Coordinates InMVSubrectBase; - NVSDK_NGX_Coordinates InTranslucencySubrectBase; - NVSDK_NGX_Coordinates InBiasCurrentColorSubrectBase; - NVSDK_NGX_Coordinates InOutputSubrectBase; - float InPreExposure; - float InExposureScale; - int InIndicatorInvertXAxis; - int InIndicatorInvertYAxis; - /*** OPTIONAL - only for research purposes ***/ - NVSDK_NGX_D3D12_GBuffer GBufferSurface; - NVSDK_NGX_ToneMapperType InToneMapperType; - ID3D12Resource* pInMotionVectors3D; - ID3D12Resource* pInIsParticleMask; /* to identify which pixels contains particles, essentially that are not drawn as part of base pass */ - ID3D12Resource* pInAnimatedTextureMask; /* a binary mask covering pixels occupied by animated textures */ - ID3D12Resource* pInDepthHighRes; - ID3D12Resource* pInPositionViewSpace; - float InFrameTimeDeltaInMsec; /* helps in determining the amount to denoise or anti-alias based on the speed of the object from motion vector magnitudes and fps as determined by this delta */ - ID3D12Resource* pInRayTracingHitDistance; /* for each effect - approximation to the amount of noise in a ray-traced color */ - ID3D12Resource* pInMotionVectorsReflections; /* motion vectors of reflected objects like for mirrored surfaces */ -} NVSDK_NGX_D3D12_DLSS_Eval_Params; - -typedef struct NVSDK_NGX_D3D12_DLISP_Eval_Params -{ - NVSDK_NGX_D3D12_Feature_Eval_Params Feature; - /*** OPTIONAL ***/ - unsigned int InRectX; - unsigned int InRectY; - unsigned int InRectW; - unsigned int InRectH; - float InDenoise; -} NVSDK_NGX_D3D12_DLISP_Eval_Params; - -static inline NVSDK_NGX_Result NGX_D3D12_CREATE_DLSS_EXT( - ID3D12GraphicsCommandList *pInCmdList, - unsigned int InCreationNodeMask, - unsigned int InVisibilityNodeMask, - NVSDK_NGX_Handle **ppOutHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_DLSS_Create_Params *pInDlssCreateParams) -{ - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssCreateParams->Feature.InWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssCreateParams->Feature.InHeight); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlssCreateParams->Feature.InTargetWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlssCreateParams->Feature.InTargetHeight); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlssCreateParams->Feature.InPerfQualityValue); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, pInDlssCreateParams->InFeatureCreateFlags); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects, pInDlssCreateParams->InEnableOutputSubrects ? 1 : 0); - - return NVSDK_NGX_D3D12_CreateFeature(pInCmdList, NVSDK_NGX_Feature_SuperSampling, pInParams, ppOutHandle); -} - -static inline NVSDK_NGX_Result NGX_D3D12_EVALUATE_DLSS_EXT( - ID3D12GraphicsCommandList *pInCmdList, - NVSDK_NGX_Handle *pInHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_D3D12_DLSS_Eval_Params *pInDlssEvalParams) -{ - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Color, pInDlssEvalParams->Feature.pInColor); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Output, pInDlssEvalParams->Feature.pInOutput); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Depth, pInDlssEvalParams->pInDepth); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors, pInDlssEvalParams->pInMotionVectors); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_X, pInDlssEvalParams->InJitterOffsetX); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_Y, pInDlssEvalParams->InJitterOffsetY); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pInDlssEvalParams->Feature.InSharpness); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_Reset, pInDlssEvalParams->InReset); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_X, pInDlssEvalParams->InMVScaleX == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleX); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_Y, pInDlssEvalParams->InMVScaleY == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleY); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_TransparencyMask, pInDlssEvalParams->pInTransparencyMask); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_ExposureTexture, pInDlssEvalParams->pInExposureTexture); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, pInDlssEvalParams->pInBiasCurrentColorMask); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Albedo, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ALBEDO]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ROUGHNESS]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Metallic, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_METALLIC]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Specular, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SPECULAR]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Subsurface, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SUBSURFACE]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_NORMALS]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_ShadingModelId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SHADINGMODELID]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_MaterialId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_MATERIALID]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_8, pInDlssEvalParams->GBufferSurface.pInAttrib[8]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_9, pInDlssEvalParams->GBufferSurface.pInAttrib[9]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_10, pInDlssEvalParams->GBufferSurface.pInAttrib[10]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_11, pInDlssEvalParams->GBufferSurface.pInAttrib[11]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_12, pInDlssEvalParams->GBufferSurface.pInAttrib[12]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_13, pInDlssEvalParams->GBufferSurface.pInAttrib[13]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_14, pInDlssEvalParams->GBufferSurface.pInAttrib[14]); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_15, pInDlssEvalParams->GBufferSurface.pInAttrib[15]); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_TonemapperType, pInDlssEvalParams->InToneMapperType); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors3D, pInDlssEvalParams->pInMotionVectors3D); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_IsParticleMask, pInDlssEvalParams->pInIsParticleMask); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_AnimatedTextureMask, pInDlssEvalParams->pInAnimatedTextureMask); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DepthHighRes, pInDlssEvalParams->pInDepthHighRes); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Position_ViewSpace, pInDlssEvalParams->pInPositionViewSpace); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, pInDlssEvalParams->InFrameTimeDeltaInMsec); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_RayTracingHitDistance, pInDlssEvalParams->pInRayTracingHitDistance); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_MotionVectorsReflection, pInDlssEvalParams->pInMotionVectorsReflections); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X, pInDlssEvalParams->InColorSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y, pInDlssEvalParams->InColorSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X, pInDlssEvalParams->InDepthSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y, pInDlssEvalParams->InDepthSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X, pInDlssEvalParams->InMVSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y, pInDlssEvalParams->InMVSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X, pInDlssEvalParams->InTranslucencySubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y, pInDlssEvalParams->InTranslucencySubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X, pInDlssEvalParams->InBiasCurrentColorSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y, pInDlssEvalParams->InBiasCurrentColorSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X, pInDlssEvalParams->InOutputSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y, pInDlssEvalParams->InOutputSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width , pInDlssEvalParams->InRenderSubrectDimensions.Width); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height, pInDlssEvalParams->InRenderSubrectDimensions.Height); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Pre_Exposure, pInDlssEvalParams->InPreExposure == 0.0f ? 1.0f : pInDlssEvalParams->InPreExposure); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Exposure_Scale, pInDlssEvalParams->InExposureScale == 0.0f ? 1.0f : pInDlssEvalParams->InExposureScale); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis, pInDlssEvalParams->InIndicatorInvertXAxis); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, pInDlssEvalParams->InIndicatorInvertYAxis); - - return NVSDK_NGX_D3D12_EvaluateFeature_C(pInCmdList, pInHandle, pInParams, NULL); -} - -static inline NVSDK_NGX_Result NGX_D3D12_CREATE_DLISP_EXT( - ID3D12GraphicsCommandList *InCmdList, - unsigned int InCreationNodeMask, - unsigned int InVisibilityNodeMask, - NVSDK_NGX_Handle **ppOutHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_Feature_Create_Params *pDlispCreateParams) -{ - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pDlispCreateParams->InWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pDlispCreateParams->InHeight); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pDlispCreateParams->InTargetWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pDlispCreateParams->InTargetHeight); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pDlispCreateParams->InPerfQualityValue); - - return NVSDK_NGX_D3D12_CreateFeature(InCmdList, NVSDK_NGX_Feature_ImageSignalProcessing, pInParams, ppOutHandle); -} - -static inline NVSDK_NGX_Result NGX_D3D12_EVALUATE_DLISP_EXT( - ID3D12GraphicsCommandList *pInCmdList, - NVSDK_NGX_Handle *pInHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_D3D12_DLISP_Eval_Params *pDlispEvalParams) -{ - if (pDlispEvalParams->Feature.InSharpness < 0.0f || pDlispEvalParams->Feature.InSharpness > 1.0f || pDlispEvalParams->InDenoise < 0.0f || pDlispEvalParams->InDenoise > 1.0f) - { - return NVSDK_NGX_Result_FAIL_InvalidParameter; - } - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Color, pDlispEvalParams->Feature.pInColor); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Output, pDlispEvalParams->Feature.pInOutput); - // Both sharpness and denoise in range [0.0f,1.0f] - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pDlispEvalParams->Feature.InSharpness); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Denoise, pDlispEvalParams->InDenoise); - // If input is atlas - use RECT to upscale only the required area - if (pDlispEvalParams->InRectW) - { - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_X, pDlispEvalParams->InRectX); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_Y, pDlispEvalParams->InRectY); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_W, pDlispEvalParams->InRectW); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_H, pDlispEvalParams->InRectH); - } - return NVSDK_NGX_D3D12_EvaluateFeature_C(pInCmdList, pInHandle, pInParams, NULL); -} - -static inline NVSDK_NGX_Result NGX_D3D12_CREATE_DLRESOLVE_EXT( - ID3D12GraphicsCommandList *pInCmdList, - unsigned int InCreationNodeMask, - unsigned int InVisibilityNodeMask, - NVSDK_NGX_Handle **ppOutHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_Feature_Create_Params *pDlresolveCreateParams) -{ - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pDlresolveCreateParams->InWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pDlresolveCreateParams->InHeight); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pDlresolveCreateParams->InTargetWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pDlresolveCreateParams->InTargetHeight); - - return NVSDK_NGX_D3D12_CreateFeature(pInCmdList, NVSDK_NGX_Feature_DeepResolve, pInParams, ppOutHandle); -} - -static inline NVSDK_NGX_Result NGX_D3D12_EVALUATE_DLRESOLVE_EXT( - ID3D12GraphicsCommandList *pInCmdList, - NVSDK_NGX_Handle *pInHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_D3D12_Feature_Eval_Params *pDlresolveEvalParams) -{ - // This call to NVSDK_NGX_Parameter_SetXXX() is equivalent to the Params->Set below functionally - // but to work around the lack of virtual functions and polymorphism in a C only project - // we introduced this new way to set params. - // The test should enforce that both paths work. - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Color, pDlresolveEvalParams->pInColor); - NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Output, pDlresolveEvalParams->pInOutput); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pDlresolveEvalParams->InSharpness); - - return NVSDK_NGX_D3D12_EvaluateFeature_C(pInCmdList, pInHandle, pInParams, NULL); -} - -#endif diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_helpers_vk.h b/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_helpers_vk.h deleted file mode 100644 index dbfbcdae..00000000 --- a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_helpers_vk.h +++ /dev/null @@ -1,319 +0,0 @@ -/* -* Copyright (c) 2018 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -#ifndef NVSDK_NGX_HELPERS_VK_H -#define NVSDK_NGX_HELPERS_VK_H -#pragma once - -#include "nvsdk_ngx_vk.h" - -#define NVSDK_NGX_ENSURE_VK_IMAGEVIEW(InResource) if ((InResource) && (InResource)->Type != NVSDK_NGX_RESOURCE_VK_TYPE_VK_IMAGEVIEW) { return NVSDK_NGX_Result_FAIL_InvalidParameter; } - -static inline NVSDK_NGX_Resource_VK NVSDK_NGX_Create_ImageView_Resource_VK(VkImageView imageView, VkImage image, VkImageSubresourceRange subresourceRange, VkFormat format, unsigned int width, unsigned int height, bool readWrite) -{ - NVSDK_NGX_Resource_VK resourceVK = {0}; - resourceVK.Type = NVSDK_NGX_RESOURCE_VK_TYPE_VK_IMAGEVIEW; - resourceVK.Resource.ImageViewInfo.ImageView = imageView; - resourceVK.Resource.ImageViewInfo.Image = image; - resourceVK.Resource.ImageViewInfo.SubresourceRange = subresourceRange; - resourceVK.Resource.ImageViewInfo.Height = height; - resourceVK.Resource.ImageViewInfo.Width = width; - resourceVK.Resource.ImageViewInfo.Format = format; - resourceVK.ReadWrite = readWrite; - return resourceVK; -} - -static inline NVSDK_NGX_Resource_VK NVSDK_NGX_Create_Buffer_Resource_VK(VkBuffer buffer, unsigned int sizeInBytes, bool readWrite) -{ - NVSDK_NGX_Resource_VK resourceVK = {0}; - resourceVK.Type = NVSDK_NGX_RESOURCE_VK_TYPE_VK_BUFFER; - resourceVK.Resource.BufferInfo.Buffer = buffer; - resourceVK.Resource.BufferInfo.SizeInBytes = sizeInBytes; - resourceVK.ReadWrite = readWrite; - return resourceVK; -} - -typedef struct NVSDK_NGX_VK_Feature_Eval_Params -{ - NVSDK_NGX_Resource_VK *pInColor; - NVSDK_NGX_Resource_VK *pInOutput; - /*** OPTIONAL for DLSS ***/ - float InSharpness; -} NVSDK_NGX_VK_Feature_Eval_Params; - -typedef struct NVSDK_NGX_VK_GBuffer -{ - NVSDK_NGX_Resource_VK *pInAttrib[NVSDK_NGX_GBUFFERTYPE_NUM]; -} NVSDK_NGX_VK_GBuffer; - -typedef struct NVSDK_NGX_Coordinates_VK -{ - unsigned int X; - unsigned int Y; -} NVSDK_NGX_Coordinates_VK; - -typedef struct NVSDK_NGX_VK_DLSS_Eval_Params -{ - NVSDK_NGX_VK_Feature_Eval_Params Feature; - NVSDK_NGX_Resource_VK * pInDepth; - NVSDK_NGX_Resource_VK * pInMotionVectors; - float InJitterOffsetX; /* Jitter offset must be in input/render pixel space */ - float InJitterOffsetY; - NVSDK_NGX_Dimensions InRenderSubrectDimensions; - /*** OPTIONAL - leave to 0/0.0f if unused ***/ - int InReset; /* Set to 1 when scene changes completely (new level etc) */ - float InMVScaleX; /* If MVs need custom scaling to convert to pixel space */ - float InMVScaleY; - NVSDK_NGX_Resource_VK * pInTransparencyMask; /* Unused/Reserved for future use */ - NVSDK_NGX_Resource_VK * pInExposureTexture; - NVSDK_NGX_Resource_VK * pInBiasCurrentColorMask; - NVSDK_NGX_Coordinates InColorSubrectBase; - NVSDK_NGX_Coordinates InDepthSubrectBase; - NVSDK_NGX_Coordinates InMVSubrectBase; - NVSDK_NGX_Coordinates InTranslucencySubrectBase; - NVSDK_NGX_Coordinates InBiasCurrentColorSubrectBase; - NVSDK_NGX_Coordinates InOutputSubrectBase; - float InPreExposure; - float InExposureScale; - int InIndicatorInvertXAxis; - int InIndicatorInvertYAxis; - /*** OPTIONAL - only for research purposes ***/ - NVSDK_NGX_VK_GBuffer GBufferSurface; - NVSDK_NGX_ToneMapperType InToneMapperType; - NVSDK_NGX_Resource_VK * pInMotionVectors3D; - NVSDK_NGX_Resource_VK * pInIsParticleMask; /* to identify which pixels contains particles, essentially that are not drawn as part of base pass */ - NVSDK_NGX_Resource_VK * pInAnimatedTextureMask; /* a binary mask covering pixels occupied by animated textures */ - NVSDK_NGX_Resource_VK * pInDepthHighRes; - NVSDK_NGX_Resource_VK * pInPositionViewSpace; - float InFrameTimeDeltaInMsec; /* helps in determining the amount to denoise or anti-alias based on the speed of the object from motion vector magnitudes and fps as determined by this delta */ - NVSDK_NGX_Resource_VK * pInRayTracingHitDistance; /* for each effect - approximation to the amount of noise in a ray-traced color */ - NVSDK_NGX_Resource_VK * pInMotionVectorsReflections; /* motion vectors of reflected objects like for mirrored surfaces */ -} NVSDK_NGX_VK_DLSS_Eval_Params; - -typedef struct NVSDK_NGX_VK_DLISP_Eval_Params -{ - NVSDK_NGX_VK_Feature_Eval_Params Feature; - /*** OPTIONAL - leave to 0/0.0f if unused ***/ - unsigned int InRectX; - unsigned int InRectY; - unsigned int InRectW; - unsigned int InRectH; - float InDenoise; -} NVSDK_NGX_VK_DLISP_Eval_Params; - -static inline NVSDK_NGX_Result NGX_VULKAN_CREATE_DLSS_EXT1( - VkDevice InDevice, - VkCommandBuffer InCmdList, - unsigned int InCreationNodeMask, - unsigned int InVisibilityNodeMask, - NVSDK_NGX_Handle **ppOutHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_DLSS_Create_Params *pInDlssCreateParams) -{ - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssCreateParams->Feature.InWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssCreateParams->Feature.InHeight); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlssCreateParams->Feature.InTargetWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlssCreateParams->Feature.InTargetHeight); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlssCreateParams->Feature.InPerfQualityValue); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, pInDlssCreateParams->InFeatureCreateFlags); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects, pInDlssCreateParams->InEnableOutputSubrects ? 1 : 0); - - if (InDevice) return NVSDK_NGX_VULKAN_CreateFeature1(InDevice, InCmdList, NVSDK_NGX_Feature_SuperSampling, pInParams, ppOutHandle); - else return NVSDK_NGX_VULKAN_CreateFeature(InCmdList, NVSDK_NGX_Feature_SuperSampling, pInParams, ppOutHandle); -} - -static inline NVSDK_NGX_Result NGX_VULKAN_CREATE_DLSS_EXT( - VkCommandBuffer InCmdList, - unsigned int InCreationNodeMask, - unsigned int InVisibilityNodeMask, - NVSDK_NGX_Handle **ppOutHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_DLSS_Create_Params *pInDlssCreateParams) -{ - return NGX_VULKAN_CREATE_DLSS_EXT1(NULL, InCmdList, InCreationNodeMask, InVisibilityNodeMask, ppOutHandle, pInParams, pInDlssCreateParams); -} - -static inline NVSDK_NGX_Result NGX_VULKAN_EVALUATE_DLSS_EXT( - VkCommandBuffer InCmdList, - NVSDK_NGX_Handle *pInHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_VK_DLSS_Eval_Params *pInDlssEvalParams) -{ - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->Feature.pInColor); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInMotionVectors); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->Feature.pInOutput); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInDepth); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInTransparencyMask); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInExposureTexture); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInBiasCurrentColorMask); - for (size_t i = 0; i <= 15; i++) - { - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->GBufferSurface.pInAttrib[i]); - } - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInMotionVectors3D); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInIsParticleMask); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInAnimatedTextureMask); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInDepthHighRes); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInPositionViewSpace); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInRayTracingHitDistance); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInMotionVectorsReflections); - - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Color, pInDlssEvalParams->Feature.pInColor); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Output, pInDlssEvalParams->Feature.pInOutput); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Depth, pInDlssEvalParams->pInDepth); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_MotionVectors, pInDlssEvalParams->pInMotionVectors); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_X, pInDlssEvalParams->InJitterOffsetX); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_Y, pInDlssEvalParams->InJitterOffsetY); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pInDlssEvalParams->Feature.InSharpness); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_Reset, pInDlssEvalParams->InReset); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_X, pInDlssEvalParams->InMVScaleX == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleX); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_Y, pInDlssEvalParams->InMVScaleY == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleY); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_TransparencyMask, pInDlssEvalParams->pInTransparencyMask); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_ExposureTexture, pInDlssEvalParams->pInExposureTexture); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, pInDlssEvalParams->pInBiasCurrentColorMask); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Albedo, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ALBEDO]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ROUGHNESS]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Metallic, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_METALLIC]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Specular, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SPECULAR]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Subsurface, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SUBSURFACE]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_NORMALS]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_ShadingModelId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SHADINGMODELID]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_MaterialId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_MATERIALID]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_8, pInDlssEvalParams->GBufferSurface.pInAttrib[8]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_9, pInDlssEvalParams->GBufferSurface.pInAttrib[9]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_10, pInDlssEvalParams->GBufferSurface.pInAttrib[10]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_11, pInDlssEvalParams->GBufferSurface.pInAttrib[11]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_12, pInDlssEvalParams->GBufferSurface.pInAttrib[12]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_13, pInDlssEvalParams->GBufferSurface.pInAttrib[13]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_14, pInDlssEvalParams->GBufferSurface.pInAttrib[14]); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_15, pInDlssEvalParams->GBufferSurface.pInAttrib[15]); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_TonemapperType, pInDlssEvalParams->InToneMapperType); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_MotionVectors3D, pInDlssEvalParams->pInMotionVectors3D); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_IsParticleMask, pInDlssEvalParams->pInIsParticleMask); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_AnimatedTextureMask, pInDlssEvalParams->pInAnimatedTextureMask); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DepthHighRes, pInDlssEvalParams->pInDepthHighRes); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Position_ViewSpace, pInDlssEvalParams->pInPositionViewSpace); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, pInDlssEvalParams->InFrameTimeDeltaInMsec); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_RayTracingHitDistance, pInDlssEvalParams->pInRayTracingHitDistance); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_MotionVectorsReflection, pInDlssEvalParams->pInMotionVectorsReflections); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X, pInDlssEvalParams->InColorSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y, pInDlssEvalParams->InColorSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X, pInDlssEvalParams->InDepthSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y, pInDlssEvalParams->InDepthSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X, pInDlssEvalParams->InMVSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y, pInDlssEvalParams->InMVSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X, pInDlssEvalParams->InTranslucencySubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y, pInDlssEvalParams->InTranslucencySubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X, pInDlssEvalParams->InBiasCurrentColorSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y, pInDlssEvalParams->InBiasCurrentColorSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X, pInDlssEvalParams->InOutputSubrectBase.X); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y, pInDlssEvalParams->InOutputSubrectBase.Y); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width , pInDlssEvalParams->InRenderSubrectDimensions.Width); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height, pInDlssEvalParams->InRenderSubrectDimensions.Height); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Pre_Exposure, pInDlssEvalParams->InPreExposure == 0.0f ? 1.0f : pInDlssEvalParams->InPreExposure); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Exposure_Scale, pInDlssEvalParams->InExposureScale == 0.0f ? 1.0f : pInDlssEvalParams->InExposureScale); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis, pInDlssEvalParams->InIndicatorInvertXAxis); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, pInDlssEvalParams->InIndicatorInvertYAxis); - - return NVSDK_NGX_VULKAN_EvaluateFeature_C(InCmdList, pInHandle, pInParams, NULL); -} - -static inline NVSDK_NGX_Result NGX_VULKAN_CREATE_DLISP_EXT( - VkCommandBuffer InCmdList, - unsigned int InCreationNodeMask, - unsigned int InVisibilityNodeMask, - NVSDK_NGX_Handle **ppOutHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_Feature_Create_Params *pInDlispCreateParams) -{ - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlispCreateParams->InWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlispCreateParams->InHeight); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlispCreateParams->InTargetWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlispCreateParams->InTargetHeight); - NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlispCreateParams->InPerfQualityValue); - - return NVSDK_NGX_VULKAN_CreateFeature(InCmdList, NVSDK_NGX_Feature_ImageSignalProcessing, pInParams, ppOutHandle); -} - -static inline NVSDK_NGX_Result NGX_VULKAN_EVALUATE_DLISP_EXT( - VkCommandBuffer InCmdList, - NVSDK_NGX_Handle *InHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_VK_DLISP_Eval_Params *pInDlispEvalParams) -{ - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlispEvalParams->Feature.pInColor); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlispEvalParams->Feature.pInOutput); - - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Color, pInDlispEvalParams->Feature.pInColor); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Output, pInDlispEvalParams->Feature.pInOutput); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pInDlispEvalParams->Feature.InSharpness); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Denoise, pInDlispEvalParams->InDenoise); - // If input is atlas - use RECT to upscale only the required area - if (pInDlispEvalParams->InRectW) - { - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_X, pInDlispEvalParams->InRectX); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_Y, pInDlispEvalParams->InRectY); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_W, pInDlispEvalParams->InRectW); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_H, pInDlispEvalParams->InRectH); - } - - return NVSDK_NGX_VULKAN_EvaluateFeature_C(InCmdList, InHandle, pInParams, NULL); -} - - -static inline NVSDK_NGX_Result NGX_VULKAN_CREATE_DLRESOLVE_EXT( - VkCommandBuffer InCmdList, - unsigned int InCreationNodeMask, - unsigned int InVisibilityNodeMask, - NVSDK_NGX_Handle **ppOutHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_Feature_Create_Params *pInDlresolveCreateParams) -{ - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlresolveCreateParams->InWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlresolveCreateParams->InHeight); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlresolveCreateParams->InTargetWidth); - NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlresolveCreateParams->InTargetHeight); - - return NVSDK_NGX_VULKAN_CreateFeature(InCmdList, NVSDK_NGX_Feature_DeepResolve, pInParams, ppOutHandle); -} - -static inline NVSDK_NGX_Result NGX_VULKAN_EVALUATE_DLRESOLVE_EXT( - VkCommandBuffer InCmdList, - NVSDK_NGX_Handle *pInHandle, - NVSDK_NGX_Parameter *pInParams, - NVSDK_NGX_VK_Feature_Eval_Params *pInDlresolveEvalParams) -{ - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlresolveEvalParams->pInColor); - NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlresolveEvalParams->pInOutput); - - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Color, pInDlresolveEvalParams->pInColor); - NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Output, pInDlresolveEvalParams->pInOutput); - NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pInDlresolveEvalParams->InSharpness); - - return NVSDK_NGX_VULKAN_EvaluateFeature_C(InCmdList, pInHandle, pInParams, NULL); -} - -#endif // NVSDK_NGX_HELPERS_VK_H diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_params.h b/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_params.h deleted file mode 100644 index 2e66097b..00000000 --- a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_params.h +++ /dev/null @@ -1,124 +0,0 @@ -/* -* Copyright (c) 2018 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - - -#ifndef NVSDK_NGX_PARAMS_H -#define NVSDK_NGX_PARAMS_H - -#include "nvsdk_ngx_defs.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -typedef struct ID3D11Resource ID3D11Resource; -typedef struct ID3D12Resource ID3D12Resource; - -typedef struct NVSDK_NGX_Feature_Create_Params -{ - unsigned int InWidth; - unsigned int InHeight; - unsigned int InTargetWidth; - unsigned int InTargetHeight; - /*** OPTIONAL ***/ - NVSDK_NGX_PerfQuality_Value InPerfQualityValue; -} NVSDK_NGX_Feature_Create_Params; - -typedef struct NVSDK_NGX_DLSS_Create_Params -{ - NVSDK_NGX_Feature_Create_Params Feature; - /*** OPTIONAL ***/ - int InFeatureCreateFlags; - bool InEnableOutputSubrects; -} NVSDK_NGX_DLSS_Create_Params; - -typedef struct NVSDK_NGX_DLDenoise_Create_Params -{ - NVSDK_NGX_Feature_Create_Params Feature; - /*** OPTIONAL ***/ - int InFeatureCreateFlags; -} NVSDK_NGX_DLDenoise_Create_Params; - -#ifdef __cplusplus -typedef struct NVSDK_NGX_Parameter -{ - virtual void Set(const char * InName, unsigned long long InValue) = 0; - virtual void Set(const char * InName, float InValue) = 0; - virtual void Set(const char * InName, double InValue) = 0; - virtual void Set(const char * InName, unsigned int InValue) = 0; - virtual void Set(const char * InName, int InValue) = 0; - virtual void Set(const char * InName, ID3D11Resource *InValue) = 0; - virtual void Set(const char * InName, ID3D12Resource *InValue) = 0; - virtual void Set(const char * InName, void *InValue) = 0; - - virtual NVSDK_NGX_Result Get(const char * InName, unsigned long long *OutValue) const = 0; - virtual NVSDK_NGX_Result Get(const char * InName, float *OutValue) const = 0; - virtual NVSDK_NGX_Result Get(const char * InName, double *OutValue) const = 0; - virtual NVSDK_NGX_Result Get(const char * InName, unsigned int *OutValue) const = 0; - virtual NVSDK_NGX_Result Get(const char * InName, int *OutValue) const = 0; - virtual NVSDK_NGX_Result Get(const char * InName, ID3D11Resource **OutValue) const = 0; - virtual NVSDK_NGX_Result Get(const char * InName, ID3D12Resource **OutValue) const = 0; - virtual NVSDK_NGX_Result Get(const char * InName, void **OutValue) const = 0; - - virtual void Reset() = 0; -} NVSDK_NGX_Parameter; -#else -typedef struct NVSDK_NGX_Parameter NVSDK_NGX_Parameter; -#endif // _cplusplus - -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetULL)(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned long long InValue); -NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetULL(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned long long InValue); -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetF)(NVSDK_NGX_Parameter *InParameter, const char * InName, float InValue); -NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetF(NVSDK_NGX_Parameter *InParameter, const char * InName, float InValue); -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetD)(NVSDK_NGX_Parameter *InParameter, const char * InName, double InValue); -NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetD(NVSDK_NGX_Parameter *InParameter, const char * InName, double InValue); -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetUI)(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned int InValue); -NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetUI(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned int InValue); -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetI)(NVSDK_NGX_Parameter *InParameter, const char * InName, int InValue); -NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetI(NVSDK_NGX_Parameter *InParameter, const char * InName, int InValue); -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetD3d11Resource)(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D11Resource *InValue); -NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetD3d11Resource(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D11Resource *InValue); -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetD3d12Resource)(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D12Resource *InValue); -NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetD3d12Resource(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D12Resource *InValue); -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetVoidPointer)(NVSDK_NGX_Parameter *InParameter, const char * InName, void *InValue); -NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetVoidPointer(NVSDK_NGX_Parameter *InParameter, const char * InName, void *InValue); -typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetULL)(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned long long *OutValue); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetULL(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned long long *OutValue); -typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetF)(NVSDK_NGX_Parameter *InParameter, const char * InName, float *OutValue); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetF(NVSDK_NGX_Parameter *InParameter, const char * InName, float *OutValue); -typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetD)(NVSDK_NGX_Parameter *InParameter, const char * InName, double *OutValue); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetD(NVSDK_NGX_Parameter *InParameter, const char * InName, double *OutValue); -typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetUI)(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned int *OutValue); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetUI(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned int *OutValue); -typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetI)(NVSDK_NGX_Parameter *InParameter, const char * InName, int *OutValue); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetI(NVSDK_NGX_Parameter *InParameter, const char * InName, int *OutValue); -typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetD3d11Resource)(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D11Resource **OutValue); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetD3d11Resource(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D11Resource **OutValue); -typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetD3d12Resource)(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D12Resource **OutValue); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetD3d12Resource(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D12Resource **OutValue); -typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetVoidPointer)(NVSDK_NGX_Parameter *InParameter, const char * InName, void **OutValue); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetVoidPointer(NVSDK_NGX_Parameter *InParameter, const char * InName, void **OutValue); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // #define NVSDK_NGX_PARAMS_H diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_vk.h b/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_vk.h deleted file mode 100644 index e57221e2..00000000 --- a/plugins/DLSS/Source/ThirdParty/NGX/Include/nvsdk_ngx_vk.h +++ /dev/null @@ -1,464 +0,0 @@ -/* -* Copyright (c) 2018 NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA Corporation and its licensors retain all intellectual property and proprietary -* rights in and to this software, related documentation and any modifications thereto. -* Any use, reproduction, disclosure or distribution of this software and related -* documentation without an express license agreement from NVIDIA Corporation is strictly -* prohibited. -* -* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* -* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, -* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY -* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT -* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR -* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGES. -*/ - -/* -* HOW TO USE: -* -* IMPORTANT: Methods in this library are NOT thread safe. It is up to the -* client to ensure that thread safety is enforced as needed. -* -* 1) Call NVSDK_CONV NVSDK_NGX_D3D11/D3D12/CUDA_Init and pass your app Id -* and other parameters. This will initialize SDK or return an error code -* if SDK cannot run on target machine. Depending on error user might -* need to update drivers. Please note that application Id is provided -* by NVIDIA so if you do not have one please contact us. -* -* 2) Call NVSDK_NGX_D3D11/D3D12/CUDA_GetParameters to obtain pointer to -* interface used to pass parameters to SDK. Interface instance is -* allocated and released by SDK so there is no need to do any memory -* management on client side. -* -* 3) Set key parameters for the feature you want to use. For example, -* width and height are required for all features and they can be -* set like this: -* Params->Set(NVSDK_NGX_Parameter_Width,MY_WIDTH); -* Params->Set(NVSDK_NGX_Parameter_Height,MY_HEIGHT); -* -* You can also provide hints like NVSDK_NGX_Parameter_Hint_HDR to tell -* SDK that it should expect HDR color space is needed. Please refer to -* samples since different features need different parameters and hints. -* -* 4) Call NVSDK_NGX_D3D11/D3D12/CUDA_GetScratchBufferSize to obtain size of -* the scratch buffer needed by specific feature. This D3D or CUDA buffer -* should be allocated by client and passed as: -* Params->Set(NVSDK_NGX_Parameter_Scratch,MY_SCRATCH_POINTER) -* Params->Set(NVSDK_NGX_Parameter_Scratch_SizeInBytes,MY_SCRATCH_SIZE_IN_BYTES) -* NOTE: Returned size can be 0 if feature does not use any scratch buffer. -* It is OK to use bigger buffer or reuse buffers across features as long -* as minimum size requirement is met. -* -* 5) Call NVSDK_NGX_D3D11/D3D12/CUDA_CreateFeature to create feature you need. -* On success SDK will return a handle which must be used in any successive -* calls to SDK which require feature handle. SDK will use all parameters -* and hints provided by client to generate feature. If feature with the same -* parameters already exists and error code will be returned. -* -* 6) Call NVSDK_NGX_D3D11/D3D12/CUDA_EvaluateFeature to invoke execution of -* specific feature. Before feature can be evaluated input parameters must -* be specified (like for example color/albedo buffer, motion vectors etc) -* -* 6) Call NVSDK_NGX_D3D11/D3D12/CUDA_ReleaseFeature when feature is no longer -* needed. After this call feature handle becomes invalid and cannot be used. -* -* 7) Call NVSDK_NGX_D3D11/D3D12/CUDA_Shutdown when SDK is no longer needed to -* release all resources. - -* Contact: ngxsupport@nvidia.com -*/ - - -#ifndef NVSDK_NGX_VK_H -#define NVSDK_NGX_VK_H - -#include "nvsdk_ngx_defs.h" -#include "nvsdk_ngx_params.h" -#ifndef __cplusplus -#include -#include -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_ImageViewInfo_VK [Vulkan only] -// Contains ImageView-specific metadata. -// ImageView: -// The VkImageView resource. -// -// Image: -// The VkImage associated to this VkImageView. -// -// SubresourceRange: -// The VkImageSubresourceRange associated to this VkImageView. -// -// Format: -// The format of the resource. -// -// Width: -// The width of the resource. -// -// Height: -// The height of the resource. -// -typedef struct NVSDK_NGX_ImageViewInfo_VK { - VkImageView ImageView; - VkImage Image; - VkImageSubresourceRange SubresourceRange; - VkFormat Format; - unsigned int Width; - unsigned int Height; -} NVSDK_NGX_ImageViewInfo_VK; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_BufferInfo_VK [Vulkan only] -// Contains Buffer-specific metadata. -// Buffer -// The VkBuffer resource. -// -// SizeInBytes: -// The size of the resource (in bytes). -// -typedef struct NVSDK_NGX_BufferInfo_VK { - VkBuffer Buffer; - unsigned int SizeInBytes; -} NVSDK_NGX_BufferInfo_VK; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_Resource_VK [Vulkan only] -// -// ImageViewInfo: -// The VkImageView resource, and VkImageView-specific metadata. A NVSDK_NGX_Resource_VK can only have one of ImageViewInfo or BufferInfo. -// -// BufferInfo: -// The VkBuffer Resource, and VkBuffer-specific metadata. A NVSDK_NGX_Resource_VK can only have one of ImageViewInfo or BufferInfo. -// -// Type: -// Whether or this resource is a VkImageView or a VkBuffer. -// -// ReadWrite: -// True if the resource is available for read and write access. -// For VkBuffer resources: VkBufferUsageFlags includes VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_BUFFER_BIT -// For VkImage resources: VkImageUsageFlags for associated VkImage includes VK_IMAGE_USAGE_STORAGE_BIT -// -typedef struct NVSDK_NGX_Resource_VK { - union { - NVSDK_NGX_ImageViewInfo_VK ImageViewInfo; - NVSDK_NGX_BufferInfo_VK BufferInfo; - } Resource; - NVSDK_NGX_Resource_VK_Type Type; - bool ReadWrite; -} NVSDK_NGX_Resource_VK; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_RequiredExtensions [Vulkan only] -// -// OutInstanceExtCount: -// Returns the number of instance extensions NGX requires -// -// OutInstanceExts: -// Returns a pointer to *OutInstanceExtCount strings of instance extensions -// -// OutDeviceExtCount: -// Returns the number of device extensions NGX requires -// -// OutDeviceExts: -// Returns a pointer to *OutDeviceExtCount strings of device extensions -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_RequiredExtensions(unsigned int *OutInstanceExtCount, const char *** OutInstanceExts, unsigned int *OutDeviceExtCount, const char *** OutDeviceExts); - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_Init -// ------------------------------------- -// -// InApplicationId: -// Unique Id provided by NVIDIA -// -// InApplicationDataPath: -// Folder to store logs and other temporary files (write access required), -// Normally this would be a location in Documents or ProgramData. -// -// InDevice: [d3d11/12 only] -// DirectX device to use -// -// DESCRIPTION: -// Initializes new SDK instance. -// -#ifdef __cplusplus -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API); -#else -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion); -#endif - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_Init_with_ProjectID -// ------------------------------------- -// -// InParojectId: -// Unique Id provided by the rendering engine used -// -// InEngineType: -// Rendering engine used by the application / plugin. -// Use NVSDK_NGX_ENGINE_TYPE_CUSTOM if the specific engine type is not supported explicitly -// -// InEngineVersion: -// Version number of the rendering engine used by the application / plugin. -// -// InApplicationDataPath: -// Folder to store logs and other temporary files (write access required), -// Normally this would be a location in Documents or ProgramData. -// -// InDevice: [d3d11/12 only] -// DirectX device to use -// -// InFeatureInfo: -// Contains information common to all features, presently only a list of all paths -// feature dlls can be located in, other than the default path - application directory. -// -// DESCRIPTION: -// Initializes new SDK instance. -// -#ifdef __cplusplus -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API); -#else -NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion); -#endif - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_Shutdown -// ------------------------------------- -// -// DESCRIPTION: -// Shuts down the current SDK instance and releases all resources. -// Shutdown1(Device) only affects specified device -// Shutdown1(nullptr) = Shutdown() and shuts down all devices -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Shutdown(void); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Shutdown1(VkDevice InDevice); - -#ifdef NGX_ENABLE_DEPRECATED_GET_PARAMETERS -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_GetParameters -// ---------------------------------------------------------- -// -// OutParameters: -// Parameters interface used to set any parameter needed by the SDK -// -// DESCRIPTION: -// This interface allows simple parameter setup using named fields. -// For example one can set width by calling Set(NVSDK_NGX_Parameter_Denoiser_Width,100) or -// provide CUDA buffer pointer by calling Set(NVSDK_NGX_Parameter_Denoiser_Color,cudaBuffer) -// For more details please see sample code. Please note that allocated memory -// will be freed by NGX so free/delete operator should NOT be called. -// Parameter maps output by NVSDK_NGX_GetParameters are also pre-populated -// with NGX capabilities and available features. -// Unlike with NVSDK_NGX_AllocateParameters, parameter maps output by NVSDK_NGX_GetParameters -// have their lifetimes managed by NGX, and must not -// be destroyed by the app using NVSDK_NGX_DestroyParameters. -// NVSDK_NGX_GetParameters is deprecated and apps should move to using -// NVSDK_NGX_AllocateParameters and NVSDK_NGX_GetCapabilityParameters when possible. -// Nevertheless, due to the possibility that the user will be using an older driver version, -// NVSDK_NGX_GetParameters may still be used as a fallback if NVSDK_NGX_AllocateParameters -// or NVSDK_NGX_GetCapabilityParameters return NVSDK_NGX_Result_FAIL_OutOfDate. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetParameters(NVSDK_NGX_Parameter **OutParameters); -#endif // NGX_ENABLE_DEPRECATED_GET_PARAMETERS - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_AllocateParameters -// ---------------------------------------------------------- -// -// OutParameters: -// Parameters interface used to set any parameter needed by the SDK -// -// DESCRIPTION: -// This interface allows allocating a simple parameter setup using named fields, whose -// lifetime the app must manage. -// For example one can set width by calling Set(NVSDK_NGX_Parameter_Denoiser_Width,100) or -// provide CUDA buffer pointer by calling Set(NVSDK_NGX_Parameter_Denoiser_Color,cudaBuffer) -// For more details please see sample code. -// Parameter maps output by NVSDK_NGX_AllocateParameters must NOT be freed using -// the free/delete operator; to free a parameter map -// output by NVSDK_NGX_AllocateParameters, NVSDK_NGX_DestroyParameters should be used. -// Unlike with NVSDK_NGX_GetParameters, parameter maps allocated with NVSDK_NGX_AllocateParameters -// must be destroyed by the app using NVSDK_NGX_DestroyParameters. -// Also unlike with NVSDK_NGX_GetParameters, parameter maps output by NVSDK_NGX_AllocateParameters -// do not come pre-populated with NGX capabilities and available features. -// To create a new parameter map pre-populated with such information, NVSDK_NGX_GetCapabilityParameters -// should be used. -// This function may return NVSDK_NGX_Result_FAIL_OutOfDate if an older driver, which -// does not support this API call is being used. In such a case, NVSDK_NGX_GetParameters -// may be used as a fallback. -// This function may only be called after a successful call into NVSDK_NGX_Init. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_AllocateParameters(NVSDK_NGX_Parameter** OutParameters); - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_GetCapabilityParameters -// ---------------------------------------------------------- -// -// OutParameters: -// The parameters interface populated with NGX and feature capabilities -// -// DESCRIPTION: -// This interface allows the app to create a new parameter map -// pre-populated with NGX capabilities and available features. -// The output parameter map can also be used for any purpose -// parameter maps output by NVSDK_NGX_AllocateParameters can be used for -// but it is not recommended to use NVSDK_NGX_GetCapabilityParameters -// unless querying NGX capabilities and available features -// due to the overhead associated with pre-populating the parameter map. -// Parameter maps output by NVSDK_NGX_GetCapabilityParameters must NOT be freed using -// the free/delete operator; to free a parameter map -// output by NVSDK_NGX_GetCapabilityParameters, NVSDK_NGX_DestroyParameters should be used. -// Unlike with NVSDK_NGX_GetParameters, parameter maps allocated with NVSDK_NGX_GetCapabilityParameters -// must be destroyed by the app using NVSDK_NGX_DestroyParameters. -// This function may return NVSDK_NGX_Result_FAIL_OutOfDate if an older driver, which -// does not support this API call is being used. This function may only be called -// after a successful call into NVSDK_NGX_Init. -// If NVSDK_NGX_GetCapabilityParameters fails with NVSDK_NGX_Result_FAIL_OutOfDate, -// NVSDK_NGX_GetParameters may be used as a fallback, to get a parameter map pre-populated -// with NGX capabilities and available features. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters); - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_DestroyParameters -// ---------------------------------------------------------- -// -// InParameters: -// The parameters interface to be destroyed -// -// DESCRIPTION: -// This interface allows the app to destroy the parameter map passed in. Once -// NVSDK_NGX_DestroyParameters is called on a parameter map, it -// must not be used again. -// NVSDK_NGX_DestroyParameters must not be called on any parameter map returned -// by NVSDK_NGX_GetParameters; NGX will manage the lifetime of those -// parameter maps. -// This function may return NVSDK_NGX_Result_FAIL_OutOfDate if an older driver, which -// does not support this API call is being used. This function may only be called -// after a successful call into NVSDK_NGX_Init. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_DestroyParameters(NVSDK_NGX_Parameter* InParameters); - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_GetScratchBufferSize -// ---------------------------------------------------------- -// -// InFeatureId: -// AI feature in question -// -// InParameters: -// Parameters used by the feature to help estimate scratch buffer size -// -// OutSizeInBytes: -// Number of bytes needed for the scratch buffer for the specified feature. -// -// DESCRIPTION: -// SDK needs a buffer of a certain size provided by the client in -// order to initialize AI feature. Once feature is no longer -// needed buffer can be released. It is safe to reuse the same -// scratch buffer for different features as long as minimum size -// requirement is met for all features. Please note that some -// features might not need a scratch buffer so return size of 0 -// is completely valid. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter *InParameters, size_t *OutSizeInBytes); - -///////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_CreateFeature -// ------------------------------------- -// -// InCmdBuffer: -// Command buffer to use to execute GPU commands. Must be: -// - Open and recording - -// InFeatureID: -// AI feature to initialize -// -// InParameters: -// List of parameters -// -// OutHandle: -// Handle which uniquely identifies the feature. If feature with -// provided parameters already exists the "already exists" error code is returned. -// -// DESCRIPTION: -// Each feature needs to be created before it can be used. -// Refer to the sample code to find out which input parameters -// are needed to create specific feature. -// CreateFeature() creates feature on single existing Device -// CreateFeature1() creates feature on the specified Device -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_CreateFeature(VkCommandBuffer InCmdBuffer, NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_CreateFeature1(VkDevice InDevice, VkCommandBuffer InCmdList, NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle); - -///////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_Release -// ------------------------------------- -// -// InHandle: -// Handle to feature to be released -// -// DESCRIPTION: -// Releases feature with a given handle. -// Handles are not reference counted so -// after this call it is invalid to use provided handle. -// -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_ReleaseFeature(NVSDK_NGX_Handle *InHandle); - -///////////////////////////////////////////////////////////////////////// -// NVSDK_NGX_EvaluateFeature -// ------------------------------------- -// -// InCmdList:[d3d12 only] -// Command list to use to execute GPU commands. Must be: -// - Open and recording -// - With node mask including the device provided in NVSDK_NGX_D3D12_Init -// - Execute on non-copy command queue. -// InDevCtx: [d3d11 only] -// Device context to use to execute GPU commands -// -// InFeatureHandle: -// Handle representing feature to be evaluated -// -// InParameters: -// List of parameters required to evaluate feature -// -// InCallback: -// Optional callback for features which might take longer -// to execture. If specified SDK will call it with progress -// values in range 0.0f - 1.0f -// -// DESCRIPTION: -// Evaluates given feature using the provided parameters and -// pre-trained NN. Please note that for most features -// it can be benefitials to pass as many input buffers and parameters -// as possible (for example provide all render targets like color, albedo, normals, depth etc) -// - -#ifdef __cplusplus -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_ProgressCallback)(float InCurrentProgress, bool &OutShouldCancel); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_EvaluateFeature(VkCommandBuffer InCmdList, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback = NULL); -#endif -typedef void (NVSDK_CONV *PFN_NVSDK_NGX_ProgressCallback_C)(float InCurrentProgress, bool *OutShouldCancel); -NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_EvaluateFeature_C(VkCommandBuffer InCmdList, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback_C InCallback); - -// NGX return-code conversion-to-string utility only as a helper for debugging/logging - not for official use. -const wchar_t* NVSDK_CONV GetNGXResultAsString(NVSDK_NGX_Result InNGXResult); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // #define NVSDK_NGX_VK_H diff --git a/plugins/DLSS/Source/ThirdParty/NGX/LICENSE.txt b/plugins/DLSS/Source/ThirdParty/NGX/LICENSE.txt deleted file mode 100644 index 94965d73..00000000 --- a/plugins/DLSS/Source/ThirdParty/NGX/LICENSE.txt +++ /dev/null @@ -1,408 +0,0 @@ -NVIDIA RTX SDKs LICENSE - -This license is a legal agreement between you and NVIDIA Corporation ("NVIDIA") -and governs the use of the NVIDIA RTX software development kits, including the -DLSS SDK, NGX SDK, RTXGI SDK, RTXDI SDK and/or NRD SDK, if and when made -available to you under this license (in each case, the "SDK"). This license can -be accepted only by an adult of legal age of majority in the country in which -the SDK is used. If you are under the legal age of majority, you must ask your -parent or legal guardian to consent to this license. If you are entering this -license on behalf of a company or other legal entity, you represent that you -have legal authority and "you" will mean the entity you represent. By using the -SDK, you affirm that you have reached the legal age of majority, you accept the -terms of this license, and you take legal and financial responsibility for the -actions of your permitted users. - -You agree to use the SDK only for purposes that are permitted by (a) this -license, and (b) any applicable law, regulation or generally accepted practices -or guidelines in the relevant jurisdictions. - -1. LICENSE. Subject to the terms of this license and the terms in the supplement -attached, NVIDIA hereby grants you a non-exclusive, non-transferable license, -without the right to sublicense (except as expressly provided in this license) -to: - -(a) Install and use the SDK, - -(b) Modify and create derivative works of sample source code delivered in the -SDK, and - -(c) Distribute any software and materials within the SDK, other than developer -tools provided for your internal use, as incorporated in object code format into -a software application subject to the distribution requirements indicated in -this license. - -2. DISTRIBUTION REQUIREMENTS. These are the distribution requirements for you to -exercise the grants above: - -(a) An application must have material additional functionality, beyond the -included portions of the SDK. - -(b) The following notice shall be included in modifications and derivative works -of source code distributed: "This software contains source code provided by -NVIDIA Corporation." - -(c) You agree to distribute the SDK subject to the terms at least as protective -as the terms of this license, including (without limitation) terms relating to -the license grant, license restrictions and protection of NVIDIA's intellectual -property rights. Additionally, you agree that you will protect the privacy, -security and legal rights of your application users. - -(d) You agree to notify NVIDIA in writing of any known or suspected distribution -or use of the SDK not in compliance with the requirements of this license, and -to enforce the terms of your agreements with respect to the distributed portions -of the SDK. - -3. AUTHORIZED USERS. You may allow employees and contractors of your entity or -of your subsidiary(ies) to access and use the SDK from your secure network to -perform work on your behalf. If you are an academic institution you may allow -users enrolled or employed by the academic institution to access and use the SDK -from your secure network. You are responsible for the compliance with the terms -of this license by your authorized users. - -4. LIMITATIONS. Your license to use the SDK is restricted as follows: - -(a) You may not reverse engineer, decompile or disassemble, or remove copyright -or other proprietary notices from any portion of the SDK or copies of the SDK. - -(b) Except as expressly provided in this license, you may not copy, sell, rent, -sublicense, transfer, distribute, modify, or create derivative works of any -portion of the SDK. For clarity, you may not distribute or sublicense the SDK as -a stand-alone product. - -(c) Unless you have an agreement with NVIDIA for this purpose, you may not -indicate that an application created with the SDK is sponsored or endorsed by -NVIDIA. - -(d) You may not bypass, disable, or circumvent any technical limitation, -encryption, security, digital rights management or authentication mechanism in -the SDK. - -(e) You may not use the SDK in any manner that would cause it to become subject -to an open source software license. As examples, licenses that require as a -condition of use, modification, and/or distribution that the SDK be: (i) -disclosed or distributed in source code form; (ii) licensed for the purpose of -making derivative works; or (iii) redistributable at no charge. - -(f) Unless you have an agreement with NVIDIA for this purpose, you may not use -the SDK with any system or application where the use or failure of the system or -application can reasonably be expected to threaten or result in personal injury, -death, or catastrophic loss. Examples include use in avionics, navigation, -military, medical, life support or other life critical applications. NVIDIA does -not design, test or manufacture the SDK for these critical uses and NVIDIA shall -not be liable to you or any third party, in whole or in part, for any claims or -damages arising from such uses. - -(g) You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, -and their respective employees, contractors, agents, officers and directors, -from and against any and all claims, damages, obligations, losses, liabilities, -costs or debt, fines, restitutions and expenses (including but not limited to -attorney's fees and costs incident to establishing the right of indemnification) -arising out of or related to your use of the SDK outside of the scope of this -license, or not in compliance with its terms. - -5. UPDATES. NVIDIA may, at its option, make available patches, workarounds or -other updates to this SDK. Unless the updates are provided with their separate -governing terms, they are deemed part of the SDK licensed to you as provided in -this license. You agree that the form and content of the SDK that NVIDIA -provides may change without prior notice to you. While NVIDIA generally -maintains compatibility between versions, NVIDIA may in some cases make changes -that introduce incompatibilities in future versions of the SDK. - -6. PRE-RELEASE VERSIONS. SDK versions identified as alpha, beta, preview, early -access or otherwise as pre-release may not be fully functional, may contain -errors or design flaws, and may have reduced or different security, privacy, -availability, and reliability standards relative to commercial versions of -NVIDIA software and materials. You may use a pre-release SDK version at your own -risk, understanding that these versions are not intended for use in production -or business-critical systems. NVIDIA may choose not to make available a -commercial version of any pre-release SDK. NVIDIA may also choose to abandon -development and terminate the availability of a pre-release SDK at any time -without liability. - -7. THIRD-PARTY COMPONENTS. The SDK may include third-party components with -separate legal notices or terms as may be described in proprietary notices -accompanying the SDK. If and to the extent there is a conflict between the terms -in this license and the third-party license terms, the third-party terms control -only to the extent necessary to resolve the conflict. - -8. OWNERSHIP. - -8.1 NVIDIA reserves all rights, title and interest in and to the SDK not -expressly granted to you under this license. NVIDIA and its suppliers hold all -rights, title and interest in and to the SDK, including their respective -intellectual property rights. The SDK is copyrighted and protected by the laws -of the United States and other countries, and international treaty provisions. - -8.2 Subject to the rights of NVIDIA and its suppliers in the SDK, you hold all -rights, title and interest in and to your applications and your derivative works -of the sample source code delivered in the SDK including their respective -intellectual property rights. - -9. FEEDBACK. You may, but are not obligated to, provide Feedback to NVIDIA. -"Feedback" means all suggestions, fixes, modifications, feature requests or -other feedback regarding the SDK. Feedback, even if designated as confidential -by you, shall not create any confidentiality obligation for NVIDIA. NVIDIA and -its designees have a perpetual, non-exclusive, worldwide, irrevocable license to -use, reproduce, publicly display, modify, create derivative works of, license, -sublicense, and otherwise distribute and exploit Feedback as NVIDIA sees fit -without payment and without obligation or restriction of any kind on account of -intellectual property rights or otherwise. - -10. NO WARRANTIES. THE SDK IS PROVIDED AS-IS. TO THE MAXIMUM EXTENT PERMITTED BY -APPLICABLE LAW NVIDIA AND ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF -ANY KIND OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT -LIMITED TO, WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR A -PARTICULAR PURPOSE. NVIDIA DOES NOT WARRANT THAT THE SDK WILL MEET YOUR -REQUIREMENTS OR THAT THE OPERATION THEREOF WILL BE UNINTERRUPTED OR ERROR-FREE, -OR THAT ALL ERRORS WILL BE CORRECTED. - -11. LIMITATIONS OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW -NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, -PUNITIVE OR CONSEQUENTIAL DAMAGES, OR FOR ANY LOST PROFITS, PROJECT DELAYS, LOSS -OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE -PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE USE OR -PERFORMANCE OF THE SDK, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON -BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT -LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY, EVEN IF NVIDIA -HAS PREVIOUSLY BEEN ADVISED OF, OR COULD REASONABLY HAVE FORESEEN, THE -POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL NVIDIA'S AND ITS AFFILIATES TOTAL -CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS LICENSE EXCEED US$10.00. THE -NATURE OF THE LIABILITY OR THE NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR -EXTEND THIS LIMIT. - -12. TERMINATION. Your rights under this license will terminate automatically -without notice from NVIDIA if you fail to comply with any term and condition of -this license or if you commence or participate in any legal proceeding against -NVIDIA with respect to the SDK. NVIDIA may terminate this license with advance -written notice to you, if NVIDIA decides to no longer provide the SDK in a -country or, in NVIDIA's sole discretion, the continued use of it is no longer -commercially viable. Upon any termination of this license, you agree to promptly -discontinue use of the SDK and destroy all copies in your possession or control. -Your prior distributions in accordance with this license are not affected by the -termination of this license. All provisions of this license will survive -termination, except for the license granted to you. - -13. APPLICABLE LAW. This license will be governed in all respects by the laws of -the United States and of the State of Delaware, without regard to the conflicts -of laws principles. The United Nations Convention on Contracts for the -International Sale of Goods is specifically disclaimed. You agree to all terms -of this license in the English language. The state or federal courts residing in -Santa Clara County, California shall have exclusive jurisdiction over any -dispute or claim arising out of this license. Notwithstanding this, you agree -that NVIDIA shall still be allowed to apply for injunctive remedies or urgent -legal relief in any jurisdiction. - -14. NO ASSIGNMENT. This license and your rights and obligations thereunder may -not be assigned by you by any means or operation of law without NVIDIA's -permission. Any attempted assignment not approved by NVIDIA in writing shall be -void and of no effect. NVIDIA may assign, delegate or transfer this license and -its rights and obligations, and if to a non-affiliate you will be notified. - -15. EXPORT. The SDK is subject to United States export laws and regulations. You -agree to comply with all applicable U.S. and international export laws, -including the Export Administration Regulations (EAR) administered by the U.S. -Department of Commerce and economic sanctions administered by the U.S. -Department of Treasury's Office of Foreign Assets Control (OFAC). These laws -include restrictions on destinations, end-users and end-use. By accepting this -license, you confirm that you are not currently residing in a country or region -currently embargoed by the U.S. and that you are not otherwise prohibited from -receiving the SDK. - -16. GOVERNMENT USE. The SDK is, and shall be treated as being, "Commercial -Items" as that term is defined at 48 CFR § 2.101, consisting of "commercial -computer software" and "commercial computer software documentation", -respectively, as such terms are used in, respectively, 48 CFR § 12.212 and 48 -CFR §§ 227.7202 & 252.227-7014(a)(1). Use, duplication or disclosure by the U.S. -Government or a U.S. Government subcontractor is subject to the restrictions in -this license pursuant to 48 CFR § 12.212 or 48 CFR § 227.7202. In no event shall -the US Government user acquire rights in the SDK beyond those specified in 48 -C.F.R. 52.227-19(b)(1)-(2). - -17. NOTICES. You agree that any notices that NVIDIA sends you electronically, -such as via email, will satisfy any legal communication requirements. Please -direct your legal notices or other correspondence to NVIDIA Corporation, 2788 -San Tomas Expressway, Santa Clara, California 95051, United States of America, -Attention: Legal Department. - -18. ENTIRE AGREEMENT. This license is the final, complete and exclusive -agreement between the parties relating to the subject matter of this license and -supersedes all prior or contemporaneous understandings and agreements relating -to this subject matter, whether oral or written. If any court of competent -jurisdiction determines that any provision of this license is illegal, invalid -or unenforceable, the remaining provisions will remain in full force and effect. -Any amendment or waiver under this license shall be in writing and signed by -representatives of both parties. - -19. LICENSING. If the distribution terms in this license are not suitable for -your organization, or for any questions regarding this license, please contact -NVIDIA at nvidia-rtx-license-questions@nvidia.com. - -(v. April 12, 2021) - - - -NVIDIA RTX SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE -DEVELOPMENT KITS - -The terms in this supplement govern your use of the NVIDIA RTX SDKs, including -the DLSS SDK, NGX SDK, RTXGI SDK, RTXDI SDK and/or NRD SDK, if and when made -available to you (in each case, the "SDK") under the terms of your license -agreement ("Agreement") as modified by this supplement. Capitalized terms used -but not defined below have the meaning assigned to them in the Agreement. - -This supplement is an exhibit to the Agreement and is incorporated as an -integral part of the Agreement. In the event of conflict between the terms in -this supplement and the terms in the Agreement, the terms in this supplement -govern. - -1. Interoperability. Your applications that incorporate, or are based on, the -SDK must be fully interoperable with compatible GPU hardware products designed -by NVIDIA or its affiliates. Further, the DLSS SDK and NGX SDK are licensed for -you to develop applications only for their use in systems with NVIDIA GPUs. - -2. Limitations for the DLSS SDK and NGX SDK. Your applications that incorporate, -or are based on, the DLSS SDK or NGX SDK may be deployed in a cloud service that -runs on systems that consume NVIDIA vGPU software, and any other cloud service -use of such SDKs or their functionality is outside of the scope of the -Agreement. For the purpose of this section, cloud services include application -service providers or service bureaus, operators of hosted/virtual system -environments, or hosting, time sharing or providing any other type of service to -others. - -3. Notification for the DLSS SDK and NGX SDK. You are required to notify NVIDIA -prior to commercial release of an application (including a plug-in to a -commercial application) that incorporates, or is based on, the DLSS SDK or NGX -SDK. Please send notifications to: https://developer.nvidia.com/sw-notification -and provide the following information in the email: company name, publisher and -developer name, NVIDIA SDK used, application name, platform (i.e. PC, Linux), -scheduled ship date, and weblink to product/video. - -4. Audio and Video Encoders and Decoders. You acknowledge and agree that it is -your sole responsibility to obtain any additional third-party licenses required -to make, have made, use, have used, sell, import, and offer for sale your -products or services that include or incorporate any third-party software and -content relating to audio and/or video encoders and decoders from, including but -not limited to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A., MPEG-LA, and -Coding Technologies. NVIDIA does not grant to you under this Agreement any -necessary patent or other rights with respect to any audio and/or video encoders -and decoders. - -5. DLSS SDK Terms. By installing or using the DLSS SDK you agree that NVIDIA can -make over-the-air updates of DLSS in systems that have DLSS installed, including -(without limitation) for quality, stability or performance improvements or to -support new hardware. If you publicly release a DLSS integration in an end user -game or application that presents material stability, performance, image -quality, or other technical issues impacting the user experience, you will work -to quickly address the integration issues. In the case issues are not addressed, -NVIDIA reserves the right, as a last resort, to temporarily disable the DLSS -integration until the issues can be fixed. - -6. Marketing. - -6.1 Marketing Activities. Your license to the SDK(s) under the Agreement is -subject to your compliance with the following marketing terms: - -(a) Identification by You in the DLSS SDK or NGX SDK. During the term of the -Agreement, NVIDIA agrees that you may identify NVIDIA on your websites, printed -collateral, trade-show displays and other retail packaging materials, as the -supplier of the DLSS SDK or NGX SDK for the applications that were developed -with use of such SDKs, provided that all such references to NVIDIA will be -subject to NVIDIA's prior review and written approval, which will not be -unreasonably withheld or delayed. - -(b) NVIDIA Trademark Placement in Applications with the DLSS SDK or NGX SDK. -For applications that incorporate the DLSS SDK or NGX SDK or portions thereof, -you must attribute the use of the applicable SDK and include the NVIDIA Marks -on splash screens, in the about box of the application (if present), and in -credits for game applications. - -(c) NVIDIA Trademark Placement in Applications with a licensed SDK, other than -the DLSS SDK or NGX SDK. For applications that incorporates and/or makes use of -a licensed SDK, other than the DLSS SDK or NGX SDK, you must attribute the use -of the applicable SDK and include the NVIDIA Marks on the credit screen for -applications that have such credit screen, or where a credit screen is not -present prominently in end user documentation for the application. d) -Identification by NVIDIA in the DLSS SDK or NGX SDK. You agree that NVIDIA may -identify you on NVIDIA's websites, printed collateral, trade-show displays, and -other retail packaging materials as an individual or entity that produces -products and services which incorporate the DLSS SDK or NGX SDK as applicable. -To the extent that you provide NVIDIA with input or usage requests with regard -to the use of your logo or materials, NVIDIA will use commercially reasonable -efforts to comply with such requests. For the avoidance of doubt, NVIDIA's -rights pursuant to this section shall survive any expiration or termination of -the Agreement with respect to existing applications which incorporate the DLSS -SDK or NGX SDK. - -(e) Applications Marketing Material in the DLSS SDK or NGX SDK. You may provide -NVIDIA with screenshots, imagery, and video footage of applications -representative of your use of the NVIDIA DLSS SDK or NGX SDKs in your -application (collectively, "Assets"). You hereby grant to NVIDIA the right to -create and display self-promotional demo materials using the Assets, and after -release of the application to the public to distribute, sub-license, and use -the Assets to promote and market the NVIDIA RTX SDKs. To the extent you -provide NVIDIA with input or usage requests with regard to the use of your logo -or materials, NVIDIA will use commercially reasonable efforts to comply with -such requests. For the avoidance of doubt, NVIDIA's rights pursuant to this -section shall survive any termination of the Agreement with respect to -applications which incorporate the NVIDIA RTX SDK. - -6.2 Trademark Ownership and Licenses. Trademarks are owned and licenses as -follows: - -(a) Ownership of Trademarks. Each party owns the trademarks, logos, and trade -names (collectively "Marks") for their respective products or services, -including without limitation in applications, and the NVIDIA RTX SDKs. Each -party agrees to use the Marks of the other only as permitted in this exhibit. - -(b) Trademark License to NVIDIA. You grant to NVIDIA a non-exclusive, non-sub -licensable, non-transferable (except as set forth in the assignment provision -of the Agreement), worldwide license to refer to you and your applications, and -to use your Marks on NVIDIA's marketing materials and on NVIDIA's website -(subject to any reasonable conditions of you) solely for NVIDIA's marketing -activities set forth in this exhibit Sections (d)-(e) above. NVIDIA will -follow your specifications for your Marks as to style, color, and typeface as -reasonably provided to NVIDIA. - -(c) Trademark License to You. NVIDIA grants to you a non-exclusive, non-sub -licensable, non-transferable (except as set forth in the assignment provision -of the Agreement), worldwide license, subject to the terms of this exhibit and -the Agreement, to use NVIDIA RTX™, NVIDIA GeForce RTX™ in combination with -GeForce products, and/or NVIDIA Quadro RTX™ in combination with Quadro -products (collectively, the "NVIDIA Marks") on your marketing materials and on -your website (subject to any reasonable conditions of NVIDIA) solely for your -marketing activities set forth in this exhibit Sections 6.1 (a)-(c) above. For -the avoidance of doubt, you will not and will not permit others to use any -NVIDIA Mark for any other goods or services, or in a way that tarnishes, -degrades, disparages or reflects adversely any of the NVIDIA Marks or NVIDIA's -business or reputation, or that dilutes or otherwise harms the value, -reputation or distinctiveness of or NVIDIA's goodwill in any NVIDIA Mark. In -addition to the termination rights set forth in the Agreement, NVIDIA may -terminate this trademark license at any time upon written notice to you. You -will follow NVIDIA's use guidelines and specifications for NVIDIA's Marks as to -style, color and typeface as provided in NVIDIA Marks and submit a sample of -each proposed use of NVIDIA's Marks at least ten (10) business days prior to -the desired implementation of such use to obtain NVIDIA's prior written -approval (which approval will not be unreasonably withheld or delayed. Use of -NVIDIA marks is not authorized until NVIDIA provides written approval. All -goodwill associated with use of NVIDIA Marks will inure to the sole benefit of -NVIDIA. - -6.3 Use Guidelines. Use of the NVIDIA Marks is subject to the following -guidelines: - -(a) Business Practices. You covenant that you will: (a) conduct business with -respect to NVIDIA's products in a manner that reflects favorably at all times -on the good name, goodwill and reputation of such products; (b) avoid -deceptive, misleading or unethical practices that are detrimental to NVIDIA, -its customers, or end users; (c) make no false or misleading representations -with regard to NVIDIA or its products; and (d) not publish or employ or -cooperate in the publication or employment of any misleading or deceptive -advertising or promotional materials. - -(b) No Combination Marks or Similar Marks. You agree not to (a) combine NVIDIA -Marks with any other content without NVIDIA's prior written approval, or (b) -use any other trademark, trade name, or other designation of source which -creates a likelihood of confusion with NVIDIA Marks. - -(v. April 12, 2021) diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d.lib b/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d.lib deleted file mode 100644 index e5a24462..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d.lib and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_dbg.lib b/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_dbg.lib deleted file mode 100644 index a69196a7..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_dbg.lib and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_dbg_iterator0.lib b/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_dbg_iterator0.lib deleted file mode 100644 index f12b45ec..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_dbg_iterator0.lib and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_dbg_iterator1.lib b/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_dbg_iterator1.lib deleted file mode 100644 index 9fba7434..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_dbg_iterator1.lib and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_iterator1.lib b/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_iterator1.lib deleted file mode 100644 index 0e9dc988..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_d_iterator1.lib and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s.lib b/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s.lib deleted file mode 100644 index 2586bb30..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s.lib and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_dbg.lib b/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_dbg.lib deleted file mode 100644 index 8b26178c..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_dbg.lib and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_dbg_iterator0.lib b/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_dbg_iterator0.lib deleted file mode 100644 index 8f3a7325..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_dbg_iterator0.lib and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_dbg_iterator1.lib b/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_dbg_iterator1.lib deleted file mode 100644 index d8edbb9a..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_dbg_iterator1.lib and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_iterator1.lib b/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_iterator1.lib deleted file mode 100644 index 3923fb9d..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Lib/x64/nvsdk_ngx_s_iterator1.lib and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/NGX.Build.cs b/plugins/DLSS/Source/ThirdParty/NGX/NGX.Build.cs deleted file mode 100644 index 87794b7a..00000000 --- a/plugins/DLSS/Source/ThirdParty/NGX/NGX.Build.cs +++ /dev/null @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2020 - 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -* -* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual -* property and proprietary rights in and to this material, related -* documentation and any modifications thereto. Any use, reproduction, -* disclosure or distribution of this material and related documentation -* without an express license agreement from NVIDIA CORPORATION or -* its affiliates is strictly prohibited. -*/ - -using EpicGames.Core; -using UnrealBuildTool; -using System.IO; - -public class NGX : ModuleRules -{ - - protected virtual bool IsSupportedWindowsPlatform(ReadOnlyTargetRules Target) - { - return Target.Platform == UnrealTargetPlatform.Win64; - } - - public NGX (ReadOnlyTargetRules Target) : base(Target) - { - Type = ModuleType.External; - - if (IsSupportedWindowsPlatform(Target)) - { - string NGXPath = ModuleDirectory + "/"; - - PublicSystemIncludePaths.Add(NGXPath + "Include/"); - - PublicIncludePaths.Add(NGXPath + "Include/"); - - if ((Target.Configuration == UnrealTargetConfiguration.Debug) && Target.bDebugBuildsActuallyUseDebugCRT) - { - if (Target.bUseStaticCRT) - { - PublicAdditionalLibraries.Add(NGXPath + "Lib/x64/" + "nvsdk_ngx_s_dbg.lib"); - } - else - { - PublicAdditionalLibraries.Add(NGXPath + "Lib/x64/" + "nvsdk_ngx_d_dbg.lib"); - } - } - else - { - if (Target.bUseStaticCRT) - { - PublicAdditionalLibraries.Add(NGXPath + "Lib/x64/" + "nvsdk_ngx_s.lib"); - } - else - { - PublicAdditionalLibraries.Add(NGXPath + "Lib/x64/" + "nvsdk_ngx_d.lib"); - } - } - - string[] NGXSnippetDLLs = - { - "nvngx_dlss.dll", - }; - - PublicDefinitions.Add("NGX_DLSS_BINARY_NAME=TEXT(\"" + NGXSnippetDLLs[0] + "\")"); - // work around missing definition in NGX headers - PublicDefinitions.Add("NV_WINDOWS=1"); - - foreach (string NGXSnippetDLL in NGXSnippetDLLs) - { - bool bHasProjectBinary = false; - if (Target.ProjectFile != null) - { - string ProjectDLLPath = DirectoryReference.Combine(Target.ProjectFile.Directory, "Binaries/ThirdParty/NVIDIA/NGX/Win64", NGXSnippetDLL).FullName; - if (File.Exists(ProjectDLLPath)) - { - bHasProjectBinary = true; - //Log.TraceInformation("NGX project specific production DLSS binary found at {0}.", ProjectDLLPath); - RuntimeDependencies.Add(ProjectDLLPath, StagedFileType.NonUFS); - } - } - - // useful to have both plugin and project specific binary during testing, but if we have a project specific binary, then we want to ship with only that - if (!bHasProjectBinary || Target.Configuration != UnrealTargetConfiguration.Shipping) - { - RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/Win64/" + NGXSnippetDLL, StagedFileType.NonUFS); - } - - // useful to have debug overlay during testing, but we don't want to ship with that - if (Target.Configuration != UnrealTargetConfiguration.Shipping) - { - RuntimeDependencies.Add("$(PluginDir)/Binaries/ThirdParty/Win64/Development/" + NGXSnippetDLL, StagedFileType.DebugNonUFS); - } - } - } - } -} - diff --git a/plugins/DLSS/Source/ThirdParty/NGX/NGX.tps b/plugins/DLSS/Source/ThirdParty/NGX/NGX.tps deleted file mode 100644 index 64aea65a..00000000 --- a/plugins/DLSS/Source/ThirdParty/NGX/NGX.tps +++ /dev/null @@ -1,7 +0,0 @@ - - - NGX - /Engine/Source/ThirdParty/NVIDIA/NGX - NGX - SDK for DLSS and other NVIDIA DeepLearning technologies - \ No newline at end of file diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Utils/DLSS_Debug_Jitter_Configs.txt b/plugins/DLSS/Source/ThirdParty/NGX/Utils/DLSS_Debug_Jitter_Configs.txt deleted file mode 100644 index 587f39c5..00000000 --- a/plugins/DLSS/Source/ThirdParty/NGX/Utils/DLSS_Debug_Jitter_Configs.txt +++ /dev/null @@ -1,87 +0,0 @@ -Jitter Offset Configurations - -To assist in debugging issues with sub-pixel jitter, the DLSS SDK library can optionally adjust the jitter offset components using the CTRL+ALT+F9 hotkey. The configurations are listed below and pressing the hotkey cycles through them in order. - -To exchange (ie swap) the X and Y offsets, use the CTRL+ALT+F10 hotkey. - - -// By default, jitter offsets are used as sent from the engine -Config 0: OFF - - -// Combinations halving and negating both vector components -Config 1: - JitterOffsetX *= 0.5f; - JitterOffsetY *= 0.5f; - -Config 2: - JitterOffsetX *= 0.5f; - JitterOffsetY *= -0.5f; - -Config 3: - JitterOffsetX *= -0.5f; - JitterOffsetY *= 0.5f; - -Config 4: - JitterOffsetX *= -0.5f; - JitterOffsetY *= -0.5f; - - -// Combinations doubling and negating both vector components -Config 5: - JitterOffsetX *= 2.0f; - JitterOffsetY *= 2.0f; - -Config 6: - JitterOffsetX *= 2.0f; - JitterOffsetY *= -2.0f; - -Config 7: - JitterOffsetX *= -2.0f; - JitterOffsetY *= 2.0f; - -Config 8: - JitterOffsetX *= -2.0f; - JitterOffsetY *= -2.0f; - - -// Combinations negating one or both vector components -Config 9: - JitterOffsetX *= 1.0f; - JitterOffsetY *= -1.0f; - -Config 10: - JitterOffsetX *= -1.0f; - JitterOffsetY *= 1.0f; - -Config 11: - JitterOffsetX *= -1.0f; - JitterOffsetY *= -1.0f; - - -// Combinations halving and negating individual vector components -Config 12: - JitterOffsetX *= 0.5f; - -Config 13: - JitterOffsetY *= 0.5f; - -Config 14: - JitterOffsetX *= -0.5f; - -Config 15: - JitterOffsetY *= -0.5f; - - -// Combinations doubling and negating individual vector components -Config 16: - JitterOffsetX *= 2.0f; - -Config 17: - JitterOffsetY *= 2.0f; - -Config 18: - JitterOffsetX *= -2.0f; - -Config 19: - JitterOffsetY *= -2.0f; diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_driver_onscreenindicator.reg b/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_driver_onscreenindicator.reg deleted file mode 100644 index 8d5d0b1a..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_driver_onscreenindicator.reg and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_driver_onscreenindicator_off.reg b/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_driver_onscreenindicator_off.reg deleted file mode 100644 index 1a8c1262..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_driver_onscreenindicator_off.reg and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_off.reg b/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_off.reg deleted file mode 100644 index 21ab19ff..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_off.reg and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_on.reg b/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_on.reg deleted file mode 100644 index b99fb96f..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_on.reg and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_verbose.reg b/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_verbose.reg deleted file mode 100644 index 2d779298..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_verbose.reg and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_window_off.reg b/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_window_off.reg deleted file mode 100644 index 6e9666e6..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_window_off.reg and /dev/null differ diff --git a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_window_on.reg b/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_window_on.reg deleted file mode 100644 index 85f352ed..00000000 Binary files a/plugins/DLSS/Source/ThirdParty/NGX/Utils/ngx_log_window_on.reg and /dev/null differ diff --git a/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.dll b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.dll index a82c8c4a..02d67ad0 100644 Binary files a/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.dll and b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.dll differ diff --git a/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.exe b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.exe new file mode 100644 index 00000000..3eab494b Binary files /dev/null and b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.exe differ diff --git a/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.exp b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.exp new file mode 100644 index 00000000..2d6b682c Binary files /dev/null and b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.exp differ diff --git a/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.lib b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.lib new file mode 100644 index 00000000..a0321e91 Binary files /dev/null and b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.lib differ diff --git a/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.pdb b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.pdb new file mode 100644 index 00000000..ac5d195a Binary files /dev/null and b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0.pdb differ diff --git a/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0_PID_10476.exe b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0_PID_10476.exe new file mode 100644 index 00000000..3ff3138d Binary files /dev/null and b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.patch_0_PID_10476.exe differ diff --git a/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.pdb b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.pdb index 4c8c0415..3c7bc3c4 100644 Binary files a/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.pdb and b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor-EasyXMLParser.pdb differ diff --git a/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor.modules b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor.modules index 9485fe35..b3e72abc 100644 --- a/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor.modules +++ b/plugins/EasyXMLParser/Binaries/Win64/UnrealEditor.modules @@ -1,5 +1,5 @@ { - "BuildId": "23058290", + "BuildId": "27405482", "Modules": { "EasyXMLParser": "UnrealEditor-EasyXMLParser.dll" diff --git a/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.dll b/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.dll index a1daa651..7909831c 100644 Binary files a/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.dll and b/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.dll differ diff --git a/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.patch_0.exp b/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.patch_0.exp new file mode 100644 index 00000000..29a02176 Binary files /dev/null and b/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.patch_0.exp differ diff --git a/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.patch_0.lib b/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.patch_0.lib new file mode 100644 index 00000000..ae11741b Binary files /dev/null and b/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.patch_0.lib differ diff --git a/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.patch_0.pdb b/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.patch_0.pdb new file mode 100644 index 00000000..c23dc8c3 Binary files /dev/null and b/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.patch_0.pdb differ diff --git a/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.pdb b/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.pdb index f3f2da11..3f83ff80 100644 Binary files a/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.pdb and b/plugins/JPrinter/Binaries/Win64/UnrealEditor-JPrinter.pdb differ diff --git a/plugins/JPrinter/Binaries/Win64/UnrealEditor.modules b/plugins/JPrinter/Binaries/Win64/UnrealEditor.modules index 24fed7df..15523c9d 100644 --- a/plugins/JPrinter/Binaries/Win64/UnrealEditor.modules +++ b/plugins/JPrinter/Binaries/Win64/UnrealEditor.modules @@ -1,5 +1,5 @@ { - "BuildId": "23058290", + "BuildId": "27405482", "Modules": { "JPrinter": "UnrealEditor-JPrinter.dll" diff --git a/plugins/JPrinter/JPrinter.uplugin b/plugins/JPrinter/JPrinter.uplugin index 980a408c..a1314242 100644 --- a/plugins/JPrinter/JPrinter.uplugin +++ b/plugins/JPrinter/JPrinter.uplugin @@ -10,7 +10,6 @@ "DocsURL": "", "MarketplaceURL": "", "SupportURL": "", - "EngineVersion": "5.1.0", "CanContainContent": false, "Installed": true, "Modules": [ diff --git a/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.dll b/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.dll index de2d0a9d..a2380f57 100644 Binary files a/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.dll and b/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.dll differ diff --git a/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.patch_0.exp b/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.patch_0.exp new file mode 100644 index 00000000..1efb7be2 Binary files /dev/null and b/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.patch_0.exp differ diff --git a/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.patch_0.lib b/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.patch_0.lib new file mode 100644 index 00000000..6840c94b Binary files /dev/null and b/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.patch_0.lib differ diff --git a/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.patch_0.pdb b/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.patch_0.pdb new file mode 100644 index 00000000..13c49912 Binary files /dev/null and b/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.patch_0.pdb differ diff --git a/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.pdb b/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.pdb index 0f5c809f..c30d9106 100644 Binary files a/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.pdb and b/plugins/createProcess/Binaries/Win64/UnrealEditor-createProcess.pdb differ diff --git a/plugins/createProcess/Binaries/Win64/UnrealEditor.modules b/plugins/createProcess/Binaries/Win64/UnrealEditor.modules index 4a376be8..cae33b62 100644 --- a/plugins/createProcess/Binaries/Win64/UnrealEditor.modules +++ b/plugins/createProcess/Binaries/Win64/UnrealEditor.modules @@ -1,5 +1,5 @@ { - "BuildId": "23058290", + "BuildId": "27405482", "Modules": { "createProcess": "UnrealEditor-createProcess.dll" diff --git a/plugins/createProcess/createProcess.uplugin b/plugins/createProcess/createProcess.uplugin index 0651c540..10fd26fe 100644 --- a/plugins/createProcess/createProcess.uplugin +++ b/plugins/createProcess/createProcess.uplugin @@ -10,7 +10,6 @@ "DocsURL": "", "MarketplaceURL": "", "SupportURL": "", - "EngineVersion": "5.1.0", "CanContainContent": false, "Installed": true, "Modules": [ diff --git a/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.dll b/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.dll index 89f40811..cad171a6 100644 Binary files a/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.dll and b/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.dll differ diff --git a/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.patch_0.exp b/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.patch_0.exp new file mode 100644 index 00000000..260d7ad9 Binary files /dev/null and b/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.patch_0.exp differ diff --git a/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.patch_0.lib b/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.patch_0.lib new file mode 100644 index 00000000..b141263a Binary files /dev/null and b/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.patch_0.lib differ diff --git a/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.patch_0.pdb b/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.patch_0.pdb new file mode 100644 index 00000000..31045d8c Binary files /dev/null and b/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.patch_0.pdb differ diff --git a/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.pdb b/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.pdb index b30b4cc8..3090ed33 100644 Binary files a/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.pdb and b/plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.pdb differ diff --git a/plugins/manageTextFile/Binaries/Win64/UnrealEditor.modules b/plugins/manageTextFile/Binaries/Win64/UnrealEditor.modules index daa9cddb..71ca57e3 100644 --- a/plugins/manageTextFile/Binaries/Win64/UnrealEditor.modules +++ b/plugins/manageTextFile/Binaries/Win64/UnrealEditor.modules @@ -1,5 +1,5 @@ { - "BuildId": "23058290", + "BuildId": "27405482", "Modules": { "manageTextFile": "UnrealEditor-manageTextFile.dll"