VirtualBox

Changeset 98051 in vbox


Ignore:
Timestamp:
Jan 11, 2023 5:45:06 AM (2 years ago)
Author:
vboxsync
Message:

Devices/Graphics: use the first subresource if the number of levels is not specified. bugref:9830

Location:
trunk/src/VBox/Devices/Graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.cpp

    r96407 r98051  
    3131*********************************************************************************************************************************/
    3232#define LOG_GROUP LOG_GROUP_DEV_VMSVGA
    33 #include <VBox/AssertGuest.h>
    3433#include <VBox/vmm/pdmdev.h>
    3534#include <iprt/errcore.h>
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h

    r96407 r98051  
    3232#endif
    3333
     34#include <VBox/AssertGuest.h>
     35
    3436#include "DevVGA-SVGA.h"
    3537
     
    196198DECLINLINE(void) vmsvga3dCalcMipmapAndFace(uint32_t cMipLevels, uint32_t iSubresource, uint32_t *piMipmap, uint32_t *piFace)
    197199{
    198     *piFace = iSubresource / cMipLevels;
    199     *piMipmap = iSubresource % cMipLevels;
     200    if (RT_LIKELY(cMipLevels))
     201    {
     202        *piFace = iSubresource / cMipLevels;
     203        *piMipmap = iSubresource % cMipLevels;
     204    }
     205    else
     206    {
     207        ASSERT_GUEST_FAILED();
     208        *piFace = 0;
     209        *piMipmap = 0;
     210    }
    200211}
    201212
Note: See TracChangeset for help on using the changeset viewer.

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