Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xml] Group fixes for GL_ATI_fragment_shader #521

Merged
merged 3 commits into from
Jul 22, 2022

Conversation

SunSerega
Copy link
Contributor

@SunSerega SunSerega commented Jun 24, 2022

The GL_ATI_fragment_shader extension had 4 of its enum groups defined, 3 of them never used.
I was fixing them as part of #520. But then I noticed how much more is missing and decided to add the rest of the groups.
I know this extension is outdated, but I don't want to leave it still half-baked after my changes.

From the spec, here are lists of which function takes what enums:

# ColorFragmentOp[%N%]ATI
	dst: REG_0_ATI
=	dstMod: NONE, 2X_BIT_ATI, 4X_BIT_ATI, 8X_BIT_ATI, HALF_BIT_ATI, QUARTER_BIT_ATI, EIGHTH_BIT_ATI, SATURATE_BIT_ATI
=	dstMask: NONE, RED_BIT_ATI, GREEN_BIT_ATI, BLUE_BIT_ATI
	argN: REG_0_ATI, CON_0_ATI, ZERO, ONE, PRIMARY_COLOR_ARB, SECONDARY_INTERPOLATOR_ATI
	argNRep: NONE, RED, GREEN, BLUE, ALPHA
=	argNMod: 2X_BIT_ATI, COMP_BIT_ATI, NEGATE_BIT_ATI, BIAS_BIT_ATI
# ColorFragmentOp1ATI
	op: MOV_ATI
# ColorFragmentOp2ATI
	op: ADD_ATI, MUL_ATI, SUB_ATI, DOT3_ATI, DOT4_ATI
# ColorFragmentOp3ATI
	op: MAD_ATI, LERP_ATI, CND_ATI, CND0_ATI, DOT2_ADD_ATI
	
# AlphaFragmentOp[%N%]ATI
	dst: REG_0_ATI
=	dstMod: NONE, 2X_BIT_ATI, 4X_BIT_ATI, 8X_BIT_ATI, HALF_BIT_ATI, QUARTER_BIT_ATI, EIGHTH_BIT_ATI, SATURATE_BIT_ATI
	argN: REG_0_ATI, CON_0_ATI, ZERO, ONE, PRIMARY_COLOR_ARB, SECONDARY_INTERPOLATOR_ATI
	argNRep: NONE, RED, GREEN, BLUE, ALPHA
=	argNMod: 2X_BIT_ATI, COMP_BIT_ATI, NEGATE_BIT_ATI, BIAS_BIT_ATI
# AlphaFragmentOp1ATI
	op: MOV_ATI
# AlphaFragmentOp2ATI
	op: ADD_ATI, MUL_ATI, SUB_ATI, DOT3_ATI, DOT4_ATI
# AlphaFragmentOp3ATI
	op: MAD_ATI, LERP_ATI, CND_ATI, CND0_ATI, DOT2_ADD_ATI
	
# PassTexCoordATI
	dst: REG_0_ATI
	coord: REG_0_ATI, TEXTURE0_ARB
=	swizzle: SWIZZLE_STR_ATI, SWIZZLE_STQ_ATI, SWIZZLE_STR_DR_ATI, SWIZZLE_STQ_DQ_ATI
	
# SampleMapATI
	dst: REG_0_ATI
	interp: REG_0_ATI, TEXTURE0_ARB
=	swizzle: SWIZZLE_STR_ATI, SWIZZLE_STQ_ATI, SWIZZLE_STR_DR_ATI, SWIZZLE_STQ_DQ_ATI
	
# SetFragmentShaderConstantATI
	dst: CON_0_ATI

= denotes groups that existed before my changes.

In the end, the groups of this extension are:

# FragmentShaderDestMaskATI
	NONE, RED_BIT_ATI, GREEN_BIT_ATI, BLUE_BIT_ATI
	ColorFragmentOp[%N%]ATI: dskMask
	
# FragmentShaderDestModMaskATI
	NONE, 2X_BIT_ATI, 4X_BIT_ATI, 8X_BIT_ATI, HALF_BIT_ATI, QUARTER_BIT_ATI, EIGHTH_BIT_ATI, SATURATE_BIT_ATI
	ColorFragmentOp[%N%]ATI: dstMod
	AlphaFragmentOp[%N%]ATI: dstMod

# FragmentShaderColorModMaskATI
	2X_BIT_ATI, COMP_BIT_ATI, NEGATE_BIT_ATI, BIAS_BIT_ATI
	ColorFragmentOp[%N%]ATI: argNMod
	AlphaFragmentOp[%N%]ATI: argNMod

# SwizzleOpATI
	SWIZZLE_STR_ATI, SWIZZLE_STQ_ATI, SWIZZLE_STR_DR_ATI, SWIZZLE_STQ_DQ_ATI
	PassTexCoordATI: swizzle
	SampleMapATI: swizzle

# FragmentShaderRegATI
	REG_0_ATI
	ColorFragmentOp[%N%]ATI: dst
	AlphaFragmentOp[%N%]ATI: dst
	PassTexCoordATI: dst
	SampleMapATI: dst

# FragmentShaderConATI
	CON_0_ATI
	SetFragmentShaderConstantATI: dst

# FragmentShaderGenericSourceATI
	REG_0_ATI, CON_0_ATI, ZERO, ONE, PRIMARY_COLOR_ARB, SECONDARY_INTERPOLATOR_ATI
	ColorFragmentOp[%N%]ATI: argN
	AlphaFragmentOp[%N%]ATI: argN

# FragmentShaderTextureSourceATI
	REG_0_ATI, TEXTURE0_ARB
	PassTexCoordATI: coord
	SampleMapATI: interp

# FragmentShaderValueRepATI
	NONE, RED, GREEN, BLUE, ALPHA
	ColorFragmentOp[%N%]ATI: argNRep
	AlphaFragmentOp[%N%]ATI: argNRep

# FragmentOp1ATI
	MOV_ATI
	ColorFragmentOp1ATI: op
	AlphaFragmentOp1ATI: op

# FragmentOp2ATI
	ADD_ATI, MUL_ATI, SUB_ATI, DOT3_ATI, DOT4_ATI
	ColorFragmentOp2ATI: op
	AlphaFragmentOp2ATI: op

# FragmentOp3ATI
	MAD_ATI, LERP_ATI, CND_ATI, CND0_ATI, DOT2_ADD_ATI
	ColorFragmentOp3ATI: op
	AlphaFragmentOp3ATI: op

+FragmentOpATI separated into 3 more specific groups
Copy link
Contributor

@Perksey Perksey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ancient history but seems reasonable

@pdaniell-nv
Copy link
Contributor

@rpatlega if you're happy with this I can approve for merge.

@rpatlega
Copy link

AMD is good for this change.

@pdaniell-nv
Copy link
Contributor

@oddhack this is approved to merge.

@oddhack oddhack merged commit 8f9b0ca into KhronosGroup:main Jul 22, 2022
@SunSerega SunSerega deleted the GL_ATI_fragment_shader branch July 22, 2022 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants