Commit graph

  • 242196b036 code clean up with XBPushBuffer.cpp Jack Chen 2023-10-18 06:36:47 +08:00
  • 053fbcec49 unpatch fence related apis Jack Chen 2023-10-18 05:54:51 +08:00
  • f0f73dfb2e revise combiner special ICW/OCW translation, this fix Otogi1 level selection menu Jack Chen 2023-10-18 05:23:44 +08:00
  • 68b7f4c625 revised g_XGVertexBufferData array size to 100, this won't deal with CrimsonSky, not even with 2000 array elements. todo: try ringbuffer Jack Chen 2023-10-18 04:56:12 +08:00
  • f080095cb6 add handling for combiner translation with colorICW=0x04200000 and colorOCW=0x00010c00 Jack Chen 2023-10-18 04:54:54 +08:00
  • 03eaa98a01 unpatch XGSetTextureHeader(), XGSetSurfaceHeader(), XGSetVetetxBufferHeader(), D3DDevice_SetTile(),D3DDevice_GetTile() because current cache couldn't handle edge cases like CrimsonSky. may revised to ring buffer. Jack Chen 2023-10-18 04:53:28 +08:00
  • 35b8626a04 revised input coord padding from 1 to 0, pad 1 to w only Jack Chen 2023-10-18 04:51:42 +08:00
  • 8b35101b5a fix color/alpha OP modulate setup with correct mask. playfield works. Jack Chen 2023-10-17 08:47:35 +08:00
  • 89514b6339 set scene material to host d3d Jack Chen 2023-10-17 06:48:18 +08:00
  • 151dd11f3f correct scene ambient color, scene material ambient/emissive color calculation. add hack color scale to scale up scene ambient color and light colors since we have no way to reverse scene material colors from NV2A directly. current color scale is 2.1 using conditions from HighDynamicRange sample. this fixs HighDynamicRange sample. Jack Chen 2023-10-17 06:05:49 +08:00
  • 2c15a2fb54 use projected texcoord in pixel shader instead of vertex shader. fixs ProjectedTexture sample. Jack Chen 2023-10-16 20:44:37 +08:00
  • 7d621ccda7 set X_D3DRS_LOCALVIEWER with NV097_SET_LIGHT_CONTROL handler. Jack Chen 2023-10-16 17:42:31 +08:00
  • 8bde690ff9 revise texcoord input padding, and output projection logic. PixelShader sample works with NV2A texture transform matrix. Jack Chen 2023-10-16 17:41:53 +08:00
  • 4808be65c4
    Slightly reduce build time (#2437) CI-4808be6 NZJenkins 2023-10-16 19:51:56 +13:00
  • 5d46c9da44 fix default warp setting and composing logic in CxbxrImpl_LazySetTextureState() with correct warp mask. fix texcoord index logic to skip unused texcoord slots. clean up XbPushBuffer.cpp Jack Chen 2023-10-16 04:24:19 +08:00
  • feed74b5c1 XBPixelShader.cpp clean up Jack Chen 2023-10-16 04:21:04 +08:00
  • 62c7f9a089 add XGSetSurfaceHeader() patch, implement XGSetSurfaceHeader() XGSetTextureHeader() D3DDevice_GetTile() D3DDevice_SetTile(). not really working yet. Jack Chen 2023-10-16 04:19:56 +08:00
  • 55befe98c2 correct shift for NV097_SET_TEXTURE_ADDRESS_CYLWRAP_Q_TRUE Jack Chen 2023-10-16 04:17:32 +08:00
  • 25fb1fe5c8 add texture cache for back buffer/depth stencil created with XGSetTextureHeader() Jack Chen 2023-10-15 06:40:52 +08:00
  • 90f12f3d9b enable Lock3DSurface() patch. add patches/trampolines for D3DDevice_SetTile(), D3DDevice_GetTile() and XGSetTextureHeader(). function body not implemented yet. Jack Chen 2023-10-15 06:08:23 +08:00
  • 1dadb9f1e0 fix D3DTOP_LERP logic in CxbxrImpl_LazySetCombiners(), fixs SkyBox sample Jack Chen 2023-10-15 04:11:47 +08:00
  • 1a2bafcddb fix LodBias calculation, displacement map sample shows correct effect with first texture. Jack Chen 2023-10-14 16:27:58 +08:00
  • 6a840de943 update xbox data hash and related time variables to prevent unnecessary host surface update in LoadSurfaceDataFromHost() Jack Chen 2023-10-14 13:18:00 +08:00
  • e4402d3333 generalize xbox parent texture setting in CxbxrImpl_SetRenderTargetTexture(). Jack Chen 2023-10-14 13:14:07 +08:00
  • 85d8e69fce change CXBX_D3DCOMMON_IDENTIFYING_MASK to exclude X_D3DCOMMON_D3DCREATED. this will automatically enable two xbox textures/surfaces sharing the same format/data offset to use the same host resource. Jack Chen 2023-10-14 12:46:07 +08:00
  • 52def6ebaa generalize Lock2DSurface()/Lock3DSurface() with newly added LoadSurfaceDataFromHost() and GetXboxSurfaceAndTransferFromHostSurface(). use LoadSurfaceDataFromHost() in CxbxrImpl_SetRenderTarget() as well. Jack Chen 2023-10-14 07:21:31 +08:00
  • 97931f30b8 add XGSetVertexBufferHeader() patches and g_XGVertexBufferData cache for vertex buffer created using this api. preparation for linking render target with vertex buffer created using this api. Jack Chen 2023-10-11 05:37:01 +08:00
  • d310e7deab temp commit to fix pRenderTarget's content got altered when D3DDevice_SetRenderTarget() reached CxbxrImpl_SetRenderTarget(). we have to pass the whole render target and depth setncil buffer to pushbuffer to prevent xbox side alter the content after leaving D3DDevice_SetRenderTarget(). Jack Chen 2023-10-10 21:08:02 +08:00
  • 2d40de3f1b add wrongliy deleted "float4 temp;" line in CxbxVertexShaderTemplate.hlsl fix VSLight sample crash when lights reduced to 3. Jack Chen 2023-10-09 16:43:29 +08:00
  • 110c41b0dd update logic for setting color OP/alpha OP to diabled in stage 0 in CxbxrImpl_LazySetCombiners(). add further check with ColorICW[1] and AlphaICW[1]. this fixs ProjectedTexture sample. Jack Chen 2023-10-09 14:58:39 +08:00
  • be34728548 tmp commit for converting RectPatch to indexed triangle strip. this works in HLE, but in LLE there is no rendering at all. Jack Chen 2023-10-07 01:16:07 +08:00
  • e262885272 forces X_D3DRS_LIGHTING to true in CxbxrImpl_LazySetLights() when vertex shader is not fixed mode. xbox always set KelvinPrimitive.SetLightingEnable to false when the vertex shader is in passthrough or program mode no matter what the setting is in X_D3DRS_LIGHTING render state. so we have to force set it to true. Jack Chen 2023-10-07 01:25:26 +08:00
  • 8172c68099 add code to convert RectPatch to indexed triangle strips. Jack Chen 2023-10-07 00:41:11 +08:00
  • 9838d27bb5 experiment for HLE D3DDevice_DrawRectPatch() Jack Chen 2023-10-06 07:29:10 +08:00
  • 6ab723e1d4 X_D3DRS_MULTISAMPLEMODE X_D3DRS_MULTISAMPLERENDERTARGETMODE render states setup via pg->KelvinPrimitive.SetSurfaceFormat Jack Chen 2023-10-06 05:54:52 +08:00
  • ad805afa4e repatch D3DDevice_GetBackBuffer() D3DDevice_GetBackBuffer2() D3DDevice_GetBackBuffer2_0__LTCG_eax1() and always return current xbox backbuffer. update xbox back buffer host surface with xbox surface data if it's been locked before draw call or swap. this fixs TrueTypeFont sample Jack Chen 2023-10-05 21:57:32 +08:00
  • 2fc22ad7fb patch D3DDevice_BeginPushBuffer() and D3DDevice_EndPushBuffer() to use g_pXbox_BeginPush_Buffer as flag for pushbuffer recording. we need this flag to determine whether to trampoline certain function. Jack Chen 2023-10-05 18:36:11 +08:00
  • 060e21affd use default AvSavedDataAddress as persisted surface for D3D_GetPersistedSurface() and AvGetSavedDataAddress() Jack Chen 2023-10-05 18:14:37 +08:00
  • d1133c1bef fix GetAVSavedSurface() enable D3DDevice_GetPersistedSurface(). got bugs when xbox title tries to release AVSavedAddress. Jack Chen 2023-10-05 17:43:55 +08:00
  • 3bdc5b677b Remove/localize includes to speed up build Anthony 2023-10-05 20:31:47 +13:00
  • d22f0be039 remove filesystem include to reduce build time Anthony 2023-10-05 20:08:55 +13:00
  • d7650d13c0 unpatch D3DDevice_GetPersistedSurface() D3DDevice_GetPersistedSurface_0() and let AvGetSavedDataAddress(void) do it's job Jack Chen 2023-10-05 13:00:25 +08:00
  • 846fb3bae2 sync D3DDevice_EndVisibilityTest() D3DDevice_EndVisibilityTest_0() D3DDevice_BeginVisibilityTest() with pgraph using WaitForPGRAPH flag. fix VisibilityText sample Jack Chen 2023-10-04 22:07:13 +08:00
  • b27b4770c4 add DrawMode::PrimeVertexCache in pgraph and implement logics to handle D3DDevice_PrimeVertexCache(). fix Ripple sample. Jack Chen 2023-10-04 21:11:05 +08:00
  • c90fb04b85 add HLE patches for D3DDevice_GetPersistedSurface() and D3DDevice_GetPersistedSurface2() and implement D3DDevice_PersistDisplay() Jack Chen 2023-10-04 16:45:18 +08:00
  • 64f6bb4030 correct Light.Position/Light.Direction calculation using inverse view transform matrix. correct D3DDevice_SetLight() token setup by passing whole *pLight to pushbuffer. Jack Chen 2023-10-04 13:22:33 +08:00
  • 96a8597914 add HLE to prgaph toke template for allocating 128 bytes pushbuffer space including command word. Jack Chen 2023-10-04 13:20:48 +08:00
  • 16d20fd5ce use xbox view matrix in fix mode vertex shader constant light setup. Jack Chen 2023-10-04 06:42:24 +08:00
  • b227c7a54b fix fog mode constant update code with program vertex shader. remove wrongly applied double DWtoF() conversion. fix Fog sample Jack Chen 2023-10-04 05:37:09 +08:00
  • 65e8417fed fix state shader input handling when pData is nullptr. test case: StateSahder sample. Jack Chen 2023-10-03 23:19:32 +08:00
  • dcc7d0ef41 move linkage of render target surface with texture stage input texture code to CxbxrImpl_SetRenderTarget(). add experiment code for linking depth stencil buffer with texture stage input texture, not working yet. Jack Chen 2023-10-03 22:16:36 +08:00
  • 45b57ab75f update host texture format checking logic in CxbxUpdateHostTextures(). when not being used as bumpmap texture, we check whether the host texture is bumpmap texture format or not. Jack Chen 2023-10-01 21:12:37 +08:00
  • 8886925f4b add SetHostResourcePCFormat() in CxbxrImpl_SetTexture() to set host resource PCFormat when a rentarget type host resource was recreated as texture and used in texture stage. this fixs regressed DynamicGamma sample. prevent wrongly handling of bumpmap format textures inside CxbxUpdateHostTextures() Jack Chen 2023-10-01 21:03:05 +08:00
  • e9767851ad check duplicated texcoord vertex attribute slots and set texcoord index texture stage states accordingly. also fix texcoord index setup code in CxbxrImpl_LazySetTextureTransform() Jack Chen 2023-10-01 19:57:20 +08:00
  • e3783f9516 revert: fix host stream stride and vertex element offset calculation when there are two or more vertex elements sharing the same vertex element. 303e132a Jack Chen 2023-10-01 19:08:30 +08:00
  • f46a5528b4 change unnecessary static wait flag decl. to none static Jack Chen 2023-10-01 00:19:08 +08:00
  • 3cc1ee6824 sync Lock2DSurface() Loc3DSurface() with pgrph using wait flag to make sure HLE side can access the right data. Jack Chen 2023-10-01 00:17:59 +08:00
  • 6cb60f1cc5 confirm texture transform matrix setup in UpdateFixedFunctionVertexShaderState(). duplicate transform matrix setup in HLE direct model view mode although it's not used in LLE. clean code a bit. Jack Chen 2023-09-30 17:23:35 +08:00
  • cb5d590add add support for bumpmap X_D3DFMT_L6V5U5 and X_D3DFMT_LIN_L6V5U5 to D3DFMT_X8L8R8G8 conversion. and X_D3DFMT_V16U16 and X_D3DFMT_LIN_V16U16 to D3DFMT_X8L8R8G8 conversion. Jack Chen 2023-09-29 21:57:25 +08:00
  • 303e132aaf fix host stream stride and vertex element offset calculation when there are two or more vertex elements shaing the same vertex element. Jack Chen 2023-09-30 21:49:45 +08:00
  • bcf65f05f9 temp fix for transform matrix vertex constant update for fixed mode vertex shader. fix wrongly setup view matrix(should use matrix from D3DDevice_SetTransform()), inverse modelview matrix (matrix from NV2A should be transposed. Jack Chen 2023-09-29 19:54:57 +08:00
  • ef791276ef add stageMode[stage]!=NV097_SET_SHADER_STAGE_PROGRAM_STAGE1_PROGRAM_NONE check in CxbxUpdateHostTextures() to skip unnecessary texture stage texture setup. Jack Chen 2023-09-28 16:40:29 +08:00
  • 37aa2676f7 sync D3DDevice_Swap() and D3DD3vice_Present() with pgraph by using WaitForPGRAPH flag to pause HLE api and wait prgaph to flush all pushbuffer commands. this fix tripple dolphins being rendered in FiledRender xdk sample. Jack Chen 2023-09-28 16:30:19 +08:00
  • 6603a97c0f using signed UV format as default foramt for all UV bump map texture formats. convert to ARGB when not in bumpenv stage or colorsign not set. Jack Chen 2023-09-28 16:14:57 +08:00
  • 5c07eb68b2 use offline pixel shader HLSL for the ease of shader code debugging. add CxbxPixelShaderTemplate.hlsl for program pixel shader template Jack Chen 2023-09-27 22:53:38 +08:00
  • e1c12a6978 remove extra ; medievil1 2023-09-24 20:29:07 -04:00
  • e81491197b Small performance improvement (barely measurable, so perhaps not worth it) in the tooling functions I used in the libyuv-derived color conversion functions. PatrickvL 2022-10-14 18:43:16 +02:00
  • b5082dc7fd fix jsrf boost dash being dark and kotor character medievil1 2023-09-24 13:33:04 -04:00
  • e69baa0e85
    Merge branch 'Cxbx-Reloaded:master' into test3 medievil1 2023-09-24 11:27:19 -04:00
  • 71a25a8b20 add UV2ARGB(src) to pixel shader template and use it in DoBumpEnv(), this fixed the bumplens sample. there is still artifects around the center Y axis of the bump effect texture. Jack Chen 2023-09-24 17:17:50 +08:00
  • 75bc0ad44d add bool is_bumpmap member in struct _FormatInfo to indicate whether the texture format is an bumpmap or not. force all bumpmap format texture to be converted to ARGB. we'll handle the pixel color value signed to unsigned conversion in pixel shader. Jack Chen 2023-09-24 17:16:29 +08:00
  • 49e18692b2 add NAN handling in vertex shader template. this fixs Otogi 1 and 2 character rendering. todo: make the NAN handling optional with detection of whether there is fog used in final combiner or not. Jack Chen 2023-09-21 16:51:22 +08:00
  • 110e755801 add code might be uesful to enable gamma ramp. disabled for now since no effect so far. Jack Chen 2023-09-21 01:39:46 +08:00
  • 57055ae894 fix wrong compare operator in CxbxrImpl_LazySetCombiners() Jack Chen 2023-09-21 01:39:16 +08:00
  • def10ff466
    CI: Upgrade checkout to v4 Margen67 2023-09-20 01:28:42 -07:00
  • 99bf557214 revert diabled calling CxbxrImpl_SetVertexShader() and sync with pgraph. we need this to enable rendering in RSC and character rendering in JSRF Jack Chen 2023-09-18 20:53:15 +08:00
  • 87b6b62cca check if the input texture/surface for D3DDevice_SetTexture() was used as render target before or not. if it was render target, then get the host base texture of that render target and set the host texture to the input xbox texture's host resource with SetHostResouce() for resource cache. this establishes the link between xbox texture and host render target. fix the lumin render in DynamicGamma sample Jack Chen 2023-09-18 17:53:16 +08:00
  • b3052712c8 forced CxbxrImpl_LazySetCombiners(d) in D3D_draw_state_update() when fixed mode pixel shader was set. this has performance impact but could make the render state more compliant with xbox title's setting, for the ease of graph debug. it has no actuall effect, should be revert after we finish most graph debugging. Jack Chen 2023-09-18 17:48:20 +08:00
  • 9ebb8668d4 add list of HLE apis which synced with pgraph Jack Chen 2023-09-17 22:53:02 +08:00
  • a71247052c disable calling CxbxrImpl_SetVertexShader() since we're in full LLE. Jack Chen 2023-09-17 22:52:43 +08:00
  • b94b74afa2 revised texture stage texture cache, now cache the whole texture/surface in map. this could reserve the common member of texture/surface for better link to host resource. Jack Chen 2023-09-17 22:31:42 +08:00
  • 34a02e0a6b remove unnecessary code in CxbxrImpl_Lock2DSurface() onle force rehash xbox data when the X_D3DLOCK_READONLY is not set. Jack Chen 2023-09-17 21:05:49 +08:00
  • 81db403bfa hRet=pHostSourceSurface->GetDesc(&HostSurfaceDesc); set hRet so we don't fall in errored warning in next line Jack Chen 2023-09-17 20:59:39 +08:00
  • 9550dd4116 sync D3DDevice_Reset() D3DDevice_Reset_0__LTCG_edi1() D3DDevice_Reset_0__LTCG_ebx1() with pgraph. fix RallySportChallenge crash in freeing backbuffer when calling D3DDevice_Reset() Jack Chen 2023-09-17 20:58:24 +08:00
  • d648599938 add forward decl of EmuKickOff(); in HleInNv2a.h Jack Chen 2023-09-17 20:55:34 +08:00
  • 9901866940 sync D3DDevice_SetGammaRamp() and D3DDevice_GetGammaRamp() with pgraph. use D3DSGR_NO_CALIBRATION flag in g_pD3DDevice->SetGammaRamp() DynamicGamma sample now shows the correct GammaRamp graph. still missing the lumin histogram. Jack Chen 2023-09-17 20:51:25 +08:00
  • 19d187e9e0 add HLE sync pgraph in HLE side template Jack Chen 2023-09-17 20:38:22 +08:00
  • 145eb94c9f modify EMUPATCH(Lock2DSurface), transfer host texture/surface data to xbox data when EMUPATCH(Lock2DSurface) was called. currently only support no data conversion. Jack Chen 2023-09-16 21:07:14 +08:00
  • 705f9034e9 unpatch Lock2DSurface() unsync HLE Lock2DSurface() and Lock3DSurface() trying to fix DynamicGamma sample Jack Chen 2023-09-15 00:32:25 +08:00
  • da8f2bcd2c unpatch HLE D3DDevice_SetGammaRamp(), implement CxbxrImpl__SetGammaRamp() and sync with pgraph trying to fix DynamicGamma sample, not working yet. Jack Chen 2023-09-14 23:16:22 +08:00
  • 4baf5b4710 abort when g_xbox_transform_matrix is nullptr in CxbxrImpl_SetTransformFast() Jack Chen 2023-09-14 21:31:57 +08:00
  • 66e10cd8a8 unpatch D3DDevice_SetShaderConstantMode() and D3DDevice_SetShaderConstantMode_0__LTCG_eax1() Jack Chen 2023-09-14 21:28:46 +08:00
  • a21408c201 substract register bias when calling CxbxrImpl_SetVertexShaderConstant() in CxbxrImpl_SetShaderConstantMode() Jack Chen 2023-09-14 21:28:04 +08:00
  • d332e0b42c unpatch D3DDevice_SetStreamSource() and it's variants Jack Chen 2023-09-14 20:15:04 +08:00
  • 8c1ebbe5cc patch HLE D3DDevice_BlockOnFence() D3DDevice_IsBusy() D3D_BlockOnTime() D3D_BlockOnTime_4() because we don't implement them yet. Jack Chen 2023-09-14 19:37:36 +08:00
  • 2730adb06a unpatch HLE D3DDevice_LoadVertexShader() D3DDevice_SelectVertexShader() D3DDevice_SelectVertexShader_0__LTCG_eax1_ebx2() D3DDevice_SelectVertexShader_4__LTCG_eax1() Jack Chen 2023-09-14 18:28:46 +08:00
  • 55afb974c3 add default vertex attribute setting in NV097_SET_VERTEX_DATA4F_M method hander. test case Halo 2 Jack Chen 2023-09-14 17:33:32 +08:00
  • a9bc0c54fe add dirty flag settting for X_D3DDIRTYFLAG_SHADER_STAGE_PROGRAM X_D3DDIRTYFLAG_COMBINERS X_D3DDIRTYFLAG_SPECFOG_COMBINER in pgraph method hander. call CxbxrImpl_LazySetShaderStageProgram(d) whenever one of there 3 flags was set. Jack Chen 2023-09-14 17:08:09 +08:00
  • b016a0bebe always update NV2A_PSDef.PSFinalCombinerInputsABCD and NV2A_PSDef.PSFinalCombinerInputsEFG with KelvinPrimitive.SetCombinerSpecularFogCW0 and KelvinPrimitive.SetCombinerSpecularFogCW1 fixs Dolphin series sea buttom rendering. Jack Chen 2023-09-14 14:45:32 +08:00
  • 80efe0a180 return &g_NV2AVertexAttributeFormat in GetXboxVertexAttributeFormat() when is_pgraph_using_NV2A_Kelvin() returns true. remove the usages of set_IVB_DECL_override() and reset_IVB_DECL_override() in pgraph NV097_SET_BEGIN_END method handler draw calls. Jack Chen 2023-09-14 14:05:06 +08:00