|
781 | 781 |
|
782 | 782 | void MVKComputeResourcesCommandEncoderState::encodeImpl(uint32_t) {
|
783 | 783 |
|
784 |
| - bool fullImageViewSwizzle = false; |
785 | 784 | MVKPipeline* pipeline = _cmdEncoder->_computePipelineState.getPipeline();
|
786 |
| - if (pipeline) |
787 |
| - fullImageViewSwizzle = pipeline->fullImageViewSwizzle(); |
788 |
| - |
789 |
| - encodeBinding<MVKMTLBufferBinding>(_resourceBindings.bufferBindings, _resourceBindings.areBufferBindingsDirty, |
790 |
| - [](MVKCommandEncoder* cmdEncoder, MVKMTLBufferBinding& b)->void { |
791 |
| - if (b.isInline) |
792 |
| - cmdEncoder->setComputeBytes(cmdEncoder->getMTLComputeEncoder(kMVKCommandUseDispatch), |
793 |
| - b.mtlBytes, |
794 |
| - b.size, |
795 |
| - b.index); |
796 |
| - else |
797 |
| - [cmdEncoder->getMTLComputeEncoder(kMVKCommandUseDispatch) setBuffer: b.mtlBuffer |
798 |
| - offset: b.offset |
799 |
| - atIndex: b.index]; |
800 |
| - }); |
| 785 | + bool fullImageViewSwizzle = pipeline ? pipeline->fullImageViewSwizzle() : false; |
801 | 786 |
|
802 | 787 | if (_resourceBindings.swizzleBufferBinding.isDirty) {
|
803 |
| - |
804 | 788 | for (auto& b : _resourceBindings.textureBindings) {
|
805 | 789 | if (b.isDirty) { updateImplicitBuffer(_resourceBindings.swizzleConstants, b.index, b.swizzle); }
|
806 | 790 | }
|
|
826 | 810 |
|
827 | 811 | }
|
828 | 812 |
|
| 813 | + encodeBinding<MVKMTLBufferBinding>(_resourceBindings.bufferBindings, _resourceBindings.areBufferBindingsDirty, |
| 814 | + [](MVKCommandEncoder* cmdEncoder, MVKMTLBufferBinding& b)->void { |
| 815 | + if (b.isInline) { |
| 816 | + cmdEncoder->setComputeBytes(cmdEncoder->getMTLComputeEncoder(kMVKCommandUseDispatch), |
| 817 | + b.mtlBytes, |
| 818 | + b.size, |
| 819 | + b.index); |
| 820 | + } else { |
| 821 | + [cmdEncoder->getMTLComputeEncoder(kMVKCommandUseDispatch) setBuffer: b.mtlBuffer |
| 822 | + offset: b.offset |
| 823 | + atIndex: b.index]; |
| 824 | + } |
| 825 | + }); |
| 826 | + |
829 | 827 | encodeBinding<MVKMTLTextureBinding>(_resourceBindings.textureBindings, _resourceBindings.areTextureBindingsDirty,
|
830 | 828 | [](MVKCommandEncoder* cmdEncoder, MVKMTLTextureBinding& b)->void {
|
831 | 829 | [cmdEncoder->getMTLComputeEncoder(kMVKCommandUseDispatch) setTexture: b.mtlTexture
|
|
0 commit comments