Skip to content

Instantly share code, notes, and snippets.

View thevaber's full-sized avatar

Václav Patejdl thevaber

  • Czech Republic
View GitHub Profile
/*
Validation Error: [ SYNC-HAZARD-WRITE-RACING-WRITE ] Object 0: handle = 0x20d2c56dda0, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0x743c6069 | vkQueueSubmit():
Hazard WRITE_RACING_WRITE for entry 0, VkCommandBuffer 0x20d32948210[],
Submitted access info (submitted_usage: SYNC_COPY_TRANSFER_WRITE, command: vkCmdCopyBufferToImage, seq_no: 1, reset_no: 2).
Access info (prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION,
write_barriers: SYNC_DRAW_INDIRECT_INDIRECT_COMMAND_READ|SYNC_DRAW_INDIRECT_TRANSFORM_FEEDBACK_COUNTER_READ_EXT|SYNC_VERTEX_SHADER_ACCELERATION_STRUCTURE_READ|SYNC_VERTEX_SHADER_DESCRIPTOR_BUFFER_READ_EXT|SYNC_VERTEX_SHADER_SHADER_BINDING_TABLE_READ|SYNC_VERTEX_SHADER_SHADER_SAMPLED_READ|SYNC_VERTEX_SHADER_SHADER_STORAGE_READ|SYNC_VERTEX_SHADER_SHADER_STORAGE_WRITE|SYNC_VERTEX_SHADER_UNIFORM_READ|SYNC_TESSELLATION_CONTROL_SHADER_ACCELERATION_STRUCTURE_READ|SYNC_TESSELLATION_CONTROL_SHADER_DESCRIPTOR_BUFFER_READ_EXT|SYNC_TESSELLATION_CONTROL_SHADER_SHADER_BINDING_TABLE_READ|SYNC_TESSEL
/* The validation error message:
Validation Error: [ SYNC-HAZARD-WRITE-RACING-WRITE ] Object 0: handle = 0x29862255390, name = Upload 0, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0x743c6069 | vkQueueSubmit2KHR():
Hazard WRITE_RACING_WRITE for entry 0, VkCommandBuffer 0x2986403e690[],
Submitted access info (submitted_usage: SYNC_COPY_TRANSFER_WRITE, command: vkCmdCopyBufferToImage, seq_no: 1, reset_no: 1).
Access info (prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: SYNC_HOST_HOST_READ|SYNC_HOST_HOST_WRITE|SYNC_ACCELERATION_STRUCTURE_COPY_ACCELERATION_STRUCTURE_READ|SYNC_ACCELERATION_STRUCTURE_COPY_ACCELERATION_STRUCTURE_WRITE|SYNC_ACCELERATION_STRUCTURE_COPY_TRANSFER_READ|SYNC_ACCELERATION_STRUCTURE_COPY_TRANSFER_WRITE|SYNC_COPY_TRANSFER_READ|SYNC_COPY_TRANSFER_WRITE|SYNC_RESOLVE_TRANSFER_READ|SYNC_RESOLVE_TRANSFER_WRITE|SYNC_BLIT_TRANSFER_READ|SYNC_BLIT_TRANSFER_WRITE|SYNC_CLEAR_TRANSFER_WRITE,
queue: VkQueue 0x29862255390[Upload 0], submit: 0, batch: 0, batch_tag: 1, command: vkCmdPipelineBarr
@thevaber
thevaber / tv_toggle_token.cpp
Created January 29, 2020 19:09
4coder "toggle_token" command
function b32
tv_toggle_token(Application_Links* app, Buffer_ID buffer, View_ID view, Token* tok)
{
if (!tok) {
return false;
}
Scratch_Block scratch(app);
String_Const_u8 replacement = {};
@thevaber
thevaber / hex_colors.cpp
Created January 19, 2020 20:16
4coder theme file color preview
function void
tv_colorize_hex_colors(Application_Links *app, Buffer_ID buffer, Text_Layout_ID text_layout_id)
{
Scratch_Block scratch(app);
Range_i64 visible_range = text_layout_get_visible_range(app, text_layout_id);
String_Const_u8 text = push_buffer_range(app, scratch, buffer, visible_range);
for (i64 index = visible_range.min; text.size > 0;) {
if (text.size >= 2+8 && text.str[0] == '0' && (text.str[1] == 'x' || text.str[1] == 'X')) {
text = string_skip(text, 2);
@thevaber
thevaber / soloud_sdl2_static.cpp
Last active October 17, 2018 14:48
SoLoud SDL2 static backend fix for channels > MAX_CHANNELS
/*
SoLoud audio engine
Copyright (c) 2013-2015 Jari Komppa
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
@thevaber
thevaber / helloworld.cpp
Created December 10, 2014 20:03
bgfx #202 repro
/*
* Copyright 2011-2014 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*
* (bug repro for issue #202)
*/
#include "common.h"
#include <bgfx.h>
#include <bx/uint32_t.h>
@thevaber
thevaber / gist:1d11662f3994adc48b51
Created December 9, 2014 14:11
Possible bgfx issue with transient buffers and D3D11
/*
different bgfx transient buffer issue (dx11)
Reproduction steps:
1. use Direct3D11 renderer
2. in each frame:
2.1. render anything (even single vertex) with one vertex decl
2.2. render some triangles (or other geometry) with different vertex decl
@thevaber
thevaber / bgfx issue
Created December 7, 2014 00:58
Possible bgfx issue
/*
bgfx transient buffer issue
If in one (or more; slightly different behavior, see comments in main loop) frames a draw call is
submitted which uses a transient vertex buffer (even with one vertex and zeroed state), and in
subsequent frames different draw call with transient buffer is made using the same shader program
but different vertex type (vertex decl), it does not get rendered correctly - vertex data seems
to be corrupted (wrong vertex positions, colors,...; possibly not visible at all if the wrong
positions are out of view bounds I think). Only the first draw call in each frame gets corrupted