Пример #1
0
        public override void PrimStart(GlobalGpuState globalGpuState, GpuStateStruct *gpuState,
                                       GuPrimitiveType primitiveType)
        {
            GpuState       = gpuState;
            _primitiveType = primitiveType;
            _doPrimStart   = true;
            ResetVertex();


            if (_shader != null)
            {
                _shader.GetUniform("lopEnabled").Set(gpuState->LogicalOperationState.Enabled);

                if (gpuState->LogicalOperationState.Enabled)
                {
                    if (_logicOpsRenderTarget == null)
                    {
                        _logicOpsRenderTarget = GLRenderTarget.Create(512, 272, RenderTargetLayers.Color);
                    }
                    GLRenderTarget.CopyFromTo(GLRenderTarget.Current, _logicOpsRenderTarget);
                    _shader.GetUniform("backtex").Set(GLTextureUnit.CreateAtIndex(1).SetFiltering(GLScaleFilter.Linear)
                                                      .SetWrap(GLWrap.ClampToEdge).SetTexture(_logicOpsRenderTarget.TextureColor));

                    _shader.GetUniform("lop").Set((int)gpuState->LogicalOperationState.Operation);

                    //new Bitmap(512, 272).SetChannelsDataInterleaved(LogicOpsRenderTarget.ReadPixels(), BitmapChannelList.RGBA).Save(@"c:\temp\test.png");
                }
            }
        }
Пример #2
0
        //Action[] InstructionSwitch = new Action[256];

        /// <summary>
        /// Constructor
        /// </summary>
        internal GpuDisplayList(PspMemory Memory, GpuProcessor GpuProcessor, int Id)
        {
            this.Memory       = Memory;
            this.GpuProcessor = GpuProcessor;
            this.Id           = Id;
            GlobalGpuState    = GpuProcessor.GlobalGpuState;
        }