MCPcopy Create free account
hub / github.com/dfranx/ShaderDebugger / create_float3

Function create_float3

src/CommonLibrary.cpp:97–107  ·  view source on GitHub ↗

TODO: this could've been achieved with templates, bv_type vec_type, u8 components

Source from the content-addressed store, hash-verified

95
96 // TODO: this could've been achieved with templates, bv_type vec_type, u8 components
97 bv_variable create_float3(bv_program* prog, glm::vec3 val)
98 {
99 bv_variable ret = bv_variable_create_object(bv_program_get_object_info(prog, isGLSL(prog) ? "vec3" : "float3"));
100 bv_object* retObj = bv_variable_get_object(ret);
101
102 bv_object_set_property(retObj, "x", bv_variable_create_float(val.x));
103 bv_object_set_property(retObj, "y", bv_variable_create_float(val.y));
104 bv_object_set_property(retObj, "z", bv_variable_create_float(val.z));
105
106 return ret;
107 }
108 bv_variable create_int3(bv_program* prog, glm::ivec3 val)
109 {
110 bv_variable ret = bv_variable_create_object(bv_program_get_object_info(prog, isGLSL(prog) ? "ivec3" : "int3"));

Callers 3

lib_glsl_noise3Function · 0.85
create_vecFunction · 0.85
lib_common_crossFunction · 0.85

Calls 1

isGLSLFunction · 0.85

Tested by

no test coverage detected