mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Fixed vkGLSL binding counting
This commit is contained in:
parent
472596a548
commit
e324b8a1fd
3 changed files with 12 additions and 5 deletions
|
@ -296,7 +296,7 @@ if(USE_VULKAN)
|
|||
SET_OPTION(ENABLE_SPVREMAPPER OFF)
|
||||
SET_OPTION(ENABLE_GLSLANG_BINARIES OFF)
|
||||
SET_OPTION(ENABLE_HLSL OFF)
|
||||
SET_OPTION(ENABLE_OPT OFF)
|
||||
#SET_OPTION(ENABLE_OPT OFF)
|
||||
|
||||
#option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON)
|
||||
#option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON)
|
||||
|
|
|
@ -1146,6 +1146,7 @@ idStr idRenderProgManager::ConvertCG2GLSL( const idStr& in, const char* name, bo
|
|||
ParseInOutStruct( src, AT_VS_OUT, AT_VS_OUT_RESERVED, varsOut );
|
||||
|
||||
program += "\n";
|
||||
int numDeclareOut = 0;
|
||||
for( int i = 0; i < varsOut.Num(); i++ )
|
||||
{
|
||||
if( varsOut[i].declareInOut )
|
||||
|
@ -1153,12 +1154,14 @@ idStr idRenderProgManager::ConvertCG2GLSL( const idStr& in, const char* name, bo
|
|||
// RB: add layout locations
|
||||
if( vkGLSL )
|
||||
{
|
||||
program += va( "layout( location = %i ) out %s %s;\n", i, varsOut[i].type.c_str(), varsOut[i].nameGLSL.c_str() );
|
||||
program += va( "layout( location = %i ) out %s %s;\n", numDeclareOut, varsOut[i].type.c_str(), varsOut[i].nameGLSL.c_str() );
|
||||
}
|
||||
else
|
||||
{
|
||||
program += "out " + varsOut[i].type + " " + varsOut[i].nameGLSL + ";\n";
|
||||
}
|
||||
|
||||
numDeclareOut++;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
|
@ -1168,6 +1171,7 @@ idStr idRenderProgManager::ConvertCG2GLSL( const idStr& in, const char* name, bo
|
|||
ParseInOutStruct( src, AT_PS_IN, AT_PS_IN_RESERVED, varsIn );
|
||||
|
||||
program += "\n\n";
|
||||
int numDeclareOut = 0;
|
||||
for( int i = 0; i < varsIn.Num(); i++ )
|
||||
{
|
||||
if( varsIn[i].declareInOut )
|
||||
|
@ -1175,12 +1179,14 @@ idStr idRenderProgManager::ConvertCG2GLSL( const idStr& in, const char* name, bo
|
|||
// RB: add layout locations
|
||||
if( vkGLSL )
|
||||
{
|
||||
program += va( "layout( location = %i ) in %s %s;\n", i, varsIn[i].type.c_str(), varsIn[i].nameGLSL.c_str() );
|
||||
program += va( "layout( location = %i ) in %s %s;\n", numDeclareOut, varsIn[i].type.c_str(), varsIn[i].nameGLSL.c_str() );
|
||||
}
|
||||
else
|
||||
{
|
||||
program += "in " + varsIn[i].type + " " + varsIn[i].nameGLSL + ";\n";
|
||||
}
|
||||
|
||||
numDeclareOut++;
|
||||
}
|
||||
}
|
||||
inOutVariable_t var;
|
||||
|
@ -1272,7 +1278,7 @@ idStr idRenderProgManager::ConvertCG2GLSL( const idStr& in, const char* name, bo
|
|||
// RB: add this to every vertex shader
|
||||
if( inMain && !justEnteredMain && isVertexProgram && vkGLSL )
|
||||
{
|
||||
program += "\nvec4 position4 = vec4( in_Position, 1.0 );\n";
|
||||
program += "\n\tvec4 position4 = vec4( in_Position, 1.0 );\n";
|
||||
justEnteredMain = true;
|
||||
}
|
||||
|
||||
|
@ -1563,7 +1569,7 @@ idStr idRenderProgManager::ConvertCG2GLSL( const idStr& in, const char* name, bo
|
|||
// RB: add samplers with layout bindings
|
||||
if( vkGLSL )
|
||||
{
|
||||
int bindingOffset = uniformList.Num() > 0 ? 2 : 0;
|
||||
int bindingOffset = uniformList.Num() > 0 ? 2 : 1;
|
||||
|
||||
for( int i = 0; i < samplerList.Num(); i++ )
|
||||
{
|
||||
|
|
|
@ -181,6 +181,7 @@ void CreateDescriptorPools( VkDescriptorPool( &pools )[ NUM_FRAME_DATA ] )
|
|||
VkDescriptorPoolSize poolSizes[ numPools ];
|
||||
poolSizes[ 0 ].type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
|
||||
poolSizes[ 0 ].descriptorCount = MAX_DESC_UNIFORM_BUFFERS;
|
||||
|
||||
poolSizes[ 1 ].type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
|
||||
poolSizes[ 1 ].descriptorCount = MAX_DESC_IMAGE_SAMPLERS;
|
||||
|
||||
|
|
Loading…
Reference in a new issue