Last active
April 7, 2020 17:23
-
-
Save ndevenish/4367240d63709d43c761a5a6cd4f8c5c to your computer and use it in GitHub Desktop.
Example of failing ispc bool passing
This file contains hidden or 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
#include <algorithm> | |
#include "booltest.h" | |
int main(int argc, char**argv) | |
{ | |
bool testmask[50]; | |
std::fill(testmask, &testmask[50], true); | |
ispc::test_bool(testmask, 50); | |
} |
This file contains hidden or 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
export void test_bool(uniform bool * uniform mask, uniform int count) { | |
foreach(i = 0 ... count) { | |
print("%\n", i); | |
bool maskvar = mask[i]; | |
if (maskvar) { | |
print("Ismask %\n", i); | |
} | |
} | |
} |
This file contains hidden or 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
cmake_minimum_required(VERSION 3.8 FATAL_ERROR) | |
project(ispc_bool) | |
add_custom_command(OUTPUT booltest.o booltest.h | |
COMMAND ispc ${CMAKE_SOURCE_DIR}/booltest.ispc -o booltest.o -h booltest.h | |
DEPENDS booltest.ispc) | |
add_executable(booltest booltest.cxx booltest.o) | |
target_include_directories(booltest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment