@@ -480,12 +480,12 @@ namespace dxvk {
480480
481481 spvModule.setDebugName (specBlock, " spec_state" );
482482 spvModule.decorateDescriptorSet (specBlock, 0 );
483- spvModule.decorateBinding (specBlock, getSpecConstantBufferSlot ());
483+ spvModule.decorateBinding (specBlock, D3D9ShaderResourceMapping:: getSpecConstantBufferSlot ());
484484
485485 auto & binding = bindings.emplace_back ();
486486 binding.set = 0u ;
487- binding.binding = getSpecConstantBufferSlot ();
488- binding.resourceIndex = getSpecConstantBufferSlot ();
487+ binding.binding = D3D9ShaderResourceMapping:: getSpecConstantBufferSlot ();
488+ binding.resourceIndex = D3D9ShaderResourceMapping:: getSpecConstantBufferSlot ();
489489 binding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER ;
490490 binding.access = VK_ACCESS_UNIFORM_READ_BIT ;
491491 binding.flags .set (DxvkDescriptorFlag::UniformBuffer);
@@ -1700,9 +1700,8 @@ namespace dxvk {
17001700
17011701 m_module.setDebugName (m_vs.constantBuffer , " consts" );
17021702
1703- const uint32_t bindingId = computeResourceSlotId (
1704- D3D9ShaderType::VertexShader, DxsoBindingType::ConstantBuffer,
1705- DxsoConstantBuffers::VSFixedFunction);
1703+ const uint32_t bindingId = D3D9ShaderResourceMapping::computeCbvBinding (D3D9ShaderType::VertexShader,
1704+ D3D9ShaderResourceMapping::ConstantBuffers::VSFixedFunction);
17061705
17071706 m_module.decorateDescriptorSet (m_vs.constantBuffer , 0 );
17081707 m_module.decorateBinding (m_vs.constantBuffer , bindingId);
@@ -1739,9 +1738,8 @@ namespace dxvk {
17391738
17401739 m_module.setDebugName (m_vs.vertexBlendData , " VertexBlendData" );
17411740
1742- const uint32_t bindingId = computeResourceSlotId (
1743- D3D9ShaderType::VertexShader, DxsoBindingType::ConstantBuffer,
1744- DxsoConstantBuffers::VSVertexBlendData);
1741+ const uint32_t bindingId = D3D9ShaderResourceMapping::computeCbvBinding (D3D9ShaderType::VertexShader,
1742+ D3D9ShaderResourceMapping::ConstantBuffers::VSVertexBlendData);
17451743
17461744 m_module.decorateDescriptorSet (m_vs.vertexBlendData , 0 );
17471745 m_module.decorateBinding (m_vs.vertexBlendData , bindingId);
@@ -2445,9 +2443,8 @@ namespace dxvk {
24452443
24462444 m_module.setDebugName (m_ps.constantBuffer , " consts" );
24472445
2448- const uint32_t bindingId = computeResourceSlotId (
2449- D3D9ShaderType::PixelShader, DxsoBindingType::ConstantBuffer,
2450- DxsoConstantBuffers::PSFixedFunction);
2446+ const uint32_t bindingId = D3D9ShaderResourceMapping::computeCbvBinding (D3D9ShaderType::PixelShader,
2447+ D3D9ShaderResourceMapping::ConstantBuffers::PSFixedFunction);
24512448
24522449 m_module.decorateDescriptorSet (m_ps.constantBuffer , 0 );
24532450 m_module.decorateBinding (m_ps.constantBuffer , bindingId);
@@ -2473,8 +2470,7 @@ namespace dxvk {
24732470
24742471 // Samplers
24752472 for (uint32_t i = 0 ; i < caps::TextureStageCount; i++) {
2476- const uint32_t imageBindingId = computeResourceSlotId (D3D9ShaderType::PixelShader,
2477- DxsoBindingType::Image, i);
2473+ const uint32_t imageBindingId = D3D9ShaderResourceMapping::computeTextureBinding (D3D9ShaderType::PixelShader, i);
24782474
24792475 auto & imageBinding = m_bindings.emplace_back ();
24802476 imageBinding.set = 0u ;
@@ -2545,9 +2541,8 @@ namespace dxvk {
25452541 void D3D9FFShaderCompiler::emitPsSharedConstants () {
25462542 m_ps.sharedState = GetSharedConstants (m_module);
25472543
2548- const uint32_t bindingId = computeResourceSlotId (
2549- m_shaderType, DxsoBindingType::ConstantBuffer,
2550- PSShared);
2544+ const uint32_t bindingId = D3D9ShaderResourceMapping::computeCbvBinding (m_shaderType,
2545+ D3D9ShaderResourceMapping::ConstantBuffers::PSShared);
25512546
25522547 m_module.decorateDescriptorSet (m_ps.sharedState , 0 );
25532548 m_module.decorateBinding (m_ps.sharedState , bindingId);
@@ -2585,10 +2580,8 @@ namespace dxvk {
25852580 m_module.decorate (clipPlaneStruct, spv::DecorationBlock);
25862581 m_module.memberDecorateOffset (clipPlaneStruct, 0 , 0 );
25872582
2588- uint32_t bindingId = computeResourceSlotId (
2589- D3D9ShaderType::VertexShader,
2590- DxsoBindingType::ConstantBuffer,
2591- DxsoConstantBuffers::VSClipPlanes);
2583+ const uint32_t bindingId = D3D9ShaderResourceMapping::computeCbvBinding (D3D9ShaderType::VertexShader,
2584+ D3D9ShaderResourceMapping::ConstantBuffers::VSClipPlanes);
25922585
25932586 m_module.setDebugName (clipPlaneBlock, " clip_info" );
25942587 m_module.decorateDescriptorSet (clipPlaneBlock, 0 );
@@ -2743,7 +2736,7 @@ namespace dxvk {
27432736 if (isVS) {
27442737 std::array<DxvkBindingInfo, 4 > bindings;
27452738
2746- constexpr uint32_t specConstantBufferBindingId = getSpecConstantBufferSlot ();
2739+ constexpr uint32_t specConstantBufferBindingId = D3D9ShaderResourceMapping:: getSpecConstantBufferSlot ();
27472740 auto & specConstantBufferBinding = bindings[0 ];
27482741 specConstantBufferBinding.set = 0u ;
27492742 specConstantBufferBinding.binding = specConstantBufferBindingId;
@@ -2752,9 +2745,8 @@ namespace dxvk {
27522745 specConstantBufferBinding.access = VK_ACCESS_UNIFORM_READ_BIT ;
27532746 specConstantBufferBinding.flags .set (DxvkDescriptorFlag::UniformBuffer);
27542747
2755- constexpr uint32_t fixedFunctionDataBindingId = computeResourceSlotId (
2756- D3D9ShaderType::VertexShader, DxsoBindingType::ConstantBuffer,
2757- DxsoConstantBuffers::VSFixedFunction);
2748+ constexpr uint32_t fixedFunctionDataBindingId = D3D9ShaderResourceMapping::computeCbvBinding (
2749+ D3D9ShaderType::VertexShader, D3D9ShaderResourceMapping::ConstantBuffers::VSFixedFunction);
27582750 auto & fixedFunctionDataBinding = bindings[1 ];
27592751 fixedFunctionDataBinding.set = 0u ;
27602752 fixedFunctionDataBinding.binding = fixedFunctionDataBindingId;
@@ -2763,9 +2755,8 @@ namespace dxvk {
27632755 fixedFunctionDataBinding.access = VK_ACCESS_UNIFORM_READ_BIT ;
27642756 fixedFunctionDataBinding.flags .set (DxvkDescriptorFlag::UniformBuffer);
27652757
2766- constexpr uint32_t vertexBlendBindingId = computeResourceSlotId (
2767- D3D9ShaderType::VertexShader, DxsoBindingType::ConstantBuffer,
2768- DxsoConstantBuffers::VSVertexBlendData);
2758+ constexpr uint32_t vertexBlendBindingId = D3D9ShaderResourceMapping::computeCbvBinding (
2759+ D3D9ShaderType::VertexShader, D3D9ShaderResourceMapping::ConstantBuffers::VSVertexBlendData);
27692760 auto & vertexBlendBinding = bindings[2 ];
27702761 vertexBlendBinding.set = 0u ;
27712762 vertexBlendBinding.binding = vertexBlendBindingId;
@@ -2774,9 +2765,8 @@ namespace dxvk {
27742765 vertexBlendBinding.access = VK_ACCESS_SHADER_READ_BIT ;
27752766 vertexBlendBinding.flags .set (DxvkDescriptorFlag::UniformBuffer);
27762767
2777- constexpr uint32_t clipPlanesBindingId = computeResourceSlotId (
2778- D3D9ShaderType::VertexShader, DxsoBindingType::ConstantBuffer,
2779- DxsoConstantBuffers::VSClipPlanes);
2768+ constexpr uint32_t clipPlanesBindingId = D3D9ShaderResourceMapping::computeCbvBinding (
2769+ D3D9ShaderType::VertexShader, D3D9ShaderResourceMapping::ConstantBuffers::VSClipPlanes);
27802770 auto & clipPlanesBinding = bindings[3 ];
27812771 clipPlanesBinding.set = 0u ;
27822772 clipPlanesBinding.binding = clipPlanesBindingId;
@@ -2798,7 +2788,7 @@ namespace dxvk {
27982788 } else {
27992789 std::vector<DxvkBindingInfo> bindings;
28002790
2801- constexpr uint32_t specConstantBufferBindingId = getSpecConstantBufferSlot ();
2791+ constexpr uint32_t specConstantBufferBindingId = D3D9ShaderResourceMapping:: getSpecConstantBufferSlot ();
28022792 auto & specConstantBufferBinding = bindings.emplace_back ();
28032793 specConstantBufferBinding.set = 0u ;
28042794 specConstantBufferBinding.binding = specConstantBufferBindingId;
@@ -2807,9 +2797,8 @@ namespace dxvk {
28072797 specConstantBufferBinding.access = VK_ACCESS_UNIFORM_READ_BIT ;
28082798 specConstantBufferBinding.flags .set (DxvkDescriptorFlag::UniformBuffer);
28092799
2810- constexpr uint32_t fixedFunctionDataBindingId = computeResourceSlotId (
2811- D3D9ShaderType::PixelShader, DxsoBindingType::ConstantBuffer,
2812- DxsoConstantBuffers::PSFixedFunction);
2800+ constexpr uint32_t fixedFunctionDataBindingId = D3D9ShaderResourceMapping::computeCbvBinding (
2801+ D3D9ShaderType::PixelShader, D3D9ShaderResourceMapping::ConstantBuffers::PSFixedFunction);
28132802 auto & fixedFunctionDataBinding = bindings.emplace_back ();
28142803 fixedFunctionDataBinding.set = 0u ;
28152804 fixedFunctionDataBinding.binding = fixedFunctionDataBindingId;
@@ -2818,9 +2807,8 @@ namespace dxvk {
28182807 fixedFunctionDataBinding.access = VK_ACCESS_UNIFORM_READ_BIT ;
28192808 fixedFunctionDataBinding.flags .set (DxvkDescriptorFlag::UniformBuffer);
28202809
2821- constexpr uint32_t sharedDataBindingId = computeResourceSlotId (
2822- D3D9ShaderType::PixelShader, DxsoBindingType::ConstantBuffer,
2823- DxsoConstantBuffers::PSShared);
2810+ constexpr uint32_t sharedDataBindingId = D3D9ShaderResourceMapping::computeCbvBinding (
2811+ D3D9ShaderType::PixelShader, D3D9ShaderResourceMapping::ConstantBuffers::PSShared);
28242812 auto & sharedDataBinding = bindings.emplace_back ();
28252813 sharedDataBinding.set = 0u ;
28262814 sharedDataBinding.binding = sharedDataBindingId;
@@ -2829,10 +2817,7 @@ namespace dxvk {
28292817 sharedDataBinding.access = VK_ACCESS_SHADER_READ_BIT ;
28302818 sharedDataBinding.flags .set (DxvkDescriptorFlag::UniformBuffer);
28312819
2832- constexpr uint32_t textureBindingId = computeResourceSlotId (
2833- D3D9ShaderType::PixelShader,
2834- DxsoBindingType::Image,
2835- 0 );
2820+ constexpr uint32_t textureBindingId = D3D9ShaderResourceMapping::computeTextureBinding (D3D9ShaderType::PixelShader, 0u );
28362821 auto & textureBinding = bindings.emplace_back ();
28372822 textureBinding.set = 0u ;
28382823 textureBinding.binding = textureBindingId;
@@ -2842,10 +2827,7 @@ namespace dxvk {
28422827 textureBinding.descriptorCount = caps::TextureStageCount;
28432828
28442829 for (uint32_t i = 0 ; i < caps::TextureStageCount; i++) {
2845- uint32_t samplerBindingId = computeResourceSlotId (
2846- D3D9ShaderType::PixelShader,
2847- DxsoBindingType::Image,
2848- i);
2830+ uint32_t samplerBindingId = D3D9ShaderResourceMapping::computeTextureBinding (D3D9ShaderType::PixelShader, i);
28492831
28502832 auto & samplerBinding = bindings.emplace_back ();
28512833 samplerBinding.resourceIndex = samplerBindingId;
0 commit comments