Merge branch 'RobertBeckebans:635-nvrhi2' into 635-nvrhi2

This commit is contained in:
HarrievG 2022-06-06 00:03:05 +02:00 committed by GitHub
commit e6caee4cae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 321 additions and 221 deletions

View file

@ -1,6 +0,0 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 15 Win64" -DWINDOWS10=OFF ../neo
pause

View file

@ -1,6 +0,0 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 15 Win64" -DWINDOWS10=ON ../neo
pause

View file

@ -1,6 +0,0 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 16" -A x64 ../neo
pause

View file

@ -2,5 +2,5 @@ cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 16" -A arm64 -D WINDOWS10=ON -D USE_INTRINSICS_SSE=OFF -D FFMPEG=OFF -D BINKDEC=ON ../neo
cmake -G "Visual Studio 16" -A arm64 -DUSE_INTRINSICS_SSE=OFF -DFFMPEG=OFF -DBINKDEC=ON ../neo
pause

View file

@ -1,6 +0,0 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 16" -A x64 -DWINDOWS10=ON -DUSE_VULKAN=ON -DSPIRV_SHADERC=OFF -DFFMPEG=ON ../neo
pause

View file

@ -0,0 +1,6 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 16" -A x64 -DFFMPEG=ON -DBINKDEC=OFF ../neo
pause

View file

@ -88,6 +88,9 @@ nvrhi::BindingSetHandle BindingCache::GetOrCreateBindingSet( const nvrhi::Bindin
void BindingCache::Clear()
{
// RB FIXME void StaticDescriptorHeap::releaseDescriptors(DescriptorIndex baseIndex, uint32_t count)
// will try to gain a conflicting mutex lock and cause an abort signal
mutex.Lock();
bindingSets.Clear();
bindingHash.Clear();

View file

@ -137,8 +137,8 @@ private:
#endif
#ifdef USE_BINKDEC
BinkHandle binkHandle;
cinData_t ImageForTimeBinkDec( int milliseconds );
bool InitFromBinkDecFile( const char* qpath, bool looping );
cinData_t ImageForTimeBinkDec( int milliseconds, nvrhi::ICommandList* commandList );
bool InitFromBinkDecFile( const char* qpath, bool looping, nvrhi::ICommandList* commandList );
void BinkDecReset();
YUVbuffer yuvBuffer;
@ -336,7 +336,7 @@ idCinematic::~idCinematic()
idCinematic::InitFromFile
==============
*/
bool idCinematic::InitFromFile( const char* qpath, bool looping )
bool idCinematic::InitFromFile( const char* qpath, bool looping, nvrhi::ICommandList* commandList )
{
return false; //Carl: this is just the abstract virtual method
}
@ -375,7 +375,7 @@ void idCinematic::ResetTime( int milliseconds )
idCinematic::ImageForTime
==============
*/
cinData_t idCinematic::ImageForTime( int milliseconds )
cinData_t idCinematic::ImageForTime( int milliseconds, nvrhi::ICommandList* commandList )
{
cinData_t c;
memset( &c, 0, sizeof( c ) );
@ -856,7 +856,7 @@ void idCinematicLocal::FFMPEGReset()
#endif
#ifdef USE_BINKDEC
bool idCinematicLocal::InitFromBinkDecFile( const char* qpath, bool amilooping )
bool idCinematicLocal::InitFromBinkDecFile( const char* qpath, bool amilooping, nvrhi::ICommandList* commandList )
{
looping = amilooping;
startTime = 0;
@ -925,7 +925,7 @@ bool idCinematicLocal::InitFromBinkDecFile( const char* qpath, bool amilooping )
status = FMV_PLAY;
hasFrame = false; // SRS - Implemented hasFrame for BinkDec behaviour consistency with FFMPEG
framePos = -1;
ImageForTime( 0 ); // SRS - Was missing initial call to ImageForTime() - fixes validation errors when using Vulkan renderer
ImageForTime( 0, commandList ); // SRS - Was missing initial call to ImageForTime() - fixes validation errors when using Vulkan renderer
status = ( looping ) ? FMV_PLAY : FMV_IDLE; // SRS - Update status based on looping flag
return true;
@ -1009,7 +1009,7 @@ bool idCinematicLocal::InitFromFile( const char* qpath, bool amilooping, nvrhi::
animationLength = 0;
fileName = temp;
//idLib::Warning( "New filename: '%s'\n", fileName.c_str() );
return InitFromBinkDecFile( fileName.c_str(), amilooping );
return InitFromBinkDecFile( fileName.c_str(), amilooping, commandList );
#else
animationLength = 0;
return false;
@ -1181,7 +1181,7 @@ cinData_t idCinematicLocal::ImageForTime( int thisTime, nvrhi::ICommandList* com
#elif defined(USE_BINKDEC) // DG: libbinkdec support
if( !isRoQ )
{
return ImageForTimeBinkDec( thisTime );
return ImageForTimeBinkDec( thisTime, commandList );
}
#endif
@ -1505,7 +1505,7 @@ cinData_t idCinematicLocal::ImageForTimeFFMPEG( int thisTime, nvrhi::ICommandLis
#ifdef USE_BINKDEC
cinData_t idCinematicLocal::ImageForTimeBinkDec( int thisTime )
cinData_t idCinematicLocal::ImageForTimeBinkDec( int thisTime, nvrhi::ICommandList* commandList )
{
cinData_t cinData;
int16_t* audioBuffer = NULL;
@ -1598,7 +1598,7 @@ cinData_t idCinematicLocal::ImageForTimeBinkDec( int thisTime )
double invAspRat = double( CIN_HEIGHT ) / double( CIN_WIDTH );
idImage* imgs[3] = {imgY, imgCb, imgCr}; // that's the order of the channels in yuvBuffer[]
idImage* imgs[ 3 ] = { imgY, imgCb, imgCr }; // that's the order of the channels in yuvBuffer[]
for( int i = 0; i < 3; ++i )
{
// Note: img->UploadScratch() seems to assume 32bit per pixel data, but this is 8bit/pixel
@ -1632,6 +1632,9 @@ cinData_t idCinematicLocal::ImageForTimeBinkDec( int thisTime )
#endif
}
#if defined( USE_NVRHI )
img->UploadScratch( yuvBuffer[i].data, w, h, commandList );
#else
if( img->GetUploadWidth() != w || img->GetUploadHeight() != h )
{
idImageOpts opts = img->GetOpts();
@ -1639,7 +1642,8 @@ cinData_t idCinematicLocal::ImageForTimeBinkDec( int thisTime )
opts.height = h;
img->AllocImage( opts, TF_LINEAR, TR_REPEAT );
}
img->SubImageUpload( 0, 0, 0, 0, w, h, yuvBuffer[i].data );
img->SubImageUpload( 0, 0, 0, 0, w, h, yuvBuffer[i].data, commandList );
#endif
}
hasFrame = true;

View file

@ -84,7 +84,7 @@ public:
virtual ~idCinematic();
// returns false if it failed to load
virtual bool InitFromFile( const char* qpath, bool looping );
virtual bool InitFromFile( const char* qpath, bool looping, nvrhi::ICommandList* commandList );
// returns the length of the animation in milliseconds
virtual int AnimationLength();
@ -94,7 +94,7 @@ public:
// RB end
// the pointers in cinData_t will remain valid until the next UpdateForTime() call
virtual cinData_t ImageForTime( int milliseconds );
virtual cinData_t ImageForTime( int milliseconds, nvrhi::ICommandList* commandList );
// closes the file and frees all allocated memory
virtual void Close();

View file

@ -256,7 +256,7 @@ public:
~idDeferredImage();
idStr name;
byte* pic;
byte* pic;
int width;
int height;
textureFilter_t textureFilter;

View file

@ -1194,7 +1194,6 @@ void idImage::UploadScratch( const byte* data, int cols, int rows, nvrhi::IComma
if( opts.textureType != TT_CUBIC || usage != TD_LOOKUP_TABLE_RGBA )
{
GenerateCubeImage( pic, cols, TF_LINEAR, TD_LOOKUP_TABLE_RGBA, commandList );
return;
}
@ -1243,12 +1242,16 @@ void idImage::UploadScratch( const byte* data, int cols, int rows, nvrhi::IComma
}
else
{
if( opts.textureType != TT_2D || usage != TD_LOOKUP_TABLE_RGBA )
#if defined( USE_NVRHI )
/*
if( opts.textureType != TT_2D )//|| usage != TD_LOOKUP_TABLE_RGBA )
{
GenerateImage( data, cols, rows, TF_LINEAR, TR_REPEAT, TD_LOOKUP_TABLE_RGBA, commandList );
return;
}
*/
if( opts.width != cols || opts.height != rows )
{
opts.width = cols;
@ -1257,30 +1260,48 @@ void idImage::UploadScratch( const byte* data, int cols, int rows, nvrhi::IComma
AllocImage();
}
#if defined( USE_NVRHI )
int numChannels = 4;
int bytesPerPixel = numChannels;
if( opts.format == FMT_ALPHA || opts.format == FMT_DXT1 || opts.format == FMT_INT8 || opts.format == FMT_R8 )
if( data != NULL && commandList != NULL )
{
bytesPerPixel = 1;
int numChannels = 4;
int bytesPerPixel = numChannels;
if( opts.format == FMT_ALPHA || opts.format == FMT_DXT1 || opts.format == FMT_INT8 || opts.format == FMT_R8 || opts.format == FMT_LUM8 )
{
bytesPerPixel = 1;
}
const nvrhi::FormatInfo& info = nvrhi::getFormatInfo( texture->getDesc().format );
bytesPerPixel = info.bytesPerBlock;
SetSamplerState( TF_LINEAR, TR_REPEAT );
int bufferW = opts.width;
if( IsCompressed() )
{
bufferW = ( opts.width + 3 ) & ~3;
}
commandList->beginTrackingTextureState( texture, nvrhi::AllSubresources, nvrhi::ResourceStates::Common );
commandList->writeTexture( texture, 0, 0, data, GetRowPitch( opts.format, opts.width ) );
//commandList->setPermanentTextureState( texture, nvrhi::ResourceStates::ShaderResource );
commandList->commitBarriers();
}
const nvrhi::FormatInfo& info = nvrhi::getFormatInfo( texture->getDesc().format );
bytesPerPixel = info.bytesPerBlock;
SetSamplerState( TF_LINEAR, TR_REPEAT );
int bufferW = opts.width;
if( IsCompressed() )
{
bufferW = ( opts.width + 3 ) & ~3;
}
commandList->beginTrackingTextureState( texture, nvrhi::AllSubresources, nvrhi::ResourceStates::Common );
commandList->writeTexture( texture, 0, 0, data, GetRowPitch( opts.format, opts.width ) );
commandList->setPermanentTextureState( texture, nvrhi::ResourceStates::ShaderResource );
commandList->commitBarriers();
#else
if( opts.textureType != TT_2D || usage != TD_LOOKUP_TABLE_RGBA )
{
GenerateImage( data, cols, rows, TF_LINEAR, TR_REPEAT, TD_LOOKUP_TABLE_RGBA, commandList );
return;
}
if( opts.width != cols || opts.height != rows )
{
opts.width = cols;
opts.height = rows;
AllocImage();
}
SetSamplerState( TF_LINEAR, TR_REPEAT );
SubImageUpload( 0, 0, 0, 0, opts.width, opts.height, data );
#endif

View file

@ -1765,7 +1765,7 @@ void idMaterial::ParseStage( idLexer& src, const textureRepeat_t trpDefault )
}
}
ts->cinematic = idCinematic::Alloc();
ts->cinematic->InitFromFile( token.c_str(), loop );
ts->cinematic->InitFromFile( token.c_str(), loop, NULL );
continue;
}
@ -1777,7 +1777,7 @@ void idMaterial::ParseStage( idLexer& src, const textureRepeat_t trpDefault )
continue;
}
ts->cinematic = new( TAG_MATERIAL ) idSndWindow();
ts->cinematic->InitFromFile( token.c_str(), true );
ts->cinematic->InitFromFile( token.c_str(), true, NULL );
continue;
}

View file

@ -423,7 +423,21 @@ void idRenderBackend::GetCurrentBindingLayout( int type )
nvrhi::BindingSetItem::ConstantBuffer( 0, renderProgManager.ConstantBuffer() ),
nvrhi::BindingSetItem::Texture_SRV( 0, ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 1, ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 2, ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 2, ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID() )
};
}
else
{
desc[0].bindings[0].resourceHandle = renderProgManager.ConstantBuffer();
desc[0].bindings[1].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID();
desc[0].bindings[2].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID();
desc[0].bindings[3].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID();
}
if( desc[1].bindings.empty() )
{
desc[1].bindings =
{
nvrhi::BindingSetItem::Texture_SRV( 3, ( nvrhi::ITexture* )GetImageAt( 3 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 4, ( nvrhi::ITexture* )GetImageAt( 4 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 7, ( nvrhi::ITexture* )GetImageAt( 7 )->GetTextureID() ),
@ -434,21 +448,17 @@ void idRenderBackend::GetCurrentBindingLayout( int type )
}
else
{
desc[0].bindings[0].resourceHandle = renderProgManager.ConstantBuffer();
desc[0].bindings[1].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID();
desc[0].bindings[2].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID();
desc[0].bindings[3].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID();
desc[0].bindings[4].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 3 )->GetTextureID();
desc[0].bindings[5].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 4 )->GetTextureID();
desc[0].bindings[6].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 7 )->GetTextureID();
desc[0].bindings[7].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 8 )->GetTextureID();
desc[0].bindings[8].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 9 )->GetTextureID();
desc[0].bindings[9].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 10 )->GetTextureID();
desc[1].bindings[0].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 3 )->GetTextureID();
desc[1].bindings[1].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 4 )->GetTextureID();
desc[1].bindings[2].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 7 )->GetTextureID();
desc[1].bindings[3].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 8 )->GetTextureID();
desc[1].bindings[4].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 9 )->GetTextureID();
desc[1].bindings[5].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 10 )->GetTextureID();
}
if( desc[1].bindings.empty() )
if( desc[2].bindings.empty() )
{
desc[1].bindings =
desc[2].bindings =
{
nvrhi::BindingSetItem::Sampler( 0, commonPasses.m_AnisotropicWrapSampler ),
nvrhi::BindingSetItem::Sampler( 1, commonPasses.m_LinearClampSampler )
@ -456,8 +466,8 @@ void idRenderBackend::GetCurrentBindingLayout( int type )
}
else
{
desc[1].bindings[0].resourceHandle = commonPasses.m_AnisotropicWrapSampler;
desc[1].bindings[1].resourceHandle = commonPasses.m_LinearClampSampler;
desc[2].bindings[0].resourceHandle = commonPasses.m_AnisotropicWrapSampler;
desc[2].bindings[1].resourceHandle = commonPasses.m_LinearClampSampler;
}
}
else if( type == BINDING_LAYOUT_DRAW_AO )
@ -515,9 +525,7 @@ void idRenderBackend::GetCurrentBindingLayout( int type )
nvrhi::BindingSetItem::ConstantBuffer( 0, renderProgManager.ConstantBuffer() ),
nvrhi::BindingSetItem::Texture_SRV( 0, ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 1, ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 2, ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 3, ( nvrhi::ITexture* )GetImageAt( 3 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 4, ( nvrhi::ITexture* )GetImageAt( 4 )->GetTextureID() )
nvrhi::BindingSetItem::Texture_SRV( 2, ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID() )
};
}
else
@ -526,13 +534,25 @@ void idRenderBackend::GetCurrentBindingLayout( int type )
desc[0].bindings[1].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID();
desc[0].bindings[2].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID();
desc[0].bindings[3].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID();
desc[0].bindings[4].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 3 )->GetTextureID();
desc[0].bindings[5].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 4 )->GetTextureID();
}
if( desc[1].bindings.empty() )
{
desc[1].bindings =
{
nvrhi::BindingSetItem::Texture_SRV( 3, ( nvrhi::ITexture* )GetImageAt( 3 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 4, ( nvrhi::ITexture* )GetImageAt( 4 )->GetTextureID() )
};
}
else
{
desc[1].bindings[0].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 3 )->GetTextureID();
desc[1].bindings[1].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 4 )->GetTextureID();
}
if( desc[2].bindings.empty() )
{
desc[2].bindings =
{
nvrhi::BindingSetItem::Sampler( 0, commonPasses.m_AnisotropicWrapSampler ),
nvrhi::BindingSetItem::Sampler( 1, commonPasses.m_LinearBorderSampler )
@ -540,8 +560,8 @@ void idRenderBackend::GetCurrentBindingLayout( int type )
}
else
{
desc[1].bindings[0].resourceHandle = commonPasses.m_AnisotropicWrapSampler;
desc[1].bindings[1].resourceHandle = commonPasses.m_LinearBorderSampler;
desc[2].bindings[0].resourceHandle = commonPasses.m_AnisotropicWrapSampler;
desc[2].bindings[1].resourceHandle = commonPasses.m_LinearBorderSampler;
}
}
else if( type == BINDING_LAYOUT_DRAW_INTERACTION_SM )
@ -553,7 +573,23 @@ void idRenderBackend::GetCurrentBindingLayout( int type )
nvrhi::BindingSetItem::ConstantBuffer( 0, renderProgManager.ConstantBuffer() ),
nvrhi::BindingSetItem::Texture_SRV( 0, ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 1, ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 2, ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 2, ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID() )
};
}
else
{
auto& bindings = desc[0].bindings;
bindings[0].resourceHandle = renderProgManager.ConstantBuffer();
bindings[1].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID();
bindings[2].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID();
bindings[3].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID();
}
if( desc[1].bindings.empty() )
{
auto& bindings = desc[1].bindings;
bindings =
{
nvrhi::BindingSetItem::Texture_SRV( 3, ( nvrhi::ITexture* )GetImageAt( 3 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 4, ( nvrhi::ITexture* )GetImageAt( 4 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 5, ( nvrhi::ITexture* )GetImageAt( 5 )->GetTextureID() ),
@ -562,19 +598,17 @@ void idRenderBackend::GetCurrentBindingLayout( int type )
}
else
{
desc[0].bindings[0].resourceHandle = renderProgManager.ConstantBuffer();
desc[0].bindings[1].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID();
desc[0].bindings[2].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID();
desc[0].bindings[3].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID();
desc[0].bindings[4].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 3 )->GetTextureID();
desc[0].bindings[5].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 4 )->GetTextureID();
desc[0].bindings[6].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 5 )->GetTextureID();
desc[0].bindings[7].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 6 )->GetTextureID();
auto& bindings = desc[1].bindings;
bindings[0].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 3 )->GetTextureID();
bindings[1].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 4 )->GetTextureID();
bindings[2].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 5 )->GetTextureID();
bindings[3].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 6 )->GetTextureID();
}
if( desc[1].bindings.empty() )
if( desc[2].bindings.empty() )
{
desc[1].bindings =
auto& bindings = desc[2].bindings;
bindings =
{
nvrhi::BindingSetItem::Sampler( 0, commonPasses.m_AnisotropicWrapSampler ),
nvrhi::BindingSetItem::Sampler( 1, commonPasses.m_LinearBorderSampler ),
@ -584,10 +618,11 @@ void idRenderBackend::GetCurrentBindingLayout( int type )
}
else
{
desc[1].bindings[0].resourceHandle = commonPasses.m_AnisotropicWrapSampler;
desc[1].bindings[1].resourceHandle = commonPasses.m_LinearBorderSampler;
desc[1].bindings[2].resourceHandle = commonPasses.m_LinearClampCompareSampler;
desc[1].bindings[3].resourceHandle = commonPasses.m_PointWrapSampler;
auto& bindings = desc[2].bindings;
bindings[0].resourceHandle = commonPasses.m_AnisotropicWrapSampler;
bindings[1].resourceHandle = commonPasses.m_LinearBorderSampler;
bindings[2].resourceHandle = commonPasses.m_LinearClampCompareSampler;
bindings[3].resourceHandle = commonPasses.m_PointWrapSampler;
}
}
else if( type == BINDING_LAYOUT_DRAW_FOG )
@ -746,6 +781,38 @@ void idRenderBackend::GetCurrentBindingLayout( int type )
desc[1].bindings[0].resourceHandle = commonPasses.m_LinearWrapSampler;
}
}
else if( type == BINDING_LAYOUT_BINK_VIDEO )
{
if( desc[0].bindings.empty() )
{
desc[0].bindings =
{
nvrhi::BindingSetItem::ConstantBuffer( 0, renderProgManager.ConstantBuffer() ),
nvrhi::BindingSetItem::Texture_SRV( 0, ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 1, ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID() ),
nvrhi::BindingSetItem::Texture_SRV( 2, ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID() )
};
}
else
{
desc[0].bindings[0].resourceHandle = renderProgManager.ConstantBuffer();
desc[0].bindings[1].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID();
desc[0].bindings[2].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID();
desc[0].bindings[3].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 2 )->GetTextureID();
}
if( desc[1].bindings.empty() )
{
desc[1].bindings =
{
nvrhi::BindingSetItem::Sampler( 0, commonPasses.m_LinearWrapSampler )
};
}
else
{
desc[1].bindings[0].resourceHandle = commonPasses.m_LinearWrapSampler;
}
}
else if( type == BINDING_LAYOUT_TAA_MOTION_VECTORS )
{
if( desc[0].bindings.empty() )

View file

@ -2256,7 +2256,7 @@ void idRenderBackend::DBG_TestImage()
// SRS - Don't need calibrated time for testing cinematics, so just call ImageForTime( 0 ) for current system time
// This simplification allows cinematic test playback to work over both 2D and 3D background scenes
cin = tr.testVideo->ImageForTime( 0 /*viewDef->renderView.time[1] - tr.testVideoStartTime*/ );
cin = tr.testVideo->ImageForTime( 0 /*viewDef->renderView.time[1] - tr.testVideoStartTime*/, commandList );
if( cin.imageY != NULL )
{
image = cin.imageY;

View file

@ -127,7 +127,7 @@ void idRenderProgManager::LoadShader( shader_t& shader )
}
else
{
common->FatalError( "Unsuported graphics api" );
common->FatalError( "Unsupported graphics api" );
}
ShaderBlob shaderBlob = GetBytecode( adjustedName );

View file

@ -284,7 +284,7 @@ void idRenderBackend::BindVariableStageImage( const textureStage_t* texture, con
// offset time by shaderParm[7] (FIXME: make the time offset a parameter of the shader?)
// We make no attempt to optimize for multiple identical cinematics being in view, or
// for cinematics going at a lower framerate than the renderer.
cin = texture->cinematic->ImageForTime( viewDef->renderView.time[0] + idMath::Ftoi( 1000.0f * viewDef->renderView.shaderParms[11] ) );
cin = texture->cinematic->ImageForTime( viewDef->renderView.time[0] + idMath::Ftoi( 1000.0f * viewDef->renderView.shaderParms[11] ), commandList );
if( cin.imageY != NULL )
{
GL_SelectTexture( 0 );
@ -7450,7 +7450,9 @@ void idRenderBackend::PostProcess( const void* data )
BlitParameters blitParms;
blitParms.sourceTexture = ( nvrhi::ITexture* )globalImages->ldrImage->GetTextureID();
blitParms.targetFramebuffer = globalFramebuffers.smaaBlendFBO->GetApiObject();
blitParms.targetViewport = nvrhi::Viewport( renderSystem->GetWidth(), renderSystem->GetHeight() );
// RB: add + 1 to dimensions so filtering works
blitParms.targetViewport = nvrhi::Viewport( renderSystem->GetWidth() + 1, renderSystem->GetHeight() + 1 );
commonPasses.BlitTexture( commandList, blitParms, &bindingCache );
GL_SelectTexture( 0 );

View file

@ -866,6 +866,7 @@ enum bindingLayoutType_t
BINDING_LAYOUT_POST_PROCESS_FINAL,
BINDING_LAYOUT_NORMAL_CUBE,
BINDING_LAYOUT_BLENDLIGHT,
BINDING_LAYOUT_BINK_VIDEO,
// NVRHI render passes specific
BINDING_LAYOUT_TAA_MOTION_VECTORS,

View file

@ -85,7 +85,7 @@ static void R_ReloadShaders( const idCmdArgs& args )
idRenderProgManager::Init()
================================================================================================
*/
void idRenderProgManager::Init( nvrhi::IDevice* _device )
void idRenderProgManager::Init( nvrhi::IDevice* device )
{
common->Printf( "----- Initializing Render Shaders -----\n" );
@ -95,7 +95,7 @@ void idRenderProgManager::Init( nvrhi::IDevice* _device )
}
#if defined( USE_NVRHI )
device = _device;
this->device = device;
uniforms.SetNum( RENDERPARM_TOTAL, vec4_zero );
uniformsChanged = false;
@ -106,7 +106,7 @@ void idRenderProgManager::Init( nvrhi::IDevice* _device )
c_MaxRenderPassConstantBufferVersions ) );
// === Main draw vertex layout ===
vertexLayoutDescs.SetNum( NUM_VERTEX_LAYOUTS, idList<nvrhi::VertexAttributeDesc>() );
vertexLayoutDescs.SetNum( NUM_VERTEX_LAYOUTS, {} );
vertexLayoutDescs[LAYOUT_DRAW_VERT].Append(
nvrhi::VertexAttributeDesc()
@ -192,12 +192,17 @@ void idRenderProgManager::Init( nvrhi::IDevice* _device )
bindingLayouts[BINDING_LAYOUT_CONSTANT_BUFFER_ONLY] = { device->createBindingLayout( constantBufferLayoutDesc ) };
auto defaultMaterialLayoutDesc = nvrhi::BindingLayoutDesc()
.setVisibility( nvrhi::ShaderType::All )
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) ) // normal
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) ) // specular
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 2 ) ); // base color
auto defaultMaterialLayout = device->createBindingLayout( defaultMaterialLayoutDesc );
auto ambientIblLayoutDesc = nvrhi::BindingLayoutDesc()
.setVisibility( nvrhi::ShaderType::All )
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) ) // normal
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) ) // specular
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 2 ) ) // base color
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 3 ) ) // brdf lut
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 4 ) ) // ssao
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 7 ) ) // irradiance cube map
@ -211,7 +216,10 @@ void idRenderProgManager::Init( nvrhi::IDevice* _device )
.addItem( nvrhi::BindingLayoutItem::Sampler( 1 ) ); // (Clamp) Linear sampler: brdf lut sampler & ssao sampler
auto samplerTwoBindingLayout = device->createBindingLayout( samplerTwoBindingLayoutDesc );
bindingLayouts[BINDING_LAYOUT_AMBIENT_LIGHTING_IBL] = { device->createBindingLayout( ambientIblLayoutDesc ), samplerTwoBindingLayout };
bindingLayouts[ BINDING_LAYOUT_AMBIENT_LIGHTING_IBL ] =
{
defaultMaterialLayout, device->createBindingLayout( ambientIblLayoutDesc ), samplerTwoBindingLayout
};
auto blitLayoutDesc = nvrhi::BindingLayoutDesc()
.setVisibility( nvrhi::ShaderType::All )
@ -245,21 +253,13 @@ void idRenderProgManager::Init( nvrhi::IDevice* _device )
auto interactionBindingLayout = nvrhi::BindingLayoutDesc()
.setVisibility( nvrhi::ShaderType::All )
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) ) // normal
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) ) // specular
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 2 ) ) // base color
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 3 ) ) // light falloff
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 4 ) ); // light projection
bindingLayouts[BINDING_LAYOUT_DRAW_INTERACTION] = { device->createBindingLayout( interactionBindingLayout ), samplerTwoBindingLayout };
bindingLayouts[BINDING_LAYOUT_DRAW_INTERACTION] = { defaultMaterialLayout, device->createBindingLayout( interactionBindingLayout ), samplerTwoBindingLayout };
auto interactionSmBindingLayout = nvrhi::BindingLayoutDesc()
.setVisibility( nvrhi::ShaderType::All )
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) ) // normal
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) ) // specular
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 2 ) ) // base color
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 3 ) ) // light falloff
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 4 ) ) // light projection
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 5 ) ) // shadow map array
@ -273,7 +273,7 @@ void idRenderProgManager::Init( nvrhi::IDevice* _device )
.addItem( nvrhi::BindingLayoutItem::Sampler( 3 ) ); // blue noise for shadow jitter
auto samplerFourBindingLayout = device->createBindingLayout( samplerFourBindingLayoutDesc );
bindingLayouts[BINDING_LAYOUT_DRAW_INTERACTION_SM] = { device->createBindingLayout( interactionSmBindingLayout ), samplerFourBindingLayout };
bindingLayouts[BINDING_LAYOUT_DRAW_INTERACTION_SM] = { defaultMaterialLayout, device->createBindingLayout( interactionSmBindingLayout ), samplerFourBindingLayout };
auto fogBindingLayout = nvrhi::BindingLayoutDesc()
.setVisibility( nvrhi::ShaderType::All )
@ -316,6 +316,15 @@ void idRenderProgManager::Init( nvrhi::IDevice* _device )
bindingLayouts[BINDING_LAYOUT_NORMAL_CUBE] = { device->createBindingLayout( normalCubeBindingLayout ), samplerOneBindingLayout };
auto binkVideoBindingLayout = nvrhi::BindingLayoutDesc()
.setVisibility( nvrhi::ShaderType::All )
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) ) // cube map
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) ) // cube map
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 2 ) ); // normal map
bindingLayouts[BINDING_LAYOUT_BINK_VIDEO] = { device->createBindingLayout( binkVideoBindingLayout ), samplerOneBindingLayout };
auto motionVectorsBindingLayout = nvrhi::BindingLayoutDesc()
.setVisibility( nvrhi::ShaderType::All )
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
@ -505,9 +514,9 @@ void idRenderProgManager::Init( nvrhi::IDevice* _device )
// RB end
{ BUILTIN_STEREO_DEGHOST, "builtin/VR/stereoDeGhost", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
{ BUILTIN_STEREO_WARP, "builtin/VR/stereoWarp", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
{ BUILTIN_BINK, "builtin/video/bink", "", { {"USE_SRGB", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
{ BUILTIN_BINK_SRGB, "builtin/video/bink", "_srgb", { {"USE_SRGB", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
{ BUILTIN_BINK_GUI, "builtin/video/bink_gui", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
{ BUILTIN_BINK, "builtin/video/bink", "", { {"USE_SRGB", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_BINK_VIDEO },
{ BUILTIN_BINK_SRGB, "builtin/video/bink", "_srgb", { {"USE_SRGB", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_BINK_VIDEO },
{ BUILTIN_BINK_GUI, "builtin/video/bink_gui", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_BINK_VIDEO },
{ BUILTIN_STEREO_INTERLACE, "builtin/VR/stereoInterlace", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
{ BUILTIN_MOTION_BLUR, "builtin/post/motionBlur", "", { { "VECTORS_ONLY", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },

View file

@ -432,7 +432,7 @@ public:
idRenderProgManager();
virtual ~idRenderProgManager();
void Init( nvrhi::IDevice* _device );
void Init( nvrhi::IDevice* device );
void Shutdown();
void StartFrame();

View file

@ -700,10 +700,12 @@ void R_TestVideo_f( const idCmdArgs& args )
tr.testImage = globalImages->ImageFromFile( "_scratch", TF_DEFAULT, TR_REPEAT, TD_DEFAULT );
tr.testVideo = idCinematic::Alloc();
tr.testVideo->InitFromFile( args.Argv( 1 ), true );
tr.testVideo->InitFromFile( args.Argv( 1 ), true, NULL );
cinData_t cin;
cin = tr.testVideo->ImageForTime( 0 );
// FIXME commandList
cin = tr.testVideo->ImageForTime( 0, NULL );
// SRS - Also handle ffmpeg and original RoQ decoders for test videos (using cin.image)
if( cin.imageY == NULL && cin.image == NULL )
{
@ -2234,6 +2236,9 @@ idRenderSystemLocal::BeginLevelLoad
*/
void idRenderSystemLocal::BeginLevelLoad()
{
// clear binding sets for previous level images and light data #676
backend.ClearCaches();
globalImages->BeginLevelLoad();
renderModelManager->BeginLevelLoad();

View file

@ -31,10 +31,10 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
TextureCube t_CubeMap : register(t0);
Texture2D t_NormalMap : register(t1);
TextureCube t_CubeMap : register(t0 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_NormalMap : register(t1 VK_DESCRIPTOR_SET( 1 ) );
SamplerState samp0 : register(s0); // texture 0 is the cube map
SamplerState samp0 : register(s0 VK_DESCRIPTOR_SET( 2 ) ); // texture 0 is the cube map
struct PS_IN {
float4 position : SV_Position;

View file

@ -28,15 +28,13 @@ If you have questions concerning this license or the applicable additional terms
#include "global_inc.hlsl"
// *INDENT-OFF*
#if USE_GPU_SKINNING
cbuffer CB :
register( b1 )
{
cbuffer CB : register( b1 VK_DESCRIPTOR_SET( 0 )) {
float4 matrices[408];
};
#endif
// *INDENT-OFF*
struct VS_IN {
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
@ -178,4 +176,4 @@ void main( VS_IN vertex, out VS_OUT result )
#endif
result.color = rpColor;
}
}

View file

@ -30,8 +30,8 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
TextureCube t_CubeMap : register( t0 );
SamplerState samp0 : register( s0 ); // texture 0 is the cube map
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 {
float4 position : SV_Position;

View file

@ -35,16 +35,16 @@ If you have questions concerning this license or the applicable additional terms
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_BrdfLut : register( t3 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_Ssao : register( t4 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_IrradianceCubeMap : register( t7 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_RadianceCubeMap1 : register( t8 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_RadianceCubeMap2 : register( t9 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_RadianceCubeMap3 : register( t10 VK_DESCRIPTOR_SET( 0 ) );
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 ) );
SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 1 ) ); // (Wrap) Anisotropic sampler: normal sampler & specular sampler
SamplerState s_LinearClamp : register( s1 VK_DESCRIPTOR_SET( 1 ) ); // (Clamp) Linear sampler: brdf lut sampler & ssao sampler
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.
struct PS_IN

View file

@ -36,17 +36,17 @@ If you have questions concerning this license or the applicable additional terms
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_BrdfLut : register( t3 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_Ssao : register( t4 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_IrradianceCubeMap : register( t7 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_RadianceCubeMap1 : register( t8 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_RadianceCubeMap2 : register( t9 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_RadianceCubeMap3 : register( t10 VK_DESCRIPTOR_SET( 0 ) );
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 ) );
SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 1 ) ); // (Wrap) Anisotropic sampler: normal sampler & specular sampler
SamplerState s_LinearClamp : register( s1 VK_DESCRIPTOR_SET( 1 ) ); // (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( 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.
struct PS_IN
{

View file

@ -35,23 +35,24 @@ If you have questions concerning this license or the applicable additional terms
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_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 0 ) );
SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 1 ) ); // for the normal/specular/basecolor
SamplerState s_Lighting : register( s1 VK_DESCRIPTOR_SET( 1 ) ); // for sampling the jitter
Texture2D t_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 1 ) );
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
struct PS_IN
{
float4 position : SV_Position;
float4 texcoord0 : TEXCOORD0_centroid;
float4 texcoord1 : TEXCOORD1_centroid;
float4 texcoord2 : TEXCOORD2_centroid;
float4 texcoord3 : TEXCOORD3_centroid;
float4 texcoord4 : TEXCOORD4_centroid;
float4 texcoord5 : TEXCOORD5_centroid;
float4 texcoord6 : TEXCOORD6_centroid;
float4 color : COLOR0;
float4 texcoord0 : TEXCOORD0_centroid;
float4 texcoord1 : TEXCOORD1_centroid;
float4 texcoord2 : TEXCOORD2_centroid;
float4 texcoord3 : TEXCOORD3_centroid;
float4 texcoord4 : TEXCOORD4_centroid;
float4 texcoord5 : TEXCOORD5_centroid;
float4 texcoord6 : TEXCOORD6_centroid;
float4 color : COLOR0;
};
struct PS_OUT

View file

@ -34,11 +34,12 @@ If you have questions concerning this license or the applicable additional terms
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_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 0 ) );
SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 1 ) ); // for the normal/specular/basecolor
SamplerState s_Lighting : register( s1 VK_DESCRIPTOR_SET( 1 ) ); // for sampling the jitter
Texture2D t_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 1 ) );
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
struct PS_IN
{

View file

@ -36,19 +36,20 @@ If you have questions concerning this license or the applicable additional terms
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_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 0 ) );
Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 0 ) );
#if USE_SHADOW_ATLAS
Texture2D t_ShadowAtlas : register( t5 VK_DESCRIPTOR_SET( 0 ) );
#else
Texture2DArray<float> t_ShadowMapArray : register( t5 VK_DESCRIPTOR_SET( 0 ) );
#endif
Texture2D t_Jitter : register( t6 VK_DESCRIPTOR_SET( 0 ) );
SamplerState s_Material : register( s0 VK_DESCRIPTOR_SET( 1 ) ); // for the normal/specular/basecolor
SamplerState s_Lighting : register( s1 VK_DESCRIPTOR_SET( 1 ) ); // for sampling the jitter
SamplerComparisonState s_Shadow : register( s2 VK_DESCRIPTOR_SET( 1 ) ); // for the depth shadow map sampler with a compare function
SamplerState s_Jitter : register( s3 VK_DESCRIPTOR_SET( 1 ) ); // for sampling the jitter
Texture2D t_LightFalloff : register( t3 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_LightProjection : register( t4 VK_DESCRIPTOR_SET( 1 ) );
#if USE_SHADOW_ATLAS
Texture2D t_ShadowAtlas : register( t5 VK_DESCRIPTOR_SET( 1 ) );
#else
Texture2DArray<float> t_ShadowMapArray : register( t5 VK_DESCRIPTOR_SET( 1 ) );
#endif
Texture2D t_Jitter : register( t6 VK_DESCRIPTOR_SET( 1 ) );
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
struct PS_IN
{

View file

@ -29,16 +29,15 @@ If you have questions concerning this license or the applicable additional terms
#include "global_inc.hlsl"
// *INDENT-OFF*
#if USE_GPU_SKINNING
cbuffer CB :
register( b1 )
cbuffer CB : register( b1 )
{
float4 matrices[408];
};
#endif
// *INDENT-OFF*
struct VS_IN {
float4 position : POSITION;
float2 texcoord : TEXCOORD0;

View file

@ -36,10 +36,10 @@ If you have questions concerning this license or the applicable additional terms
#include "SMAA.inc.hlsl"
// *INDENT-OFF*
Texture2D t_CurrentRender : register( t0 );
Texture2D t_PredictColor : register( t1 );
SamplerState samp0 : register( s0 ); // _currentColor
SamplerState samp1 : register( s1 ); // TODO _predictColor
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
struct PS_IN
{

View file

@ -22,6 +22,8 @@
#pragma pack_matrix(row_major)
#include "vulkan.hlsli"
struct ToneMappingConstants
{
uint2 viewOrigin;

View file

@ -30,8 +30,8 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
Texture2D tex : register( t0 );
SamplerState samp0 : register( s0 );
Texture2D tex : register( t0 VK_DESCRIPTOR_SET( 1 ) );
SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) );
struct PS_IN {
float4 position : SV_Position0;

View file

@ -30,8 +30,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 s_Sampler : register( s0 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_BaseColor : register( t0 VK_DESCRIPTOR_SET( 1 ) );
SamplerState s_Sampler : register( s0 VK_DESCRIPTOR_SET( 2 ) );
struct PS_IN {
float4 position : SV_POSITION;
@ -49,4 +49,4 @@ void main( in PS_IN fragment, out PS_OUT result )
float4 color = t_BaseColor.Sample( s_Sampler, fragment.texcoord0 ) * fragment.color;
clip( color.a - rpAlphaTest.x );
result.color = sRGBAToLinearRGBA( color );
}
}

View file

@ -46,7 +46,7 @@ struct VS_IN {
};
struct VS_OUT {
float4 position : SV_POSITION;
float4 position : SV_Position;
float2 texcoord0 : TEXCOORD0_centroid;
float4 color : COLOR0;
};
@ -130,4 +130,4 @@ void main( VS_IN vertex, out VS_OUT result )
float4 vertexColor = ( swizzleColor( vertex.color ) * rpVertexColorModulate ) + rpVertexColorAdd;
result.color = vertexColor * rpColor;
}
}

View file

@ -29,11 +29,11 @@ If you have questions concerning this license or the applicable additional terms
#include "global_inc.hlsl"
// *INDENT-OFF*
Texture2D t_Texture : register( t0 );
SamplerState samp0 : register( s0 );
Texture2D t_Texture : register( t0 VK_DESCRIPTOR_SET( 1 ) );
SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) );
struct PS_IN {
float4 position : VPOS;
float4 position : SV_Position;
float4 texcoord0 : TEXCOORD0_centroid;
float4 color : COLOR0;
};

View file

@ -38,7 +38,7 @@ SamplerState LinearSampler : register( s0 );
struct PS_IN {
float4 position : VPOS;
float4 position : SV_Position;
float2 texcoord0 : TEXCOORD0_centroid;
};

View file

@ -39,8 +39,8 @@ struct VS_IN {
};
struct VS_OUT {
float4 position : POSITION;
float2 texcoord0 : TEXCOORD0;
float4 position : SV_Position;
float2 texcoord0 : TEXCOORD0_centroid;
};
// *INDENT-ON*

View file

@ -37,7 +37,7 @@ Texture2D t_Cb : register( t2 );
SamplerState LinearSampler : register( s0 );
struct PS_IN {
float4 position : VPOS;
float4 position : SV_Position;
float2 texcoord0 : TEXCOORD0_centroid;
float4 texcoord1 : TEXCOORD1_centroid;
float4 color : COLOR0;

View file

@ -41,9 +41,9 @@ struct VS_IN {
};
struct VS_OUT {
float4 position : POSITION;
float2 texcoord0 : TEXCOORD0;
float4 texcoord1 : TEXCOORD1;
float4 position : SV_Position;
float2 texcoord0 : TEXCOORD0_centroid;
float4 texcoord1 : TEXCOORD1_centroid;
float4 color : COLOR0;
};
// *INDENT-ON*

View file

@ -30,9 +30,9 @@ 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 {
float4 position : SV_Position;

View file

@ -30,10 +30,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( 1 ) );
Texture2D t_NormalMap : register( t1 VK_DESCRIPTOR_SET( 1 ) );
SamplerState LinearSampler : register( s0 );
SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ));
struct PS_IN {
float4 position : SV_Position;
@ -60,4 +60,4 @@ void main( PS_IN fragment, out PS_OUT result )
// load the screen render
result.color = t_CurrentRender.Sample( LinearSampler, screenTexCoord );
}
}

View file

@ -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( 1 ) );
Texture2D t_NormalMap : register( t1 VK_DESCRIPTOR_SET( 1 ) );
SamplerState LinearSampler : register( s0 );
SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) );
struct PS_IN {
float4 position : SV_Position;

View file

@ -495,7 +495,8 @@ float3 Hash33( float3 p3 )
return frac( ( p3.xxy + p3.yxx ) * p3.zyx );
}
static float3 ditherRGB( float3 color, float2 uvSeed, float quantSteps )
/*
static float3 DitherRGB( float3 color, float2 uvSeed, float quantSteps )
{
// uniform noise
//float3 noise = Hash33( float3( uvSeed, rpJitterTexOffset.w ) );
@ -529,8 +530,10 @@ static float3 ditherRGB( float3 color, float2 uvSeed, float quantSteps )
return color;
}
*/
static float3 ditherChromaticBlueNoise( float3 color, float2 n, SamplerState blueTex )
/*
static float3 DitherChromaticBlueNoise( float3 color, float2 n, SamplerState blueTex )
{
// uniform noise
//float3 noise = Hash33( float3( n, rpJitterTexOffset.w ) );
@ -563,5 +566,6 @@ static float3 ditherChromaticBlueNoise( float3 color, float2 n, SamplerState blu
return color;
}
*/
#define SMAA_RT_METRICS float4(1.0 / 1280.0, 1.0 / 720.0, 1280.0, 720.0)

View file

@ -1,7 +1,7 @@
REM 7z a RBDOOM-3-BFG-1.3.1.1-lite-win64-20220109-git-xxxxxxx.7z -r base/env/ base/maps/*.lightgrid base/maps/*_extra_ents.map -x!generated
set filename=RBDOOM-3-BFG-1.5.0.1-lite-win64-20220529-git-xxxxxxx.7z
7z a %filename% README.md RELEASE-NOTES.md base/devtools.cfg base/modelviewer.cfg base/extract_resources.cfg base/convert_maps_to_valve220.cfg base/def/*.def base/materials/*.mtr base/textures/common base/textures/editor base/maps/zoomaps -x!generated -xr!autosave -xr!*.xcf -xr!*.blend
7z a %filename% README.md RELEASE-NOTES.md base/renderprogs2/dxil/*.bin
7z a %filename% README.md RELEASE-NOTES.md -r base/renderprogs2/dxil/*.bin
7z a %filename% README.md RELEASE-NOTES.md base/_tb/fgd/*.fgd
7z a %filename% README.md RELEASE-NOTES.md tools/trenchbroom -xr!TrenchBroom-nomanual* -xr!TrenchBroom.pdb
pause