Changeset 91011 in vbox
- Timestamp:
- Aug 30, 2021 7:34:32 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146651
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-hlp.cpp
r86593 r91011 39 39 /** Version token. */ 40 40 SVGA3dShaderVersion version; 41 42 SVGA3dShaderOpCodeType currentOpcode; 43 union 44 { 45 SVGA3DOpDclArgs *pDclArgs; 46 } u; 41 47 } VMSVGA3DSHADERPARSECONTEXT; 42 48 … … 159 165 Log3(("Dest: type %d, r0 %d, shfScale %d, dstMod %d, mask 0x%x, r1 %d, relAddr %d, num %d\n", 160 166 regType, dest.reserved0, dest.shfScale, dest.dstMod, dest.mask, dest.reserved1, dest.relAddr, dest.num)); 167 168 if (pCtx->currentOpcode == SVGA3DOP_DCL && regType == SVGA3DREG_SAMPLER) 169 { 170 if (pCtx->u.pDclArgs->type == SVGA3DSAMP_UNKNOWN) 171 { 172 Log3(("Replacing SVGA3DSAMP_UNKNOWN with SVGA3DSAMP_2D\n")); 173 pCtx->u.pDclArgs->type = SVGA3DSAMP_2D; 174 } 175 } 161 176 162 177 return vmsvga3dShaderParseRegOffset(pCtx, false, regType, dest.num); … … 300 315 * https://docs.microsoft.com/en-us/windows-hardware/drivers/display/shader-code-format 301 316 */ 302 int vmsvga3dShaderParse(SVGA3dShaderType type, uint32_t cbShaderData, uint32_t const* pShaderData)303 { 304 uint32_t const*paTokensStart = (uint32_t*)pShaderData;317 int vmsvga3dShaderParse(SVGA3dShaderType type, uint32_t cbShaderData, uint32_t* pShaderData) 318 { 319 uint32_t *paTokensStart = (uint32_t*)pShaderData; 305 320 uint32_t const cTokens = cbShaderData / sizeof(uint32_t); 306 321 … … 341 356 342 357 /* Scan the tokens. Immediately return an error code on any unexpected data. */ 343 uint32_t const*paTokensEnd = &paTokensStart[cTokens];344 uint32_t const*pToken = &paTokensStart[1]; /* Skip the version token. */358 uint32_t *paTokensEnd = &paTokensStart[cTokens]; 359 uint32_t *pToken = &paTokensStart[1]; /* Skip the version token. */ 345 360 bool bEndTokenFound = false; 346 361 while (pToken < paTokensEnd) … … 366 381 } 367 382 383 ctx.currentOpcode = (SVGA3dShaderOpCodeType)token.op; 384 368 385 /* If this instrution is in the aOps table. */ 369 386 if (token.op <= SVGA3DOP_BREAKP) 370 387 { 371 388 VMSVGA3DSHADERPARSEOP const* pOp = &aOps[token.op]; 389 390 if (ctx.currentOpcode == SVGA3DOP_DCL) 391 ctx.u.pDclArgs = (SVGA3DOpDclArgs *)&pToken[1]; 372 392 373 393 /* cInstLen can be greater than pOp->Length. -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h
r89171 r91011 1408 1408 #endif 1409 1409 1410 int vmsvga3dShaderParse(SVGA3dShaderType type, uint32_t cbShaderData, uint32_t const*pShaderData);1410 int vmsvga3dShaderParse(SVGA3dShaderType type, uint32_t cbShaderData, uint32_t *pShaderData); 1411 1411 void vmsvga3dShaderLogRel(char const *pszMsg, SVGA3dShaderType type, uint32_t cbShaderData, uint32_t const *pShaderData); 1412 1412
Note:
See TracChangeset
for help on using the changeset viewer.