Windows Settings – Publish and action after

Prototype:
win_settings_v1
*no processing enable/disable options

  • Visual Studio Version — select the studio version for which the project will be exported. Options: 2010, 2012, 2013, 2015, 2017, 2019. Default: 2019.
  • Action After Publishing — select an action after a successful publication. Options:
    • Nothing - do nothing. Default value;
    • Open In Visual Studio - open the project in the corresponding studio version;
    • Compile - compilation of the project;
    • Compile and Run - compile and run the project.
  • Mode - compilation mode. Options: Debug, Release. Default: Debug.
  • Architecture - the architecture for which the application will be built. Options: x86, x64. Default: x64.
  • Open Build Directory - open the folder with the application after a successful build.

The settings, compilation and launch are already in Kha, more precisely in the Kincmake module (kincmake/src/main.ts). But:

  • the architecture of the future application cannot be specified, it is determined by the architecture of the current computer;
  • you cannot output the compilation log to the console so that the user can immediately see the error;
  • with several installed studio on the computer, it is imperative that the variables in the system environment (VS[version]COMNTOOLS) be specified, because of this, when installing 2017 and trying to compile, there will be an error (although only 2019 is on the PC). Developers, somewhere they took into account the 2019 version, but somewhere they didn’t;
  • in the case of how the make.py module is organized in Armory, the user will receive a message about the project export only after all operations and launch (more precisely, even when the application is closed). By the way, now by default it is written that the project is being created for 2017, which is incorrect. By default, it is created for 2019.

Therefore, I want to write a compilation functionality that takes into account the subtleties of Armory. From Kha there will be an indication of the version of Visual Studio Version. The principle will be the same, but there will be more flexibility in the settings in the interface, assembly, as well as more information for the user.

Questions:

  1. Do you support me writing “my own bike” to replace Kha?

  2. Need to add a project version to the project name for Visual Studio?

  3. Graphics API. DirectX 12 is installed on my computer, but the application does not start.
    Visual Studio throws an error when debugging:

    Exception thrown: Read access violation.
    renderTarget-> impl. ** depthStencilDescriptorHeap ** was nullptr.
    

    Should you remove DirectX 12?
    DirectX 11 and OpenGL work fine.

  4. I look forward to your comments and suggestions.

4 Likes

UPDATE:

win_settings_v2

  • Visual Studio Version - select the studio version for which the project will be exported. Options: 2010, 2012, 2013, 2015, 2017, 2019. Default: 2019.
  • Update - checks the installed versions of Visual Studio on the PC and adds (installed) to the version in the list if available (for information). Example:
    sample_vs_2
  • Action After Publishing - select an action after a successful publication. Options:
    • Nothing - do nothing. Default value;
    • Open In Visual Studio - open the project in the corresponding studio version;
    • Compile - compilation of the project;
    • Compile and Run - compile and run the project. Then the executable file will be copied to the windows-hl folder (where the resources are located).
  • Mode - compilation mode. Options: Debug, Release. Default: Debug.
  • Architecture - the architecture for which the application will be built. Options: x86, x64. Default: version of the user’s PC architecture.
  • Compile Log Parameter - setting the output of messages during compilation:
    • Summary - show the error and warning summary at the end. Default value;
    • No Summary - don \ 't show the error and warning summary at the end;
    • Warnings and Errors Only - show only warnings and errors;
    • Warnings Only - show only warnings;
    • Errors Only - show only errors.
      More details can be found here - MSBuild command-line reference (I took only part of the settings).
  • Count CPU - specifies the maximum number of concurrent processes to use when building. More details can be found here - MSBuild command-line reference. The default is 1. Maximum value: the number of CPUs in the system (function multiprocessing.cpu_count()).
  • Open Build Directory - open the folder with the application after a successful build. If the Compile and Run option is selected, then the executable file will be copied to the windows-hl folder (where the resources are located) and this folder will open. Otherwise, the folder where the given Visual Studio file is going will open.

The user will also receive a message if the studio version selected for export and for opening in the studio or compilation is not on the PC. And a list of installed ones will be issued. Example:

Visual Studio 2017 (version 15) not found.
The following are installed on the PC:
- Visual Studio Community 2019 (version 16.8.30711.63)

To obtain information about the installed versions of Visual Studio, use the vswhere.exe utility (open source) included in Kha (located in the …\ArmorySDK\Kha\Kinc\Tools\kincmake\Data\windows).

Question
Compiled application launch errors for certain settings:

  1. DirectX 12 is installed on my computer, but the application does not start.
    Visual Studio throws an error when debugging:
    In the file ArmorySDK\Kha\Kinc\Backends\Graphics5\Direct3D12\Sources\Kore\CommandList5Impl.cpp

    Exception thrown: Read access violation.
    renderTarget-> impl. ** depthStencilDescriptorHeap ** was nullptr.
    

    In the function:

    void kinc_g5_command_list_clear(kinc_g5_command_list *list, kinc_g5_render_target_t *renderTarget, unsigned flags, unsigned color, float depth, int stencil) {
     if (flags & KINC_G5_CLEAR_COLOR) {
     	float clearColor[] = {((color & 0x00ff0000) >> 16) / 255.0f,
     						  ((color & 0x0000ff00) >> 8) / 255.0f,
     						   (color & 0x000000ff) / 255.0f,
     						  ((color & 0xff000000) >> 24) / 255.0f};
     	list->impl._commandList->ClearRenderTargetView(renderTarget->impl.renderTargetDescriptorHeap->GetCPUDescriptorHandleForHeapStart(), clearColor, 0, nullptr);
     }
     if ((flags & KINC_G5_CLEAR_DEPTH) || (flags & KINC_G5_CLEAR_STENCIL)) {
     	D3D12_CLEAR_FLAGS d3dflags = (flags & KINC_G5_CLEAR_DEPTH) && (flags & KINC_G5_CLEAR_STENCIL)
     	                                 ? D3D12_CLEAR_FLAG_DEPTH | D3D12_CLEAR_FLAG_STENCIL
     	                                 : (flags & KINC_G5_CLEAR_DEPTH) ? D3D12_CLEAR_FLAG_DEPTH : D3D12_CLEAR_FLAG_STENCIL;
     	list->impl._commandList->ClearDepthStencilView(renderTarget->impl.depthStencilDescriptorHeap->GetCPUDescriptorHandleForHeapStart(), d3dflags, depth, stencil,
     	                                               0, nullptr);
     }
    }
    
  2. When building under win32 at startup, it gives an error in the function. Visual Studio throws an error when debugging:
    In the file ArmorySDK\Kha\Backends\KoreHL\KoreC\arrays.cpp

    Exception thrown: Read access violation.
    ** arr ** was 0xBA14112.
    

    In the function:

    extern "C" unsigned char hl_kore_uint8array_get (vbyte * u8array, int index) {
    unsigned char * arr = (unsigned char *) u8array;
    return arr [index];
    }
    

Both errors relate to Kha and can you create an issue there?

I look forward to your comments and suggestions. If everything suits I will do PR.

4 Likes