Address review comments

This commit is contained in:
msiglreith 2020-05-05 18:13:07 +02:00
parent e2ed54361d
commit abd238bff3
2 changed files with 7 additions and 7 deletions

View file

@ -208,7 +208,7 @@ impl VkInstance {
None,
)?;
let (_dbg_loader, _dbg_callbk) = if false {
let (_dbg_loader, _dbg_callbk) = if cfg!(debug_assertions) {
let dbg_info = vk::DebugUtilsMessengerCreateInfoEXT::builder()
.message_severity(
vk::DebugUtilsMessageSeverityFlagsEXT::ERROR
@ -504,7 +504,7 @@ impl crate::Device for VkDevice {
/// This creates a pipeline that runs over the buffer.
///
/// The descriptor set layout is just some number of buffers (this will change).
/// The descriptor set layout is just some number of storage buffers and storage images (this might change).
unsafe fn create_simple_compute_pipeline(
&self,
code: &[u8],

View file

@ -63,11 +63,11 @@ void main() {
SegChunk seg_chunk = SegChunk_read(seg_chunk_ref);
for (int i = 0; i < seg_chunk.n; i++) {
Segment seg = Segment_read(SegmentRef(seg_chunk_ref.offset + SegChunk_size + Segment_size * i));
vec2 line_vec = seg.end - seg.start;
vec2 dpos = xy + vec2(0.5, 0.5) - seg.start;
float t = clamp(dot(line_vec, dpos) / dot(line_vec, line_vec), 0.0, 1.0);
df = min(df, length(line_vec * t - dpos));
}
vec2 line_vec = seg.end - seg.start;
vec2 dpos = xy + vec2(0.5, 0.5) - seg.start;
float t = clamp(dot(line_vec, dpos) / dot(line_vec, line_vec), 0.0, 1.0);
df = min(df, length(line_vec * t - dpos));
}
seg_chunk_ref = seg_chunk.next;
} while (seg_chunk_ref.offset != 0);
fg_rgba = unpackUnorm4x8(stroke.rgba_color).wzyx;