| 676 | } |
| 677 | |
| 678 | void EngineGL33::SetMultiTexturing(VFormatSet format) |
| 679 | { |
| 680 | if (_formatSet == format) |
| 681 | return; |
| 682 | _formatSet = format; |
| 683 | |
| 684 | // Same FF-equivalence rationale as SetTexture: a SingleTex shader still |
| 685 | // has sampler1 declared; even if it doesn't sample (or its result is |
| 686 | // multiplied out), the driver validates the binding. Bind the white |
| 687 | // sentinel for SingleTex / for any null detail-spec-grass texture. |
| 688 | unsigned int boundHandle = _fallbackWhiteTex; |
| 689 | switch (format) |
| 690 | { |
| 691 | case SingleTex: |
| 692 | boundHandle = _fallbackWhiteTex; |
| 693 | break; |
| 694 | case DetailTex: |
| 695 | { |
| 696 | TextureGL33* detail = _textBank ? _textBank->GetDetailTexture() : nullptr; |
| 697 | if (_textBank && detail) |
| 698 | _textBank->UseMipmap(detail, 0, 0); |
| 699 | unsigned int dh = detail ? detail->GetHandle() : 0; |
| 700 | LOG_DEBUG(Graphics, "GL33: SetMultiTex DetailTex handle={} detail={}", dh, (void*)detail); |
| 701 | boundHandle = dh ? dh : _fallbackWhiteTex; |
| 702 | break; |
| 703 | } |
| 704 | case GrassTex: |
| 705 | { |
| 706 | TextureGL33* grass = _textBank ? _textBank->GetGrassTexture() : nullptr; |
| 707 | if (_textBank && grass) |
| 708 | _textBank->UseMipmap(grass, 0, 0); |
| 709 | unsigned int gh = grass ? grass->GetHandle() : 0; |
| 710 | boundHandle = gh ? gh : _fallbackWhiteTex; |
| 711 | break; |
| 712 | } |
| 713 | case SpecularTex: |
| 714 | { |
| 715 | TextureGL33* spec = _textBank ? _textBank->GetSpecularTexture() : nullptr; |
| 716 | if (_textBank && spec) |
| 717 | _textBank->UseMipmap(spec, 0, 0); |
| 718 | unsigned int sh = spec ? spec->GetHandle() : 0; |
| 719 | boundHandle = sh ? sh : _fallbackWhiteTex; |
| 720 | break; |
| 721 | } |
| 722 | } |
| 723 | GL33Bind::Tex2D(1, boundHandle); |
| 724 | GL33Bind::ActiveUnit(0); |
| 725 | // Snapshot for the frame capture: latch the resolved handle so the next TL |
| 726 | // capture knows what's bound on TEXTURE1, even across the |
| 727 | // early-out path above. |
| 728 | _lastTexture1Handle = boundHandle; |
| 729 | } |
nothing calls this directly
no test coverage detected