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

Function lib_hlsl_dst

src/HLSLLibrary.cpp:408–431  ·  view source on GitHub ↗

vector */

Source from the content-addressed store, hash-verified

406
407 /* vector */
408 bv_variable lib_hlsl_dst(bv_program* prog, u8 count, bv_variable* args)
409 {
410 /* dst(genType) */
411 if (count == 1) {
412 if (args[0].type == bv_type_object) { // ceil(vec3), ...
413 bv_object* vec = bv_variable_get_object(args[0]);
414
415 glm::vec4 src1 = sd::AsVector<4, float>(args[0]);
416 glm::vec4 src2 = sd::AsVector<4, float>(args[1]);
417
418 glm::vec4 vecData(1.0f, src1.y * src2.y, src1.z, src2.w); // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dst---vs
419
420 bv_variable ret = Common::create_vec(prog, bv_type_float, 4);
421 bv_object* retObj = bv_variable_get_object(ret);
422
423 for (u16 i = 0; i < retObj->type->props.name_count; i++)
424 retObj->prop[i] = bv_variable_create_float(vecData[i]);
425
426 return ret;
427 }
428 }
429
430 return Common::create_vec(prog, bv_type_float, 4);
431 }
432 bv_variable lib_hlsl_lit(bv_program* prog, u8 count, bv_variable* args)
433 {
434 float ambient = 1, diffuse = 0, specular = 0;

Callers

nothing calls this directly

Calls 1

create_vecFunction · 0.85

Tested by

no test coverage detected