File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Engine/Staple.Core/Rendering/RenderSystem/Backend/Impls/SDLGPU Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -453,11 +453,13 @@ SDL.SDL_GPUTextureUsageFlags HandleFlags(SDL.SDL_GPUTextureUsageFlags f)
453453
454454 if ( flags . HasFlag ( TextureFlags . ColorTarget ) )
455455 {
456- return HandleFlags ( SDL . SDL_GPUTextureUsageFlags . SDL_GPU_TEXTUREUSAGE_COLOR_TARGET ) ;
456+ return HandleFlags ( SDL . SDL_GPUTextureUsageFlags . SDL_GPU_TEXTUREUSAGE_SAMPLER |
457+ SDL . SDL_GPUTextureUsageFlags . SDL_GPU_TEXTUREUSAGE_COLOR_TARGET ) ;
457458 }
458459 else if ( flags . HasFlag ( TextureFlags . DepthStencilTarget ) )
459460 {
460- return HandleFlags ( SDL . SDL_GPUTextureUsageFlags . SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET ) ;
461+ return HandleFlags ( SDL . SDL_GPUTextureUsageFlags . SDL_GPU_TEXTUREUSAGE_SAMPLER |
462+ SDL . SDL_GPUTextureUsageFlags . SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET ) ;
461463 }
462464
463465 return HandleFlags ( SDL . SDL_GPUTextureUsageFlags . SDL_GPU_TEXTUREUSAGE_SAMPLER ) ;
Original file line number Diff line number Diff line change @@ -836,12 +836,17 @@ internal void ResumeRenderPass()
836836 }
837837 else
838838 {
839- //TODO: texture
839+ if ( viewData . renderTarget . ColorTextureCount > 0 &&
840+ viewData . renderTarget . colorTextures [ 0 ] . impl is SDLGPUTexture t &&
841+ TryGetTexture ( t . handle , out var textureResource ) )
842+ {
843+ texture = textureResource . texture ;
844+ }
840845
841846 width = viewData . renderTarget . width ;
842847 height = viewData . renderTarget . height ;
843848
844- return ;
849+ depthTexture = viewData . renderTarget . DepthTexture ? . impl as SDLGPUTexture ;
845850 }
846851
847852 if ( texture == nint . Zero ||
You can’t perform that action at this time.
0 commit comments