mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 22:50:45 +00:00
Merge branch '635-nvrhi2' into 679-gltf-map-support-nvrhi
This commit is contained in:
commit
f195a7670e
55 changed files with 1238 additions and 670 deletions
|
@ -1129,6 +1129,7 @@ set(WIN32_RESOURCES
|
|||
# sys/win32/rc/res/dbg_open.bmp
|
||||
# sys/win32/rc/res/dbg_toolbar.bmp
|
||||
sys/win32/rc/res/doom.ico
|
||||
sys/win32/rc/doom.rc
|
||||
# sys/win32/rc/res/fpoint.cur
|
||||
# sys/win32/rc/res/fxed_link.ico
|
||||
# sys/win32/rc/res/fxed_toolbar.bmp
|
||||
|
|
|
@ -242,6 +242,9 @@ void idCommonLocal::VPrintf( const char* fmt, va_list args )
|
|||
time( &aclock );
|
||||
struct tm* newtime = localtime( &aclock );
|
||||
Printf( "log file '%s' opened on %s\n", fileName, asctime( newtime ) );
|
||||
|
||||
// print engine version
|
||||
Printf( "%s\n", com_version.GetString() );
|
||||
}
|
||||
if( logFile )
|
||||
{
|
||||
|
|
|
@ -92,6 +92,10 @@ void BindingCache::Clear()
|
|||
// will try to gain a conflicting mutex lock and cause an abort signal
|
||||
|
||||
mutex.Lock();
|
||||
for( int i = 0; i < bindingSets.Num(); i++ )
|
||||
{
|
||||
bindingSets[i].Reset();
|
||||
}
|
||||
bindingSets.Clear();
|
||||
bindingHash.Clear();
|
||||
mutex.Unlock();
|
||||
|
|
|
@ -60,7 +60,8 @@ public:
|
|||
static void Shutdown();
|
||||
static void CheckFramebuffers();
|
||||
static Framebuffer* Find( const char* name );
|
||||
static void ResizeFramebuffers();
|
||||
static void ResizeFramebuffers( bool reloadImages = true );
|
||||
static void ReloadImages();
|
||||
|
||||
void Bind();
|
||||
bool IsBound();
|
||||
|
|
|
@ -477,7 +477,7 @@ void R_SetupProjectionMatrix( viewDef_t* viewDef, bool doJitter )
|
|||
// for motion blurred anti-aliasing
|
||||
float jitterx, jittery;
|
||||
|
||||
if( R_UseTemporalAA() && doJitter )
|
||||
if( R_UseTemporalAA() && doJitter && !( viewDef->renderView.rdflags & RDF_IRRADIANCE ) )
|
||||
{
|
||||
idVec2 jitter = tr.backend.GetCurrentPixelOffset();
|
||||
jitterx = jitter.x;
|
||||
|
|
|
@ -87,7 +87,7 @@ void idGuiModel::ReadFromDemo( idDemoFile* demo )
|
|||
idGuiModel::BeginFrame
|
||||
================
|
||||
*/
|
||||
void idGuiModel::BeginFrame( nvrhi::ICommandList* commandList )
|
||||
void idGuiModel::BeginFrame()
|
||||
{
|
||||
vertexBlock = vertexCache.AllocVertex( NULL, MAX_VERTS );
|
||||
indexBlock = vertexCache.AllocIndex( NULL, MAX_INDEXES );
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
void ReadFromDemo( idDemoFile* demo );
|
||||
|
||||
// allocates memory for verts and indexes in frame-temporary buffer memory
|
||||
void BeginFrame( nvrhi::ICommandList* commandList );
|
||||
void BeginFrame();
|
||||
|
||||
void EmitToCurrentView( float modelMatrix[16], bool depthHack );
|
||||
void EmitFullScreen( textureStage_t* textureStage = nullptr );
|
||||
|
|
|
@ -73,11 +73,13 @@ void R_ReloadImages_f( const idCmdArgs& args )
|
|||
}
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
nvrhi::CommandListHandle commandList = deviceManager->GetDevice()->createCommandList();
|
||||
commandList->open();
|
||||
globalImages->ReloadImages( all, commandList );
|
||||
commandList->close();
|
||||
deviceManager->GetDevice()->executeCommandList( commandList );
|
||||
tr.commandList->open();
|
||||
globalImages->ReloadImages( all, tr.commandList );
|
||||
tr.commandList->close();
|
||||
deviceManager->GetDevice()->executeCommandList( tr.commandList );
|
||||
|
||||
// Images (including the framebuffer images) were reloaded, reinitialize the framebuffers.
|
||||
Framebuffer::ResizeFramebuffers();
|
||||
#else
|
||||
globalImages->ReloadImages( all );
|
||||
#endif
|
||||
|
@ -656,6 +658,8 @@ void idImageManager::ReloadImages( bool all, nvrhi::ICommandList* commandList )
|
|||
{
|
||||
images[ i ]->Reload( all, commandList );
|
||||
}
|
||||
|
||||
LoadDeferredImages( commandList );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -324,7 +324,7 @@ static void R_SMAAImage_ResNative( idImage* image, nvrhi::ICommandList* commandL
|
|||
|
||||
static void R_AmbientOcclusionImage_ResNative( idImage* image, nvrhi::ICommandList* commandList )
|
||||
{
|
||||
image->GenerateImage( NULL, renderSystem->GetWidth(), renderSystem->GetHeight(), TF_LINEAR, TR_CLAMP, TD_R8F, nullptr, true );
|
||||
image->GenerateImage( NULL, renderSystem->GetWidth(), renderSystem->GetHeight(), TF_LINEAR, TR_CLAMP, TD_R8F, nullptr, true, true );
|
||||
}
|
||||
|
||||
static void R_GeometryBufferImage_ResNative( idImage* image, nvrhi::ICommandList* commandList )
|
||||
|
@ -341,7 +341,7 @@ static void R_SSAOImage_ResHalf( idImage* image, nvrhi::ICommandList* commandLis
|
|||
|
||||
static void R_HierarchicalZBufferImage_ResNative( idImage* image, nvrhi::ICommandList* commandList )
|
||||
{
|
||||
image->GenerateImage( NULL, renderSystem->GetWidth(), renderSystem->GetHeight(), TF_NEAREST_MIPMAP, TR_CLAMP, TD_R32F, nullptr, true );
|
||||
image->GenerateImage( NULL, renderSystem->GetWidth(), renderSystem->GetHeight(), TF_NEAREST_MIPMAP, TR_CLAMP, TD_R32F, nullptr, true, true );
|
||||
}
|
||||
|
||||
static void R_R8Image_ResNative_Linear( idImage* image, nvrhi::ICommandList* commandList )
|
||||
|
|
|
@ -99,21 +99,6 @@ int BitsForFormat( textureFormat_t format )
|
|||
}
|
||||
}
|
||||
|
||||
int BytesPerBlockForFormat( const textureFormat_t& format )
|
||||
{
|
||||
switch( format )
|
||||
{
|
||||
case FMT_NONE:
|
||||
return 0;
|
||||
case FMT_DXT1:
|
||||
return 8;
|
||||
case FMT_DXT5:
|
||||
return 16;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int BlockSizeForFormat( const textureFormat_t& format )
|
||||
{
|
||||
switch( format )
|
||||
|
|
|
@ -40,12 +40,12 @@ extern DeviceManager* deviceManager;
|
|||
|
||||
namespace
|
||||
{
|
||||
const int c_drawVertsCapacity = ( 20000 * 4 );
|
||||
//const int c_drawIndexesCapacity = ( 20000 * 6 );
|
||||
const int c_drawVertsCapacity = ( 40000 * 4 );
|
||||
const int c_drawIndexesCapacity = ( c_drawVertsCapacity * 2 );
|
||||
|
||||
idDrawVert drawVerts[c_drawVertsCapacity];
|
||||
triIndex_t lineIndices[c_drawVertsCapacity * 2];
|
||||
triIndex_t sphereIndices[c_drawVertsCapacity * 2];
|
||||
triIndex_t lineIndices[c_drawIndexesCapacity];
|
||||
triIndex_t sphereIndices[c_drawIndexesCapacity];
|
||||
|
||||
bool active = false;
|
||||
}
|
||||
|
@ -53,7 +53,10 @@ bool active = false;
|
|||
int fhImmediateMode::drawCallCount = 0;
|
||||
int fhImmediateMode::drawCallVertexSize = 0;
|
||||
|
||||
void fhImmediateMode::Init()
|
||||
idVertexBuffer fhImmediateMode::vertexBuffer;
|
||||
idIndexBuffer fhImmediateMode::indexBuffer;
|
||||
|
||||
void fhImmediateMode::Init( nvrhi::ICommandList* commandList )
|
||||
{
|
||||
for( int i = 0; i < c_drawVertsCapacity * 2; ++i )
|
||||
{
|
||||
|
@ -61,6 +64,7 @@ void fhImmediateMode::Init()
|
|||
}
|
||||
|
||||
ResetStats();
|
||||
InitBuffers( commandList );
|
||||
}
|
||||
|
||||
void fhImmediateMode::ResetStats()
|
||||
|
@ -68,6 +72,7 @@ void fhImmediateMode::ResetStats()
|
|||
drawCallCount = 0;
|
||||
drawCallVertexSize = 0;
|
||||
}
|
||||
|
||||
int fhImmediateMode::DrawCallCount()
|
||||
{
|
||||
return drawCallCount;
|
||||
|
@ -78,6 +83,14 @@ int fhImmediateMode::DrawCallVertexSize()
|
|||
return drawCallVertexSize;
|
||||
}
|
||||
|
||||
void fhImmediateMode::InitBuffers( nvrhi::ICommandList* commandList )
|
||||
{
|
||||
commandList->open();
|
||||
vertexBuffer.AllocBufferObject( nullptr, c_drawVertsCapacity * sizeof( idDrawVert ), bufferUsageType_t::BU_STATIC, commandList );
|
||||
indexBuffer.AllocBufferObject( nullptr, c_drawIndexesCapacity * sizeof( triIndex_t ), bufferUsageType_t::BU_STATIC, commandList );
|
||||
commandList->close();
|
||||
deviceManager->GetDevice()->executeCommandList( commandList );
|
||||
}
|
||||
|
||||
fhImmediateMode::fhImmediateMode( nvrhi::ICommandList* _commandList, bool geometryOnly ) :
|
||||
commandList( _commandList ),
|
||||
|
@ -116,27 +129,8 @@ void fhImmediateMode::End()
|
|||
return;
|
||||
}
|
||||
|
||||
nvrhi::BufferDesc vertexBufferDesc;
|
||||
vertexBufferDesc.byteSize = drawVertsUsed * sizeof( idDrawVert );
|
||||
vertexBufferDesc.isVertexBuffer = true;
|
||||
vertexBufferDesc.debugName = "VertexBuffer";
|
||||
vertexBufferDesc.initialState = nvrhi::ResourceStates::CopyDest;
|
||||
vertexBuffer = deviceManager->GetDevice()->createBuffer( vertexBufferDesc );
|
||||
|
||||
commandList->beginTrackingBufferState( vertexBuffer, nvrhi::ResourceStates::CopyDest );
|
||||
commandList->writeBuffer( vertexBuffer, drawVerts, drawVertsUsed * sizeof( idDrawVert ) );
|
||||
commandList->setPermanentBufferState( vertexBuffer, nvrhi::ResourceStates::VertexBuffer );
|
||||
|
||||
nvrhi::BufferDesc indexBufferDesc;
|
||||
indexBufferDesc.byteSize = drawVertsUsed * sizeof( triIndex_t );
|
||||
indexBufferDesc.isIndexBuffer = true;
|
||||
indexBufferDesc.debugName = "IndexBuffer";
|
||||
indexBufferDesc.initialState = nvrhi::ResourceStates::CopyDest;
|
||||
indexBuffer = deviceManager->GetDevice()->createBuffer( indexBufferDesc );
|
||||
|
||||
commandList->beginTrackingBufferState( indexBuffer, nvrhi::ResourceStates::CopyDest );
|
||||
commandList->writeBuffer( indexBuffer, lineIndices, drawVertsUsed * sizeof( triIndex_t ) );
|
||||
commandList->setPermanentBufferState( indexBuffer, nvrhi::ResourceStates::IndexBuffer );
|
||||
vertexBuffer.Update( drawVerts, drawVertsUsed * sizeof( idDrawVert ), 0, false, commandList );
|
||||
indexBuffer.Update( lineIndices, drawVertsUsed * sizeof( triIndex_t ), 0, false, commandList );
|
||||
|
||||
renderProgManager.CommitConstantBuffer( commandList );
|
||||
|
||||
|
@ -167,8 +161,8 @@ void fhImmediateMode::End()
|
|||
state.bindings.push_back( tr.backend.currentBindingSets[i] );
|
||||
}
|
||||
|
||||
state.indexBuffer = { indexBuffer, nvrhi::Format::R16_UINT, 0 };
|
||||
state.vertexBuffers = { { vertexBuffer, 0, 0 } };
|
||||
state.indexBuffer = { indexBuffer.GetAPIObject(), nvrhi::Format::R16_UINT, 0};
|
||||
state.vertexBuffers = { { vertexBuffer.GetAPIObject(), 0, 0 } };
|
||||
state.pipeline = pipeline;
|
||||
state.framebuffer = tr.backend.currentFrameBuffer->GetApiObject();
|
||||
|
||||
|
|
|
@ -72,14 +72,17 @@ public:
|
|||
|
||||
static void AddTrianglesFromPolygon( fhImmediateMode& im, const idVec3* xyz, int num );
|
||||
|
||||
static void Init();
|
||||
static void Init( nvrhi::ICommandList* commandList );
|
||||
static void ResetStats();
|
||||
static int DrawCallCount();
|
||||
static int DrawCallVertexSize();
|
||||
private:
|
||||
|
||||
static void InitBuffers( nvrhi::ICommandList* commandList );
|
||||
|
||||
nvrhi::CommandListHandle commandList;
|
||||
nvrhi::BufferHandle vertexBuffer;
|
||||
nvrhi::BufferHandle indexBuffer;
|
||||
static idVertexBuffer vertexBuffer;
|
||||
static idIndexBuffer indexBuffer;
|
||||
|
||||
bool geometryOnly;
|
||||
float currentTexCoord[2];
|
||||
|
|
|
@ -115,7 +115,7 @@ bool idVertexBuffer::AllocBufferObject( const void* data, int allocSize, bufferU
|
|||
}
|
||||
else
|
||||
{
|
||||
vertexBufferDesc.initialState = nvrhi::ResourceStates::Common;
|
||||
vertexBufferDesc.initialState = nvrhi::ResourceStates::CopyDest;
|
||||
vertexBufferDesc.keepInitialState = true;
|
||||
vertexBufferDesc.debugName = "Static idDrawVert vertex buffer";
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ bool idVertexBuffer::AllocBufferObject( const void* data, int allocSize, bufferU
|
|||
}
|
||||
|
||||
// copy the data
|
||||
if( data != NULL )
|
||||
if( data )
|
||||
{
|
||||
Update( data, allocSize, 0, true, commandList );
|
||||
}
|
||||
|
@ -196,9 +196,9 @@ void idVertexBuffer::Update( const void* data, int updateSize, int offset, bool
|
|||
{
|
||||
if( initialUpdate )
|
||||
{
|
||||
commandList->beginTrackingBufferState( bufferHandle, nvrhi::ResourceStates::Common );
|
||||
commandList->beginTrackingBufferState( bufferHandle, nvrhi::ResourceStates::CopyDest );
|
||||
commandList->writeBuffer( bufferHandle, data, numBytes, GetOffset() + offset );
|
||||
commandList->setPermanentBufferState( bufferHandle, nvrhi::ResourceStates::ShaderResource | nvrhi::ResourceStates::VertexBuffer );
|
||||
commandList->setPermanentBufferState( bufferHandle, nvrhi::ResourceStates::VertexBuffer );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -309,21 +309,20 @@ bool idIndexBuffer::AllocBufferObject( const void* data, int allocSize, bufferUs
|
|||
nvrhi::BufferDesc indexBufferDesc;
|
||||
indexBufferDesc.byteSize = numBytes;
|
||||
indexBufferDesc.isIndexBuffer = true;
|
||||
indexBufferDesc.initialState = nvrhi::ResourceStates::Common;
|
||||
indexBufferDesc.initialState = nvrhi::ResourceStates::CopyDest;
|
||||
indexBufferDesc.canHaveRawViews = true;
|
||||
indexBufferDesc.canHaveTypedViews = true;
|
||||
indexBufferDesc.format = nvrhi::Format::R16_UINT;
|
||||
|
||||
if( _usage == BU_STATIC )
|
||||
{
|
||||
indexBufferDesc.debugName = "VertexCache Static Index Buffer";
|
||||
indexBufferDesc.keepInitialState = true;
|
||||
indexBufferDesc.debugName = "VertexCache Static Index Buffer";
|
||||
}
|
||||
else if( _usage == BU_DYNAMIC )
|
||||
{
|
||||
indexBufferDesc.debugName = "VertexCache Mapped Index Buffer";
|
||||
indexBufferDesc.initialState = nvrhi::ResourceStates::CopyDest;
|
||||
indexBufferDesc.cpuAccess = nvrhi::CpuAccessMode::Write;
|
||||
indexBufferDesc.debugName = "VertexCache Mapped Index Buffer";
|
||||
}
|
||||
|
||||
bufferHandle = deviceManager->GetDevice()->createBuffer( indexBufferDesc );
|
||||
|
@ -386,7 +385,7 @@ void idIndexBuffer::Update( const void* data, int updateSize, int offset, bool i
|
|||
idLib::FatalError( "idIndexBuffer::Update: size overrun, %i > %i\n", updateSize, GetSize() );
|
||||
}
|
||||
|
||||
int numBytes = ( updateSize + 15 ) & ~15;
|
||||
const int numBytes = ( updateSize + 15 ) & ~15;
|
||||
|
||||
if( usage == BU_DYNAMIC )
|
||||
{
|
||||
|
@ -396,9 +395,9 @@ void idIndexBuffer::Update( const void* data, int updateSize, int offset, bool i
|
|||
{
|
||||
if( initialUpdate )
|
||||
{
|
||||
commandList->beginTrackingBufferState( bufferHandle, nvrhi::ResourceStates::Common );
|
||||
commandList->beginTrackingBufferState( bufferHandle, nvrhi::ResourceStates::CopyDest );
|
||||
commandList->writeBuffer( bufferHandle, data, numBytes, GetOffset() + offset );
|
||||
commandList->setPermanentBufferState( bufferHandle, nvrhi::ResourceStates::IndexBuffer | nvrhi::ResourceStates::ShaderResource );
|
||||
commandList->setPermanentBufferState( bufferHandle, nvrhi::ResourceStates::IndexBuffer );
|
||||
commandList->commitBarriers();
|
||||
}
|
||||
else
|
||||
|
@ -419,7 +418,7 @@ void* idIndexBuffer::MapBuffer( bufferMapType_t mapType )
|
|||
assert( IsMapped() == false );
|
||||
|
||||
nvrhi::CpuAccessMode accessMode = nvrhi::CpuAccessMode::Write;
|
||||
if( mapType == bufferMapType_t::BM_READ )
|
||||
if( mapType == BM_READ )
|
||||
{
|
||||
accessMode = nvrhi::CpuAccessMode::Read;
|
||||
}
|
||||
|
@ -428,7 +427,7 @@ void* idIndexBuffer::MapBuffer( bufferMapType_t mapType )
|
|||
|
||||
SetMapped();
|
||||
|
||||
if( buffer == NULL )
|
||||
if( buffer == nullptr )
|
||||
{
|
||||
idLib::FatalError( "idVertexBuffer::MapBuffer: failed" );
|
||||
}
|
||||
|
@ -492,7 +491,7 @@ idUniformBuffer::idUniformBuffer()
|
|||
idUniformBuffer::AllocBufferObject
|
||||
========================
|
||||
*/
|
||||
bool idUniformBuffer::AllocBufferObject( const void* data, int allocSize, bufferUsageType_t _usage, nvrhi::ICommandList* commandList )
|
||||
bool idUniformBuffer::AllocBufferObject( const void* data, int allocSize, bufferUsageType_t allocatedUsage, nvrhi::ICommandList* commandList )
|
||||
{
|
||||
assert( !bufferHandle );
|
||||
assert_16_byte_aligned( data );
|
||||
|
@ -503,38 +502,46 @@ bool idUniformBuffer::AllocBufferObject( const void* data, int allocSize, buffer
|
|||
}
|
||||
|
||||
size = allocSize;
|
||||
usage = _usage;
|
||||
usage = allocatedUsage;
|
||||
|
||||
bool allocationFailed = false;
|
||||
|
||||
int numBytes = GetAllocedSize();
|
||||
const int numBytes = GetAllocedSize();
|
||||
|
||||
// This buffer is a shader resource as opposed to a constant buffer due to
|
||||
// constant buffers not being able to be sub-ranged.
|
||||
nvrhi::BufferDesc bufferDesc;
|
||||
bufferDesc.initialState = nvrhi::ResourceStates::ShaderResource;
|
||||
bufferDesc.keepInitialState = true;
|
||||
bufferDesc.canHaveTypedViews = true;
|
||||
bufferDesc.canHaveRawViews = true;
|
||||
bufferDesc.byteSize = numBytes;
|
||||
bufferDesc.isConstantBuffer = true;
|
||||
bufferDesc.initialState = nvrhi::ResourceStates::Common;
|
||||
bufferDesc.structStride = sizeof( idVec4 );
|
||||
|
||||
if( usage == BU_DYNAMIC )
|
||||
{
|
||||
bufferDesc.debugName = "Mapped ConstantBuffer";
|
||||
bufferDesc.debugName = "Mapped JointBuffer";
|
||||
bufferDesc.initialState = nvrhi::ResourceStates::CopyDest;
|
||||
bufferDesc.cpuAccess = nvrhi::CpuAccessMode::Write;
|
||||
}
|
||||
else
|
||||
{
|
||||
bufferDesc.debugName = "Static ConstantBuffer";
|
||||
bufferDesc.debugName = "Static JointBuffer";
|
||||
bufferDesc.keepInitialState = true;
|
||||
}
|
||||
|
||||
bufferHandle = deviceManager->GetDevice()->createBuffer( bufferDesc );
|
||||
|
||||
if( !bufferHandle )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// copy the data
|
||||
if( data != NULL )
|
||||
if( data )
|
||||
{
|
||||
Update( data, allocSize, 0, true, commandList );
|
||||
}
|
||||
|
||||
return !allocationFailed;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -544,6 +551,31 @@ idUniformBuffer::FreeBufferObject
|
|||
*/
|
||||
void idUniformBuffer::FreeBufferObject()
|
||||
{
|
||||
if( IsMapped() )
|
||||
{
|
||||
UnmapBuffer();
|
||||
}
|
||||
|
||||
// if this is a sub-allocation inside a larger buffer, don't actually free anything.
|
||||
if( OwnsBuffer() == false )
|
||||
{
|
||||
ClearWithoutFreeing();
|
||||
return;
|
||||
}
|
||||
|
||||
if( !bufferHandle )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( r_showBuffers.GetBool() )
|
||||
{
|
||||
idLib::Printf( "index buffer free %p, api %p (%i bytes)\n", this, bufferHandle.Get(), GetSize() );
|
||||
}
|
||||
|
||||
bufferHandle.Reset();
|
||||
|
||||
ClearWithoutFreeing();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -574,7 +606,7 @@ void idUniformBuffer::Update( const void* data, int updateSize, int offset, bool
|
|||
{
|
||||
commandList->beginTrackingBufferState( bufferHandle, nvrhi::ResourceStates::Common );
|
||||
commandList->writeBuffer( bufferHandle, data, numBytes, GetOffset() + offset );
|
||||
commandList->setPermanentBufferState( bufferHandle, nvrhi::ResourceStates::ConstantBuffer | nvrhi::ResourceStates::ShaderResource );
|
||||
commandList->setPermanentBufferState( bufferHandle, nvrhi::ResourceStates::Common | nvrhi::ResourceStates::ShaderResource );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -594,7 +626,7 @@ void* idUniformBuffer::MapBuffer( bufferMapType_t mapType )
|
|||
assert( IsMapped() == false );
|
||||
|
||||
nvrhi::CpuAccessMode accessMode = nvrhi::CpuAccessMode::Write;
|
||||
if( mapType == bufferMapType_t::BM_READ )
|
||||
if( mapType == BM_READ )
|
||||
{
|
||||
accessMode = nvrhi::CpuAccessMode::Read;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ void Framebuffer::Shutdown()
|
|||
framebuffers.DeleteContents( true );
|
||||
}
|
||||
|
||||
void Framebuffer::ResizeFramebuffers()
|
||||
void Framebuffer::ResizeFramebuffers( bool reloadImages )
|
||||
{
|
||||
tr.backend.ClearCaches();
|
||||
|
||||
|
@ -108,35 +108,10 @@ void Framebuffer::ResizeFramebuffers()
|
|||
globalFramebuffers.swapFramebuffers.Resize( backBufferCount );
|
||||
globalFramebuffers.swapFramebuffers.SetNum( backBufferCount );
|
||||
|
||||
tr.backend.commandList->open();
|
||||
globalImages->ldrImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->currentRenderImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->currentDepthImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->currentRenderHDRImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->currentRenderHDRImage64->Reload( false, tr.backend.commandList );
|
||||
for( int i = 0; i < MAX_SSAO_BUFFERS; i++ )
|
||||
if( reloadImages )
|
||||
{
|
||||
globalImages->ambientOcclusionImage[i]->Reload( false, tr.backend.commandList );
|
||||
ReloadImages();
|
||||
}
|
||||
globalImages->hierarchicalZbufferImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->gbufferNormalsRoughnessImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->taaMotionVectorsImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->taaResolvedImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->taaFeedback1Image->Reload( false, tr.backend.commandList );
|
||||
globalImages->taaFeedback2Image->Reload( false, tr.backend.commandList );
|
||||
globalImages->smaaEdgesImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->smaaBlendImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->shadowAtlasImage->Reload( false, tr.backend.commandList );
|
||||
for( int i = 0; i < MAX_SHADOWMAP_RESOLUTIONS; i++ )
|
||||
{
|
||||
globalImages->shadowImage[i]->Reload( false, tr.backend.commandList );
|
||||
}
|
||||
for( int i = 0; i < MAX_BLOOM_BUFFERS; i++ )
|
||||
{
|
||||
globalImages->bloomRenderImage[i]->Reload( false, tr.backend.commandList );
|
||||
}
|
||||
tr.backend.commandList->close();
|
||||
deviceManager->GetDevice()->executeCommandList( tr.backend.commandList );
|
||||
|
||||
for( uint32_t index = 0; index < backBufferCount; index++ )
|
||||
{
|
||||
|
@ -233,6 +208,39 @@ void Framebuffer::ResizeFramebuffers()
|
|||
Framebuffer::Unbind();
|
||||
}
|
||||
|
||||
void Framebuffer::ReloadImages()
|
||||
{
|
||||
tr.backend.commandList->open();
|
||||
globalImages->ldrImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->currentRenderImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->currentDepthImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->currentRenderHDRImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->currentRenderHDRImage64->Reload( false, tr.backend.commandList );
|
||||
for( int i = 0; i < MAX_SSAO_BUFFERS; i++ )
|
||||
{
|
||||
globalImages->ambientOcclusionImage[i]->Reload( false, tr.backend.commandList );
|
||||
}
|
||||
globalImages->hierarchicalZbufferImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->gbufferNormalsRoughnessImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->taaMotionVectorsImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->taaResolvedImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->taaFeedback1Image->Reload( false, tr.backend.commandList );
|
||||
globalImages->taaFeedback2Image->Reload( false, tr.backend.commandList );
|
||||
globalImages->smaaEdgesImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->smaaBlendImage->Reload( false, tr.backend.commandList );
|
||||
globalImages->shadowAtlasImage->Reload( false, tr.backend.commandList );
|
||||
for( int i = 0; i < MAX_SHADOWMAP_RESOLUTIONS; i++ )
|
||||
{
|
||||
globalImages->shadowImage[i]->Reload( false, tr.backend.commandList );
|
||||
}
|
||||
for( int i = 0; i < MAX_BLOOM_BUFFERS; i++ )
|
||||
{
|
||||
globalImages->bloomRenderImage[i]->Reload( false, tr.backend.commandList );
|
||||
}
|
||||
tr.backend.commandList->close();
|
||||
deviceManager->GetDevice()->executeCommandList( tr.backend.commandList );
|
||||
}
|
||||
|
||||
void Framebuffer::Bind()
|
||||
{
|
||||
if( tr.backend.currentFrameBuffer != this )
|
||||
|
|
|
@ -347,7 +347,6 @@ void idImage::AllocImage()
|
|||
return;
|
||||
}
|
||||
|
||||
int compressedSize = 0;
|
||||
uint originalWidth = opts.width;
|
||||
uint originalHeight = opts.height;
|
||||
|
||||
|
@ -436,8 +435,6 @@ void idImage::AllocImage()
|
|||
|
||||
if( opts.isRenderTarget )
|
||||
{
|
||||
//textureDesc.keepInitialState = true;
|
||||
//textureDesc.setKeepInitialState( true );
|
||||
textureDesc.setInitialState( nvrhi::ResourceStates::RenderTarget )
|
||||
.setClearValue( nvrhi::Color( 0.f ) )
|
||||
.setIsRenderTarget( true )
|
||||
|
@ -449,7 +446,7 @@ void idImage::AllocImage()
|
|||
.setClearValue( nvrhi::Color( 1.f ) );
|
||||
}
|
||||
|
||||
if( opts.format == FMT_R32F || opts.format == FMT_R8 )
|
||||
if( opts.isUAV )
|
||||
{
|
||||
// TODO(Stephen): Probably make this an image option.
|
||||
// This is a hack to make cszBuffer and ambient occlusion uav work.
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -160,9 +160,9 @@ void TonemapPass::Render(
|
|||
state.framebuffer = _targetFb;
|
||||
state.bindings = { renderBindingSet };
|
||||
nvrhi::Viewport viewport{ ( float )viewDef->viewport.x1,
|
||||
( float )viewDef->viewport.x2,
|
||||
( float )viewDef->viewport.x2 + 1,
|
||||
( float )viewDef->viewport.y1,
|
||||
( float )viewDef->viewport.y2,
|
||||
( float )viewDef->viewport.y2 + 1,
|
||||
viewDef->viewport.zmin,
|
||||
viewDef->viewport.zmax };
|
||||
state.viewport.addViewportAndScissorRect( viewport );
|
||||
|
|
|
@ -62,7 +62,7 @@ nvrhi::GraphicsPipelineHandle PipelineCache::GetOrCreatePipeline( const Pipeline
|
|||
}
|
||||
|
||||
nvrhi::GraphicsPipelineDesc pipelineDesc;
|
||||
programInfo_t progInfo = renderProgManager.GetProgramInfo( key.program );
|
||||
const programInfo_t progInfo = renderProgManager.GetProgramInfo( key.program );
|
||||
pipelineDesc.setVertexShader( progInfo.vs ).setFragmentShader( progInfo.ps );
|
||||
pipelineDesc.inputLayout = progInfo.inputLayout;
|
||||
for( int i = 0; i < progInfo.bindingLayouts->Num(); i++ )
|
||||
|
@ -78,9 +78,6 @@ nvrhi::GraphicsPipelineHandle PipelineCache::GetOrCreatePipeline( const Pipeline
|
|||
{
|
||||
target.enableBlend();
|
||||
}
|
||||
//pipelineDesc.renderState.rasterState.enableDepthClip();
|
||||
//pipelineDesc.renderState.rasterState.depthBias = 0;
|
||||
//pipelineDesc.renderState.rasterState.slopeScaledDepthBias = 0;
|
||||
|
||||
// Specialize the state with the state key.
|
||||
GetRenderState( key.state, key, pipelineDesc.renderState );
|
||||
|
|
|
@ -6738,6 +6738,16 @@ void idRenderBackend::DrawViewInternal( const viewDef_t* _viewDef, const int ste
|
|||
}
|
||||
}
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
// SP: reset the graphics state for validation layers
|
||||
currentVertexBuffer = nullptr;
|
||||
currentIndexBuffer = nullptr;
|
||||
currentJointBuffer = nullptr;
|
||||
currentVertexOffset = 0;
|
||||
currentIndexOffset = 0;
|
||||
currentJointOffset = 0;
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------
|
||||
// RB_BeginDrawingView
|
||||
//
|
||||
|
@ -6753,17 +6763,15 @@ void idRenderBackend::DrawViewInternal( const viewDef_t* _viewDef, const int ste
|
|||
|
||||
bool useHDR = r_useHDR.GetBool() && !_viewDef->is2Dgui;
|
||||
bool clearColor = false;
|
||||
if( useHDR )
|
||||
|
||||
if( _viewDef->renderView.rdflags & RDF_IRRADIANCE )
|
||||
{
|
||||
if( _viewDef->renderView.rdflags & RDF_IRRADIANCE )
|
||||
{
|
||||
globalFramebuffers.envprobeFBO->Bind();
|
||||
clearColor = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
globalFramebuffers.hdrFBO->Bind();
|
||||
}
|
||||
globalFramebuffers.envprobeFBO->Bind();
|
||||
clearColor = true;
|
||||
}
|
||||
else if( useHDR )
|
||||
{
|
||||
globalFramebuffers.hdrFBO->Bind();
|
||||
}
|
||||
else if( viewDef->targetRender )
|
||||
{
|
||||
|
@ -7228,6 +7236,11 @@ void idRenderBackend::DrawView( const void* data, const int stereoEye )
|
|||
// if there aren't any drawsurfs, do nothing
|
||||
if( !viewDef->numDrawSurfs )
|
||||
{
|
||||
if( viewDef->renderView.rdflags & RDF_IRRADIANCE )
|
||||
{
|
||||
nvrhi::utils::ClearColorAttachment( commandList, globalFramebuffers.envprobeFBO->GetApiObject(), 0, nvrhi::Color( 0.f ) );
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -7451,8 +7464,7 @@ void idRenderBackend::PostProcess( const void* data )
|
|||
blitParms.sourceTexture = ( nvrhi::ITexture* )globalImages->ldrImage->GetTextureID();
|
||||
blitParms.targetFramebuffer = globalFramebuffers.smaaBlendFBO->GetApiObject();
|
||||
|
||||
// RB: add + 1 to dimensions so filtering works
|
||||
blitParms.targetViewport = nvrhi::Viewport( renderSystem->GetWidth() + 1, renderSystem->GetHeight() + 1 );
|
||||
blitParms.targetViewport = nvrhi::Viewport( renderSystem->GetWidth(), renderSystem->GetHeight() );
|
||||
commonPasses.BlitTexture( commandList, blitParms, &bindingCache );
|
||||
|
||||
GL_SelectTexture( 0 );
|
||||
|
|
|
@ -529,6 +529,8 @@ private:
|
|||
nvrhi::BufferHandle currentIndexBuffer;
|
||||
uint currentIndexOffset;
|
||||
nvrhi::BindingLayoutHandle currentBindingLayout;
|
||||
nvrhi::IBuffer* currentJointBuffer;
|
||||
uint currentJointOffset;
|
||||
nvrhi::GraphicsPipelineHandle currentPipeline;
|
||||
|
||||
idStaticList<nvrhi::BindingSetHandle, nvrhi::c_MaxBindingLayouts> currentBindingSets;
|
||||
|
|
|
@ -851,21 +851,43 @@ enum vertexLayoutType_t
|
|||
|
||||
enum bindingLayoutType_t
|
||||
{
|
||||
// REGULAR AND SKINNED VERSIONS
|
||||
BINDING_LAYOUT_DEFAULT,
|
||||
BINDING_LAYOUT_DEFAULT_SKINNED,
|
||||
|
||||
BINDING_LAYOUT_CONSTANT_BUFFER_ONLY,
|
||||
BINDING_LAYOUT_GBUFFER,
|
||||
BINDING_LAYOUT_CONSTANT_BUFFER_ONLY_SKINNED,
|
||||
|
||||
//BINDING_LAYOUT_GBUFFER,
|
||||
//BINDING_LAYOUT_GBUFFER_SKINNED,
|
||||
|
||||
BINDING_LAYOUT_AMBIENT_LIGHTING_IBL,
|
||||
BINDING_LAYOUT_AMBIENT_LIGHTING_IBL_SKINNED,
|
||||
|
||||
//BINDING_LAYOUT_DRAW_SHADOWVOLUME, // TODO FIX or REMOVE?
|
||||
//BINDING_LAYOUT_DRAW_SHADOWVOLUME_SKINNED,
|
||||
|
||||
BINDING_LAYOUT_DRAW_INTERACTION,
|
||||
BINDING_LAYOUT_DRAW_INTERACTION_SKINNED,
|
||||
BINDING_LAYOUT_DRAW_INTERACTION_SM,
|
||||
BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED,
|
||||
|
||||
BINDING_LAYOUT_FOG,
|
||||
BINDING_LAYOUT_FOG_SKINNED,
|
||||
BINDING_LAYOUT_BLENDLIGHT,
|
||||
BINDING_LAYOUT_BLENDLIGHT_SKINNED,
|
||||
|
||||
BINDING_LAYOUT_NORMAL_CUBE,
|
||||
BINDING_LAYOUT_NORMAL_CUBE_SKINNED,
|
||||
|
||||
// NO GPU SKINNING ANYMORE
|
||||
BINDING_LAYOUT_POST_PROCESS_INGAME,
|
||||
BINDING_LAYOUT_POST_PROCESS_FINAL,
|
||||
|
||||
BINDING_LAYOUT_BLIT,
|
||||
BINDING_LAYOUT_DRAW_AO,
|
||||
BINDING_LAYOUT_DRAW_AO1,
|
||||
BINDING_LAYOUT_DRAW_SHADOWVOLUME,
|
||||
BINDING_LAYOUT_DRAW_INTERACTION,
|
||||
BINDING_LAYOUT_DRAW_INTERACTION_SM,
|
||||
BINDING_LAYOUT_DRAW_FOG,
|
||||
BINDING_LAYOUT_POST_PROCESS_INGAME,
|
||||
BINDING_LAYOUT_POST_PROCESS_FINAL,
|
||||
BINDING_LAYOUT_NORMAL_CUBE,
|
||||
BINDING_LAYOUT_BLENDLIGHT,
|
||||
|
||||
BINDING_LAYOUT_BINK_VIDEO,
|
||||
|
||||
// NVRHI render passes specific
|
||||
|
@ -1328,7 +1350,7 @@ NVRHI helpers
|
|||
====================================================================
|
||||
*/
|
||||
bool R_ReadPixelsRGB8( nvrhi::IDevice* device, CommonRenderPasses* pPasses, nvrhi::ITexture* texture, nvrhi::ResourceStates textureState, const char* fullname );
|
||||
bool R_ReadPixelsRGB16F( nvrhi::IDevice* device, CommonRenderPasses* pPasses, nvrhi::ITexture* texture, nvrhi::ResourceStates textureState, void* pic, int picWidth, int picHeight );
|
||||
bool R_ReadPixelsRGB16F( nvrhi::IDevice* device, CommonRenderPasses* pPasses, nvrhi::ITexture* texture, nvrhi::ResourceStates textureState, byte** pic, int picWidth, int picHeight );
|
||||
|
||||
/*
|
||||
====================================================================
|
||||
|
|
|
@ -172,9 +172,21 @@ void idRenderProgManager::Init( nvrhi::IDevice* device )
|
|||
|
||||
bindingLayouts.SetNum( NUM_BINDING_LAYOUTS );
|
||||
|
||||
auto uniformsLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) );
|
||||
|
||||
auto uniformsLayout = device->createBindingLayout( uniformsLayoutDesc );
|
||||
|
||||
auto skinningLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
|
||||
.addItem( nvrhi::BindingLayoutItem::StructuredBuffer_SRV( 11 ) ); // joint buffer;
|
||||
|
||||
auto skinningLayout = device->createBindingLayout( skinningLayoutDesc );
|
||||
|
||||
auto defaultLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
|
||||
.setVisibility( nvrhi::ShaderType::Pixel )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) );
|
||||
|
||||
auto samplerOneLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
|
@ -184,17 +196,14 @@ void idRenderProgManager::Init( nvrhi::IDevice* device )
|
|||
|
||||
auto defaultLayout = device->createBindingLayout( defaultLayoutDesc );
|
||||
|
||||
bindingLayouts[BINDING_LAYOUT_DEFAULT] = { defaultLayout, samplerOneBindingLayout };
|
||||
bindingLayouts[BINDING_LAYOUT_DEFAULT] = { uniformsLayout, defaultLayout, samplerOneBindingLayout };
|
||||
bindingLayouts[BINDING_LAYOUT_DEFAULT_SKINNED] = { skinningLayout, defaultLayout, samplerOneBindingLayout };
|
||||
|
||||
auto constantBufferLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) );
|
||||
|
||||
bindingLayouts[BINDING_LAYOUT_CONSTANT_BUFFER_ONLY] = { device->createBindingLayout( constantBufferLayoutDesc ) };
|
||||
bindingLayouts[BINDING_LAYOUT_CONSTANT_BUFFER_ONLY] = { uniformsLayout };
|
||||
bindingLayouts[BINDING_LAYOUT_CONSTANT_BUFFER_ONLY_SKINNED] = { skinningLayout };
|
||||
|
||||
auto defaultMaterialLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
|
||||
.setVisibility( nvrhi::ShaderType::Pixel )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) ) // normal
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) ) // specular
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 2 ) ); // base color
|
||||
|
@ -202,7 +211,7 @@ void idRenderProgManager::Init( nvrhi::IDevice* device )
|
|||
auto defaultMaterialLayout = device->createBindingLayout( defaultMaterialLayoutDesc );
|
||||
|
||||
auto ambientIblLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.setVisibility( nvrhi::ShaderType::Pixel )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 3 ) ) // brdf lut
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 4 ) ) // ssao
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 7 ) ) // irradiance cube map
|
||||
|
@ -210,6 +219,8 @@ void idRenderProgManager::Init( nvrhi::IDevice* device )
|
|||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 9 ) ) // radiance cube map 2
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 10 ) ); // radiance cube map 3
|
||||
|
||||
auto ambientIblLayout = device->createBindingLayout( ambientIblLayoutDesc );
|
||||
|
||||
auto samplerTwoBindingLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::Pixel )
|
||||
.addItem( nvrhi::BindingLayoutItem::Sampler( 0 ) ) // (Wrap) Anisotropic sampler: normal sampler & specular sampler
|
||||
|
@ -218,7 +229,11 @@ void idRenderProgManager::Init( nvrhi::IDevice* device )
|
|||
|
||||
bindingLayouts[ BINDING_LAYOUT_AMBIENT_LIGHTING_IBL ] =
|
||||
{
|
||||
defaultMaterialLayout, device->createBindingLayout( ambientIblLayoutDesc ), samplerTwoBindingLayout
|
||||
uniformsLayout, defaultMaterialLayout, ambientIblLayout, samplerTwoBindingLayout
|
||||
};
|
||||
bindingLayouts[ BINDING_LAYOUT_AMBIENT_LIGHTING_IBL_SKINNED ] =
|
||||
{
|
||||
skinningLayout, defaultMaterialLayout, ambientIblLayout, samplerTwoBindingLayout
|
||||
};
|
||||
|
||||
auto blitLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
|
@ -243,27 +258,43 @@ void idRenderProgManager::Init( nvrhi::IDevice* device )
|
|||
|
||||
bindingLayouts[BINDING_LAYOUT_DRAW_AO1] = { device->createBindingLayout( aoLayoutDesc2 ), samplerOneBindingLayout };
|
||||
|
||||
nvrhi::BindingLayoutDesc shadowLayout;
|
||||
shadowLayout.visibility = nvrhi::ShaderType::All;
|
||||
shadowLayout.bindings =
|
||||
/*
|
||||
nvrhi::BindingLayoutDesc shadowLayoutDesc;
|
||||
shadowLayoutDesc.visibility = nvrhi::ShaderType::All;
|
||||
shadowLayoutDesc.bindings =
|
||||
{
|
||||
nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 )
|
||||
};
|
||||
bindingLayouts[BINDING_LAYOUT_DRAW_SHADOWVOLUME] = { device->createBindingLayout( shadowLayout ) };
|
||||
auto shadowLayout = device->createBindingLayout( shadowLayoutDesc );
|
||||
bindingLayouts[BINDING_LAYOUT_DRAW_SHADOWVOLUME] =
|
||||
{
|
||||
|
||||
auto interactionBindingLayout = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 3 ) ) // light falloff
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 4 ) ); // light projection
|
||||
};
|
||||
*/
|
||||
|
||||
bindingLayouts[BINDING_LAYOUT_DRAW_INTERACTION] = { defaultMaterialLayout, device->createBindingLayout( interactionBindingLayout ), samplerTwoBindingLayout };
|
||||
auto interactionBindingLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::Pixel )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 3 ) ) // light falloff
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 4 ) ); // light projection
|
||||
|
||||
auto interactionSmBindingLayout = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.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
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 6 ) ); // jitter
|
||||
auto interactionBindingLayout = device->createBindingLayout( interactionBindingLayoutDesc );
|
||||
bindingLayouts[BINDING_LAYOUT_DRAW_INTERACTION] =
|
||||
{
|
||||
uniformsLayout, defaultMaterialLayout, interactionBindingLayout, samplerTwoBindingLayout
|
||||
};
|
||||
bindingLayouts[BINDING_LAYOUT_DRAW_INTERACTION_SKINNED] =
|
||||
{
|
||||
skinningLayout, defaultMaterialLayout, interactionBindingLayout, samplerTwoBindingLayout
|
||||
};
|
||||
|
||||
auto interactionSmBindingLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::Pixel )
|
||||
.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
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 6 ) ); // jitter
|
||||
|
||||
auto interactionSmBindingLayout = device->createBindingLayout( interactionSmBindingLayoutDesc );
|
||||
|
||||
auto samplerFourBindingLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::Pixel )
|
||||
|
@ -273,23 +304,46 @@ 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] = { defaultMaterialLayout, device->createBindingLayout( interactionSmBindingLayout ), samplerFourBindingLayout };
|
||||
bindingLayouts[BINDING_LAYOUT_DRAW_INTERACTION_SM] =
|
||||
{
|
||||
uniformsLayout, defaultMaterialLayout, interactionSmBindingLayout, samplerFourBindingLayout
|
||||
};
|
||||
bindingLayouts[BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED] =
|
||||
{
|
||||
skinningLayout, defaultMaterialLayout, interactionSmBindingLayout, samplerFourBindingLayout
|
||||
};
|
||||
|
||||
auto fogBindingLayout = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) );
|
||||
auto fogBindingLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::Pixel )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) );
|
||||
|
||||
bindingLayouts[BINDING_LAYOUT_DRAW_FOG] = { device->createBindingLayout( fogBindingLayout ), samplerTwoBindingLayout };
|
||||
auto fogBindingLayout = device->createBindingLayout( fogBindingLayoutDesc );
|
||||
|
||||
auto blendLightBindingLayout = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) ) // light 1
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) ); // light 2
|
||||
bindingLayouts[BINDING_LAYOUT_FOG] =
|
||||
{
|
||||
uniformsLayout, fogBindingLayout, samplerTwoBindingLayout
|
||||
};
|
||||
bindingLayouts[BINDING_LAYOUT_FOG_SKINNED] =
|
||||
{
|
||||
skinningLayout, fogBindingLayout, samplerTwoBindingLayout
|
||||
};
|
||||
|
||||
bindingLayouts[BINDING_LAYOUT_BLENDLIGHT] = { device->createBindingLayout( blendLightBindingLayout ), samplerOneBindingLayout };
|
||||
auto blendLightBindingLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::Pixel )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) ) // light 1
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) ); // light 2
|
||||
|
||||
auto blendLightBindingLayout = device->createBindingLayout( blendLightBindingLayoutDesc );
|
||||
|
||||
bindingLayouts[BINDING_LAYOUT_BLENDLIGHT] =
|
||||
{
|
||||
uniformsLayout, blendLightBindingLayout, samplerOneBindingLayout
|
||||
};
|
||||
bindingLayouts[BINDING_LAYOUT_BLENDLIGHT_SKINNED] =
|
||||
{
|
||||
uniformsLayout, blendLightBindingLayout, samplerOneBindingLayout
|
||||
};
|
||||
|
||||
auto pp3DBindingLayout = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
|
@ -308,13 +362,21 @@ void idRenderProgManager::Init( nvrhi::IDevice* device )
|
|||
|
||||
bindingLayouts[BINDING_LAYOUT_POST_PROCESS_FINAL] = { device->createBindingLayout( ppFxBindingLayout ), samplerTwoBindingLayout };
|
||||
|
||||
auto normalCubeBindingLayout = 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 ) ); // normal map
|
||||
auto normalCubeBindingLayoutDesc = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::Pixel )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) ) // cube map
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) ); // normal map
|
||||
|
||||
bindingLayouts[BINDING_LAYOUT_NORMAL_CUBE] = { device->createBindingLayout( normalCubeBindingLayout ), samplerOneBindingLayout };
|
||||
auto normalCubeBindingLayout = device->createBindingLayout( normalCubeBindingLayoutDesc );
|
||||
|
||||
bindingLayouts[BINDING_LAYOUT_NORMAL_CUBE] =
|
||||
{
|
||||
uniformsLayout, normalCubeBindingLayout, samplerOneBindingLayout
|
||||
};
|
||||
bindingLayouts[BINDING_LAYOUT_NORMAL_CUBE_SKINNED] =
|
||||
{
|
||||
skinningLayout, normalCubeBindingLayout, samplerOneBindingLayout
|
||||
};
|
||||
|
||||
auto binkVideoBindingLayout = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
|
@ -382,106 +444,107 @@ void idRenderProgManager::Init( nvrhi::IDevice* device )
|
|||
{ 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 },
|
||||
// RB begin
|
||||
{ BUILTIN_COLOR_SKINNED, "builtin/color", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, 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_DEFAULT_SKINNED },
|
||||
{ BUILTIN_VERTEX_COLOR, "builtin/vertex_color", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
|
||||
{ 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 },
|
||||
{ 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 },
|
||||
{ BUILTIN_AMBIENT_LIGHTING_IBL_PBR, "builtin/lighting/ambient_lighting_IBL", "_PBR", { { "USE_GPU_SKINNING", "0" }, { "USE_PBR", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_AMBIENT_LIGHTING_IBL },
|
||||
{ BUILTIN_AMBIENT_LIGHTING_IBL_PBR_SKINNED, "builtin/lighting/ambient_lighting_IBL", "_PBR_skinned", { { "USE_GPU_SKINNING", "1" }, { "USE_PBR", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_AMBIENT_LIGHTING_IBL },
|
||||
{ BUILTIN_AMBIENT_LIGHTING_IBL_PBR_SKINNED, "builtin/lighting/ambient_lighting_IBL", "_PBR_skinned", { { "USE_GPU_SKINNING", "1" }, { "USE_PBR", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_AMBIENT_LIGHTING_IBL_SKINNED },
|
||||
|
||||
{ BUILTIN_AMBIENT_LIGHTGRID_IBL, "builtin/lighting/ambient_lightgrid_IBL", "", { { "USE_GPU_SKINNING", "0" }, { "USE_PBR", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_AMBIENT_LIGHTING_IBL },
|
||||
{ BUILTIN_AMBIENT_LIGHTGRID_IBL_SKINNED, "builtin/lighting/ambient_lightgrid_IBL", "_skinned", { { "USE_GPU_SKINNING", "1" }, { "USE_PBR", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_AMBIENT_LIGHTING_IBL },
|
||||
{ BUILTIN_AMBIENT_LIGHTGRID_IBL_SKINNED, "builtin/lighting/ambient_lightgrid_IBL", "_skinned", { { "USE_GPU_SKINNING", "1" }, { "USE_PBR", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_AMBIENT_LIGHTING_IBL_SKINNED },
|
||||
{ BUILTIN_AMBIENT_LIGHTGRID_IBL_PBR, "builtin/lighting/ambient_lightgrid_IBL", "_PBR", { { "USE_GPU_SKINNING", "0" }, { "USE_PBR", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_AMBIENT_LIGHTING_IBL },
|
||||
{ BUILTIN_AMBIENT_LIGHTGRID_IBL_PBR_SKINNED, "builtin/lighting/ambient_lightgrid_IBL", "_PBR_skinned", { { "USE_GPU_SKINNING", "1" }, { "USE_PBR", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_AMBIENT_LIGHTING_IBL },
|
||||
{ BUILTIN_AMBIENT_LIGHTGRID_IBL_PBR_SKINNED, "builtin/lighting/ambient_lightgrid_IBL", "_PBR_skinned", { { "USE_GPU_SKINNING", "1" }, { "USE_PBR", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_AMBIENT_LIGHTING_IBL_SKINNED },
|
||||
|
||||
{ BUILTIN_SMALL_GEOMETRY_BUFFER, "builtin/gbuffer", "", { {"USE_GPU_SKINNING", "0" }, { "USE_NORMAL_FMT_RGB8", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_SMALL_GEOMETRY_BUFFER_SKINNED, "builtin/gbuffer", "_skinned", { {"USE_GPU_SKINNING", "1" }, { "USE_NORMAL_FMT_RGB8", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_SMALL_GEOMETRY_BUFFER_SKINNED, "builtin/gbuffer", "_skinned", { {"USE_GPU_SKINNING", "1" }, { "USE_NORMAL_FMT_RGB8", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT_SKINNED },
|
||||
// RB end
|
||||
{ BUILTIN_TEXTURED, "builtin/texture", "", { }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_TEXTURE_VERTEXCOLOR, "builtin/texture_color", "", { {"USE_GPU_SKINNING", "0" }, {"USE_SRGB", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_TEXTURE_VERTEXCOLOR_SRGB, "builtin/texture_color", "_sRGB", { {"USE_GPU_SKINNING", "0" }, {"USE_SRGB", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_TEXTURE_VERTEXCOLOR_SKINNED, "builtin/texture_color", "_skinned", { {"USE_GPU_SKINNING", "1" }, {"USE_SRGB", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_TEXTURE_VERTEXCOLOR_SKINNED, "builtin/texture_color", "_skinned", { {"USE_GPU_SKINNING", "1" }, {"USE_SRGB", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT_SKINNED },
|
||||
{ BUILTIN_TEXTURE_TEXGEN_VERTEXCOLOR, "builtin/texture_color_texgen", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
|
||||
// RB begin
|
||||
{ BUILTIN_INTERACTION, "builtin/lighting/interaction", "", { {"USE_GPU_SKINNING", "0" }, { "USE_PBR", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION },
|
||||
{ BUILTIN_INTERACTION_SKINNED, "builtin/lighting/interaction", "_skinned", { {"USE_GPU_SKINNING", "1" }, { "USE_PBR", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION },
|
||||
{ BUILTIN_INTERACTION_SKINNED, "builtin/lighting/interaction", "_skinned", { {"USE_GPU_SKINNING", "1" }, { "USE_PBR", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SKINNED },
|
||||
|
||||
{ BUILTIN_INTERACTION_AMBIENT, "builtin/lighting/interactionAmbient", "", { {"USE_GPU_SKINNING", "0" }, { "USE_PBR", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION },
|
||||
{ BUILTIN_INTERACTION_AMBIENT_SKINNED, "builtin/lighting/interactionAmbient", "_skinned", { {"USE_GPU_SKINNING", "1" }, { "USE_PBR", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION },
|
||||
{ BUILTIN_INTERACTION_AMBIENT_SKINNED, "builtin/lighting/interactionAmbient", "_skinned", { {"USE_GPU_SKINNING", "1" }, { "USE_PBR", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SKINNED },
|
||||
|
||||
// PBR variants
|
||||
{ BUILTIN_PBR_INTERACTION, "builtin/lighting/interaction", "_PBR", { {"USE_GPU_SKINNING", "0" }, { "USE_PBR", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION },
|
||||
{ BUILTIN_PBR_INTERACTION_SKINNED, "builtin/lighting/interaction", "_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "USE_PBR", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION },
|
||||
{ BUILTIN_PBR_INTERACTION_SKINNED, "builtin/lighting/interaction", "_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "USE_PBR", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SKINNED },
|
||||
|
||||
{ BUILTIN_PBR_INTERACTION_AMBIENT, "builtin/lighting/interactionAmbient", "_PBR", { {"USE_GPU_SKINNING", "0" }, { "USE_PBR", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION },
|
||||
{ BUILTIN_PBR_INTERACTION_AMBIENT_SKINNED, "builtin/lighting/interactionAmbient", "_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "USE_PBR", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION },
|
||||
{ BUILTIN_PBR_INTERACTION_AMBIENT_SKINNED, "builtin/lighting/interactionAmbient", "_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "USE_PBR", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SKINNED },
|
||||
|
||||
// regular shadow mapping
|
||||
{ BUILTIN_INTERACTION_SHADOW_MAPPING_SPOT, "builtin/lighting/interactionSM", "_spot", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_MAPPING_SPOT_SKINNED, "builtin/lighting/interactionSM", "_spot_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_MAPPING_SPOT_SKINNED, "builtin/lighting/interactionSM", "_spot_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
{ BUILTIN_INTERACTION_SHADOW_MAPPING_POINT, "builtin/lighting/interactionSM", "_point", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_MAPPING_POINT_SKINNED, "builtin/lighting/interactionSM", "_point_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_MAPPING_POINT_SKINNED, "builtin/lighting/interactionSM", "_point_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
{ BUILTIN_INTERACTION_SHADOW_MAPPING_PARALLEL, "builtin/lighting/interactionSM", "_parallel", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_MAPPING_PARALLEL_SKINNED, "builtin/lighting/interactionSM", "_parallel_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_MAPPING_PARALLEL_SKINNED, "builtin/lighting/interactionSM", "_parallel_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_MAPPING_SPOT, "builtin/lighting/interactionSM", "_spot_PBR", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_MAPPING_SPOT_SKINNED, "builtin/lighting/interactionSM", "_spot_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_MAPPING_SPOT_SKINNED, "builtin/lighting/interactionSM", "_spot_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_MAPPING_POINT, "builtin/lighting/interactionSM", "_point_PBR", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_MAPPING_POINT_SKINNED, "builtin/lighting/interactionSM", "_point_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_MAPPING_POINT_SKINNED, "builtin/lighting/interactionSM", "_point_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_MAPPING_PARALLEL, "builtin/lighting/interactionSM", "_parallel_PBR", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_MAPPING_PARALLEL_SKINNED, "builtin/lighting/interactionSM", "_parallel_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_MAPPING_PARALLEL_SKINNED, "builtin/lighting/interactionSM", "_parallel_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "0" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
// shadow mapping using a big atlas
|
||||
{ BUILTIN_INTERACTION_SHADOW_ATLAS_SPOT, "builtin/lighting/interactionSM", "_atlas_spot", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_ATLAS_SPOT_SKINNED, "builtin/lighting/interactionSM", "_atlas_spot_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_ATLAS_SPOT_SKINNED, "builtin/lighting/interactionSM", "_atlas_spot_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
{ BUILTIN_INTERACTION_SHADOW_ATLAS_POINT, "builtin/lighting/interactionSM", "_atlas_point", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_ATLAS_POINT_SKINNED, "builtin/lighting/interactionSM", "_atlas_point_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_ATLAS_POINT_SKINNED, "builtin/lighting/interactionSM", "_atlas_point_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
{ BUILTIN_INTERACTION_SHADOW_ATLAS_PARALLEL, "builtin/lighting/interactionSM", "_atlas_parallel", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_ATLAS_PARALLEL_SKINNED, "builtin/lighting/interactionSM", "_atlas_parallel_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_INTERACTION_SHADOW_ATLAS_PARALLEL_SKINNED, "builtin/lighting/interactionSM", "_atlas_parallel_skinned", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "0" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_ATLAS_SPOT, "builtin/lighting/interactionSM", "_atlas_spot_PBR", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_ATLAS_SPOT_SKINNED, "builtin/lighting/interactionSM", "_atlas_spot_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_ATLAS_SPOT_SKINNED, "builtin/lighting/interactionSM", "_atlas_spot_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_ATLAS_POINT, "builtin/lighting/interactionSM", "_atlas_point_PBR", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_ATLAS_POINT_SKINNED, "builtin/lighting/interactionSM", "_atlas_point_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_ATLAS_POINT_SKINNED, "builtin/lighting/interactionSM", "_atlas_point_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "1" }, { "LIGHT_PARALLEL", "0" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_ATLAS_PARALLEL, "builtin/lighting/interactionSM", "_atlas_parallel_PBR", { {"USE_GPU_SKINNING", "0" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_ATLAS_PARALLEL_SKINNED, "builtin/lighting/interactionSM", "_atlas_parallel_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM },
|
||||
{ BUILTIN_PBR_INTERACTION_SHADOW_ATLAS_PARALLEL_SKINNED, "builtin/lighting/interactionSM", "_atlas_parallel_skinned_PBR", { {"USE_GPU_SKINNING", "1" }, { "LIGHT_POINT", "0" }, { "LIGHT_PARALLEL", "1" }, { "USE_PBR", "1" }, { "USE_NORMAL_FMT_RGB8", "0" }, { "USE_SHADOW_ATLAS", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_INTERACTION_SM_SKINNED },
|
||||
|
||||
|
||||
// debug stuff
|
||||
{ BUILTIN_DEBUG_LIGHTGRID, "builtin/debug/lightgrid", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_DEBUG_LIGHTGRID_SKINNED, "builtin/debug/lightgrid", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_DEBUG_LIGHTGRID_SKINNED, "builtin/debug/lightgrid", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT_SKINNED },
|
||||
|
||||
{ BUILTIN_DEBUG_OCTAHEDRON, "builtin/debug/octahedron", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_DEBUG_OCTAHEDRON_SKINNED, "builtin/debug/octahedron", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_DEBUG_OCTAHEDRON_SKINNED, "builtin/debug/octahedron", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT_SKINNED },
|
||||
// RB end
|
||||
|
||||
{ BUILTIN_ENVIRONMENT, "builtin/legacy/environment", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_ENVIRONMENT_SKINNED, "builtin/legacy/environment", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true , SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_ENVIRONMENT_SKINNED, "builtin/legacy/environment", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true , SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT_SKINNED },
|
||||
{ BUILTIN_BUMPY_ENVIRONMENT, "builtin/legacy/bumpyenvironment", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_NORMAL_CUBE },
|
||||
{ BUILTIN_BUMPY_ENVIRONMENT_SKINNED, "builtin/legacy/bumpyenvironment", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_NORMAL_CUBE },
|
||||
{ BUILTIN_BUMPY_ENVIRONMENT_SKINNED, "builtin/legacy/bumpyenvironment", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_NORMAL_CUBE_SKINNED },
|
||||
|
||||
{ BUILTIN_DEPTH, "builtin/depth", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_CONSTANT_BUFFER_ONLY },
|
||||
{ BUILTIN_DEPTH_SKINNED, "builtin/depth", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_CONSTANT_BUFFER_ONLY },
|
||||
{ BUILTIN_DEPTH_SKINNED, "builtin/depth", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_CONSTANT_BUFFER_ONLY_SKINNED },
|
||||
|
||||
{ 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 },
|
||||
{ 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 },
|
||||
{ BUILTIN_SHADOW_DEBUG_SKINNED, "builtin/debug/shadowDebug", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT_SKINNED },
|
||||
|
||||
{ BUILTIN_BLENDLIGHT, "builtin/fog/blendlight", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_BLENDLIGHT },
|
||||
{ BUILTIN_FOG, "builtin/fog/fog", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_FOG },
|
||||
{ BUILTIN_FOG_SKINNED, "builtin/fog/fog", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_FOG },
|
||||
{ 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 },
|
||||
{ BUILTIN_FOG, "builtin/fog/fog", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_FOG },
|
||||
{ BUILTIN_FOG_SKINNED, "builtin/fog/fog", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_FOG_SKINNED },
|
||||
{ BUILTIN_SKYBOX, "builtin/legacy/skybox", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_WOBBLESKY, "builtin/legacy/wobblesky", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_POSTPROCESS, "builtin/post/postprocess", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_POST_PROCESS_FINAL },
|
||||
|
|
|
@ -365,6 +365,7 @@ enum
|
|||
BUILTIN_SHADOW_DEBUG_SKINNED,
|
||||
|
||||
BUILTIN_BLENDLIGHT,
|
||||
BUILTIN_BLENDLIGHT_SKINNED,
|
||||
BUILTIN_FOG,
|
||||
BUILTIN_FOG_SKINNED,
|
||||
BUILTIN_SKYBOX,
|
||||
|
@ -985,13 +986,9 @@ public:
|
|||
// the joints buffer should only be bound for vertex programs that use joints
|
||||
bool ShaderUsesJoints() const
|
||||
{
|
||||
#if defined( USE_NVRHI )
|
||||
// FIXME
|
||||
return false;
|
||||
#else
|
||||
return renderProgs[current].usesJoints;
|
||||
#endif
|
||||
return renderProgs[currentIndex].usesJoints;
|
||||
}
|
||||
|
||||
// the rpEnableSkinning render parm should only be set for vertex programs that use it
|
||||
bool ShaderHasOptionalSkinning() const
|
||||
{
|
||||
|
|
|
@ -908,7 +908,7 @@ const emptyCommand_t* idRenderSystemLocal::SwapCommandBuffers_FinishCommandBuffe
|
|||
}
|
||||
|
||||
// prepare the new command buffer
|
||||
guiModel->BeginFrame( commandList );
|
||||
guiModel->BeginFrame();
|
||||
|
||||
//------------------------------
|
||||
// Make sure that geometry used by code is present in the buffer cache.
|
||||
|
|
|
@ -885,9 +885,19 @@ bool R_ReadPixelsRGB8( nvrhi::IDevice* device, CommonRenderPasses* pPasses, nvrh
|
|||
pData = newData;
|
||||
}
|
||||
|
||||
// fix alpha
|
||||
byte* data = static_cast<byte*>( pData );
|
||||
|
||||
#if 0
|
||||
// fill with red for debugging
|
||||
for( int i = 0; i < ( desc.width * desc.height ); i++ )
|
||||
{
|
||||
data[ i * 4 + 0 ] = 255;
|
||||
data[ i * 4 + 1 ] = 0;
|
||||
data[ i * 4 + 2 ] = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
// fix alpha
|
||||
for( int i = 0; i < ( desc.width * desc.height ); i++ )
|
||||
{
|
||||
data[ i * 4 + 3 ] = 0xff;
|
||||
|
@ -906,16 +916,18 @@ bool R_ReadPixelsRGB8( nvrhi::IDevice* device, CommonRenderPasses* pPasses, nvrh
|
|||
return true;
|
||||
}
|
||||
|
||||
bool R_ReadPixelsRGB16F( nvrhi::IDevice* device, CommonRenderPasses* pPasses, nvrhi::ITexture* texture, nvrhi::ResourceStates textureState, void* pic, int picWidth, int picHeight )
|
||||
bool R_ReadPixelsRGB16F( nvrhi::IDevice* device, CommonRenderPasses* pPasses, nvrhi::ITexture* texture, nvrhi::ResourceStates textureState, byte** pic, int picWidth, int picHeight )
|
||||
{
|
||||
nvrhi::TextureDesc desc = texture->getDesc();
|
||||
nvrhi::TextureHandle tempTexture;
|
||||
nvrhi::FramebufferHandle tempFramebuffer;
|
||||
|
||||
#if 0
|
||||
if( desc.width != picWidth || desc.height != picHeight )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
nvrhi::CommandListHandle commandList = device->createCommandList();
|
||||
commandList->open();
|
||||
|
@ -976,9 +988,22 @@ bool R_ReadPixelsRGB16F( nvrhi::IDevice* device, CommonRenderPasses* pPasses, nv
|
|||
pData = newData;
|
||||
}
|
||||
|
||||
int pix = picWidth * picHeight;
|
||||
const int bufferSize = pix * 3 * 2;
|
||||
|
||||
void* floatRGB16F = R_StaticAlloc( bufferSize );
|
||||
*pic = ( byte* ) floatRGB16F;
|
||||
|
||||
// copy from RGBA16F to RGB16F
|
||||
uint16_t* data = static_cast<uint16_t*>( pData );
|
||||
uint16_t* outData = static_cast<uint16_t*>( pic );
|
||||
uint16_t* outData = static_cast<uint16_t*>( floatRGB16F );
|
||||
|
||||
for( int i = 0; i < ( desc.width * desc.height ); i++ )
|
||||
{
|
||||
outData[ i * 3 + 0 ] = F32toF16( 1 );
|
||||
outData[ i * 3 + 1 ] = F32toF16( 0 );
|
||||
outData[ i * 3 + 2 ] = F32toF16( 0 );
|
||||
}
|
||||
|
||||
for( int i = 0; i < ( desc.width * desc.height ); i++ )
|
||||
{
|
||||
|
@ -2225,7 +2250,7 @@ void idRenderSystemLocal::ResetGuiModels()
|
|||
delete guiModel;
|
||||
guiModel = new( TAG_RENDER ) idGuiModel;
|
||||
guiModel->Clear();
|
||||
guiModel->BeginFrame( commandList );
|
||||
guiModel->BeginFrame();
|
||||
tr_guiModel = guiModel; // for DeviceContext fast path
|
||||
}
|
||||
|
||||
|
|
|
@ -1049,15 +1049,13 @@ CONSOLE_COMMAND( bakeEnvironmentProbes, "Bake environment probes", NULL )
|
|||
// discard anything currently on the list (this triggers SwapBuffers)
|
||||
tr.SwapCommandBuffers( NULL, NULL, NULL, NULL, NULL, NULL );
|
||||
|
||||
int pix = captureSize * captureSize;
|
||||
const int bufferSize = pix * 3 * 2;
|
||||
|
||||
byte* floatRGB16F = ( byte* )R_StaticAlloc( bufferSize );
|
||||
|
||||
#if defined( USE_VULKAN )
|
||||
// TODO
|
||||
#elif defined( USE_NVRHI )
|
||||
R_ReadPixelsRGB16F( deviceManager->GetDevice(), &tr.backend.GetCommonPasses(), globalImages->envprobeHDRImage->GetTextureHandle() , nvrhi::ResourceStates::RenderTarget, floatRGB16F, captureSize, captureSize );
|
||||
|
||||
byte* floatRGB16F = NULL;
|
||||
|
||||
R_ReadPixelsRGB16F( deviceManager->GetDevice(), &tr.backend.GetCommonPasses(), globalImages->envprobeHDRImage->GetTextureHandle() , nvrhi::ResourceStates::RenderTarget, &floatRGB16F, captureSize, captureSize );
|
||||
|
||||
#if 0
|
||||
idStr testName;
|
||||
|
@ -1066,6 +1064,11 @@ CONSOLE_COMMAND( bakeEnvironmentProbes, "Bake environment probes", NULL )
|
|||
#endif
|
||||
|
||||
#else
|
||||
int pix = captureSize * captureSize;
|
||||
const int bufferSize = pix * 3 * 2;
|
||||
|
||||
byte* floatRGB16F = ( byte* )R_StaticAlloc( bufferSize );
|
||||
|
||||
|
||||
glFinish();
|
||||
|
||||
|
|
|
@ -1275,18 +1275,15 @@ CONSOLE_COMMAND( bakeLightGrids, "Bake irradiance/vis light grid data", NULL )
|
|||
// discard anything currently on the list (this triggers SwapBuffers)
|
||||
tr.SwapCommandBuffers( NULL, NULL, NULL, NULL, NULL, NULL );
|
||||
|
||||
int pix = captureSize * captureSize;
|
||||
const int bufferSize = pix * 3 * 2;
|
||||
|
||||
byte* floatRGB16F = ( byte* )R_StaticAlloc( bufferSize );
|
||||
|
||||
#if defined( USE_VULKAN )
|
||||
// TODO
|
||||
#elif defined( USE_NVRHI )
|
||||
// make sure that all frames have finished rendering
|
||||
//deviceManager->GetDevice()->waitForIdle();
|
||||
|
||||
R_ReadPixelsRGB16F( deviceManager->GetDevice(), &tr.backend.GetCommonPasses(), globalImages->envprobeHDRImage->GetTextureHandle() , nvrhi::ResourceStates::RenderTarget, floatRGB16F, captureSize, captureSize );
|
||||
byte* floatRGB16F = NULL;
|
||||
|
||||
R_ReadPixelsRGB16F( deviceManager->GetDevice(), &tr.backend.GetCommonPasses(), globalImages->envprobeHDRImage->GetTextureHandle() , nvrhi::ResourceStates::RenderTarget, &floatRGB16F, captureSize, captureSize );
|
||||
|
||||
// release all in-flight references to the render targets
|
||||
//deviceManager->GetDevice()->runGarbageCollection();
|
||||
|
@ -1298,6 +1295,11 @@ CONSOLE_COMMAND( bakeLightGrids, "Bake irradiance/vis light grid data", NULL )
|
|||
#endif
|
||||
|
||||
#else
|
||||
int pix = captureSize * captureSize;
|
||||
const int bufferSize = pix * 3 * 2;
|
||||
|
||||
byte* floatRGB16F = ( byte* )R_StaticAlloc( bufferSize );
|
||||
|
||||
glFinish();
|
||||
|
||||
glReadBuffer( GL_BACK );
|
||||
|
|
|
@ -334,7 +334,7 @@ R_SetupDrawSurfJoints
|
|||
*/
|
||||
void R_SetupDrawSurfJoints( drawSurf_t* drawSurf, const srfTriangles_t* tri, const idMaterial* shader, nvrhi::ICommandList* commandList )
|
||||
{
|
||||
// RB: added check wether GPU skinning is available at all
|
||||
// RB: added check whether GPU skinning is available at all
|
||||
if( tri->staticModelWithJoints == NULL || !r_useGPUSkinning.GetBool() || !glConfig.gpuSkinningAvailable )
|
||||
{
|
||||
drawSurf->jointCache = 0;
|
||||
|
@ -347,7 +347,6 @@ void R_SetupDrawSurfJoints( drawSurf_t* drawSurf, const srfTriangles_t* tri, con
|
|||
|
||||
if( !vertexCache.CacheIsCurrent( model->jointsInvertedBuffer ) )
|
||||
{
|
||||
const int alignment = glConfig.uniformBufferOffsetAlignment;
|
||||
model->jointsInvertedBuffer = vertexCache.AllocJoint( model->jointsInverted, model->numInvertedJoints, sizeof( idJointMat ), commandList );
|
||||
}
|
||||
drawSurf->jointCache = model->jointsInvertedBuffer;
|
||||
|
@ -734,7 +733,7 @@ void R_AddSingleModel( viewEntity_t* vEntity )
|
|||
// individual surfaces.
|
||||
const bool surfaceDirectlyVisible = modelIsVisible && !idRenderMatrix::CullBoundsToMVP( vEntity->mvp, tri->bounds );
|
||||
|
||||
// RB: added check wether GPU skinning is available at all
|
||||
// RB: added check whether GPU skinning is available at all
|
||||
const bool gpuSkinned = ( tri->staticModelWithJoints != NULL && r_useGPUSkinning.GetBool() && glConfig.gpuSkinningAvailable );
|
||||
// RB end
|
||||
|
||||
|
|
|
@ -30,15 +30,11 @@ 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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
|
|
|
@ -30,18 +30,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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
|
||||
StructuredBuffer<float4> matrices: register(t11);
|
||||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -50,7 +45,8 @@ struct VS_IN {
|
|||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float3 texcoord0 : TEXCOORD0_centroid;
|
||||
float3 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -30,18 +30,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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
|
||||
StructuredBuffer<float4> matrices: register(t11);
|
||||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -50,7 +45,8 @@ struct VS_IN {
|
|||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float3 texcoord0 : TEXCOORD0_centroid;
|
||||
float3 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -31,13 +31,11 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
// *INDENT-OFF*
|
||||
#if USE_GPU_SKINNING
|
||||
cbuffer CB : register( b1 VK_DESCRIPTOR_SET( 0 ))
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices: register(t11);
|
||||
#endif
|
||||
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
#if USE_GPU_SKINNING
|
||||
float4 color : COLOR0;
|
||||
|
@ -45,7 +43,8 @@ struct VS_IN {
|
|||
#endif
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
};
|
||||
// *INDENT-ON*
|
||||
|
|
|
@ -28,10 +28,9 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "global_inc.hlsl"
|
||||
|
||||
|
||||
// *INDENT-OFF*
|
||||
|
||||
struct PS_OUT {
|
||||
struct PS_OUT
|
||||
{
|
||||
float4 color : SV_Target0;
|
||||
};
|
||||
// *INDENT-ON*
|
||||
|
|
|
@ -28,17 +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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
#if USE_GPU_SKINNING
|
||||
float2 texcoord : TEXCOORD0;
|
||||
|
@ -49,7 +45,8 @@ struct VS_IN {
|
|||
#endif
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
};
|
||||
// *INDENT-ON*
|
||||
|
|
|
@ -1,45 +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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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*
|
||||
Texture2D t_ViewDepth : register( t0 );
|
||||
|
||||
SamplerState LinearSampler : register( s0 );
|
||||
|
||||
struct PS_OUT {
|
||||
float4 color : COLOR;
|
||||
};
|
||||
// *INDENT-ON*
|
||||
|
||||
void main( out PS_OUT result )
|
||||
{
|
||||
result.color = float4( 0.0, 0.0, 0.0, 1.0 );
|
||||
}
|
|
@ -1,93 +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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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;
|
||||
};
|
||||
// *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 );
|
||||
}
|
|
@ -30,15 +30,24 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct VS_IN {
|
||||
#if USE_GPU_SKINNING
|
||||
StructuredBuffer<float4> matrices: register(t11);
|
||||
#endif
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
float4 tangent : TANGENT;
|
||||
float4 color : COLOR0;
|
||||
#if USE_GPU_SKINNING
|
||||
float4 color2 : COLOR1;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float4 texcoord0 : TEXCOORD0_centroid;
|
||||
float2 texcoord1 : TEXCOORD1_centroid;
|
||||
|
@ -47,6 +56,59 @@ struct VS_OUT {
|
|||
|
||||
void main( VS_IN vertex, out VS_OUT result )
|
||||
{
|
||||
#if USE_GPU_SKINNING
|
||||
//--------------------------------------------------------------
|
||||
// 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;
|
||||
// end of skinning
|
||||
|
||||
// start of fog portion
|
||||
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.x = dot4( modelPosition, rpTexGen0S );
|
||||
result.texcoord0.y = dot4( modelPosition, rpTexGen0T );
|
||||
result.texcoord0.z = 0.0;
|
||||
result.texcoord0.w = dot4( modelPosition, rpTexGen0Q );
|
||||
|
||||
result.texcoord1.x = dot4( modelPosition, rpTexGen1S );
|
||||
result.texcoord1.y = 0.5;
|
||||
#else
|
||||
result.position.x = dot4( vertex.position, rpMVPmatrixX );
|
||||
result.position.y = dot4( vertex.position, rpMVPmatrixY );
|
||||
result.position.z = dot4( vertex.position, rpMVPmatrixZ );
|
||||
|
@ -59,4 +121,5 @@ void main( VS_IN vertex, out VS_OUT result )
|
|||
|
||||
result.texcoord1.x = dot4( vertex.position, rpTexGen1S );
|
||||
result.texcoord1.y = 0.5;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -31,13 +31,11 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
// *INDENT-OFF*
|
||||
#if USE_GPU_SKINNING
|
||||
cbuffer CB : register( b1 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices: register(t11);
|
||||
#endif
|
||||
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -48,7 +46,8 @@ struct VS_IN {
|
|||
#endif
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float2 texcoord0 : TEXCOORD0_centroid;
|
||||
float2 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -29,17 +29,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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -48,7 +44,8 @@ struct VS_IN {
|
|||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float2 texcoord0 : TEXCOORD0_centroid;
|
||||
float3 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -30,12 +30,11 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
// *INDENT-OFF*
|
||||
#if USE_GPU_SKINNING
|
||||
cbuffer CB : register( b1 VK_DESCRIPTOR_SET( 0 )) {
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -46,7 +45,8 @@ struct VS_IN {
|
|||
#endif
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float2 texcoord0 : TEXCOORD0_centroid;
|
||||
float3 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -28,16 +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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float4 normal : NORMAL;
|
||||
float4 color : COLOR0;
|
||||
|
@ -46,7 +43,8 @@ struct VS_IN {
|
|||
#endif
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float3 texcoord0 : TEXCOORD0_centroid;
|
||||
float3 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -30,16 +30,14 @@ 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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices: register(t11);
|
||||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -48,7 +46,8 @@ struct VS_IN {
|
|||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float4 texcoord0 : TEXCOORD0_centroid;
|
||||
float4 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -30,16 +30,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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices: register(t11);
|
||||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -48,7 +45,8 @@ struct VS_IN {
|
|||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float4 texcoord0 : TEXCOORD0_centroid;
|
||||
float4 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -29,16 +29,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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices: register(t11);
|
||||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -47,7 +44,8 @@ struct VS_IN {
|
|||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float4 texcoord0 : TEXCOORD0_centroid;
|
||||
float4 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -28,49 +28,32 @@ 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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices: register(t11);
|
||||
#endif
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position :
|
||||
POSITION;
|
||||
float2 texcoord :
|
||||
TEXCOORD0;
|
||||
float4 normal :
|
||||
NORMAL;
|
||||
float4 tangent :
|
||||
TANGENT;
|
||||
float4 color :
|
||||
COLOR0;
|
||||
float4 color2 :
|
||||
COLOR1;
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
float4 tangent : TANGENT;
|
||||
float4 color : COLOR0;
|
||||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT
|
||||
{
|
||||
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 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;
|
||||
};
|
||||
|
||||
// *INDENT-ON*
|
||||
|
|
|
@ -30,15 +30,12 @@ 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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices: register(t11);
|
||||
#endif
|
||||
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -47,7 +44,8 @@ struct VS_IN {
|
|||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float4 texcoord0 : TEXCOORD0_centroid;
|
||||
float4 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -31,13 +31,11 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
// *INDENT-OFF*
|
||||
#if USE_GPU_SKINNING
|
||||
cbuffer CB : register( b1 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
#if USE_GPU_SKINNING
|
||||
float4 color : COLOR0;
|
||||
|
@ -45,7 +43,8 @@ struct VS_IN {
|
|||
#endif
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : POSITION;
|
||||
};
|
||||
// *INDENT-ON*
|
||||
|
|
|
@ -28,24 +28,21 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "global_inc.hlsl"
|
||||
|
||||
//#pragma pack_matrix(row_major)
|
||||
|
||||
// *INDENT-OFF*
|
||||
#if USE_GPU_SKINNING
|
||||
cbuffer CB : register( b1 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 color : COLOR0;
|
||||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float2 texcoord0 : TEXCOORD0_centroid;
|
||||
float4 color : COLOR0;
|
||||
|
|
|
@ -33,14 +33,9 @@ If you have questions concerning this license or the applicable additional terms
|
|||
// User Renderparms start at 128 as per renderprogs.h
|
||||
|
||||
// *INDENT-OFF*
|
||||
//
|
||||
#if USE_GPU_SKINNING
|
||||
cbuffer CB : register( b1 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
// RB end
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
|
|
|
@ -30,16 +30,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 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -48,7 +45,8 @@ struct VS_IN {
|
|||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float4 texcoord0 : TEXCOORD0_centroid;
|
||||
float4 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -33,17 +33,12 @@ If you have questions concerning this license or the applicable additional terms
|
|||
// User Renderparms start at 128 as per renderprogs.h
|
||||
|
||||
// *INDENT-OFF*
|
||||
//
|
||||
// RB: no GPU skinning with ES 2.0
|
||||
#if USE_GPU_SKINNING
|
||||
cbuffer CB : register( b1 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
// RB end
|
||||
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -52,7 +47,8 @@ struct VS_IN {
|
|||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float4 texcoord0 : TEXCOORD0_centroid;
|
||||
float4 texcoord1 : TEXCOORD1_centroid;
|
||||
|
|
|
@ -28,18 +28,13 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "global_inc.hlsl"
|
||||
|
||||
// RB: no GPU skinning with ES 2.0
|
||||
// *INDENT-OFF*
|
||||
#if USE_GPU_SKINNING
|
||||
cbuffer CB :
|
||||
register( b1 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
// RB end
|
||||
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -48,7 +43,8 @@ struct VS_IN {
|
|||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
float4 texcoord0 : TEXCOORD0;
|
||||
float4 texcoord1 : TEXCOORD1;
|
||||
|
|
|
@ -88,8 +88,8 @@ builtin/SSGI/DeepGBufferRadiosity_blur.ps.hlsl -T ps_5_0
|
|||
builtin/SSGI/DeepGBufferRadiosity_radiosity.vs.hlsl -T vs_5_0
|
||||
builtin/SSGI/DeepGBufferRadiosity_radiosity.ps.hlsl -T ps_5_0
|
||||
|
||||
builtin/fog/blendLight.vs.hlsl -T vs_5_0
|
||||
builtin/fog/blendLight.ps.hlsl -T ps_5_0
|
||||
builtin/fog/blendLight.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/fog/blendLight.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/fog/fog.vs.hlsl -T vs_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
builtin/fog/fog.ps.hlsl -T ps_5_0 -D USE_GPU_SKINNING={0,1}
|
||||
|
||||
|
|
|
@ -28,19 +28,13 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "global_inc.hlsl"
|
||||
|
||||
// RB: no GPU skinning with ES 2.0
|
||||
#if USE_GPU_SKINNING
|
||||
cbuffer CB :
|
||||
register( b1 )
|
||||
{
|
||||
float4 matrices[408];
|
||||
};
|
||||
#endif
|
||||
// RB end
|
||||
|
||||
// *INDENT-OFF*
|
||||
#if USE_GPU_SKINNING
|
||||
StructuredBuffer<float4> matrices : register(t11);
|
||||
#endif
|
||||
|
||||
struct VS_IN {
|
||||
struct VS_IN
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
|
@ -49,7 +43,8 @@ struct VS_IN {
|
|||
float4 color2 : COLOR1;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float4 texcoord0 : TEXCOORD0;
|
||||
float4 texcoord1 : TEXCOORD1;
|
||||
|
|
|
@ -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
|
||||
set filename=RBDOOM-3-BFG-1.5.0.4-lite-win64-yyyymmdd-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 -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
|
||||
7z a %filename% -r base/renderprogs2/dxil/*.bin
|
||||
7z a %filename% base/_tb/fgd/*.fgd
|
||||
7z a %filename% tools/trenchbroom -xr!TrenchBroom-nomanual* -xr!TrenchBroom.pdb
|
||||
pause
|
||||
|
|
Loading…
Reference in a new issue