Kode / Kinc

Modern low level game library and hardware abstraction.
http://kinc.tech
zlib License
519 stars 118 forks source link

Rendertarget samples broken with G4onG5 #864

Open SunDaw opened 9 months ago

SunDaw commented 9 months ago

Describe the bug Several render target samples from https://github.com/Kode/Kinc-Samples crash with G4onG5 backends (tested with both D3D12 and Vulkan).

To Reproduce Steps to reproduce the behavior:

  1. Clone https://github.com/Kode/Kinc-Samples
  2. Build either of 06_render_targets, 07_multiple_render_targets or 08_float_render_targets
  3. Run executable, crashes on first update call

Expected behavior Samples should work the same way they do with Direct3D11/OpenGL backends

Execution Environment:

Additional context Callstack shows crash in "G4.c.h" startDraw on memcpy(current_state.vertex_constant_data, vertexConstantBuffer.data, constantBufferSize); because vertexConstantBuffer.data is a nullpointer

Example.exe!memcpy() Line 304 Unknown Example.exe!startDraw(bool compute) Line 167 C Example.exe!kinc_g4_draw_indexed_vertices() Line 264 C Example.exe!update(void data) Line 42 C Example.exe!kinc_internal_update_callback() Line 483 C Example.exe!kinc_internal_frame() Line 577 C Example.exe!kinc_start() Line 591 C Example.exe!kickstart(int argc, char argv) Line 118 C Example.exe!WinMain(HINSTANCE__ hInstance, HINSTANCE__ hPrevInstance, char lpCmdLine, int nCmdShow) Line 1324 C

SunDaw commented 9 months ago

Note: sample 09_depth_render_targets works fine, I haven't investigated what it does differently

RobDangerous commented 7 months ago

Dave gets this for 06 with Vulkan: Vulkan ERROR: Code 7060244 : Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x55555b060ac8, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: ID 22[%22] has not been defined %23 = OpVariable %22 Function

RobDangerous commented 7 months ago

False alarm on that one, Dave uses Kong.