On Tue, 30 Aug 2022 18:37:38 GMT, Nir Lisker <nlis...@openjdk.org> wrote:

>>> What do you mean by "revert the type function parameter here"?
>> 
>> `VsOutput main(VsInput vsInput)`: in the declaration, the type of function 
>> parameter `VsInput vsInput` should be reverted with change in build.gradle.
>> `VsOutput main(VsInput vsInput)` should be changed to `VsOutput 
>> main(VertexType vsInput)`
>
> I still don't understand. What is `VertexType`? I see a comment on `VsInput` 
> "// this is a .hlsl mirror of the vertex format, see VertexTypes.h". If the 
> gradle file has `"/DVertexType=VsInput"`, shouldn't it be fine with `VsInput` 
> as the main function argument?

Referring code without this PR changes:

- `/DVertexType=ObjVertex`  -> Is a macro definition passed to DirectX shader 
compiler.
- This macro is used only once in `Mtl1VS.hlsl` as a type of main function's 
argument: `ObjVsOutput main(VertexType i)`
- So, if we directly use struct name in `Mtl1VS.hlsl` then the Macro in 
build.gradle goes unused. So can/should be removed from build.gradle.

With current changes in PR:
- With this change `VsOutput main(VsInput vsInput)` in Mtl1VS.hlsl the macro 
def `/DVertexType=VSInput` in build.gradle can/should also be removed:-> 
`["$FXC", "/nologo", "/T", "vs_3_0", "/Fh", 
"$buildDir/headers/PrismD3D/hlsl/Mtl1VS_Obj.h", "$VS_3D_SRC"]`

OR

- In build.gradle:  Change `"/DVertexType=ObjVertex"` to 
`"/DVertexType=VsInput"` and,
In Mtl1VS.hlsl:  Change `VsOutput main(VsInput vsInput)` to `VsOutput 
main(VertexType vsInput)`

-------------

PR: https://git.openjdk.org/jfx/pull/789

Reply via email to