Zgragselus

CommandSignature.cpp

Jan 24th, 2026
136
0
Never
9
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.47 KB | None | 0 0
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // CommandSignature.cpp
  4. //
  5. ///////////////////////////////////////////////////////////////////////////////////////////////////
  6.  
  7. ///////////////////////////////////////////////////////////////////////////////////////////////////
  8. // Header section
  9.  
  10. #include "CommandSignature.h"
  11. #include "../D3DRenderer.h"
  12.  
  13. ///////////////////////////////////////////////////////////////////////////////////////////////////
  14. // Declaration section
  15.  
  16. using namespace Engine;
  17.  
  18. ///////////////////////////////////////////////////////////////////////////////////////////////////
  19. // Definition section
  20.  
  21. /// <summary>
  22. /// Initialize Direct3D 12 command signature object
  23. /// </summary>
  24. /// <param name="device">Direct3D 12 device</param>
  25. /// <param name="stride">Record stride</param>
  26. /// <param name="rootSignature">Root signature for this command signature</param>
  27. void CommandSignature::Init(ID3D12Device* device, size_t stride, RootSignature* rootSignature)
  28. {
  29.     if (mFinalized)
  30.     {
  31.         return;
  32.     }
  33.  
  34.     unsigned int byteStride = 0;
  35.     bool requiresRootSignature = false;
  36.  
  37.     for (unsigned int i = 0; i < mNumParameters; i++)
  38.     {
  39.         switch (mParameters[i].Get().Type)
  40.         {
  41.         case D3D12_INDIRECT_ARGUMENT_TYPE_DRAW:
  42.             byteStride += sizeof(D3D12_DRAW_ARGUMENTS);
  43.             break;
  44.  
  45.         case D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED:
  46.             byteStride += sizeof(D3D12_DRAW_INDEXED_ARGUMENTS);
  47.             break;
  48.  
  49.         case D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH:
  50.             byteStride += sizeof(D3D12_DISPATCH_ARGUMENTS);
  51.             break;
  52.  
  53.         case D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW:
  54.             byteStride += sizeof(D3D12_VERTEX_BUFFER_VIEW);
  55.             break;
  56.  
  57.         case D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW:
  58.             byteStride += sizeof(D3D12_INDEX_BUFFER_VIEW);
  59.             break;
  60.  
  61.         case D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT:
  62.             byteStride += mParameters[i].Get().Constant.Num32BitValuesToSet * 4;
  63.             requiresRootSignature = true;
  64.             break;
  65.  
  66.         case D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW:
  67.         case D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW:
  68.         case D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW:
  69.             byteStride += 8;
  70.             requiresRootSignature = true;
  71.             break;
  72.  
  73.         case D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH:
  74.             byteStride += sizeof(D3D12_DISPATCH_ARGUMENTS);
  75.             requiresRootSignature = true;
  76.             break;
  77.         }
  78.     }
  79.  
  80.     byteStride = (unsigned int)stride;
  81.  
  82.     D3D12_COMMAND_SIGNATURE_DESC desc;
  83.     desc.ByteStride = byteStride;
  84.     desc.NumArgumentDescs = mNumParameters;
  85.     desc.pArgumentDescs = (const D3D12_INDIRECT_ARGUMENT_DESC*)mParameters;
  86.     desc.NodeMask = 1;
  87.  
  88.     //ID3DBlob* outBlob;
  89.     //ID3DBlob* errorBlob;
  90.  
  91.     ID3D12RootSignature* rootSignatureD3D = rootSignature ? rootSignature->Get() : nullptr;
  92.     if (requiresRootSignature)
  93.     {
  94.         // TODO: if rootSignature is null, log!
  95.     }
  96.     else
  97.     {
  98.         rootSignatureD3D = nullptr;
  99.     }
  100.  
  101.     device->CreateCommandSignature(&desc, rootSignatureD3D, __uuidof(ID3D12CommandSignature), (void**)&mSignature);
  102.     mSignature->SetName(L"CommandSignature");
  103.  
  104.     mFinalized = true;
  105. }
  106.  
  107. /// <summary>
  108. /// Initialize Direct3D 12 command signature object
  109. /// </summary>
  110. /// <param name="renderer">Direct3D 12 renderer</param>
  111. /// <param name="stride">Record stride</param>
  112. /// <param name="rootSignature">Root signature for this command signature</param>
  113. void CommandSignature::Init(D3DRenderer* renderer, size_t stride, RootSignature* rootSignature)
  114. {
  115.     Init(renderer->GetDevice(), stride, rootSignature);
  116. }
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Prasoldy
    15 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=gdqxjsyoyr
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment