This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 450 | |
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; | |
struct Neighbour { | |
int id; | |
float dist; | |
}; | |
struct TileDynamic { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let app = vulkano::instance::ApplicationInfo { application_name: "test", application_version: 1, engine_name: "test", engine_version: 1 }; | |
let instance = vulkano::instance::Instance::new(Some(&app), None).expect("failed to create instance"); | |
let physical = vulkano::instance::PhysicalDevice::enumerate(&instance) | |
.next().expect("no device available"); | |
println!("Using device: {} (type: {:?})", physical.name(), physical.ty()); | |
let window = unsafe { create_window() }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" | |
target triple = "asmjs-unknown-emscripten" | |
@.str = private unnamed_addr constant [9 x i8] c"*%d,%d*\0A\00" ; [#uses=1] | |
define {i32, i32} @read_pair({i32, i32}* %ptr) norecurse nounwind readonly uwtable { | |
entry: | |
%value = load {i32, i32}, {i32, i32}* %ptr, align 4 | |
ret {i32, i32} %value | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ModuleID = 'test.0.rs' | |
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128" | |
target triple = "asmjs-unknown-emscripten" | |
@_ZN5hello4DATA20hc62f1ab83f6c61e4GaaE = internal constant [5 x i8] c"\01\02\03\04\05", align 1 | |
; Function Attrs: noinline norecurse nounwind readnone uwtable | |
define { i8*, i32 } @_ZN3get20h14b169bb767a00d2naaE(i8* noalias nonnull readonly, i32) unnamed_addr #0 { | |
entry-block: | |
%2 = insertvalue { i8*, i32 } undef, i8* %0, 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ModuleID = 'test.0.rs' | |
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128" | |
target triple = "asmjs-unknown-emscripten" | |
; Function Attrs: noinline uwtable | |
define i8* @_ZN5hello20he76161cf814e3896haaE() unnamed_addr #0 { | |
entry-block: | |
%0 = tail call { i8*, i32 } @_ZN3get20h05af50f9733c2d54haaE() | |
%1 = extractvalue { i8*, i32 } %0, 0 | |
ret i8* %1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** IR Dump After Expand out variables with struct types *** | |
; Function Attrs: noinline uwtable | |
define internal fastcc i8* @_ZN5hello20h950a00b68330e9b8haaE() unnamed_addr #0 { | |
entry-block: | |
%0 = alloca i8, i32 8, align 16 | |
%.bc = bitcast i8* %0 to { i8*, i32 }* | |
call void @_ZN3get20h05af50f9733c2d54haaE({ i8*, i32 }* %.bc) | |
%.sreg.index = getelementptr { i8*, i32 }, { i8*, i32 }* %.bc, i32 0, i32 0 | |
%.sreg.field = load i8*, i8** %.sreg.index, align 16 | |
%.sreg.index1 = getelementptr { i8*, i32 }, { i8*, i32 }* %.bc, i32 0, i32 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate libc; | |
use std::os::raw::c_char; | |
use std::mem; | |
use std::slice; | |
pub struct CStr { | |
inner: [c_char] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __ZN5hello20h898a0b35c963e11dgaaE() { | |
var $$sreg$field = 0, $$sreg$field2 = 0, $$sreg$index1 = 0, $0 = 0, $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $f = 0, $v = 0, label = 0, sp = 0; | |
sp = STACKTOP; | |
STACKTOP = STACKTOP + 32|0; | |
$0 = sp; | |
$f = sp + 16|0; | |
$v = sp + 8|0; | |
__ZN3ffi5c_str4CStr8from_ptr20hcd4af70afe08fc0cKOeE(($0|0),((-559038737)|0)); | |
$$sreg$field = HEAP32[$0>>2]|0; | |
$$sreg$index1 = ((($0)) + 4|0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Function Attrs: noinline uwtable | |
define internal i8* @_ZN5hello20h898a0b35c963e11dgaaE() unnamed_addr #0 { | |
entry-block: | |
%f = alloca { %"1.std::ffi::c_str::CStr"*, i32 } | |
%v = alloca { i8*, i32 } | |
%0 = call { %"1.std::ffi::c_str::CStr"*, i32 } @_ZN3ffi5c_str4CStr8from_ptr20hcd4af70afe08fc0cKOeE(i8* inttoptr (i32 -559038737 to i8*)) | |
%1 = extractvalue { %"1.std::ffi::c_str::CStr"*, i32 } %0, 0 | |
%2 = getelementptr inbounds { %"1.std::ffi::c_str::CStr"*, i32 }, { %"1.std::ffi::c_str::CStr"*, i32 }* %f, i32 0, i32 0 | |
store %"1.std::ffi::c_str::CStr"* %1, %"1.std::ffi::c_str::CStr"** %2 | |
%3 = extractvalue { %"1.std::ffi::c_str::CStr"*, i32 } %0, 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __ZN5hello20h00209f75792421a9gaaE() { | |
var $$sreg$field = 0, $$sreg$field2 = 0, $$sreg$index1 = 0, $0 = 0, $1 = 0, $2 = 0, $f = 0, $v = 0, label = 0, sp = 0; | |
sp = STACKTOP; | |
STACKTOP = STACKTOP + 32|0; if ((STACKTOP|0) >= (STACK_MAX|0)) abort(); | |
$0 = sp; | |
$f = sp + 16|0; | |
$v = sp + 8|0; | |
__ZN5slice14from_raw_parts21h14897924922607837926E($0,(-559038737),6); | |
$$sreg$field = HEAP32[$0>>2]|0; | |
$$sreg$index1 = ((($0)) + 4|0); |