mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-04-24 10:38:53 +00:00
Merge branch 'nvrhi-update-20240225'
This commit is contained in:
commit
a973c40b19
14 changed files with 275 additions and 215 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -40,6 +40,7 @@ base/wads/
|
|||
base/renderprogs2/
|
||||
base/generated/
|
||||
base/env/
|
||||
base/screenshots/
|
||||
|
||||
GPATH
|
||||
GRTAGS
|
||||
|
@ -50,3 +51,4 @@ neo/.kdev4
|
|||
neo/neo.kdev4
|
||||
neo/.idea/
|
||||
neo/cmake-build-*/
|
||||
neo/bin/
|
||||
|
|
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -1,3 +1,6 @@
|
|||
[submodule "neo/extern/nvrhi"]
|
||||
path = neo/extern/nvrhi
|
||||
url = https://github.com/RobertBeckebans/nvrhi.git
|
||||
[submodule "neo/extern/ShaderMake"]
|
||||
path = neo/extern/ShaderMake
|
||||
url = https://github.com/RobertBeckebans/ShaderMake.git
|
||||
|
|
|
@ -443,6 +443,9 @@ set(NVRHI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/nvrhi)
|
|||
add_subdirectory(${NVRHI_DIR})
|
||||
add_definitions(-DUSE_NVRHI)
|
||||
|
||||
set(SHADERMAKE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/ShaderMake)
|
||||
add_subdirectory(${SHADERMAKE_DIR})
|
||||
|
||||
if(USE_DX11)
|
||||
find_package(FXC REQUIRED)
|
||||
endif()
|
||||
|
@ -457,6 +460,7 @@ if(USE_VULKAN)
|
|||
endif()
|
||||
|
||||
include_directories(${NVRHI_DIR}/include)
|
||||
include_directories(${SHADERMAKE_DIR}/include)
|
||||
|
||||
include_directories("libs/optick")
|
||||
|
||||
|
@ -1522,9 +1526,10 @@ if(MSVC)
|
|||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/DXT/DXTEncoder.cpp)
|
||||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/DXT/DXTEncoder_SSE2.cpp)
|
||||
|
||||
if(USE_VULKAN)
|
||||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/sys/DeviceManager_VK.cpp)
|
||||
endif()
|
||||
# SRS - Exclusion no longer needed with updated nvrhi CMakeLists.txt that makes Vulkan-Headers private
|
||||
#if(USE_VULKAN)
|
||||
# list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/sys/DeviceManager_VK.cpp)
|
||||
#endif()
|
||||
|
||||
#foreach( src_file ${RBDOOM3_PRECOMPILED_SOURCES} )
|
||||
# message(STATUS "-include precompiled.h for ${src_file}")
|
||||
|
@ -1669,9 +1674,10 @@ else()
|
|||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/DXT/DXTEncoder.cpp)
|
||||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/DXT/DXTEncoder_SSE2.cpp)
|
||||
|
||||
if(USE_VULKAN)
|
||||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/sys/DeviceManager_VK.cpp)
|
||||
endif()
|
||||
# SRS - Exclusion no longer needed with updated nvrhi CMakeLists.txt that makes Vulkan-Headers private
|
||||
#if(USE_VULKAN)
|
||||
# list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/sys/DeviceManager_VK.cpp)
|
||||
#endif()
|
||||
|
||||
foreach( src_file ${RBDOOM3_PRECOMPILED_SOURCES} )
|
||||
#message(STATUS "-include precompiled.h for ${src_file}")
|
||||
|
@ -1831,7 +1837,9 @@ endif()
|
|||
|
||||
# needs to come after nvrhi_d3d11 etc. for link order
|
||||
target_link_libraries(RBDoom3BFG nvrhi)
|
||||
target_link_libraries(RBDoom3BFG ShaderMakeBlob)
|
||||
|
||||
add_subdirectory(shaders)
|
||||
add_dependencies(Shaders ShaderMake)
|
||||
add_dependencies(RBDoom3BFG Shaders)
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ function(compile_shaders)
|
|||
set_source_files_properties(${params_SOURCES} PROPERTIES VS_TOOL_OVERRIDE "None")
|
||||
|
||||
add_custom_target(${params_TARGET}
|
||||
DEPENDS shaderCompiler
|
||||
DEPENDS ShaderMake
|
||||
SOURCES ${params_SOURCES})
|
||||
|
||||
if (params_DXIL AND (USE_DX12 AND USE_DXIL_ON_DX12))
|
||||
|
@ -62,20 +62,21 @@ function(compile_shaders)
|
|||
endif()
|
||||
|
||||
if (NOT params_CFLAGS)
|
||||
set(CFLAGS "$<IF:$<CONFIG:Debug>,-Zi -Qembed_debug,-Qstrip_debug -Qstrip_reflect> -O3 -WX -Zpr")
|
||||
set(CFLAGS $<IF:$<CONFIG:Debug>,--embedPDB,--stripReflection> --shaderModel=6_0 -O3 --WX --matrixRowMajor)
|
||||
else()
|
||||
set(CFLAGS ${params_CFLAGS})
|
||||
endif()
|
||||
|
||||
add_custom_command(TARGET ${params_TARGET} PRE_BUILD
|
||||
COMMAND shaderCompiler
|
||||
--infile ${params_CONFIG}
|
||||
--parallel
|
||||
--out ${params_DXIL}
|
||||
--platform dxil
|
||||
--cflags "${CFLAGS}"
|
||||
COMMAND ShaderMake
|
||||
--config=${params_CONFIG}
|
||||
--out=${params_DXIL}
|
||||
--platform=DXIL
|
||||
--binaryBlob
|
||||
--outputExt=.bin
|
||||
-I ${SHADER_INCLUDE_DIR}
|
||||
--compiler ${DXC_DXIL_EXECUTABLE})
|
||||
${CFLAGS}
|
||||
--compiler=${DXC_DXIL_EXECUTABLE})
|
||||
endif()
|
||||
|
||||
if (params_DXBC AND (USE_DX11 OR (USE_DX12 AND NOT USE_DXIL_ON_DX12)))
|
||||
|
@ -84,20 +85,21 @@ function(compile_shaders)
|
|||
endif()
|
||||
|
||||
if (NOT params_CFLAGS)
|
||||
set(CFLAGS "$<IF:$<CONFIG:Debug>,-Zi,-Qstrip_priv -Qstrip_debug -Qstrip_reflect> -O3 -WX -Zpr")
|
||||
set(CFLAGS $<IF:$<CONFIG:Debug>,--PDB,--stripReflection> --shaderModel=6_0 -O3 --WX --matrixRowMajor)
|
||||
else()
|
||||
set(CFLAGS ${params_CFLAGS})
|
||||
endif()
|
||||
|
||||
add_custom_command(TARGET ${params_TARGET} PRE_BUILD
|
||||
COMMAND shaderCompiler
|
||||
--infile ${params_CONFIG}
|
||||
--parallel
|
||||
--out ${params_DXBC}
|
||||
--platform dxbc
|
||||
--cflags "${CFLAGS}"
|
||||
COMMAND ShaderMake
|
||||
--config=${params_CONFIG}
|
||||
--out=${params_DXBC}
|
||||
--platform=DXBC
|
||||
--binaryBlob
|
||||
--outputExt=.bin
|
||||
-I ${SHADER_INCLUDE_DIR}
|
||||
--compiler ${FXC_EXECUTABLE})
|
||||
${CFLAGS}
|
||||
--compiler=${FXC_EXECUTABLE})
|
||||
endif()
|
||||
|
||||
if (params_SPIRV_DXC AND USE_VULKAN)
|
||||
|
@ -106,28 +108,22 @@ function(compile_shaders)
|
|||
endif()
|
||||
|
||||
if (NOT params_CFLAGS)
|
||||
set(CFLAGS "$<IF:$<CONFIG:Debug>,-Zi,> -fspv-target-env=vulkan1.2 -O3 -WX -Zpr")
|
||||
set(CFLAGS $<IF:$<CONFIG:Debug>,--PDB,> --vulkanVersion=1.2 --shaderModel=6_0 -O3 --WX --matrixRowMajor --tRegShift=0 --sRegShift=128 --bRegShift=256 --uRegShift=384)
|
||||
else()
|
||||
set(CFLAGS ${params_CFLAGS})
|
||||
endif()
|
||||
|
||||
# SRS - Parallel shader compilation sometimes fails, disable for now until issue is resolved
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(PARALLEL_SHADERS "")
|
||||
else()
|
||||
set(PARALLEL_SHADERS "--parallel")
|
||||
endif()
|
||||
|
||||
add_custom_command(TARGET ${params_TARGET} PRE_BUILD
|
||||
COMMAND shaderCompiler
|
||||
--infile ${params_CONFIG}
|
||||
${PARALLEL_SHADERS}
|
||||
--out ${params_SPIRV_DXC}
|
||||
--platform spirv
|
||||
COMMAND ShaderMake
|
||||
--config=${params_CONFIG}
|
||||
--out=${params_SPIRV_DXC}
|
||||
--platform=SPIRV
|
||||
--binaryBlob
|
||||
--outputExt=.bin
|
||||
-I ${SHADER_INCLUDE_DIR}
|
||||
-D SPIRV
|
||||
--cflags "${CFLAGS}"
|
||||
--compiler ${DXC_SPIRV_EXECUTABLE})
|
||||
${CFLAGS}
|
||||
--compiler=${DXC_SPIRV_EXECUTABLE})
|
||||
endif()
|
||||
|
||||
if(params_FOLDER)
|
||||
|
|
1
neo/extern/ShaderMake
vendored
Submodule
1
neo/extern/ShaderMake
vendored
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 13867771f6142f35690a5e2103c1e1efdd90cb0e
|
2
neo/extern/nvrhi
vendored
2
neo/extern/nvrhi
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 1cbc9e9d16f997948c429739b1a1886fb4d0c796
|
||||
Subproject commit f203c60b4d0c93903dbcced9306211814d79a214
|
|
@ -73,59 +73,59 @@ pickBufferUsage - copied from nvrhi vulkan-buffer.cpp
|
|||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
vk::BufferUsageFlags pickBufferUsage( const nvrhi::BufferDesc& desc )
|
||||
VkBufferUsageFlags pickBufferUsage( const nvrhi::BufferDesc& desc )
|
||||
{
|
||||
vk::BufferUsageFlags usageFlags = vk::BufferUsageFlagBits::eTransferSrc |
|
||||
vk::BufferUsageFlagBits::eTransferDst;
|
||||
VkBufferUsageFlags usageFlags = VkBufferUsageFlagBits::VK_BUFFER_USAGE_TRANSFER_SRC_BIT |
|
||||
VkBufferUsageFlagBits::VK_BUFFER_USAGE_TRANSFER_DST_BIT;
|
||||
|
||||
if( desc.isVertexBuffer )
|
||||
{
|
||||
usageFlags |= vk::BufferUsageFlagBits::eVertexBuffer;
|
||||
usageFlags |= VkBufferUsageFlagBits::VK_BUFFER_USAGE_VERTEX_BUFFER_BIT;
|
||||
}
|
||||
|
||||
if( desc.isIndexBuffer )
|
||||
{
|
||||
usageFlags |= vk::BufferUsageFlagBits::eIndexBuffer;
|
||||
usageFlags |= VkBufferUsageFlagBits::VK_BUFFER_USAGE_INDEX_BUFFER_BIT;
|
||||
}
|
||||
|
||||
if( desc.isDrawIndirectArgs )
|
||||
{
|
||||
usageFlags |= vk::BufferUsageFlagBits::eIndirectBuffer;
|
||||
usageFlags |= VkBufferUsageFlagBits::VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT;
|
||||
}
|
||||
|
||||
if( desc.isConstantBuffer )
|
||||
{
|
||||
usageFlags |= vk::BufferUsageFlagBits::eUniformBuffer;
|
||||
usageFlags |= VkBufferUsageFlagBits::VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
|
||||
}
|
||||
|
||||
if( desc.structStride != 0 || desc.canHaveUAVs || desc.canHaveRawViews )
|
||||
{
|
||||
usageFlags |= vk::BufferUsageFlagBits::eStorageBuffer;
|
||||
usageFlags |= VkBufferUsageFlagBits::VK_BUFFER_USAGE_STORAGE_BUFFER_BIT;
|
||||
}
|
||||
|
||||
if( desc.canHaveTypedViews )
|
||||
{
|
||||
usageFlags |= vk::BufferUsageFlagBits::eUniformTexelBuffer;
|
||||
usageFlags |= VkBufferUsageFlagBits::VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT;
|
||||
}
|
||||
|
||||
if( desc.canHaveTypedViews && desc.canHaveUAVs )
|
||||
{
|
||||
usageFlags |= vk::BufferUsageFlagBits::eStorageTexelBuffer;
|
||||
usageFlags |= VkBufferUsageFlagBits::VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT;
|
||||
}
|
||||
|
||||
if( desc.isAccelStructBuildInput )
|
||||
{
|
||||
usageFlags |= vk::BufferUsageFlagBits::eAccelerationStructureBuildInputReadOnlyKHR;
|
||||
usageFlags |= VkBufferUsageFlagBits::VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR;
|
||||
}
|
||||
|
||||
if( desc.isAccelStructStorage )
|
||||
{
|
||||
usageFlags |= vk::BufferUsageFlagBits::eAccelerationStructureStorageKHR;
|
||||
usageFlags |= VkBufferUsageFlagBits::VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR;
|
||||
}
|
||||
|
||||
if( deviceManager->IsVulkanDeviceExtensionEnabled( VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME ) )
|
||||
{
|
||||
usageFlags |= vk::BufferUsageFlagBits::eShaderDeviceAddress;
|
||||
usageFlags |= VkBufferUsageFlagBits::VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT;
|
||||
}
|
||||
|
||||
return usageFlags;
|
||||
|
@ -214,7 +214,7 @@ bool idVertexBuffer::AllocBufferObject( const void* data, int allocSize, bufferU
|
|||
{
|
||||
VkBufferCreateInfo bufferCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
|
||||
bufferCreateInfo.size = numBytes;
|
||||
bufferCreateInfo.usage = static_cast< VkBufferUsageFlags >( pickBufferUsage( vertexBufferDesc ) );
|
||||
bufferCreateInfo.usage = pickBufferUsage( vertexBufferDesc );
|
||||
bufferCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
|
||||
|
||||
VmaAllocationCreateInfo allocCreateInfo = {};
|
||||
|
@ -482,7 +482,7 @@ bool idIndexBuffer::AllocBufferObject( const void* data, int allocSize, bufferUs
|
|||
{
|
||||
VkBufferCreateInfo bufferCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
|
||||
bufferCreateInfo.size = numBytes;
|
||||
bufferCreateInfo.usage = static_cast< VkBufferUsageFlags >( pickBufferUsage( indexBufferDesc ) );
|
||||
bufferCreateInfo.usage = pickBufferUsage( indexBufferDesc );
|
||||
bufferCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
|
||||
|
||||
VmaAllocationCreateInfo allocCreateInfo = {};
|
||||
|
@ -753,7 +753,7 @@ bool idUniformBuffer::AllocBufferObject( const void* data, int allocSize, buffer
|
|||
{
|
||||
VkBufferCreateInfo bufferCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
|
||||
bufferCreateInfo.size = numBytes;
|
||||
bufferCreateInfo.usage = static_cast< VkBufferUsageFlags >( pickBufferUsage( bufferDesc ) );
|
||||
bufferCreateInfo.usage = pickBufferUsage( bufferDesc );
|
||||
bufferCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
|
||||
|
||||
VmaAllocationCreateInfo allocCreateInfo = {};
|
||||
|
|
|
@ -71,34 +71,34 @@ pickImageUsage - copied from nvrhi vulkan-texture.cpp
|
|||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
vk::ImageUsageFlags pickImageUsage( const nvrhi::TextureDesc& desc )
|
||||
VkImageUsageFlags pickImageUsage( const nvrhi::TextureDesc& desc )
|
||||
{
|
||||
const nvrhi::FormatInfo& formatInfo = nvrhi::getFormatInfo( desc.format );
|
||||
|
||||
vk::ImageUsageFlags usageFlags = vk::ImageUsageFlagBits::eTransferSrc |
|
||||
vk::ImageUsageFlagBits::eTransferDst |
|
||||
vk::ImageUsageFlagBits::eSampled;
|
||||
VkImageUsageFlags usageFlags = VkImageUsageFlagBits::VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
|
||||
VkImageUsageFlagBits::VK_IMAGE_USAGE_TRANSFER_DST_BIT |
|
||||
VkImageUsageFlagBits::VK_IMAGE_USAGE_SAMPLED_BIT;
|
||||
|
||||
if( desc.isRenderTarget )
|
||||
{
|
||||
if( formatInfo.hasDepth || formatInfo.hasStencil )
|
||||
{
|
||||
usageFlags |= vk::ImageUsageFlagBits::eDepthStencilAttachment;
|
||||
usageFlags |= VkImageUsageFlagBits::VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
usageFlags |= vk::ImageUsageFlagBits::eColorAttachment;
|
||||
usageFlags |= VkImageUsageFlagBits::VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
}
|
||||
}
|
||||
|
||||
if( desc.isUAV )
|
||||
{
|
||||
usageFlags |= vk::ImageUsageFlagBits::eStorage;
|
||||
usageFlags |= VkImageUsageFlagBits::VK_IMAGE_USAGE_STORAGE_BIT;
|
||||
}
|
||||
|
||||
if( desc.isShadingRateSurface )
|
||||
{
|
||||
usageFlags |= vk::ImageUsageFlagBits::eFragmentShadingRateAttachmentKHR;
|
||||
usageFlags |= VkImageUsageFlagBits::VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR;
|
||||
}
|
||||
|
||||
return usageFlags;
|
||||
|
@ -598,7 +598,7 @@ void idImage::AllocImage()
|
|||
imageCreateInfo.arrayLayers = textureDesc.arraySize;
|
||||
imageCreateInfo.samples = static_cast< VkSampleCountFlagBits >( opts.samples );
|
||||
imageCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
|
||||
imageCreateInfo.usage = static_cast< VkImageUsageFlags >( pickImageUsage( textureDesc ) );
|
||||
imageCreateInfo.usage = pickImageUsage( textureDesc );
|
||||
imageCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
|
||||
imageCreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#pragma hdrstop
|
||||
|
||||
#include "../RenderCommon.h"
|
||||
#include "nvrhi/common/shader-blob.h"
|
||||
#include <ShaderMake/ShaderBlob.h>
|
||||
#include <sys/DeviceManager.h>
|
||||
|
||||
|
||||
|
@ -88,6 +88,52 @@ void idRenderProgManager::LoadShader( int index, rpStage_t stage )
|
|||
|
||||
extern DeviceManager* deviceManager;
|
||||
|
||||
/*
|
||||
================================================================================================
|
||||
createShaderPermutation
|
||||
|
||||
* Copyright (c) 2014-2021, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
================================================================================================
|
||||
*/
|
||||
nvrhi::ShaderHandle createShaderPermutation( nvrhi::IDevice* device, const nvrhi::ShaderDesc& d, const void* blob, size_t blobSize,
|
||||
const ShaderMake::ShaderConstant* constants, uint32_t numConstants, bool errorIfNotFound = true )
|
||||
{
|
||||
const void* binary = nullptr;
|
||||
size_t binarySize = 0;
|
||||
|
||||
if( ShaderMake::FindPermutationInBlob( blob, blobSize, constants, numConstants, &binary, &binarySize ) )
|
||||
{
|
||||
return device->createShader( d, binary, binarySize );
|
||||
}
|
||||
|
||||
if( errorIfNotFound )
|
||||
{
|
||||
std::string message = ShaderMake::FormatShaderNotFoundMessage( blob, blobSize, constants, numConstants );
|
||||
device->getMessageCallback()->message( nvrhi::MessageSeverity::Error, message.c_str() );
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*
|
||||
================================================================================================
|
||||
idRenderProgManager::LoadGLSLShader
|
||||
|
@ -136,11 +182,11 @@ void idRenderProgManager::LoadShader( shader_t& shader )
|
|||
return;
|
||||
}
|
||||
|
||||
idList<nvrhi::ShaderConstant> constants;
|
||||
idList<ShaderMake::ShaderConstant> constants;
|
||||
|
||||
for( int i = 0; i < shader.macros.Num(); i++ )
|
||||
{
|
||||
constants.Append( nvrhi::ShaderConstant
|
||||
constants.Append( ShaderMake::ShaderConstant
|
||||
{
|
||||
shader.macros[i].name.c_str(),
|
||||
shader.macros[i].definition.c_str()
|
||||
|
@ -154,9 +200,9 @@ void idRenderProgManager::LoadShader( shader_t& shader )
|
|||
// TODO(Stephen): Might not want to hard-code this.
|
||||
descCopy.entryName = "main";
|
||||
|
||||
nvrhi::ShaderConstant* shaderConstant( nullptr );
|
||||
ShaderMake::ShaderConstant* shaderConstant( nullptr );
|
||||
|
||||
nvrhi::ShaderHandle shaderHandle = nvrhi::createShaderPermutation( device, descCopy, shaderBlob.data, shaderBlob.size,
|
||||
nvrhi::ShaderHandle shaderHandle = createShaderPermutation( device, descCopy, shaderBlob.data, shaderBlob.size,
|
||||
( constants.Num() > 0 ) ? &constants[0] : shaderConstant, uint32_t( constants.Num() ) );
|
||||
|
||||
shader.handle = shaderHandle;
|
||||
|
|
|
@ -69,6 +69,7 @@ static nvrhi::TextureHandle createNullTexture( nvrhi::DeviceHandle device )
|
|||
desc.useClearValue = false;
|
||||
desc.sampleCount = 1;
|
||||
desc.dimension = nvrhi::TextureDimension::Texture2D;
|
||||
desc.initialState = nvrhi::ResourceStates::UnorderedAccess;
|
||||
desc.keepInitialState = true;
|
||||
desc.arraySize = 1;
|
||||
desc.isUAV = true;
|
||||
|
|
|
@ -1,144 +1,144 @@
|
|||
|
||||
## Note: A lot of the defines for a vertex shader are there just to
|
||||
## satisfy the requirement in the engine. In the future, we can
|
||||
## remove these if we load the shaders as separate units instead of as
|
||||
## packaged programs.
|
||||
// Note: A lot of the defines for a vertex shader are there just to
|
||||
// satisfy the requirement in the engine. In the future, we can
|
||||
// remove these if we load the shaders as separate units instead of as
|
||||
// packaged programs.
|
||||
|
||||
builtin/debug/lightgrid.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/debug/lightgrid.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/debug/octahedron.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/debug/octahedron.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/debug/debug_shadowmap.vs.hlsl -T vs_5_0
|
||||
builtin/debug/debug_shadowmap.ps.hlsl -T ps_5_0
|
||||
builtin/debug/lightgrid.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
builtin/debug/lightgrid.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
builtin/debug/octahedron.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
builtin/debug/octahedron.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
builtin/debug/debug_shadowmap.vs.hlsl -T vs
|
||||
builtin/debug/debug_shadowmap.ps.hlsl -T ps
|
||||
|
||||
builtin/gui.vs.hlsl -T vs_5_0
|
||||
builtin/gui.ps.hlsl -T ps_5_0
|
||||
builtin/color.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/color.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/vertex_color.vs.hlsl -T vs_5_0
|
||||
builtin/vertex_color.ps.hlsl -T ps_5_0
|
||||
builtin/texture_color.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1} -D USE_SRGB={0,1}
|
||||
builtin/texture_color.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1} -D USE_SRGB={0,1}
|
||||
builtin/texture_color_texgen.vs.hlsl -T vs_5_0
|
||||
builtin/texture_color_texgen.ps.hlsl -T ps_5_0
|
||||
builtin/texture.vs.hlsl -T vs_5_0
|
||||
builtin/texture.ps.hlsl -T ps_5_0
|
||||
builtin/gbuffer.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1} -D USE_NORMAL_FMT_RGB8={0,1}
|
||||
builtin/gbuffer.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1} -D USE_NORMAL_FMT_RGB8={0,1}
|
||||
builtin/depth.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/depth.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/blit.ps.hlsl -T ps_5_0 -D TEXTURE_ARRAY={0,1}
|
||||
builtin/rect.vs.hlsl -T vs_5_0
|
||||
builtin/gui.vs.hlsl -T vs
|
||||
builtin/gui.ps.hlsl -T ps
|
||||
builtin/color.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
builtin/color.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
builtin/vertex_color.vs.hlsl -T vs
|
||||
builtin/vertex_color.ps.hlsl -T ps
|
||||
builtin/texture_color.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1} -D USE_SRGB={0,1}
|
||||
builtin/texture_color.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1} -D USE_SRGB={0,1}
|
||||
builtin/texture_color_texgen.vs.hlsl -T vs
|
||||
builtin/texture_color_texgen.ps.hlsl -T ps
|
||||
builtin/texture.vs.hlsl -T vs
|
||||
builtin/texture.ps.hlsl -T ps
|
||||
builtin/gbuffer.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1} -D USE_NORMAL_FMT_RGB8={0,1}
|
||||
builtin/gbuffer.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1} -D USE_NORMAL_FMT_RGB8={0,1}
|
||||
builtin/depth.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
builtin/depth.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
builtin/blit.ps.hlsl -T ps -D TEXTURE_ARRAY={0,1}
|
||||
builtin/rect.vs.hlsl -T vs
|
||||
|
||||
builtin/legacy/environment.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/legacy/environment.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/legacy/bumpyenvironment.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/legacy/bumpyenvironment.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/legacy/skybox.vs.hlsl -T vs_5_0
|
||||
builtin/legacy/skybox.ps.hlsl -T ps_5_0
|
||||
builtin/legacy/wobblesky.vs.hlsl -T vs_5_0
|
||||
builtin/legacy/wobblesky.ps.hlsl -T ps_5_0
|
||||
builtin/legacy/environment.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
builtin/legacy/environment.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
builtin/legacy/bumpyenvironment.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
builtin/legacy/bumpyenvironment.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
builtin/legacy/skybox.vs.hlsl -T vs
|
||||
builtin/legacy/skybox.ps.hlsl -T ps
|
||||
builtin/legacy/wobblesky.vs.hlsl -T vs
|
||||
builtin/legacy/wobblesky.ps.hlsl -T ps
|
||||
|
||||
builtin/lighting/ambient_lighting_IBL.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/ambient_lighting_IBL.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/ambient_lightgrid_IBL.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/ambient_lightgrid_IBL.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/interaction.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/interaction.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/interactionAmbient.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/interactionAmbient.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/interactionSM.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1} -D LIGHT_POINT={0,1} -D LIGHT_PARALLEL={0,1} -D USE_PBR={0,1} -D USE_NORMAL_FMT_RGB8={0,1} -D USE_SHADOW_ATLAS={0,1}
|
||||
builtin/lighting/interactionSM.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1} -D LIGHT_POINT={0,1} -D LIGHT_PARALLEL={0,1} -D USE_PBR={0,1} -D USE_NORMAL_FMT_RGB8={0,1} -D USE_SHADOW_ATLAS={0,1}
|
||||
builtin/lighting/ambient_lighting_IBL.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/ambient_lighting_IBL.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/ambient_lightgrid_IBL.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/ambient_lightgrid_IBL.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/interaction.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/interaction.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/interactionAmbient.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/interactionAmbient.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1} -D USE_PBR={0,1}
|
||||
builtin/lighting/interactionSM.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1} -D LIGHT_POINT={0,1} -D LIGHT_PARALLEL={0,1} -D USE_PBR={0,1} -D USE_NORMAL_FMT_RGB8={0,1} -D USE_SHADOW_ATLAS={0,1}
|
||||
builtin/lighting/interactionSM.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1} -D LIGHT_POINT={0,1} -D LIGHT_PARALLEL={0,1} -D USE_PBR={0,1} -D USE_NORMAL_FMT_RGB8={0,1} -D USE_SHADOW_ATLAS={0,1}
|
||||
|
||||
builtin/post/postprocess.vs.hlsl -T vs_5_0
|
||||
builtin/post/postprocess.ps.hlsl -T ps_5_0
|
||||
builtin/post/retro_c64.vs.hlsl -T vs_5_0
|
||||
builtin/post/retro_c64.ps.hlsl -T ps_5_0
|
||||
builtin/post/retro_cpc.vs.hlsl -T vs_5_0
|
||||
builtin/post/retro_cpc.ps.hlsl -T ps_5_0
|
||||
builtin/post/retro_genesis.vs.hlsl -T vs_5_0
|
||||
builtin/post/retro_genesis.ps.hlsl -T ps_5_0
|
||||
builtin/post/retro_ps1.vs.hlsl -T vs_5_0
|
||||
builtin/post/retro_ps1.ps.hlsl -T ps_5_0
|
||||
builtin/post/crt_mattias.vs.hlsl -T vs_5_0
|
||||
builtin/post/crt_mattias.ps.hlsl -T ps_5_0
|
||||
builtin/post/crt_newpixie.vs.hlsl -T vs_5_0
|
||||
builtin/post/crt_newpixie.ps.hlsl -T ps_5_0
|
||||
builtin/post/screen.vs.hlsl -T vs_5_0
|
||||
builtin/post/screen.ps.hlsl -T ps_5_0
|
||||
builtin/post/tonemap.vs.hlsl -T vs_5_0 -D BRIGHTPASS={0,1} -D HDR_DEBUG={0,1}
|
||||
builtin/post/tonemap.ps.hlsl -T ps_5_0 -D BRIGHTPASS={0,1} -D HDR_DEBUG={0,1}
|
||||
builtin/post/hdr_glare_chromatic.vs.hlsl -T vs_5_0
|
||||
builtin/post/hdr_glare_chromatic.ps.hlsl -T ps_5_0
|
||||
builtin/post/SMAA_edge_detection.vs.hlsl -T vs_5_0
|
||||
builtin/post/SMAA_edge_detection.ps.hlsl -T ps_5_0
|
||||
builtin/post/SMAA_blending_weight_calc.vs.hlsl -T vs_5_0
|
||||
builtin/post/SMAA_blending_weight_calc.ps.hlsl -T ps_5_0
|
||||
builtin/post/SMAA_final.vs.hlsl -T vs_5_0
|
||||
builtin/post/SMAA_final.ps.hlsl -T ps_5_0
|
||||
builtin/post/motionBlur.vs.hlsl -T vs_5_0 -D VECTORS_ONLY={0,1}
|
||||
builtin/post/motionBlur.ps.hlsl -T ps_5_0 -D VECTORS_ONLY={0,1}
|
||||
builtin/post/exposure.cs.hlsl -T cs_5_0 -D HISTOGRAM_BINS=256
|
||||
builtin/post/histogram.cs.hlsl -T cs_5_0 -D HISTOGRAM_BINS=256 -D SOURCE_ARRAY={0,1}
|
||||
builtin/post/tonemapping.ps.hlsl -T ps_5_0 -D HISTOGRAM_BINS=256 -D SOURCE_ARRAY={0,1} -D QUAD_Z={0,1}
|
||||
builtin/post/tonemapping.vs.hlsl -T vs_5_0 -D HISTOGRAM_BINS=256 -D SOURCE_ARRAY={0,1} -D QUAD_Z={0,1}
|
||||
builtin/post/taa.cs.hlsl -T cs_5_0 -D SAMPLE_COUNT={1,2,4,8} -D USE_CATMULL_ROM_FILTER={0,1}
|
||||
builtin/post/postprocess.vs.hlsl -T vs
|
||||
builtin/post/postprocess.ps.hlsl -T ps
|
||||
builtin/post/retro_c64.vs.hlsl -T vs
|
||||
builtin/post/retro_c64.ps.hlsl -T ps
|
||||
builtin/post/retro_cpc.vs.hlsl -T vs
|
||||
builtin/post/retro_cpc.ps.hlsl -T ps
|
||||
builtin/post/retro_genesis.vs.hlsl -T vs
|
||||
builtin/post/retro_genesis.ps.hlsl -T ps
|
||||
builtin/post/retro_ps1.vs.hlsl -T vs
|
||||
builtin/post/retro_ps1.ps.hlsl -T ps
|
||||
builtin/post/crt_mattias.vs.hlsl -T vs
|
||||
builtin/post/crt_mattias.ps.hlsl -T ps
|
||||
builtin/post/crt_newpixie.vs.hlsl -T vs
|
||||
builtin/post/crt_newpixie.ps.hlsl -T ps
|
||||
builtin/post/screen.vs.hlsl -T vs
|
||||
builtin/post/screen.ps.hlsl -T ps
|
||||
builtin/post/tonemap.vs.hlsl -T vs -D BRIGHTPASS={0,1} -D HDR_DEBUG={0,1}
|
||||
builtin/post/tonemap.ps.hlsl -T ps -D BRIGHTPASS={0,1} -D HDR_DEBUG={0,1}
|
||||
builtin/post/hdr_glare_chromatic.vs.hlsl -T vs
|
||||
builtin/post/hdr_glare_chromatic.ps.hlsl -T ps
|
||||
builtin/post/SMAA_edge_detection.vs.hlsl -T vs
|
||||
builtin/post/SMAA_edge_detection.ps.hlsl -T ps
|
||||
builtin/post/SMAA_blending_weight_calc.vs.hlsl -T vs
|
||||
builtin/post/SMAA_blending_weight_calc.ps.hlsl -T ps
|
||||
builtin/post/SMAA_final.vs.hlsl -T vs
|
||||
builtin/post/SMAA_final.ps.hlsl -T ps
|
||||
builtin/post/motionBlur.vs.hlsl -T vs -D VECTORS_ONLY={0,1}
|
||||
builtin/post/motionBlur.ps.hlsl -T ps -D VECTORS_ONLY={0,1}
|
||||
builtin/post/exposure.cs.hlsl -T cs -D HISTOGRAM_BINS=256
|
||||
builtin/post/histogram.cs.hlsl -T cs -D HISTOGRAM_BINS=256 -D SOURCE_ARRAY={0,1}
|
||||
builtin/post/tonemapping.ps.hlsl -T ps -D HISTOGRAM_BINS=256 -D SOURCE_ARRAY={0,1} -D QUAD_Z={0,1}
|
||||
builtin/post/tonemapping.vs.hlsl -T vs -D HISTOGRAM_BINS=256 -D SOURCE_ARRAY={0,1} -D QUAD_Z={0,1}
|
||||
builtin/post/taa.cs.hlsl -T cs -D SAMPLE_COUNT={1,2,4,8} -D USE_CATMULL_ROM_FILTER={0,1}
|
||||
|
||||
builtin/SSAO/AmbientOcclusion_AO.vs.hlsl -T vs_5_0 -D BRIGHTPASS={0,1}
|
||||
builtin/SSAO/AmbientOcclusion_AO.ps.hlsl -T ps_5_0 -D BRIGHTPASS={0,1}
|
||||
builtin/SSAO/AmbientOcclusion_blur.vs.hlsl -T vs_5_0 -D BRIGHTPASS={0,1}
|
||||
builtin/SSAO/AmbientOcclusion_blur.ps.hlsl -T ps_5_0 -D BRIGHTPASS={0,1}
|
||||
builtin/SSAO/AmbientOcclusion_AO.vs.hlsl -T vs -D BRIGHTPASS={0,1}
|
||||
builtin/SSAO/AmbientOcclusion_AO.ps.hlsl -T ps -D BRIGHTPASS={0,1}
|
||||
builtin/SSAO/AmbientOcclusion_blur.vs.hlsl -T vs -D BRIGHTPASS={0,1}
|
||||
builtin/SSAO/AmbientOcclusion_blur.ps.hlsl -T ps -D BRIGHTPASS={0,1}
|
||||
|
||||
builtin/SSGI/DeepGBufferRadiosity_blur.vs.hlsl -T vs_5_0
|
||||
builtin/SSGI/DeepGBufferRadiosity_blur.ps.hlsl -T ps_5_0
|
||||
builtin/SSGI/DeepGBufferRadiosity_radiosity.vs.hlsl -T vs_5_0
|
||||
builtin/SSGI/DeepGBufferRadiosity_radiosity.ps.hlsl -T ps_5_0
|
||||
builtin/SSGI/DeepGBufferRadiosity_blur.vs.hlsl -T vs
|
||||
builtin/SSGI/DeepGBufferRadiosity_blur.ps.hlsl -T ps
|
||||
builtin/SSGI/DeepGBufferRadiosity_radiosity.vs.hlsl -T vs
|
||||
builtin/SSGI/DeepGBufferRadiosity_radiosity.ps.hlsl -T ps
|
||||
|
||||
builtin/fog/blendLight.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/fog/blendLight.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/fog/fog.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/fog/fog.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/fog/blendLight.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
builtin/fog/blendLight.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
builtin/fog/fog.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
builtin/fog/fog.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
|
||||
builtin/video/bink.vs.hlsl -T vs_5_0 -D USE_SRGB={0,1}
|
||||
builtin/video/bink.ps.hlsl -T ps_5_0 -D USE_SRGB={0,1}
|
||||
builtin/video/bink_gui.vs.hlsl -T vs_5_0
|
||||
builtin/video/bink_gui.ps.hlsl -T ps_5_0
|
||||
builtin/video/bink.vs.hlsl -T vs -D USE_SRGB={0,1}
|
||||
builtin/video/bink.ps.hlsl -T ps -D USE_SRGB={0,1}
|
||||
builtin/video/bink_gui.vs.hlsl -T vs
|
||||
builtin/video/bink_gui.ps.hlsl -T ps
|
||||
|
||||
builtin/VR/stereoDeGhost.vs.hlsl -T vs_5_0
|
||||
builtin/VR/stereoDeGhost.ps.hlsl -T ps_5_0
|
||||
builtin/VR/stereoInterlace.vs.hlsl -T vs_5_0
|
||||
builtin/VR/stereoInterlace.ps.hlsl -T ps_5_0
|
||||
builtin/VR/stereoWarp.vs.hlsl -T vs_5_0
|
||||
builtin/VR/stereoWarp.ps.hlsl -T ps_5_0
|
||||
builtin/VR/stereoDeGhost.vs.hlsl -T vs
|
||||
builtin/VR/stereoDeGhost.ps.hlsl -T ps
|
||||
builtin/VR/stereoInterlace.vs.hlsl -T vs
|
||||
builtin/VR/stereoInterlace.ps.hlsl -T ps
|
||||
builtin/VR/stereoWarp.vs.hlsl -T vs
|
||||
builtin/VR/stereoWarp.ps.hlsl -T ps
|
||||
|
||||
# Compute shaders
|
||||
builtin/mipmapgen.cs.hlsl -T cs_5_0 -D MODE={0,1,2,3}
|
||||
builtin/SSAO/ssao_blur.cs.hlsl -T cs_5_0 -D DIRECTIONAL_OCCLUSION={0,1}
|
||||
builtin/SSAO/ssao_compute.cs.hlsl -T cs_5_0 -D OCT_ENCODED_NORMALS={0,1} -D DIRECTIONAL_OCCLUSION={0,1}
|
||||
builtin/SSAO/ssao_deinterleave.cs.hlsl -T cs_5_0 -D LINEAR_DEPTH={0,1}
|
||||
// Compute shaders
|
||||
builtin/mipmapgen.cs.hlsl -T cs -D MODE={0,1,2,3}
|
||||
builtin/SSAO/ssao_blur.cs.hlsl -T cs -D DIRECTIONAL_OCCLUSION={0,1}
|
||||
builtin/SSAO/ssao_compute.cs.hlsl -T cs -D OCT_ENCODED_NORMALS={0,1} -D DIRECTIONAL_OCCLUSION={0,1}
|
||||
builtin/SSAO/ssao_deinterleave.cs.hlsl -T cs -D LINEAR_DEPTH={0,1}
|
||||
|
||||
# User shaders
|
||||
bloodorb_draw.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb_draw.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb1_capture.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb1_capture.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb2_capture.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb2_capture.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb3_capture.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb3_capture.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
colorProcess.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
colorProcess.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
enviroSuit.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
enviroSuit.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
fogwithlights.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
fogwithlights.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
heathaze.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
heathaze.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
heatHazeWithMask.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
heatHazeWithMask.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
heatHazeWithMaskAndVertex.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
heatHazeWithMaskAndVertex.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
mattiascrt.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
mattiascrt.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
vornoipattern.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
vornoipattern.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
// User shaders
|
||||
bloodorb_draw.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb_draw.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb1_capture.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb1_capture.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb2_capture.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb2_capture.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb3_capture.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
bloodorb3_capture.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
colorProcess.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
colorProcess.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
enviroSuit.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
enviroSuit.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
fogwithlights.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
fogwithlights.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
heathaze.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
heathaze.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
heatHazeWithMask.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
heatHazeWithMask.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
heatHazeWithMaskAndVertex.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
heatHazeWithMaskAndVertex.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
mattiascrt.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
mattiascrt.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
vornoipattern.vs.hlsl -T vs -D USE_GPU_SKINNING={0,1}
|
||||
vornoipattern.ps.hlsl -T ps -D USE_GPU_SKINNING={0,1}
|
||||
|
|
|
@ -129,7 +129,7 @@ public:
|
|||
|
||||
#if USE_VK && defined( VULKAN_USE_PLATFORM_SDL )
|
||||
// SRS - Helper method for creating SDL Vulkan surface within DeviceManager_VK()
|
||||
vk::Result CreateSDLWindowSurface( vk::Instance instance, vk::SurfaceKHR* surface );
|
||||
VkResult CreateSDLWindowSurface( VkInstance instance, VkSurfaceKHR* surface );
|
||||
#endif
|
||||
|
||||
bool CreateWindowDeviceAndSwapChain( const glimpParms_t& params, const char* windowTitle );
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// SRS - Disable PCH here, otherwise get Vulkan header mismatch failures with USE_AMD_ALLOCATOR option
|
||||
//#include <precompiled.h>
|
||||
//#pragma hdrstop
|
||||
// SRS - Can now enable PCH here due to updated nvrhi CMakeLists.txt that makes Vulkan-Headers private
|
||||
#include <precompiled.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include <string>
|
||||
#include <queue>
|
||||
|
@ -36,6 +36,9 @@
|
|||
#include <sys/DeviceManager.h>
|
||||
|
||||
#include <nvrhi/vulkan.h>
|
||||
#define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
|
||||
#include <vulkan/vulkan.hpp>
|
||||
|
||||
// SRS - optionally needed for MoltenVK runtime config visibility
|
||||
#if defined(__APPLE__)
|
||||
#if defined( USE_MoltenVK )
|
||||
|
@ -574,7 +577,7 @@ bool DeviceManager_VK::createInstance()
|
|||
const vk::Result res = vk::createInstance( &info, nullptr, &m_VulkanInstance );
|
||||
if( res != vk::Result::eSuccess )
|
||||
{
|
||||
common->FatalError( "Failed to create a Vulkan instance, error code = %s", nvrhi::vulkan::resultToString( res ) );
|
||||
common->FatalError( "Failed to create a Vulkan instance, error code = %s", nvrhi::vulkan::resultToString( ( VkResult )res ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -599,7 +602,7 @@ void DeviceManager_VK::installDebugCallback()
|
|||
|
||||
bool DeviceManager_VK::pickPhysicalDevice()
|
||||
{
|
||||
vk::Format requestedFormat = nvrhi::vulkan::convertFormat( m_DeviceParams.swapChainFormat );
|
||||
vk::Format requestedFormat = vk::Format( nvrhi::vulkan::convertFormat( m_DeviceParams.swapChainFormat ) );
|
||||
vk::Extent2D requestedExtent( m_DeviceParams.backBufferWidth, m_DeviceParams.backBufferHeight );
|
||||
|
||||
auto devices = m_VulkanInstance.enumeratePhysicalDevices();
|
||||
|
@ -992,7 +995,7 @@ bool DeviceManager_VK::createDevice()
|
|||
const vk::Result res = m_VulkanPhysicalDevice.createDevice( &deviceDesc, nullptr, &m_VulkanDevice );
|
||||
if( res != vk::Result::eSuccess )
|
||||
{
|
||||
common->FatalError( "Failed to create a Vulkan physical device, error code = %s", nvrhi::vulkan::resultToString( res ) );
|
||||
common->FatalError( "Failed to create a Vulkan physical device, error code = %s", nvrhi::vulkan::resultToString( ( VkResult )res ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1064,19 +1067,19 @@ bool DeviceManager_VK::createWindowSurface()
|
|||
// Create the platform-specific surface
|
||||
#if defined( VULKAN_USE_PLATFORM_SDL )
|
||||
// SRS - Support generic SDL platform for linux and macOS
|
||||
const vk::Result res = CreateSDLWindowSurface( m_VulkanInstance, &m_WindowSurface );
|
||||
auto res = vk::Result( CreateSDLWindowSurface( ( VkInstance )m_VulkanInstance, ( VkSurfaceKHR* )&m_WindowSurface ) );
|
||||
|
||||
#elif defined( VK_USE_PLATFORM_WIN32_KHR )
|
||||
auto surfaceCreateInfo = vk::Win32SurfaceCreateInfoKHR()
|
||||
.setHinstance( ( HINSTANCE )windowInstance )
|
||||
.setHwnd( ( HWND )windowHandle );
|
||||
|
||||
const vk::Result res = m_VulkanInstance.createWin32SurfaceKHR( &surfaceCreateInfo, nullptr, &m_WindowSurface );
|
||||
auto res = m_VulkanInstance.createWin32SurfaceKHR( &surfaceCreateInfo, nullptr, &m_WindowSurface );
|
||||
#endif
|
||||
|
||||
if( res != vk::Result::eSuccess )
|
||||
{
|
||||
common->FatalError( "Failed to create a Vulkan window surface, error code = %s", nvrhi::vulkan::resultToString( res ) );
|
||||
common->FatalError( "Failed to create a Vulkan window surface, error code = %s", nvrhi::vulkan::resultToString( ( VkResult )res ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1165,7 +1168,7 @@ bool DeviceManager_VK::createSwapChain()
|
|||
const vk::Result res = m_VulkanDevice.createSwapchainKHR( &desc, nullptr, &m_SwapChain );
|
||||
if( res != vk::Result::eSuccess )
|
||||
{
|
||||
common->FatalError( "Failed to create a Vulkan swap chain, error code = %s", nvrhi::vulkan::resultToString( res ) );
|
||||
common->FatalError( "Failed to create a Vulkan swap chain, error code = %s", nvrhi::vulkan::resultToString( ( VkResult )res ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,15 +70,15 @@ std::vector<const char*> get_required_extensions()
|
|||
}
|
||||
|
||||
// SRS - Helper method for creating SDL Vulkan surface within DeviceManager_VK() when NVRHI enabled
|
||||
vk::Result DeviceManager::CreateSDLWindowSurface( vk::Instance instance, vk::SurfaceKHR* surface )
|
||||
VkResult DeviceManager::CreateSDLWindowSurface( VkInstance instance, VkSurfaceKHR* surface )
|
||||
{
|
||||
if( !SDL_Vulkan_CreateSurface( window, ( VkInstance )instance, ( VkSurfaceKHR* )surface ) )
|
||||
if( !SDL_Vulkan_CreateSurface( window, instance, surface ) )
|
||||
{
|
||||
common->Warning( "Error while creating SDL Vulkan surface: %s", SDL_GetError() );
|
||||
return vk::Result::eErrorSurfaceLostKHR;
|
||||
return VkResult::VK_ERROR_SURFACE_LOST_KHR;
|
||||
}
|
||||
|
||||
return vk::Result::eSuccess;
|
||||
return VkResult::VK_SUCCESS;
|
||||
}
|
||||
|
||||
bool DeviceManager::CreateWindowDeviceAndSwapChain( const glimpParms_t& parms, const char* windowTitle )
|
||||
|
|
Loading…
Reference in a new issue