コード例 #1
0
        public MGLStatisticsSource( MGLDriver driver )
            : base("Video Driver")
        {
            this.Driver = driver;

            this.Frames = new Counter( "Frames", "The number of frames rendered." );
            this.SkippedFrames = new Counter( "Skipped Frames", "The number of frames skipped due to frame skipping." );
            this.DisplayLists = new Counter( "Display Lists", "The number of display lists processed." );
            this.AbortedDisplayLists = new Counter( "Aborted Lists", "The number of display lists aborted by the game." );

            this.RegisterCounter( this.Frames );
            this.RegisterCounter( this.SkippedFrames );
            this.RegisterCounter( this.DisplayLists );
            this.RegisterCounter( this.AbortedDisplayLists );
        }
コード例 #2
0
        public MGLStatisticsSource(MGLDriver driver)
            : base("Video Driver")
        {
            this.Driver = driver;

            this.Frames              = new Counter("Frames", "The number of frames rendered.");
            this.SkippedFrames       = new Counter("Skipped Frames", "The number of frames skipped due to frame skipping.");
            this.DisplayLists        = new Counter("Display Lists", "The number of display lists processed.");
            this.AbortedDisplayLists = new Counter("Aborted Lists", "The number of display lists aborted by the game.");

            this.RegisterCounter(this.Frames);
            this.RegisterCounter(this.SkippedFrames);
            this.RegisterCounter(this.DisplayLists);
            this.RegisterCounter(this.AbortedDisplayLists);
        }
コード例 #3
0
ファイル: MGLClut.cs プロジェクト: BradFuller/pspplayer
 public MGLClut( MGLDriver driver, MGLContext ctx )
 {
     _driver = driver;
     _ctx = ctx;
 }
コード例 #4
0
 public MGLTextureCache(MGLDriver driver, MGLContext ctx)
 {
     _driver = driver;
     _ctx    = ctx;
     _values = new FastLinkedList <MGLTexture>();
 }
コード例 #5
0
 public MGLClut(MGLDriver driver, MGLContext ctx)
 {
     _driver = driver;
     _ctx    = ctx;
 }
コード例 #6
0
 public MGLTextureCache( MGLDriver driver, MGLContext ctx )
 {
     _driver = driver;
     _ctx = ctx;
     _values = new FastLinkedList<MGLTexture>();
 }
コード例 #7
0
ファイル: MGLTexture.cs プロジェクト: mattweb28/pspplayer
        public static MGLTexture LoadTexture(MGLDriver driver, MGLContext ctx, MGLTextureInfo info, uint checksum)
        {
            uint width     = info.Width;
            uint lineWidth = info.LineWidth;
            uint height    = info.Height;

            MGLTexture texture = new MGLTexture();

            texture.PixelStorage = info.PixelStorage;
            texture.Address      = info.Address;
            texture.LineWidth    = lineWidth;
            texture.Width        = width;
            texture.Height       = height;
            texture.Checksum     = checksum;
            texture.ClutPointer  = ctx.Clut.Pointer;
            texture.ClutChecksum = ctx.Clut.Checksum;

            int textureId;

            Gl.glGenTextures(1, out textureId);
            Gl.glBindTexture(Gl.GL_TEXTURE_2D, textureId);
            texture.TextureID = textureId;

            byte *        address = driver.MemorySystem.Translate(info.Address);
            TextureFormat format  = TextureFormats[( int )info.PixelStorage];
            uint          size    = lineWidth * height * format.Size;

            fixed(byte *unswizzleBuffer = &_unswizzleBuffer[0])
            fixed(byte *decodeBuffer = &_decodeBuffer[0])
            {
                bool  needRowLength = false;
                byte *buffer        = address;

                if (ctx.TexturesSwizzled == true)
                {
                    buffer = Unswizzle(format, buffer, unswizzleBuffer, lineWidth, height);
                }

                switch (texture.PixelStorage)
                {
                case TexturePixelStorage.BGR5650:
                    texture.Checksum = ColorOperations.DecodeBGR5650(buffer, decodeBuffer, lineWidth * height);
                    buffer           = decodeBuffer;
                    break;

                case TexturePixelStorage.ABGR5551:
                    texture.Checksum = ColorOperations.DecodeABGR5551(buffer, decodeBuffer, lineWidth * height);
                    buffer           = decodeBuffer;
                    break;

                case TexturePixelStorage.ABGR4444:
                    texture.Checksum = ColorOperations.DecodeABGR4444(buffer, decodeBuffer, lineWidth * height);
                    buffer           = decodeBuffer;
                    break;

                case TexturePixelStorage.ABGR8888:
                    // Pass through
                    needRowLength = true;
                    break;

                case TexturePixelStorage.Indexed4:
                    ctx.Clut.Decode4(buffer, decodeBuffer, width, height, lineWidth);
                    buffer = decodeBuffer;
                    break;

                case TexturePixelStorage.Indexed8:
                    ctx.Clut.Decode8(buffer, decodeBuffer, width, height, lineWidth);
                    buffer = decodeBuffer;
                    break;

                case TexturePixelStorage.Indexed16:
                    ctx.Clut.Decode16(buffer, decodeBuffer, width, height, lineWidth);
                    buffer = decodeBuffer;
                    break;

                case TexturePixelStorage.Indexed32:
                    ctx.Clut.Decode32(buffer, decodeBuffer, width, height, lineWidth);
                    buffer = decodeBuffer;
                    break;

                case TexturePixelStorage.DXT1:
                case TexturePixelStorage.DXT3:
                case TexturePixelStorage.DXT5:
                    // Not yet implemented
                    Debug.Assert(false);
                    break;
                }

                // TODO: eliminate these
                //Gl.glPixelStorei( Gl.GL_UNPACK_ALIGNMENT, 4 );
                //if( needRowLength == true )
                //    Gl.glPixelStorei( Gl.GL_UNPACK_ROW_LENGTH, ( int )lineWidth );
                //else
                //    Gl.glPixelStorei( Gl.GL_UNPACK_ROW_LENGTH, ( int )width );

                Gl.glTexImage2D(Gl.GL_TEXTURE_2D, 0, Gl.GL_RGBA8,
                                ( int )width, ( int )height,
                                0, Gl.GL_RGBA, Gl.GL_UNSIGNED_BYTE,
                                ( IntPtr )buffer);

                // Set cookie
                //texture.CookieOriginal = *( ( uint* )address );
                //texture.Cookie = ( uint )textureId;
                //*( ( uint* )address ) = ( uint )textureId;

                // Calculate checksum if needed
                if (texture.Checksum == 0)
                {
                    texture.Checksum = MGLTexture.CalculateChecksum(address, width, height, texture.PixelStorage);
                }
            }

            return(texture);
        }
コード例 #8
0
 public MGLDriverHook(MGLDriver driver)
 {
     this.Driver = driver;
 }
コード例 #9
0
ファイル: MGLDriverHook.cs プロジェクト: BradFuller/pspplayer
		public MGLDriverHook( MGLDriver driver )
		{
			this.Driver = driver;
		}