Jump to content
  • Advertisement

Andrew Naumov

  • Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral

About Andrew Naumov

  • Rank

Personal Information

  • Interests


  • Github

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Andrew Naumov

    dxc code size [SOLVED]

    I tried to compile your code http://shader-playground.timjones.io/7abb0a7a8455e45e6bda522c8536c6eb and got follow errors: D:\local\Temp\268cd6bd-54aa-48bf-9301-ae7880bf1c61.hlsl:1:3: error: 'push_constant' attribute only applies to global variables of struct type [[vk::push_constant]] ^ D:\local\Temp\268cd6bd-54aa-48bf-9301-ae7880bf1c61.hlsl:4:4: error: 'offset' attribute only applies to fields [[vk::offset(8)]] ^ If I change code it will compile without errors struct PConsts { [[vk::offset(8)]] float cb_push; }; [[vk::push_constant]] ConstantBuffer<PConsts> cb : register(b2); struct PixelIn { float4 posH : SV_Position; float3 color : COLOR; float2 texcoord : TEXCOORD; }; float4 main(PixelIn pIn) : SV_Target0 { float3 color = pIn.color * saturate(cb.cb_push + 0.2f); return float4(color, 1.0f); } http://shader-playground.timjones.io/8fd049b53b7960b5f6a333e83195fdcb Maybe it can help you.
  2. You can get it with D3D12_SHVER_GET_TYPE(D3D12_FUNCTION_DESC::Version) or with hlsl::RDAT::FunctionReader::GetShaderKind(). Example for first way: https://github.com/andrejnau/FlyCube/blob/636839889748ca5aaad0b9b2fb7b43313b1933de/src/Modules/Program/DX12ProgramApi.cpp#L29 And for second way: https://github.com/andrejnau/FlyCube/blob/8bd607a8ad0e478321f2d1a128a31d5db06eb1eb/src/Modules/Program/DX12ProgramApi.cpp#L39
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!