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

Supporting the BlendFactor in the D3D backend #424

Merged
merged 2 commits into from Jan 16, 2022

Conversation

baSSiLL
Copy link
Contributor

@baSSiLL baSSiLL commented Jan 5, 2022

I wanted to use the BlendStateDescription.BlendFactor property along with BlendFactor.BlendFactor and BlendFactor.InverseBlendFactor enum values in an attachment. It turned out that this function is not implemented properly for the D3D backend. The value of the blend factor is not passed to OMSetBlendState, and also BlendFactor.InverseBlendFactor is converted to a wrong D3D value.
This pull request fixes the described issue and includes a test.

@baSSiLL baSSiLL changed the title Test on using the BlendFactor in a blend state. Supporting the BlendFactor in the D3D backend Jan 5, 2022
@baSSiLL
Copy link
Contributor Author

baSSiLL commented Jan 5, 2022

As the BlendStateDescription.BlendFactor is not nullable, I decided to pass its value to OMSetBlendState always even though the corresponding parameter is nullable. Probably there's some reason to pass null when the blend factor is not used actually but I don't see it. If needed, this could be done by analyzing the XXXFactor properties in attachments for BlendFactor.BlendFactor and BlendFactor.InverseBlendFactor values.

@baSSiLL baSSiLL marked this pull request as ready for review January 5, 2022 10:14
@baSSiLL
Copy link
Contributor Author

baSSiLL commented Jan 5, 2022

Hi @mellinoe
I see the CI build fails with

C:\Users\runneradmin.nuget\packages\nerdbank.gitversioning\3.3.37\build\Nerdbank.GitVersioning.targets(115,5): error MSB4018: The "Nerdbank.GitVersioning.Tasks.SetCloudBuildVariables" task failed unexpectedly. [D:\a\veldrid\veldrid\src\Veldrid.ImageSharp\Veldrid.ImageSharp.csproj]
C:\Users\runneradmin.nuget\packages\nerdbank.gitversioning\3.3.37\build\Nerdbank.GitVersioning.targets(115,5): error MSB4018: System.IO.IOException: The process cannot access the file 'D:\a_temp_runner_file_commands\set_env_2f27e3bc-4baf-4475-b4b1-06513a2afdd5' because it is being used by another process. [D:\a\veldrid\veldrid\src\Veldrid.ImageSharp\Veldrid.ImageSharp.csproj]

Which doesn't look caused by my commits. I guess this may be a temporary glitch which won't happen on the next build. Apparently I'm not the one who can force CI to rebuild :)

@zaafar
Copy link
Contributor

zaafar commented Jan 5, 2022

@baSSiLL push a dummy commit and it will re-trigger the CI

@baSSiLL
Copy link
Contributor Author

baSSiLL commented Jan 5, 2022

Thanks @zaafar I thought about this too but I don't like the idea to make dummy commits for any reason.
Besides, it won't help if there's some issue with the build environment. So it would be better that an owner took a look.

@zaafar
Copy link
Contributor

zaafar commented Jan 5, 2022

Make sense @baSSiLL.

@mellinoe FYI: using the latest version of NerdBank lib fixes this issue.

ref: dotnet/Nerdbank.GitVersioning#556

ref2: dotnet/Nerdbank.GitVersioning#561

@mellinoe mellinoe merged commit 1832620 into veldrid:master Jan 16, 2022
@baSSiLL baSSiLL deleted the blend-factor-d3d branch January 16, 2022 05:31
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.

None yet

3 participants