OSDN Git Service

Don't blit to NULL format buffers.
authorNicolas Capens <capn@google.com>
Thu, 24 Mar 2016 15:51:05 +0000 (11:51 -0400)
committerNicolas Capens <capn@google.com>
Thu, 24 Mar 2016 17:51:35 +0000 (17:51 +0000)
This was causing crashes in Direct3D 9 applications using the "NULL" FOURCC
used as a render target format for rendering to depth only.

Bug 25351344

Change-Id: I69c2e0869f859489321c26dba56b7a80a2ed2f28
Reviewed-on: https://swiftshader-review.googlesource.com/5000
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/Renderer/Blitter.cpp

index 2e01e4c..19fcd9c 100644 (file)
@@ -45,6 +45,11 @@ namespace sw
 
        void Blitter::blit(Surface *source, const SliceRect &sourceRect, Surface *dest, const SliceRect &destRect, const Blitter::Options& options)
        {
+               if(dest->getInternalFormat() == FORMAT_NULL)
+               {
+                       return;
+               }
+
                if(blitReactor(source, sourceRect, dest, destRect, options))
                {
                        return;