Texture1/2/3D */
| 456 | |
| 457 | /* Texture1/2/3D */ |
| 458 | bv_variable lib_hlsl_Texture_Sample(bv_program* prog, bv_object* me, u8 argc, bv_variable* args) |
| 459 | { |
| 460 | /* TODO: clamp LOD, etc... */ |
| 461 | if (argc >= 2) { |
| 462 | bv_object* samplerState = bv_variable_get_object(args[0]); |
| 463 | |
| 464 | // Texture1D/2D/3D |
| 465 | if (IsBasicTexture(me->type->name)) { |
| 466 | Texture* tex = (Texture*)me->user_data; |
| 467 | glm::vec3 uv = sd::AsVector<3, float>(args[1]); |
| 468 | |
| 469 | float lod = 0.0f; // TODO: LOD calculation |
| 470 | |
| 471 | glm::vec4 sample = tex->Sample(uv.x, uv.y, uv.z, lod); |
| 472 | |
| 473 | return Common::create_float4(prog, sample); |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | return Common::create_float4(prog); |
| 478 | } |
| 479 | |
| 480 | bv_library* Library() |
| 481 | { |
nothing calls this directly
no test coverage detected