Cxbx-Reloaded icon indicating copy to clipboard operation
Cxbx-Reloaded copied to clipboard

Implement Texture Stage State xbox extensions in HLSL

Open PatrickvL opened this issue 3 years ago • 3 comments

[ Replacement for accidentally closed PR #2228 ]

This PR addresses #1604, introducing most of what's needed to support COLORSIGN, COLORKEYCOLOR, COLORKEYOP alongside with a small ALPHAKILL refactoring.

To get there, X_D3DFMT_L6V5U5 had to be converted into host D3DFMT_X8L8V8U8, and some HLSL code had to be added to implement these extensions.

Some pieces to the puzzle may still be missing, but at least this is a step in the right direction.

The most important test is to see if JSRF boost dash didn't regress because of this. I can't really judge this well, so please give us some feedback.

PatrickvL avatar Jun 07 '21 14:06 PatrickvL

ummm something is afoot...lol image

medievil1 avatar Jun 12 '21 13:06 medievil1

ummm something is afoot...lol image

This green color likely is the 'WarningColor' I return when the ColorKey operation reaches the end of the function without hitting any of the known cases. The reason this happens, is probably not because we lack a 'known' case, but because one case is disabled due to it causing a shader compilation error - this, based on the following code :

#ifdef ENABLE_FF_ALPHAKILL
	if (ColorKeyOp == 3) // = _KILL
		discard; // When compiled into FixedFunctionPixelShader.hlsl, compile errors arise

... whereby ENABLE_FF_ALPHAKILL is currently disabled.

PatrickvL avatar Jul 12 '21 09:07 PatrickvL

ok at least one change for this pr...it isn't in master but may have been (jackchen has it is his branch from master) anyway in direct3d9.cpp there is an else if checking for quadstrips...then decoding them (incorrectly) and rendering as a triangle list.... that is incorrect... quad strips should be rendered as is as triangle strips via drawprimitiveUP, no indexing at all.... heatshimmer as triangle strip image heatshimmer as triangle list indexed/decoded per this PR.. clearly missing quads as it is 1/2 the size image

medievil1 avatar Aug 10 '22 19:08 medievil1