Changeset 54633 in vbox for trunk/src/VBox/Devices/Graphics
- Timestamp:
- Mar 4, 2015 6:24:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r54626 r54633 152 152 */ 153 153 #ifdef RT_OS_WINDOWS 154 # define VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext) 155 if ((pState)->idActiveContext != pContext->id) 156 { 154 # define VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext) \ 155 if ((pState)->idActiveContext != pContext->id) \ 156 { \ 157 157 BOOL fMakeCurrentRc = wglMakeCurrent((pContext)->hdc, (pContext)->hglrc); \ 158 Assert(fMakeCurrentRc == TRUE); \ 159 pState->idActiveContext = (pContext)->id; \ 158 Assert(fMakeCurrentRc == TRUE); \ 159 LogFlowFunc(("Changing context: %#x -> %#x\n", (pState)->idActiveContext, (pContext)->id)); \ 160 (pState)->idActiveContext = (pContext)->id; \ 160 161 } else do { } while (0) 161 162 … … 165 166 { \ 166 167 vmsvga3dCocoaViewMakeCurrentContext((pContext)->cocoaView, (pContext)->cocoaContext); \ 168 LogFlowFunc(("Changing context: %#x -> %#x\n", (pState)->idActiveContext, (pContext)->id)); \ 167 169 (pState)->idActiveContext = (pContext)->id; \ 168 170 } else do { } while (0) 169 171 #else 170 172 # define VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext) \ 171 if ((pState)->idActiveContext != (pContext)->id) \ 172 { \ 173 Bool fMakeCurrentRc = glXMakeCurrent((pState)->display, \ 174 (pContext)->window, \ 175 (pContext)->glxContext); \ 176 Assert(fMakeCurrentRc == True); \ 177 (pState)->idActiveContext = (pContext)->id; \ 173 if ((pState)->idActiveContext != (pContext)->id) \ 174 { \ 175 Bool fMakeCurrentRc = glXMakeCurrent((pState)->display, \ 176 (pContext)->window, \ 177 (pContext)->glxContext); \ 178 Assert(fMakeCurrentRc == True); \ 179 LogFlowFunc(("Changing context: %#x -> %#x\n", (pState)->idActiveContext, (pContext)->id)); \ 180 (pState)->idActiveContext = (pContext)->id; \ 178 181 } else do { } while (0) 179 182 #endif … … 2754 2757 } 2755 2758 else 2759 { 2756 2760 /* Reserve texture memory. */ 2757 2761 glTexImage2D(GL_TEXTURE_2D, … … 2764 2768 pSurface->typeGL, 2765 2769 NULL); 2770 VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext); 2771 } 2766 2772 2767 2773 /* Restore the old active texture. */ … … 2769 2775 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 2770 2776 2777 LogFlow(("vmsvga3dCreateTexture: sid=%#x idAssociatedContext %#x -> %#x; oglId.texture=%#x\n", 2778 pSurface->id, pSurface->idAssociatedContext, idAssociatedContext, pSurface->oglId.texture)); 2771 2779 pSurface->flags |= SVGA3D_SURFACE_HINT_TEXTURE; 2772 LogFlow(("vmsvga3dCreateTexture: sid=%#x idAssociatedContext %#x -> %#x\n", pSurface->id, pSurface->idAssociatedContext, idAssociatedContext));2773 2780 pSurface->idAssociatedContext = idAssociatedContext; 2774 2781 return VINF_SUCCESS; 2775 2782 } 2776 2783 2777 int vmsvga3dSurfaceStretchBlt(PVGASTATE pThis, SVGA3dSurfaceImageId dest, SVGA3dBox destBox, SVGA3dSurfaceImageId src, SVGA3dBox srcBox, SVGA3dStretchBltMode mode) 2784 int vmsvga3dSurfaceStretchBlt(PVGASTATE pThis, SVGA3dSurfaceImageId dest, SVGA3dBox destBox, 2785 SVGA3dSurfaceImageId src, SVGA3dBox srcBox, SVGA3dStretchBltMode mode) 2778 2786 { 2779 2787 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState; … … 2838 2846 2839 2847 /* Bind the source and destination objects to the right place. */ 2840 pState->ext.glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pSurfaceSrc->oglId.texture, src.mipmap); 2848 pState->ext.glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 2849 pSurfaceSrc->oglId.texture, src.mipmap); 2841 2850 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 2842 pState->ext.glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pSurfaceDest->oglId.texture, dest.mipmap); 2851 pState->ext.glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 2852 pSurfaceDest->oglId.texture, dest.mipmap); 2843 2853 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 2844 2854
Note:
See TracChangeset
for help on using the changeset viewer.