HLSL: added support for tesselation shaders (WIP) #1904
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Followup to #1739 - decided to start a new pr, since original is supper outdated now.
This is still more of a prototype at this point, and the goal of PR to collect opinions about approach.
Limitations:
barrier()
- HLSL has no support for that in geometry pipeline at all. A exception will be thrown, ifOpControlBarrier
reached.gl_out[gl_InvocationID]
is supported. This is actually inline with OpenGL, but limitation in comparation with Vulkanvertex.flip_vert_y
is an issue. Flipping logically suppose to be done at the end of geometry pipeline.patchconstantfunc
will calltesc_main
multiple times, only to determinategl_TessLevel*
values.This makes for ugly code, yet DX12 compiler is smart enough to remove this code.
NOTE: there seems to be no way to pass extra data from
main
topatchconstantfunc
- so we basically have to calculategl_TessLevel*
twice.TODO:
InputPath<>
andOutputPatch<>
sizes are hard-codedoutputcontrolpoints
,domain
,partitioning
,outputtopology
- those are absent from Tess-control shader in spirv. Hard-coded for now, long term idea is to fetch them from Tess-eval shaderPractical point of view:
vertex.flip_vert_y
and to pass hints, likepartitioning
from TessEvaluation to Hull shader. What means - to delay cross compilation, until all shaders in pipeline are known.