VirtualBox

儲存庫 vbox 的更動 30885


忽略:
時間撮記:
2010-7-16 下午05:11:31 (14 年 以前)
作者:
vboxsync
訊息:

wddm/3d: Aero working cleanly!

位置:
trunk/src/VBox/Additions/WINNT/Graphics
檔案:
修改 3 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp

    r30865 r30885  
    12531253        {FALSE, D3DTSS_ALPHAARG0},               /* 27, D3DDDITSS_ALPHAARG0 */
    12541254        {FALSE, D3DTSS_RESULTARG},               /* 28, D3DDDITSS_RESULTARG */
    1255         {FALSE, D3DTSS_FORCE_DWORD},             /* 29, D3DDDITSS_SRGBTEXTURE */
    1256         {FALSE, D3DTSS_FORCE_DWORD},             /* 30, D3DDDITSS_ELEMENTINDEX */
    1257         {FALSE, D3DTSS_FORCE_DWORD},             /* 31, D3DDDITSS_DMAPOFFSET */
     1255        {TRUE, D3DSAMP_SRGBTEXTURE},             /* 29, D3DDDITSS_SRGBTEXTURE */
     1256        {TRUE, D3DSAMP_ELEMENTINDEX},            /* 30, D3DDDITSS_ELEMENTINDEX */
     1257        {TRUE, D3DSAMP_DMAPOFFSET},              /* 31, D3DDDITSS_DMAPOFFSET */
    12581258        {FALSE, D3DTSS_CONSTANT},                /* 32, D3DDDITSS_CONSTANT */
    12591259        {FALSE, D3DTSS_FORCE_DWORD},             /* 33, D3DDDITSS_DISABLETEXTURECOLORKEY */
    12601260        {FALSE, D3DTSS_FORCE_DWORD},             /* 34, D3DDDITSS_TEXTURECOLORKEYVAL */
    12611261    };
     1262
     1263    Assert(enmType > 0);
     1264    Assert(enmType < RT_ELEMENTS(lookup));
     1265    Assert(lookup[enmType].dType != D3DTSS_FORCE_DWORD);
    12621266
    12631267    return lookup[enmType];
     
    44704474    Assert(pRc);
    44714475    Assert(pData->SubResourceIndex < pRc->cAllocations);
    4472     Assert(pRc == pDevice->pRenderTargetRc);
    44734476    if (pRc == pDevice->pRenderTargetRc)
    44744477    {
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DCmn.h

    r30865 r30885  
    3838# define VBOXWDDMDISP_DEBUG
    3939# define VBOXWDDMDISP_DEBUG_FLOW
     40//# define VBOXWDDMDISP_DEBUG_DUMPSURFDATA
    4041#endif
    4142
     
    8283        vboxVDbgDoMpPrintAlloc _m ; \
    8384    } while (0)
     85#ifdef VBOXWDDMDISP_DEBUG_DUMPSURFDATA
    8486#define vboxVDbgDumpSurfData(_m) \
    8587    do { \
    8688        vboxVDbgDoDumpSurfData _m ; \
    8789    } while (0)
     90#else
     91#define vboxVDbgDumpSurfData(_m) do {} while (0)
     92#endif
    8893#ifdef VBOXWDDMDISP_DEBUG_FLOW
    8994# define vboxVDbgPrintF  vboxVDbgPrint
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c

    r28475 r30885  
    126126    struct ps_compile_args      ps_args;
    127127    UINT                        constant_version;
     128#ifdef VBOXWDDM
     129    UINT                        inp2Fixup_info;
     130#else
    128131    const struct ps_np2fixup_info *np2Fixup_info;
     132#endif
    129133};
     134
     135#ifdef VBOXWDDM
     136#define WINEFIXUPINFO_NOINDEX (~0UL)
     137#define WINEFIXUPINFO_GET(_p) get_fixup_info((const IWineD3DPixelShaderImpl*)(_p)->pshader, (_p)->inp2Fixup_info)
     138#define WINEFIXUPINFO_ISVALID(_p) ((_p)->inp2Fixup_info != WINEFIXUPINFO_NOINDEX)
     139#define WINEFIXUPINFO_INIT(_p) ((_p)->inp2Fixup_info == WINEFIXUPINFO_NOINDEX)
     140#else
     141#define WINEFIXUPINFO_GET(_p) ((_p)->np2Fixup_info)
     142#define WINEFIXUPINFO_ISVALID(_p) (!!(_p)->np2Fixup_info)
     143#define WINEFIXUPINFO_INIT(_p) ((_p)->np2Fixup_info == NULL)
     144#endif
    130145
    131146typedef struct {
     
    673688}
    674689
     690#ifdef VBOXWDDM
     691static const struct ps_np2fixup_info * get_fixup_info(const IWineD3DPixelShaderImpl *shader, UINT inp2fixup_info)
     692{
     693    struct glsl_pshader_private    *shader_data = shader->baseShader.backend_data;
     694
     695    if (inp2fixup_info == WINEFIXUPINFO_NOINDEX)
     696        return NULL;
     697
     698    if (!shader->baseShader.backend_data)
     699    {
     700        ERR("no backend data\n");
     701        return NULL;
     702    }
     703    shader_data = shader->baseShader.backend_data;
     704
     705    if (inp2fixup_info >= shader_data->num_gl_shaders)
     706    {
     707        ERR("invalid index\n");
     708        return NULL;
     709    }
     710
     711    return &shader_data->gl_shaders[inp2fixup_info].np2fixup;
     712}
     713#endif
     714
    675715/**
    676716 * Loads the texture dimensions for NP2 fixup into the currently set GLSL program.
     
    702742        GLfloat np2fixup_constants[4 * MAX_FRAGMENT_SAMPLERS];
    703743
     744        const struct ps_np2fixup_info *np2Fixup_info = WINEFIXUPINFO_GET(prog);
     745
    704746        for (i = 0; fixup; fixup >>= 1, ++i) {
    705             const unsigned char idx = prog->np2Fixup_info->idx[i];
     747            const unsigned char idx = np2Fixup_info->idx[i];
    706748            const IWineD3DBaseTextureImpl* const tex = (const IWineD3DBaseTextureImpl*) stateBlock->textures[i];
    707749            GLfloat* tex_dim = &np2fixup_constants[(idx >> 1) * 4];
     
    719761        }
    720762
    721         GL_EXTCALL(glUniform4fvARB(prog->np2Fixup_location, prog->np2Fixup_info->num_consts, np2fixup_constants));
     763        GL_EXTCALL(glUniform4fvARB(prog->np2Fixup_location, np2Fixup_info->num_consts, np2fixup_constants));
    722764    }
    723765}
     
    41364178static GLhandleARB find_glsl_pshader(const struct wined3d_context *context,
    41374179        struct wined3d_shader_buffer *buffer, IWineD3DPixelShaderImpl *shader,
    4138         const struct ps_compile_args *args, const struct ps_np2fixup_info **np2fixup_info)
     4180        const struct ps_compile_args *args,
     4181#ifdef VBOXWDDM
     4182        UINT *inp2fixup_info
     4183#else
     4184        const struct ps_np2fixup_info **np2fixup_info
     4185#endif
     4186        )
    41394187{
    41404188    UINT i;
     
    41624210    for(i = 0; i < shader_data->num_gl_shaders; i++) {
    41634211        if(memcmp(&shader_data->gl_shaders[i].args, args, sizeof(*args)) == 0) {
    4164             if(args->np2_fixup) *np2fixup_info = &shader_data->gl_shaders[i].np2fixup;
     4212            if(args->np2_fixup) {
     4213#ifdef VBOXWDDM
     4214                *inp2fixup_info = i;
     4215#else
     4216                *np2fixup_info = &shader_data->gl_shaders[i].np2fixup;
     4217#endif
     4218            }
    41654219            return shader_data->gl_shaders[i].prgId;
    41664220        }
     
    41974251    shader_buffer_clear(buffer);
    41984252    ret = shader_glsl_generate_pshader(context, buffer, shader, args, np2fixup);
     4253#ifdef VBOXWDDM
     4254    *inp2fixup_info = shader_data->num_gl_shaders;
     4255#else
     4256    *np2fixup_info = np2fixup;
     4257#endif
    41994258    shader_data->gl_shaders[shader_data->num_gl_shaders++].prgId = ret;
    4200     *np2fixup_info = np2fixup;
    42014259
    42024260    return ret;
     
    43184376    entry->ps_args = ps_compile_args;
    43194377    entry->constant_version = 0;
    4320     entry->np2Fixup_info = NULL;
     4378    WINEFIXUPINFO_INIT(entry);
    43214379    /* Add the hash table entry */
    43224380    add_glsl_program_entry(priv, entry);
     
    43714429    {
    43724430        GLhandleARB pshader_id = find_glsl_pshader(context, &priv->shader_buffer,
    4373                 (IWineD3DPixelShaderImpl *)pshader, &ps_compile_args, &entry->np2Fixup_info);
     4431                (IWineD3DPixelShaderImpl *)pshader, &ps_compile_args,
     4432#ifdef VBOXWDDM
     4433                &entry->inp2Fixup_info
     4434#else
     4435                &entry->np2Fixup_info
     4436#endif
     4437                );
    43744438        TRACE("Attaching GLSL shader object %u to program %u\n", pshader_id, programId);
    43754439        GL_EXTCALL(glAttachObjectARB(programId, pshader_id));
     
    44224486
    44234487        if (ps_compile_args.np2_fixup) {
    4424             if (entry->np2Fixup_info) {
     4488            if (WINEFIXUPINFO_ISVALID(entry)) {
    44254489                entry->np2Fixup_location = GL_EXTCALL(glGetUniformLocationARB(programId, "PsamplerNP2Fixup"));
    44264490            } else {
     
    45854649     * constants. This has to be done because it can't be guaranteed that sampler() (from state.c) is
    45864650     * called between selecting the shader and using it, which results in wrong fixup for some frames. */
    4587     if (priv->glsl_program && priv->glsl_program->np2Fixup_info)
     4651    if (priv->glsl_program && WINEFIXUPINFO_ISVALID(priv->glsl_program))
    45884652    {
    45894653        shader_glsl_load_np2fixup_constants((IWineD3DDevice *)device, usePS, useVS);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette