diff --git a/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp b/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp index 266661ea..0c2bbc30 100644 --- a/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp +++ b/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp @@ -2090,7 +2090,7 @@ idRenderBackend::idRenderBackend() glConfig.gpuSkinningAvailable = true; glConfig.uniformBufferOffsetAlignment = 256; - glConfig.timerQueryAvailable = false; + glConfig.timerQueryAvailable = true; } /* diff --git a/neo/renderer/RenderProgs.cpp b/neo/renderer/RenderProgs.cpp index 57de194d..cee76ad3 100644 --- a/neo/renderer/RenderProgs.cpp +++ b/neo/renderer/RenderProgs.cpp @@ -107,7 +107,7 @@ void idRenderProgManager::Init( nvrhi::IDevice* device ) // RB: FIXME this is ugly - DOUBLECHECK this constantBuffer = device->createBuffer( nvrhi::utils::CreateVolatileConstantBufferDesc( uniforms.Allocated(), - "RenderParams", 128 ) ); + "RenderParams", 1024 ) ); } else { @@ -454,10 +454,10 @@ void idRenderProgManager::Init( nvrhi::IDevice* device ) } builtins[] = { { BUILTIN_GUI, "builtin/gui", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT }, - { BUILTIN_COLOR, "builtin/color", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT }, + { BUILTIN_COLOR, "builtin/color", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_CONSTANT_BUFFER_ONLY }, // RB begin - { BUILTIN_COLOR_SKINNED, "builtin/color", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT_SKINNED }, - { BUILTIN_VERTEX_COLOR, "builtin/vertex_color", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT }, + { BUILTIN_COLOR_SKINNED, "builtin/color", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_CONSTANT_BUFFER_ONLY_SKINNED }, + { BUILTIN_VERTEX_COLOR, "builtin/vertex_color", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_CONSTANT_BUFFER_ONLY }, { BUILTIN_AMBIENT_LIGHTING_IBL, "builtin/lighting/ambient_lighting_IBL", "", { { "USE_GPU_SKINNING", "0" }, { "USE_PBR", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_AMBIENT_LIGHTING_IBL }, { BUILTIN_AMBIENT_LIGHTING_IBL_SKINNED, "builtin/lighting/ambient_lighting_IBL", "_skinned", { { "USE_GPU_SKINNING", "1" }, { "USE_PBR", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_AMBIENT_LIGHTING_IBL_SKINNED }, @@ -550,8 +550,8 @@ void idRenderProgManager::Init( nvrhi::IDevice* device ) { BUILTIN_SHADOW, "builtin/lighting/shadow", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_SHADOW_VERT, BINDING_LAYOUT_CONSTANT_BUFFER_ONLY }, { BUILTIN_SHADOW_SKINNED, "builtin/lighting/shadow", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_SHADOW_VERT_SKINNED, BINDING_LAYOUT_CONSTANT_BUFFER_ONLY_SKINNED }, - { BUILTIN_SHADOW_DEBUG, "builtin/debug/shadowDebug", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT }, - { BUILTIN_SHADOW_DEBUG_SKINNED, "builtin/debug/shadowDebug", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT_SKINNED }, + { BUILTIN_SHADOW_DEBUG, "builtin/debug/shadowDebug", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_CONSTANT_BUFFER_ONLY }, + { BUILTIN_SHADOW_DEBUG_SKINNED, "builtin/debug/shadowDebug", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_CONSTANT_BUFFER_ONLY_SKINNED }, { BUILTIN_BLENDLIGHT, "builtin/fog/blendlight", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_BLENDLIGHT }, { BUILTIN_BLENDLIGHT_SKINNED, "builtin/fog/blendlight", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_BLENDLIGHT_SKINNED }, diff --git a/neo/renderer/RenderSystem_init.cpp b/neo/renderer/RenderSystem_init.cpp index 95131408..88dbe257 100644 --- a/neo/renderer/RenderSystem_init.cpp +++ b/neo/renderer/RenderSystem_init.cpp @@ -67,9 +67,9 @@ idCVar r_requestStereoPixelFormat( "r_requestStereoPixelFormat", "1", CVAR_RENDE idCVar r_debugContext( "r_debugContext", "0", CVAR_RENDERER, "Enable various levels of context debug." ); #if defined( USE_NVRHI ) #if defined( _WIN32 ) - idCVar r_graphicsAPI( "r_graphicsAPI", "vulkan", CVAR_RENDERER, "Specifies the graphics api to use (dx12, vulkan)" ); + idCVar r_graphicsAPI( "r_graphicsAPI", "dx12", CVAR_RENDERER | CVAR_INIT | CVAR_ARCHIVE, "Specifies the graphics api to use (dx12, vulkan)" ); #else - idCVar r_graphicsAPI( "r_graphicsAPI", "vulkan", CVAR_RENDERER, "Specifies the graphics api to use (vulkan)" ); + idCVar r_graphicsAPI( "r_graphicsAPI", "vulkan", CVAR_RENDERER | CVAR_ROM | CVAR_STATIC, "Specifies the graphics api to use (vulkan)" ); #endif idCVar r_useValidationLayers( "r_useValidationLayers", "1", CVAR_INTEGER | CVAR_INIT, "1 is just the NVRHI and 2 will turn on additional DX12, VK validation layers" ); diff --git a/neo/shaders/bloodorb1_capture.ps.hlsl b/neo/shaders/bloodorb1_capture.ps.hlsl index 81e4fd4f..068be867 100644 --- a/neo/shaders/bloodorb1_capture.ps.hlsl +++ b/neo/shaders/bloodorb1_capture.ps.hlsl @@ -30,19 +30,21 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_Accum : register( t0 ); -Texture2D t_CurrentRender : register( t1 ); -Texture2D t_Mask : register( t2 ); +Texture2D t_Accum : register( t0 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_CurrentRender : register( t1 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Mask : register( t2 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float2 texcoord0 : TEXCOORD0_centroid; float2 texcoord1 : TEXCOORD1_centroid; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target; }; // *INDENT-ON* diff --git a/neo/shaders/bloodorb2_capture.ps.hlsl b/neo/shaders/bloodorb2_capture.ps.hlsl index bc6e399e..68f04db3 100644 --- a/neo/shaders/bloodorb2_capture.ps.hlsl +++ b/neo/shaders/bloodorb2_capture.ps.hlsl @@ -30,13 +30,14 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_Accum : register( t0 ); -Texture2D t_CurrentRender : register( t1 ); -Texture2D t_Mask : register( t2 ); +Texture2D t_Accum : register( t0 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_CurrentRender : register( t1 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Mask : register( t2 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float2 texcoord0 : TEXCOORD0_centroid; float2 texcoord1 : TEXCOORD1_centroid; @@ -44,7 +45,8 @@ struct PS_IN { //float4 color : COLOR0; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target; }; // *INDENT-ON* diff --git a/neo/shaders/bloodorb3_capture.ps.hlsl b/neo/shaders/bloodorb3_capture.ps.hlsl index 8e4b64fc..5426a539 100644 --- a/neo/shaders/bloodorb3_capture.ps.hlsl +++ b/neo/shaders/bloodorb3_capture.ps.hlsl @@ -30,13 +30,14 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_Accum : register( t0 ); -Texture2D t_CurrentRender : register( t1 ); -Texture2D t_Mask : register( t2 ); +Texture2D t_Accum : register( t0 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_CurrentRender : register( t1 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Mask : register( t2 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float2 texcoord0 : TEXCOORD0_centroid; float2 texcoord1 : TEXCOORD1_centroid; diff --git a/neo/shaders/bloodorb_draw.ps.hlsl b/neo/shaders/bloodorb_draw.ps.hlsl index ff183dc3..da221fe7 100644 --- a/neo/shaders/bloodorb_draw.ps.hlsl +++ b/neo/shaders/bloodorb_draw.ps.hlsl @@ -30,18 +30,20 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_Accum : register( t0 ); -Texture2D t_CurrentRender : register( t1 ); -Texture2D t_Mask : register( t2 ); +Texture2D t_Accum : register( t0 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_CurrentRender : register( t1 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Mask : register( t2 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float2 texcoord0 : TEXCOORD0_centroid; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/SSAO/AmbientOcclusion_AO.ps.hlsl b/neo/shaders/builtin/SSAO/AmbientOcclusion_AO.ps.hlsl index 5d6afbf3..ea847563 100644 --- a/neo/shaders/builtin/SSAO/AmbientOcclusion_AO.ps.hlsl +++ b/neo/shaders/builtin/SSAO/AmbientOcclusion_AO.ps.hlsl @@ -93,11 +93,11 @@ static const float projScale = 500.0; #define VALUE_TYPE float -Texture2D t_NormalRoughness : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_ViewDepth : register( t1 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_BlueNoise : register( t2 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_NormalRoughness : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_ViewDepth : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_BlueNoise : register( t2 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState blueNoiseSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState blueNoiseSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); #define CS_Z_buffer t_ViewDepth diff --git a/neo/shaders/builtin/SSAO/AmbientOcclusion_blur.ps.hlsl b/neo/shaders/builtin/SSAO/AmbientOcclusion_blur.ps.hlsl index 0dde511e..b178d296 100644 --- a/neo/shaders/builtin/SSAO/AmbientOcclusion_blur.ps.hlsl +++ b/neo/shaders/builtin/SSAO/AmbientOcclusion_blur.ps.hlsl @@ -22,9 +22,9 @@ // *INDENT-OFF* #define VALUE_TYPE float -Texture2D t_NormalRoughness : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_ViewDepth : register( t1 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_Ao : register( t2 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_NormalRoughness : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_ViewDepth : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_Ao : register( t2 VK_DESCRIPTOR_SET( 1 ) ); #define normal_buffer t_NormalRoughness #define cszBuffer t_ViewDepth diff --git a/neo/shaders/builtin/SSAO/AmbientOcclusion_minify.ps.hlsl b/neo/shaders/builtin/SSAO/AmbientOcclusion_minify.ps.hlsl index 041ba4d3..56de4d33 100644 --- a/neo/shaders/builtin/SSAO/AmbientOcclusion_minify.ps.hlsl +++ b/neo/shaders/builtin/SSAO/AmbientOcclusion_minify.ps.hlsl @@ -19,9 +19,9 @@ // *INDENT-OFF* -Texture2D t_ViewDepth : register( t0 ); +Texture2D t_ViewDepth : register( t0 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); struct PS_IN { diff --git a/neo/shaders/builtin/SSGI/DeepGBufferRadiosity_blur.ps.hlsl b/neo/shaders/builtin/SSGI/DeepGBufferRadiosity_blur.ps.hlsl index 91f4682a..ee379ec0 100644 --- a/neo/shaders/builtin/SSGI/DeepGBufferRadiosity_blur.ps.hlsl +++ b/neo/shaders/builtin/SSGI/DeepGBufferRadiosity_blur.ps.hlsl @@ -20,11 +20,11 @@ // *INDENT-OFF* -Texture2D t_ViewNormal : register( t0 ); -Texture2D t_ViewDepth : register( t1 ); -Texture2D t_ViewAo : register( t2 ); +Texture2D t_ViewNormal : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_ViewDepth : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_ViewAo : register( t2 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); #define normal_buffer t_ViewNormal #define cszBuffer t_ViewDepth diff --git a/neo/shaders/builtin/SSGI/DeepGBufferRadiosity_radiosity.ps.hlsl b/neo/shaders/builtin/SSGI/DeepGBufferRadiosity_radiosity.ps.hlsl index c24d4302..178d5c1d 100644 --- a/neo/shaders/builtin/SSGI/DeepGBufferRadiosity_radiosity.ps.hlsl +++ b/neo/shaders/builtin/SSGI/DeepGBufferRadiosity_radiosity.ps.hlsl @@ -77,11 +77,11 @@ static const float projScale = 500.0; // #endif // *INDENT-OFF* -Texture2D t_ViewNormals : register( t0 ); -Texture2D t_ViewDepth : register( t1 ); -Texture2D t_Colors : register( t2 ); +Texture2D t_ViewNormals : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_ViewDepth : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_Colors : register( t2 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); #define normal_buffer t_ViewNormals #define CS_Z_buffer t_ViewDepth diff --git a/neo/shaders/builtin/VR/stereoDeGhost.ps.hlsl b/neo/shaders/builtin/VR/stereoDeGhost.ps.hlsl index 3a829b88..36fc735a 100644 --- a/neo/shaders/builtin/VR/stereoDeGhost.ps.hlsl +++ b/neo/shaders/builtin/VR/stereoDeGhost.ps.hlsl @@ -30,10 +30,11 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_t1 : register( t0 ); -SamplerState LinearSampler : register( s0 ); +Texture2D t_t1 : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target0; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/VR/stereoInterlace.ps.hlsl b/neo/shaders/builtin/VR/stereoInterlace.ps.hlsl index bf5736dd..65d03566 100644 --- a/neo/shaders/builtin/VR/stereoInterlace.ps.hlsl +++ b/neo/shaders/builtin/VR/stereoInterlace.ps.hlsl @@ -30,17 +30,19 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_t1 : register( t0 ); -Texture2D t_t2 : register( t1 ); +Texture2D t_t1 : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_t2 : register( t1 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : POSITION; float2 texcoord0 : TEXCOORD0_centroid; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target0; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/VR/stereoWarp.ps.hlsl b/neo/shaders/builtin/VR/stereoWarp.ps.hlsl index a4d66889..22e4f628 100644 --- a/neo/shaders/builtin/VR/stereoWarp.ps.hlsl +++ b/neo/shaders/builtin/VR/stereoWarp.ps.hlsl @@ -38,14 +38,16 @@ the optics. */ // *INDENT-OFF* -Texture2D t_t1 : register( t0 ); -SamplerState LinearSampler : register( s0 ); +Texture2D t_t1 : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); -struct PS_IN { +struct PS_IN +{ float2 texcoord0 : TEXCOORD0_centroid; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/color.ps.hlsl b/neo/shaders/builtin/color.ps.hlsl index 15948590..a3fdcc0b 100644 --- a/neo/shaders/builtin/color.ps.hlsl +++ b/neo/shaders/builtin/color.ps.hlsl @@ -29,9 +29,10 @@ If you have questions concerning this license or the applicable additional terms #include "global_inc.hlsl" // *INDENT-OFF* -sampler samp0 : register(s0); +//sampler samp0 : register( s0 VK_DESCRIPTOR_SET( 1 ) ); -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target0; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/debug/debug_shadowmap.ps.hlsl b/neo/shaders/builtin/debug/debug_shadowmap.ps.hlsl index 7de09496..8c6d094d 100644 --- a/neo/shaders/builtin/debug/debug_shadowmap.ps.hlsl +++ b/neo/shaders/builtin/debug/debug_shadowmap.ps.hlsl @@ -32,9 +32,9 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* // TODO(Stephen): I think this should be an array? -Texture2D t_t1 : register( t0 ); +Texture2D t_t1 : register( t0 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); struct PS_IN { diff --git a/neo/shaders/builtin/debug/lightgrid.ps.hlsl b/neo/shaders/builtin/debug/lightgrid.ps.hlsl index 9cbab4e1..337971bc 100644 --- a/neo/shaders/builtin/debug/lightgrid.ps.hlsl +++ b/neo/shaders/builtin/debug/lightgrid.ps.hlsl @@ -31,17 +31,19 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_Atlas : register( t0 ); -SamplerState samp0 : register( s0 ); // texture 0 is octahedron cube map atlas +Texture2D t_Atlas : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // texture 0 is octahedron cube map atlas -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float3 texcoord0 : TEXCOORD0_centroid; float3 texcoord1 : TEXCOORD1_centroid; float4 color : COLOR0; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target0; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/debug/octahedron.ps.hlsl b/neo/shaders/builtin/debug/octahedron.ps.hlsl index e63d6256..93dff5f3 100644 --- a/neo/shaders/builtin/debug/octahedron.ps.hlsl +++ b/neo/shaders/builtin/debug/octahedron.ps.hlsl @@ -31,8 +31,8 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_CubeMap : register( t0 ); -SamplerState samp0 : register( s0 ); // texture 0 is octahedron cube map +Texture2D t_CubeMap : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // texture 0 is octahedron cube map struct PS_IN { diff --git a/neo/shaders/builtin/debug/shadowDebug.ps.hlsl b/neo/shaders/builtin/debug/shadowDebug.ps.hlsl index 841bbd9a..a1ee4c44 100644 --- a/neo/shaders/builtin/debug/shadowDebug.ps.hlsl +++ b/neo/shaders/builtin/debug/shadowDebug.ps.hlsl @@ -30,13 +30,15 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -SamplerState samp0 : register(s0 VK_DESCRIPTOR_SET( 0 )); +//SamplerState samp0 : register(s0 VK_DESCRIPTOR_SET( 0 ) ); -struct VS_IN { +struct VS_IN +{ float4 position : SV_Position; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target0; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/debug/shadowDebug_skinned.ps.hlsl b/neo/shaders/builtin/debug/shadowDebug_skinned.ps.hlsl deleted file mode 100644 index 8a9f8f68..00000000 --- a/neo/shaders/builtin/debug/shadowDebug_skinned.ps.hlsl +++ /dev/null @@ -1,43 +0,0 @@ -/* -=========================================================================== - -Doom 3 BFG Edition GPL Source Code -Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. - -This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). - -Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 BFG Edition Source Code. If not, see . - -In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "global_inc.hlsl" - - -// *INDENT-OFF* -uniform sampler2D samp0 : register(s0); - -struct PS_OUT { - float4 color : COLOR; -}; -// *INDENT-ON* - -void main( out PS_OUT result ) -{ - result.color = rpColor; -} \ No newline at end of file diff --git a/neo/shaders/builtin/debug/shadowDebug_skinned.vs.hlsl b/neo/shaders/builtin/debug/shadowDebug_skinned.vs.hlsl deleted file mode 100644 index dfb85b05..00000000 --- a/neo/shaders/builtin/debug/shadowDebug_skinned.vs.hlsl +++ /dev/null @@ -1,96 +0,0 @@ -/* -=========================================================================== - -Doom 3 BFG Edition GPL Source Code -Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. -Copyright (C) 2014 Robert Beckebans - -This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). - -Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 BFG Edition Source Code. If not, see . - -In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "global_inc.hlsl" - - -uniform matrices_ubo { float4 matrices[408]; }; - -// *INDENT-OFF* -struct VS_IN { - float4 position : POSITION; - float4 color : COLOR0; - float4 color2 : COLOR1; -}; - -struct VS_OUT { - float4 position : POSITION; -}; -// *INDENT-ON* - -void main( VS_IN vertex, out VS_OUT result ) -{ - //-------------------------------------------------------------- - // GPU transformation of the normal / binormal / bitangent - // - // multiplying with 255.1 give us the same result and is faster than floor( w * 255 + 0.5 ) - //-------------------------------------------------------------- - const float w0 = vertex.color2.x; - const float w1 = vertex.color2.y; - const float w2 = vertex.color2.z; - const float w3 = vertex.color2.w; - - float4 matX, matY, matZ; // must be float4 for vec4 - int joint = int( vertex.color.x * 255.1 * 3.0 ); - matX = matrices[int( joint + 0 )] * w0; - matY = matrices[int( joint + 1 )] * w0; - matZ = matrices[int( joint + 2 )] * w0; - - joint = int( vertex.color.y * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w1; - matY += matrices[int( joint + 1 )] * w1; - matZ += matrices[int( joint + 2 )] * w1; - - joint = int( vertex.color.z * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w2; - matY += matrices[int( joint + 1 )] * w2; - matZ += matrices[int( joint + 2 )] * w2; - - joint = int( vertex.color.w * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w3; - matY += matrices[int( joint + 1 )] * w3; - matZ += matrices[int( joint + 2 )] * w3; - - float4 vertexPosition = vertex.position; - vertexPosition.w = 1.0; - - float4 modelPosition; - modelPosition.x = dot4( matX, vertexPosition ); - modelPosition.y = dot4( matY, vertexPosition ); - modelPosition.z = dot4( matZ, vertexPosition ); - modelPosition.w = vertex.position.w; - - float4 vPos = modelPosition - rpLocalLightOrigin; - vPos = ( vPos.wwww * rpLocalLightOrigin ) + vPos; - - result.position.x = dot4( vPos, rpMVPmatrixX ); - result.position.y = dot4( vPos, rpMVPmatrixY ); - result.position.z = dot4( vPos, rpMVPmatrixZ ); - result.position.w = dot4( vPos, rpMVPmatrixW ); -} \ No newline at end of file diff --git a/neo/shaders/builtin/fog/blendLight.ps.hlsl b/neo/shaders/builtin/fog/blendLight.ps.hlsl index c94d2c07..4e3ee598 100644 --- a/neo/shaders/builtin/fog/blendLight.ps.hlsl +++ b/neo/shaders/builtin/fog/blendLight.ps.hlsl @@ -31,17 +31,19 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_Light1 : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_Light2 : register( t1 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState s_LinearClamp : register( s0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_Light1 : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_Light2 : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState s_LinearClamp : register( s0 VK_DESCRIPTOR_SET( 2 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float4 texcoord0 : TEXCOORD0_centroid; float2 texcoord1 : TEXCOORD1_centroid; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target0; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/fog/fog.ps.hlsl b/neo/shaders/builtin/fog/fog.ps.hlsl index 3563b309..a050d34a 100644 --- a/neo/shaders/builtin/fog/fog.ps.hlsl +++ b/neo/shaders/builtin/fog/fog.ps.hlsl @@ -31,19 +31,21 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_Fog1 : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_Fog2 : register( t1 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Fog1 : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_Fog2 : register( t1 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState samp0 : register(s0 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState samp1 : register(s1 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState samp0 : register(s0 VK_DESCRIPTOR_SET( 2 ) ); +SamplerState samp1 : register(s1 VK_DESCRIPTOR_SET( 2 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float2 texcoord0 : TEXCOORD0_centroid; float2 texcoord1 : TEXCOORD1_centroid; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target0; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/gbuffer.ps.hlsl b/neo/shaders/builtin/gbuffer.ps.hlsl index 96c93400..806bf961 100644 --- a/neo/shaders/builtin/gbuffer.ps.hlsl +++ b/neo/shaders/builtin/gbuffer.ps.hlsl @@ -31,8 +31,8 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_NormalMap : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState s_Sampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_NormalMap : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState s_Sampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); struct PS_IN { diff --git a/neo/shaders/builtin/legacy/bumpyenvironment_skinned.ps.hlsl b/neo/shaders/builtin/legacy/bumpyenvironment_skinned.ps.hlsl deleted file mode 100644 index 11366f38..00000000 --- a/neo/shaders/builtin/legacy/bumpyenvironment_skinned.ps.hlsl +++ /dev/null @@ -1,81 +0,0 @@ -/* -=========================================================================== - -Doom 3 BFG Edition GPL Source Code -Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. -Copyright (C) 2013 Robert Beckebans - -This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). - -Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 BFG Edition Source Code. If not, see . - -In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "global_inc.hlsl" - - -// *INDENT-OFF* -TextureCube t_CubeMap : register( t0 ); -Texture2D t_NormalMap : register( t1 ); - -SamplerState samp0 : register( s0 ); - -struct PS_IN { - float4 position : SV_Position; - float2 texcoord0 : TEXCOORD0_centroid; - float3 texcoord1 : TEXCOORD1_centroid; - float3 texcoord2 : TEXCOORD2_centroid; - float3 texcoord3 : TEXCOORD3_centroid; - float3 texcoord4 : TEXCOORD4_centroid; - float4 color : COLOR0; -}; - -struct PS_OUT { - float4 color : SV_Target0; -}; -// *INDENT-ON* - -void main( PS_IN fragment, out PS_OUT result ) -{ - float4 bump = t_NormalMap.Sample( samp0, fragment.texcoord0 ) * 2.0f - 1.0f; - - // RB begin - float3 localNormal; -#if defined(GLES2) - localNormal = float3( bump.rg, 0.0f ); -#else - localNormal = float3( bump.wy, 0.0f ); -#endif - // RB end - localNormal.z = sqrt( 1.0f - dot3( localNormal, localNormal ) ); - - float3 globalNormal; - globalNormal.x = dot3( localNormal, fragment.texcoord2 ); - globalNormal.y = dot3( localNormal, fragment.texcoord3 ); - globalNormal.z = dot3( localNormal, fragment.texcoord4 ); - - float3 globalEye = normalize( fragment.texcoord1 ); - - float3 reflectionVector = globalNormal * dot3( globalEye, globalNormal ); - reflectionVector = ( reflectionVector * 2.0f ) - globalEye; - - float4 envMap = t_CubeMap.Sample( samp0, reflectionVector ); - - result.color = float4( sRGBToLinearRGB( envMap.xyz ), 1.0f ) * fragment.color; -} diff --git a/neo/shaders/builtin/legacy/bumpyenvironment_skinned.vs.hlsl b/neo/shaders/builtin/legacy/bumpyenvironment_skinned.vs.hlsl deleted file mode 100644 index 51d129b2..00000000 --- a/neo/shaders/builtin/legacy/bumpyenvironment_skinned.vs.hlsl +++ /dev/null @@ -1,143 +0,0 @@ -/* -=========================================================================== - -Doom 3 BFG Edition GPL Source Code -Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. -Copyright (C) 2014 Robert Beckebans - -This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). - -Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 BFG Edition Source Code. If not, see . - -In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "global_inc.hlsl" - - -// *INDENT-OFF* - -struct VS_IN -{ - float4 position : POSITION; - float2 texcoord : TEXCOORD0; - float4 normal : NORMAL; - float4 tangent : TANGENT; - float4 color : COLOR0; - float4 color2 : COLOR1; -}; - -struct VS_OUT -{ - float4 position : POSITION; - float2 texcoord0 : TEXCOORD0; - float3 texcoord1 : TEXCOORD1; - float3 texcoord2 : TEXCOORD2; - float3 texcoord3 : TEXCOORD3; - float3 texcoord4 : TEXCOORD4; - float4 color : COLOR0; -}; -// *INDENT-ON* - -void main( VS_IN vertex, out VS_OUT result ) -{ - float4 vNormal = vertex.normal * 2.0 - 1.0; - float4 vTangent = vertex.tangent * 2.0 - 1.0; - float3 vBinormal = cross( vNormal.xyz, vTangent.xyz ) * vTangent.w; - - //-------------------------------------------------------------- - // GPU transformation of the normal / binormal / bitangent - // - // multiplying with 255.1 give us the same result and is faster than floor( w * 255 + 0.5 ) - //-------------------------------------------------------------- - const float w0 = vertex.color2.x; - const float w1 = vertex.color2.y; - const float w2 = vertex.color2.z; - const float w3 = vertex.color2.w; - - float4 matX, matY, matZ; // must be float4 for vec4 - int joint = int( vertex.color.x * 255.1 * 3.0 ); - matX = matrices[int( joint + 0 )] * w0; - matY = matrices[int( joint + 1 )] * w0; - matZ = matrices[int( joint + 2 )] * w0; - - joint = int( vertex.color.y * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w1; - matY += matrices[int( joint + 1 )] * w1; - matZ += matrices[int( joint + 2 )] * w1; - - joint = int( vertex.color.z * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w2; - matY += matrices[int( joint + 1 )] * w2; - matZ += matrices[int( joint + 2 )] * w2; - - joint = int( vertex.color.w * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w3; - matY += matrices[int( joint + 1 )] * w3; - matZ += matrices[int( joint + 2 )] * w3; - - float3 normal; - normal.x = dot3( matX, vNormal ); - normal.y = dot3( matY, vNormal ); - normal.z = dot3( matZ, vNormal ); - normal = normalize( normal ); - - float3 tangent; - tangent.x = dot3( matX, vTangent ); - tangent.y = dot3( matY, vTangent ); - tangent.z = dot3( matZ, vTangent ); - tangent = normalize( tangent ); - - float3 binormal; - binormal.x = dot3( matX, vBinormal ); - binormal.y = dot3( matY, vBinormal ); - binormal.z = dot3( matZ, vBinormal ); - binormal = normalize( binormal ); - - float4 modelPosition; - modelPosition.x = dot4( matX, vertex.position ); - modelPosition.y = dot4( matY, vertex.position ); - modelPosition.z = dot4( matZ, vertex.position ); - modelPosition.w = 1.0; - - result.position.x = dot4( modelPosition, rpMVPmatrixX ); - result.position.y = dot4( modelPosition, rpMVPmatrixY ); - result.position.z = dot4( modelPosition, rpMVPmatrixZ ); - result.position.w = dot4( modelPosition, rpMVPmatrixW ); - - result.texcoord0 = vertex.texcoord.xy; - - float4 toEye = rpLocalViewOrigin - modelPosition; - result.texcoord1.x = dot3( toEye, rpModelMatrixX ); - result.texcoord1.y = dot3( toEye, rpModelMatrixY ); - result.texcoord1.z = dot3( toEye, rpModelMatrixZ ); - - result.texcoord2.x = dot3( tangent, rpModelMatrixX ); - result.texcoord3.x = dot3( tangent, rpModelMatrixY ); - result.texcoord4.x = dot3( tangent, rpModelMatrixZ ); - - result.texcoord2.y = dot3( binormal, rpModelMatrixX ); - result.texcoord3.y = dot3( binormal, rpModelMatrixY ); - result.texcoord4.y = dot3( binormal, rpModelMatrixZ ); - - result.texcoord2.z = dot3( normal, rpModelMatrixX ); - result.texcoord3.z = dot3( normal, rpModelMatrixY ); - result.texcoord4.z = dot3( normal, rpModelMatrixZ ); - - result.color = rpColor; -} \ No newline at end of file diff --git a/neo/shaders/builtin/legacy/environment.ps.hlsl b/neo/shaders/builtin/legacy/environment.ps.hlsl index 75c84a69..a31f56f8 100644 --- a/neo/shaders/builtin/legacy/environment.ps.hlsl +++ b/neo/shaders/builtin/legacy/environment.ps.hlsl @@ -33,14 +33,16 @@ If you have questions concerning this license or the applicable additional terms TextureCube t_CubeMap : register( t0 VK_DESCRIPTOR_SET( 1 ) ); SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // texture 0 is the cube map -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float3 texcoord0 : TEXCOORD0_centroid; float3 texcoord1 : TEXCOORD1_centroid; float4 color : COLOR0; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/legacy/environment_skinned.ps.hlsl b/neo/shaders/builtin/legacy/environment_skinned.ps.hlsl deleted file mode 100644 index 94309f9b..00000000 --- a/neo/shaders/builtin/legacy/environment_skinned.ps.hlsl +++ /dev/null @@ -1,60 +0,0 @@ -/* -=========================================================================== - -Doom 3 BFG Edition GPL Source Code -Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. - -This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). - -Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 BFG Edition Source Code. If not, see . - -In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "global_inc.hlsl" - - -// *INDENT-OFF* -uniform samplerCUBE samp0 : register(s0); // texture 0 is the cube map - -struct PS_IN { - float4 position : VPOS; - float3 texcoord0 : TEXCOORD0_centroid; - float3 texcoord1 : TEXCOORD1_centroid; - float4 color : COLOR0; -}; - -struct PS_OUT { - float4 color : COLOR; -}; -// *INDENT-ON* - -void main( PS_IN fragment, out PS_OUT result ) -{ - - float3 globalNormal = normalize( fragment.texcoord1 ); - float3 globalEye = normalize( fragment.texcoord0 ); - - float3 reflectionVector = _float3( dot3( globalEye, globalNormal ) ); - reflectionVector *= globalNormal; - reflectionVector = ( reflectionVector * 2.0f ) - globalEye; - - float4 envMap = texCUBE( samp0, reflectionVector ); - - result.color = float4( sRGBToLinearRGB( envMap.xyz ), 1.0f ) * fragment.color; -} diff --git a/neo/shaders/builtin/legacy/environment_skinned.vs.hlsl b/neo/shaders/builtin/legacy/environment_skinned.vs.hlsl deleted file mode 100644 index 3ae0af3b..00000000 --- a/neo/shaders/builtin/legacy/environment_skinned.vs.hlsl +++ /dev/null @@ -1,112 +0,0 @@ -/* -=========================================================================== - -Doom 3 BFG Edition GPL Source Code -Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. -Copyright (C) 2014 Robert Beckebans - -This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). - -Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 BFG Edition Source Code. If not, see . - -In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "global_inc.hlsl" - - -uniform matrices_ubo { float4 matrices[408]; }; - -// *INDENT-OFF* -struct VS_IN -{ - float4 position : POSITION; - float2 texcoord : TEXCOORD0; - float4 normal : NORMAL; - float4 tangent : TANGENT; - float4 color : COLOR0; - float4 color2 : COLOR1; -}; - -struct VS_OUT { - float4 position : POSITION; - float3 texcoord0 : TEXCOORD0; - float3 texcoord1 : TEXCOORD1; - float4 color : COLOR0; -}; -// *INDENT-ON* - -void main( VS_IN vertex, out VS_OUT result ) -{ - float4 vNormal = vertex.normal * 2.0 - 1.0; - - //-------------------------------------------------------------- - // GPU transformation of the normal / binormal / bitangent - // - // multiplying with 255.1 give us the same result and is faster than floor( w * 255 + 0.5 ) - //-------------------------------------------------------------- - const float w0 = vertex.color2.x; - const float w1 = vertex.color2.y; - const float w2 = vertex.color2.z; - const float w3 = vertex.color2.w; - - float4 matX, matY, matZ; // must be float4 for vec4 - int joint = int( vertex.color.x * 255.1 * 3.0 ); - matX = matrices[int( joint + 0 )] * w0; - matY = matrices[int( joint + 1 )] * w0; - matZ = matrices[int( joint + 2 )] * w0; - - joint = int( vertex.color.y * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w1; - matY += matrices[int( joint + 1 )] * w1; - matZ += matrices[int( joint + 2 )] * w1; - - joint = int( vertex.color.z * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w2; - matY += matrices[int( joint + 1 )] * w2; - matZ += matrices[int( joint + 2 )] * w2; - - joint = int( vertex.color.w * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w3; - matY += matrices[int( joint + 1 )] * w3; - matZ += matrices[int( joint + 2 )] * w3; - - float3 vNormalSkinned; - vNormalSkinned.x = dot3( matX, vNormal ); - vNormalSkinned.y = dot3( matY, vNormal ); - vNormalSkinned.z = dot3( matZ, vNormal ); - vNormalSkinned = normalize( vNormalSkinned ); - - float4 modelPosition; - modelPosition.x = dot4( matX, vertex.position ); - modelPosition.y = dot4( matY, vertex.position ); - modelPosition.z = dot4( matZ, vertex.position ); - modelPosition.w = 1.0; - - result.position.x = dot4( modelPosition, rpMVPmatrixX ); - result.position.y = dot4( modelPosition, rpMVPmatrixY ); - result.position.z = dot4( modelPosition, rpMVPmatrixZ ); - result.position.w = dot4( modelPosition, rpMVPmatrixW ); - - float4 toEye = rpLocalViewOrigin - modelPosition; - - result.texcoord0 = toEye.xyz; - result.texcoord1 = vNormalSkinned.xyz; - - result.color = rpColor; -} diff --git a/neo/shaders/builtin/legacy/skybox.ps.hlsl b/neo/shaders/builtin/legacy/skybox.ps.hlsl index 2689dcfe..60da70f4 100644 --- a/neo/shaders/builtin/legacy/skybox.ps.hlsl +++ b/neo/shaders/builtin/legacy/skybox.ps.hlsl @@ -30,16 +30,18 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -TextureCube tex : register( t0 ); -SamplerState samp0 : register(s0); +TextureCube tex : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float3 texcoord0 : TEXCOORD0_centroid; float4 color : COLOR0; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target0; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/legacy/wobblesky.ps.hlsl b/neo/shaders/builtin/legacy/wobblesky.ps.hlsl index debf171d..4f7b0d95 100644 --- a/neo/shaders/builtin/legacy/wobblesky.ps.hlsl +++ b/neo/shaders/builtin/legacy/wobblesky.ps.hlsl @@ -31,16 +31,18 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -TextureCube tex : register( t0 ); -SamplerState samp0 : register( s0 ); +TextureCube tex : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float3 texcoord0 : TEXCOORD0_centroid; float4 color : COLOR0; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target0; }; // *INDENT-ON* diff --git a/neo/shaders/builtin/lighting/ambient_lightgrid_IBL.ps.hlsl b/neo/shaders/builtin/lighting/ambient_lightgrid_IBL.ps.hlsl index daeacc4f..b700b794 100644 --- a/neo/shaders/builtin/lighting/ambient_lightgrid_IBL.ps.hlsl +++ b/neo/shaders/builtin/lighting/ambient_lightgrid_IBL.ps.hlsl @@ -32,20 +32,20 @@ If you have questions concerning this license or the applicable additional terms #include "BRDF.inc.hlsl" // *INDENT-OFF* -Texture2D t_Normal : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_Specular : register( t1 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_BaseColor : register( t2 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Normal : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_Specular : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_BaseColor : register( t2 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_BrdfLut : register( t3 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_Ssao : register( t4 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_IrradianceCubeMap : register( t7 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_RadianceCubeMap1 : register( t8 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_RadianceCubeMap2 : register( t9 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_RadianceCubeMap3 : register( t10 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_BrdfLut : register( t3 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_Ssao : register( t4 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_IrradianceCubeMap : register( t7 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_RadianceCubeMap1 : register( t8 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_RadianceCubeMap2 : register( t9 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_RadianceCubeMap3 : register( t10 VK_DESCRIPTOR_SET( 2 ) ); -SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // (Wrap) Anisotropic sampler: normal sampler & specular sampler -SamplerState s_LinearClamp : register( s1 VK_DESCRIPTOR_SET( 2 ) ); // (Clamp) Linear sampler: brdf lut sampler & ssao sampler -//SamplerState s_Light : register( s2 VK_DESCRIPTOR_SET( 1 )); // (Clamp) Anisotropic sampler: irradiance, radiance 1, 2 and 3. +SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 3 ) ); // (Wrap) Anisotropic sampler: normal sampler & specular sampler +SamplerState s_LinearClamp : register( s1 VK_DESCRIPTOR_SET( 3 ) ); // (Clamp) Linear sampler: brdf lut sampler & ssao sampler +//SamplerState s_Light : register( s2 VK_DESCRIPTOR_SET( 3 )); // (Clamp) Anisotropic sampler: irradiance, radiance 1, 2 and 3. struct PS_IN { diff --git a/neo/shaders/builtin/lighting/ambient_lighting_IBL.ps.hlsl b/neo/shaders/builtin/lighting/ambient_lighting_IBL.ps.hlsl index 2a8e4f10..589e7ed3 100644 --- a/neo/shaders/builtin/lighting/ambient_lighting_IBL.ps.hlsl +++ b/neo/shaders/builtin/lighting/ambient_lighting_IBL.ps.hlsl @@ -33,20 +33,20 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_Normal : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_Specular : register( t1 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_BaseColor : register( t2 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Normal : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_Specular : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_BaseColor : register( t2 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_BrdfLut : register( t3 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_Ssao : register( t4 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_IrradianceCubeMap : register( t7 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_RadianceCubeMap1 : register( t8 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_RadianceCubeMap2 : register( t9 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_RadianceCubeMap3 : register( t10 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_BrdfLut : register( t3 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_Ssao : register( t4 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_IrradianceCubeMap : register( t7 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_RadianceCubeMap1 : register( t8 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_RadianceCubeMap2 : register( t9 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_RadianceCubeMap3 : register( t10 VK_DESCRIPTOR_SET( 2 ) ); -SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // (Wrap) Anisotropic sampler: normal sampler & specular sampler -SamplerState s_LinearClamp : register( s1 VK_DESCRIPTOR_SET( 2 ) ); // (Clamp) Linear sampler: brdf lut sampler & ssao sampler -//SamplerState s_Light : register( s2 VK_DESCRIPTOR_SET( 2 )); // (Clamp) Anisotropic sampler: irradiance, radiance 1, 2 and 3. +SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 3 ) ); // (Wrap) Anisotropic sampler: normal sampler & specular sampler +SamplerState s_LinearClamp : register( s1 VK_DESCRIPTOR_SET( 3 ) ); // (Clamp) Linear sampler: brdf lut sampler & ssao sampler +//SamplerState s_Light : register( s2 VK_DESCRIPTOR_SET( 3 )); // (Clamp) Anisotropic sampler: irradiance, radiance 1, 2 and 3. struct PS_IN { diff --git a/neo/shaders/builtin/lighting/interaction.ps.hlsl b/neo/shaders/builtin/lighting/interaction.ps.hlsl index 581b6169..23ea32a0 100644 --- a/neo/shaders/builtin/lighting/interaction.ps.hlsl +++ b/neo/shaders/builtin/lighting/interaction.ps.hlsl @@ -32,15 +32,15 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_Normal : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_Specular : register( t1 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_BaseColor : register( t2 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Normal : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_Specular : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_BaseColor : register( t2 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 2 ) ); -SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // for the normal/specular/basecolor -SamplerState s_Lighting : register( s1 VK_DESCRIPTOR_SET( 2 ) ); // for sampling the jitter +SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 3 ) ); // for the normal/specular/basecolor +SamplerState s_Lighting : register( s1 VK_DESCRIPTOR_SET( 3 ) ); // for sampling the jitter struct PS_IN { diff --git a/neo/shaders/builtin/lighting/interactionAmbient.ps.hlsl b/neo/shaders/builtin/lighting/interactionAmbient.ps.hlsl index 28fad22d..487a482a 100644 --- a/neo/shaders/builtin/lighting/interactionAmbient.ps.hlsl +++ b/neo/shaders/builtin/lighting/interactionAmbient.ps.hlsl @@ -31,15 +31,15 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_Normal : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_Specular : register( t1 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_BaseColor : register( t2 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Normal : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_Specular : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_BaseColor : register( t2 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 2 ) ); -SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // for the normal/specular/basecolor -SamplerState s_Lighting : register( s1 VK_DESCRIPTOR_SET( 2 ) ); // for sampling the jitter +SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 3 ) ); // for the normal/specular/basecolor +SamplerState s_Lighting : register( s1 VK_DESCRIPTOR_SET( 3 ) ); // for sampling the jitter struct PS_IN { diff --git a/neo/shaders/builtin/lighting/interactionSM.ps.hlsl b/neo/shaders/builtin/lighting/interactionSM.ps.hlsl index d15d78f0..3023de85 100644 --- a/neo/shaders/builtin/lighting/interactionSM.ps.hlsl +++ b/neo/shaders/builtin/lighting/interactionSM.ps.hlsl @@ -33,23 +33,23 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_Normal : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_Specular : register( t1 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_BaseColor : register( t2 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Normal : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_Specular : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_BaseColor : register( t2 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 2 ) ); +Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 2 ) ); #if USE_SHADOW_ATLAS -Texture2D t_ShadowAtlas : register( t5 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_ShadowAtlas : register( t5 VK_DESCRIPTOR_SET( 2 ) ); #else -Texture2DArray t_ShadowMapArray : register( t5 VK_DESCRIPTOR_SET( 1 ) ); +Texture2DArray t_ShadowMapArray : register( t5 VK_DESCRIPTOR_SET( 2 ) ); #endif -Texture2D t_Jitter : register( t6 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_Jitter : register( t6 VK_DESCRIPTOR_SET( 2 ) ); -SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // for the normal/specular/basecolor -SamplerState s_Lighting : register( s1 VK_DESCRIPTOR_SET( 2 ) ); // for sampling the jitter -SamplerComparisonState s_Shadow : register( s2 VK_DESCRIPTOR_SET( 2 ) ); // for the depth shadow map sampler with a compare function -SamplerState s_Jitter : register( s3 VK_DESCRIPTOR_SET( 2 ) ); // for sampling the jitter +SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 3 ) ); // for the normal/specular/basecolor +SamplerState s_Lighting : register( s1 VK_DESCRIPTOR_SET( 3 ) ); // for sampling the jitter +SamplerComparisonState s_Shadow : register( s2 VK_DESCRIPTOR_SET( 3 ) ); // for the depth shadow map sampler with a compare function +SamplerState s_Jitter : register( s3 VK_DESCRIPTOR_SET( 3 ) ); // for sampling the jitter struct PS_IN { diff --git a/neo/shaders/builtin/post/SMAA_blending_weight_calc.ps.hlsl b/neo/shaders/builtin/post/SMAA_blending_weight_calc.ps.hlsl index 52c06323..aa861daa 100644 --- a/neo/shaders/builtin/post/SMAA_blending_weight_calc.ps.hlsl +++ b/neo/shaders/builtin/post/SMAA_blending_weight_calc.ps.hlsl @@ -36,12 +36,12 @@ If you have questions concerning this license or the applicable additional terms #include "SMAA.inc.hlsl" // *INDENT-OFF* -Texture2D t_SmaaEdges : register( t0 ); -Texture2D t_SmaaArea : register( t1 ); -Texture2D t_SmaaSearch : register( t2 ); +Texture2D t_SmaaEdges : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_SmaaArea : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_SmaaSearch : register( t2 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState LinearSampler : register( s0 ); -SamplerState PointSampler : register( s1 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); +SamplerState PointSampler : register( s1 VK_DESCRIPTOR_SET( 2 ) ); struct PS_IN { diff --git a/neo/shaders/builtin/post/SMAA_edge_detection.ps.hlsl b/neo/shaders/builtin/post/SMAA_edge_detection.ps.hlsl index e93ab98b..984b5679 100644 --- a/neo/shaders/builtin/post/SMAA_edge_detection.ps.hlsl +++ b/neo/shaders/builtin/post/SMAA_edge_detection.ps.hlsl @@ -36,8 +36,9 @@ If you have questions concerning this license or the applicable additional terms #include "SMAA.inc.hlsl" // *INDENT-OFF* -Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_PredictColor : register( t1 VK_DESCRIPTOR_SET( 1 )); +Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_PredictColor : register( t1 VK_DESCRIPTOR_SET( 1 )); + SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // _currentColor SamplerState samp1 : register( s1 VK_DESCRIPTOR_SET( 2 ) ); // TODO _predictColor diff --git a/neo/shaders/builtin/post/SMAA_final.ps.hlsl b/neo/shaders/builtin/post/SMAA_final.ps.hlsl index 161c139f..00b8ddad 100644 --- a/neo/shaders/builtin/post/SMAA_final.ps.hlsl +++ b/neo/shaders/builtin/post/SMAA_final.ps.hlsl @@ -36,12 +36,12 @@ If you have questions concerning this license or the applicable additional terms #include "SMAA.inc.hlsl" // *INDENT-OFF* -Texture2D t_CurrentColor : register( t0 ); -Texture2D t_SmaaBlend : register( t1 ); -//Texture2D t_Velocity : register( t2 ); +Texture2D t_CurrentColor : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_SmaaBlend : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +//Texture2D t_Velocity : register( t2 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState LinearSampler : register( s0 ); -SamplerState PointSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); +SamplerState PointSampler : register( s1 VK_DESCRIPTOR_SET( 2 ) ); struct PS_IN { diff --git a/neo/shaders/builtin/post/fxaa.ps.hlsl b/neo/shaders/builtin/post/fxaa.ps.hlsl deleted file mode 100644 index 69db9b85..00000000 --- a/neo/shaders/builtin/post/fxaa.ps.hlsl +++ /dev/null @@ -1,114 +0,0 @@ -/* -=========================================================================== - -Doom 3 BFG Edition GPL Source Code -Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. - -This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). - -Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 BFG Edition Source Code. If not, see . - -In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "global_inc.hlsl" - -#define FXAA_GREEN_AS_LUMA 1 -#define FXAA_EARLY_EXIT 0 -#include "Fxaa3_11.h" - -// *INDENT-OFF* -uniform sampler2D samp0 : register(s0); -uniform sampler2D samp1 : register(s1); // exponent bias -1 -uniform sampler2D samp2 : register(s2); // exponent bias -2 - -uniform float4 rpUser0 : register( c128 ); -uniform float4 rpUser1 : register( c129 ); -uniform float4 rpUser2 : register( c130 ); -uniform float4 rpUser3 : register( c131 ); -uniform float4 rpUser4 : register( c132 ); -uniform float4 rpUser5 : register( c133 ); -uniform float4 rpUser6 : register( c134 ); - -struct PS_IN { - float4 position : VPOS; - float2 texcoord0 : TEXCOORD0_centroid; -}; - -struct PS_OUT { - float4 color : COLOR; -}; -// *INDENT-ON* - -void main( PS_IN fragment, out PS_OUT result ) -{ - - const float4 FXAAQualityRCPFrame = rpUser0; - const float4 FXAAConsoleRcpFrameOpt = rpUser1; - const float4 FXAAConsoleRcpFrameOpt2 = rpUser2; - const float4 FXAAConsole360RcpFrameOpt2 = rpUser3; - const float4 FXAAQualityParms = rpUser4; - const float4 FXAAConsoleEdgeParms = rpUser5; - const float4 FXAAConsole360ConstDir = rpUser6; - - // Inputs - see more info in fxaa3_11.hfile - FxaaFloat2 fxaaPos = fragment.texcoord0; - FxaaFloat4 fxaaConsolePos; - - float2 halfPixelOffset = float2( 0.5, 0.5 ) * FXAAQualityRCPFrame.xy; - fxaaConsolePos.xy = fxaaPos.xy - ( halfPixelOffset ); - fxaaConsolePos.zw = fxaaPos.xy + ( halfPixelOffset ); - FxaaFloat2 fxaaQualityRcpFrame = FXAAQualityRCPFrame.xy; - FxaaFloat4 fxaaConsoleRcpFrameOpt = FXAAConsoleRcpFrameOpt; - FxaaFloat4 fxaaConsoleRcpFrameOpt2 = FXAAConsoleRcpFrameOpt2; - FxaaFloat4 fxaaConsole360RcpFrameOpt2 = FXAAConsole360RcpFrameOpt2; - - // Quality parms - FxaaFloat fxaaQualitySubpix = FXAAQualityParms.x; - FxaaFloat fxaaQualityEdgeThreshold = FXAAQualityParms.y; - FxaaFloat fxaaQualityEdgeThresholdMin = FXAAQualityParms.z; - - // Console specific Parms - FxaaFloat fxaaConsoleEdgeSharpness = FXAAConsoleEdgeParms.x; - FxaaFloat fxaaConsoleEdgeThreshold = FXAAConsoleEdgeParms.y; - FxaaFloat fxaaConsoleEdgeThresholdMin = FXAAConsoleEdgeParms.z; - - // 360 specific parms these have to come from a constant register so that the compiler - // does not unoptimize the shader - FxaaFloat4 fxaaConsole360ConstDir = FXAAConsole360ConstDir; - - - float4 colorSample = FxaaPixelShader( fxaaPos, - fxaaConsolePos, - samp0, - samp1, - samp2, - fxaaQualityRcpFrame, - fxaaConsoleRcpFrameOpt, - fxaaConsoleRcpFrameOpt2, - fxaaConsole360RcpFrameOpt2, - fxaaQualitySubpix, - fxaaQualityEdgeThreshold, - fxaaQualityEdgeThresholdMin, - fxaaConsoleEdgeSharpness, - fxaaConsoleEdgeThreshold, - fxaaConsoleEdgeThresholdMin, - fxaaConsole360ConstDir ); - - result.color = colorSample; -} \ No newline at end of file diff --git a/neo/shaders/builtin/post/fxaa.vs.hlsl b/neo/shaders/builtin/post/fxaa.vs.hlsl deleted file mode 100644 index db959d3c..00000000 --- a/neo/shaders/builtin/post/fxaa.vs.hlsl +++ /dev/null @@ -1,53 +0,0 @@ -/* -=========================================================================== - -Doom 3 BFG Edition GPL Source Code -Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. - -This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). - -Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 BFG Edition Source Code. If not, see . - -In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "global_inc.hlsl" - - -// *INDENT-OFF* -struct VS_IN -{ - float4 position : POSITION; - float2 texcoord : TEXCOORD0; - float4 normal : NORMAL; - float4 tangent : TANGENT; - float4 color : COLOR0; - float4 color2 : COLOR1; -}; - -struct VS_OUT { - float4 position : POSITION; - float2 texcoord0 : TEXCOORD0; -}; -// *INDENT-ON* - -void main( VS_IN vertex, out VS_OUT result ) -{ - result.position = vertex.position; - result.texcoord0 = vertex.texcoord; -} \ No newline at end of file diff --git a/neo/shaders/builtin/post/hdr_glare_chromatic.ps.hlsl b/neo/shaders/builtin/post/hdr_glare_chromatic.ps.hlsl index 0b68e5a0..a18aca3b 100644 --- a/neo/shaders/builtin/post/hdr_glare_chromatic.ps.hlsl +++ b/neo/shaders/builtin/post/hdr_glare_chromatic.ps.hlsl @@ -31,8 +31,8 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_CurrentRender : register( t0 ); -SamplerState samp0 : register( s0 ); +Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) ); struct PS_IN { diff --git a/neo/shaders/builtin/post/motionBlur.ps.hlsl b/neo/shaders/builtin/post/motionBlur.ps.hlsl index f50cf154..8548161a 100644 --- a/neo/shaders/builtin/post/motionBlur.ps.hlsl +++ b/neo/shaders/builtin/post/motionBlur.ps.hlsl @@ -32,10 +32,10 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_ViewColor : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_ViewDepth : register( t1 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_ViewColor : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_ViewDepth : register( t1 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); struct PS_IN diff --git a/neo/shaders/builtin/post/postprocess.ps.hlsl b/neo/shaders/builtin/post/postprocess.ps.hlsl index af362e6e..8684da9f 100644 --- a/neo/shaders/builtin/post/postprocess.ps.hlsl +++ b/neo/shaders/builtin/post/postprocess.ps.hlsl @@ -3,7 +3,7 @@ Doom 3 BFG Edition GPL Source Code Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. -Copyright (C) 2015-2020 Robert Beckebans +Copyright (C) 2015-2022 Robert Beckebans Copyright (C) 2014 Timothy Lottes (AMD) Copyright (C) 2019 Justin Marshall (IcedTech) diff --git a/neo/shaders/builtin/post/screen.ps.hlsl b/neo/shaders/builtin/post/screen.ps.hlsl index 36dd4481..9da70a0c 100644 --- a/neo/shaders/builtin/post/screen.ps.hlsl +++ b/neo/shaders/builtin/post/screen.ps.hlsl @@ -31,8 +31,8 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_BaseColor : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_BaseColor : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) ); struct PS_IN { diff --git a/neo/shaders/builtin/post/tonemap.ps.hlsl b/neo/shaders/builtin/post/tonemap.ps.hlsl index 110d6e88..cb13131e 100644 --- a/neo/shaders/builtin/post/tonemap.ps.hlsl +++ b/neo/shaders/builtin/post/tonemap.ps.hlsl @@ -31,11 +31,11 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -Texture2D t_HeatMap : register( t1 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_HeatMap : register( t1 VK_DESCRIPTOR_SET( 1 ) ); -SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 1 ) ); // texture 0 is _currentRender -SamplerState samp1 : register( s1 VK_DESCRIPTOR_SET( 1 ) ); // texture 1 is heatmap +SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // texture 0 is _currentRender +SamplerState samp1 : register( s1 VK_DESCRIPTOR_SET( 2 ) ); // texture 1 is heatmap struct PS_IN { diff --git a/neo/shaders/builtin/texture_color_skinned.ps.hlsl b/neo/shaders/builtin/texture_color_skinned.ps.hlsl deleted file mode 100644 index c3103eee..00000000 --- a/neo/shaders/builtin/texture_color_skinned.ps.hlsl +++ /dev/null @@ -1,51 +0,0 @@ -/* -=========================================================================== - -Doom 3 BFG Edition GPL Source Code -Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. - -This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). - -Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 BFG Edition Source Code. If not, see . - -In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "renderprogs/global.inc.hlsl" - - -// *INDENT-OFF* -uniform sampler2D samp0 : register(s0); - -struct PS_IN { - float4 position : VPOS; - float2 texcoord0 : TEXCOORD0_centroid; - float4 color : COLOR0; -}; - -struct PS_OUT { - float4 color : COLOR; -}; -// *INDENT-ON* - -void main( PS_IN fragment, out PS_OUT result ) -{ - float4 color = tex2D( samp0, fragment.texcoord0 ) * fragment.color; - clip( color.a - rpAlphaTest.x ); - result.color = sRGBAToLinearRGBA( color ); -} \ No newline at end of file diff --git a/neo/shaders/builtin/texture_color_skinned.vs.hlsl b/neo/shaders/builtin/texture_color_skinned.vs.hlsl deleted file mode 100644 index 4bdadddc..00000000 --- a/neo/shaders/builtin/texture_color_skinned.vs.hlsl +++ /dev/null @@ -1,112 +0,0 @@ -/* -=========================================================================== - -Doom 3 BFG Edition GPL Source Code -Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. -Copyright (C) 2014 Robert Beckebans - -This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). - -Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Doom 3 BFG Edition Source Code. If not, see . - -In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. - -If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. - -=========================================================================== -*/ - -#include "renderprogs/global.inc.hlsl" - - -uniform matrices_ubo { float4 matrices[408]; }; - -// *INDENT-OFF* -struct VS_IN -{ - float4 position : POSITION; - float2 texcoord : TEXCOORD0; - float4 normal : NORMAL; - float4 tangent : TANGENT; - float4 color : COLOR0; - float4 color2 : COLOR1; -}; - -struct VS_OUT -{ - float4 position : POSITION; - float2 texcoord0 : TEXCOORD0; - float4 color : COLOR0; -}; -// *INDENT-ON* - -void main( VS_IN vertex, out VS_OUT result ) -{ - //-------------------------------------------------------------- - // GPU transformation of the normal / binormal / bitangent - // - // multiplying with 255.1 give us the same result and is faster than floor( w * 255 + 0.5 ) - //-------------------------------------------------------------- - const float w0 = vertex.color2.x; - const float w1 = vertex.color2.y; - const float w2 = vertex.color2.z; - const float w3 = vertex.color2.w; - - float4 matX, matY, matZ; // must be float4 for vec4 - int joint = int( vertex.color.x * 255.1 * 3.0 ); - matX = matrices[int( joint + 0 )] * w0; - matY = matrices[int( joint + 1 )] * w0; - matZ = matrices[int( joint + 2 )] * w0; - - joint = int( vertex.color.y * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w1; - matY += matrices[int( joint + 1 )] * w1; - matZ += matrices[int( joint + 2 )] * w1; - - joint = int( vertex.color.z * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w2; - matY += matrices[int( joint + 1 )] * w2; - matZ += matrices[int( joint + 2 )] * w2; - - joint = int( vertex.color.w * 255.1 * 3.0 ); - matX += matrices[int( joint + 0 )] * w3; - matY += matrices[int( joint + 1 )] * w3; - matZ += matrices[int( joint + 2 )] * w3; - - float4 modelPosition; - modelPosition.x = dot4( matX, vertex.position ); - modelPosition.y = dot4( matY, vertex.position ); - modelPosition.z = dot4( matZ, vertex.position ); - modelPosition.w = 1.0; - - result.position.x = dot4( modelPosition, rpMVPmatrixX ); - result.position.y = dot4( modelPosition, rpMVPmatrixY ); - result.position.z = dot4( modelPosition, rpMVPmatrixZ ); - result.position.w = dot4( modelPosition, rpMVPmatrixW ); - - // compute oldschool texgen or multiply by texture matrix - BRANCH if( rpTexGen0Enabled.x > 0.0 ) - { - result.texcoord0.x = dot4( modelPosition, rpTexGen0S ); - result.texcoord0.y = dot4( modelPosition, rpTexGen0T ); - } - else - { - result.texcoord0.x = dot4( vertex.texcoord.xy, rpTextureMatrixS ); - result.texcoord0.y = dot4( vertex.texcoord.xy, rpTextureMatrixT ); - } - - float4 vertexColor = ( swizzleColor( vertex.color ) * rpVertexColorModulate ) + rpVertexColorAdd; - result.color = vertexColor * rpColor; -} \ No newline at end of file diff --git a/neo/shaders/colorProcess.ps.hlsl b/neo/shaders/colorProcess.ps.hlsl index b7dbca28..fb3dcf43 100644 --- a/neo/shaders/colorProcess.ps.hlsl +++ b/neo/shaders/colorProcess.ps.hlsl @@ -32,15 +32,17 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float4 color : COLOR0; float3 texcoord0 : TEXCOORD0_centroid; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target; }; // *INDENT-ON* diff --git a/neo/shaders/enviroSuit.ps.hlsl b/neo/shaders/enviroSuit.ps.hlsl index e82bbc3c..8744e5a2 100644 --- a/neo/shaders/enviroSuit.ps.hlsl +++ b/neo/shaders/enviroSuit.ps.hlsl @@ -30,10 +30,10 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_NormalMap : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_NormalMap : register( t1 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 )); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); struct PS_IN { float4 position : SV_Position; diff --git a/neo/shaders/fogwithlights.ps.hlsl b/neo/shaders/fogwithlights.ps.hlsl index 0bd79010..62353853 100644 --- a/neo/shaders/fogwithlights.ps.hlsl +++ b/neo/shaders/fogwithlights.ps.hlsl @@ -31,10 +31,10 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 1 ) ); -Texture2D t_NormalMap : register( t1 VK_DESCRIPTOR_SET( 1 ) ); +Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_NormalMap : register( t1 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); struct PS_IN { float4 position : SV_Position; diff --git a/neo/shaders/heatHazeWithMask.ps.hlsl b/neo/shaders/heatHazeWithMask.ps.hlsl index 5f69263f..388c861e 100644 --- a/neo/shaders/heatHazeWithMask.ps.hlsl +++ b/neo/shaders/heatHazeWithMask.ps.hlsl @@ -30,20 +30,22 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_CurrentRender : register( t0 ); -Texture2D t_NormalMap : register( t1 ); -Texture2D t_Mask : register( t2 ); +Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_NormalMap : register( t1 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Mask : register( t2 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float4 texcoord0 : TEXCOORD0_centroid; float4 texcoord1 : TEXCOORD1_centroid; float4 texcoord2 : TEXCOORD2_centroid; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target; }; // *INDENT-ON* diff --git a/neo/shaders/heatHazeWithMaskAndVertex.ps.hlsl b/neo/shaders/heatHazeWithMaskAndVertex.ps.hlsl index 6a32505a..957f860f 100644 --- a/neo/shaders/heatHazeWithMaskAndVertex.ps.hlsl +++ b/neo/shaders/heatHazeWithMaskAndVertex.ps.hlsl @@ -30,13 +30,14 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_CurrentRender : register( t0 ); -Texture2D t_NormalMap : register( t1 ); -Texture2D t_Mask : register( t2 ); +Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_NormalMap : register( t1 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_Mask : register( t2 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float4 texcoord0 : TEXCOORD0_centroid; float4 texcoord1 : TEXCOORD1_centroid; @@ -44,7 +45,8 @@ struct PS_IN { float4 color : COLOR0; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target0; }; // *INDENT-ON* diff --git a/neo/shaders/heathaze.ps.hlsl b/neo/shaders/heathaze.ps.hlsl index a21cfe6f..6b93e921 100644 --- a/neo/shaders/heathaze.ps.hlsl +++ b/neo/shaders/heathaze.ps.hlsl @@ -31,10 +31,10 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_CurrentRender : register( t0 ); -Texture2D t_NormalMap : register( t1 ); +Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 0 ) ); +Texture2D t_NormalMap : register( t1 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); struct PS_IN { float4 position : SV_Position; diff --git a/neo/shaders/mattiascrt.ps.hlsl b/neo/shaders/mattiascrt.ps.hlsl index dc96f152..f2fd239d 100644 --- a/neo/shaders/mattiascrt.ps.hlsl +++ b/neo/shaders/mattiascrt.ps.hlsl @@ -32,17 +32,19 @@ If you have questions concerning this license or the applicable additional terms // *INDENT-OFF* -Texture2D t_CurrentRender : register( t0 ); +Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 0 ) ); -SamplerState LinearSampler : register( s0 ); +SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) ); -struct PS_IN { +struct PS_IN +{ float4 position : SV_Position; float4 texcoord0 : TEXCOORD0_centroid; float4 texcoord1 : TEXCOORD1_centroid; }; -struct PS_OUT { +struct PS_OUT +{ float4 color : SV_Target; }; // *INDENT-ON*