File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -671,6 +671,20 @@ void UpdateBindGroup(DescribedBindGroup *bg) {
671671 to -> size = from -> size ;
672672 to -> sampler = from -> sampler ;
673673 to -> textureView = from -> textureView ;
674+
675+ if (bg -> layout && bg -> layout -> entries ){
676+ if (to -> sampler == NULL && bg -> layout -> entries [i ].type == texture_sampler ){
677+ to -> sampler = (WGPUSampler )g_renderstate .defaultSampler .sampler ;
678+ }
679+ if (to -> textureView == NULL && bg -> layout -> entries [i ].type == texture2d ){
680+ to -> textureView = (WGPUTextureView )g_renderstate .whitePixel .view ;
681+ }
682+ if (to -> buffer == NULL && (bg -> layout -> entries [i ].type == uniform_buffer || bg -> layout -> entries [i ].type == storage_buffer )){
683+ to -> buffer = (WGPUBuffer )g_renderstate .identityMatrix -> buffer ;
684+ to -> offset = 0 ;
685+ to -> size = 64 ; // sizeof(Matrix)
686+ }
687+ }
674688 }
675689
676690 desc .entries = aswgpu ;
You can’t perform that action at this time.
0 commit comments