Add statically disabled tessellation on macOS/iOS
This commit is contained in:
@@ -25,21 +25,23 @@ namespace DescriptorSet
|
||||
enum Stage
|
||||
{
|
||||
// Vertex shader stage
|
||||
Vertex = 0,
|
||||
Vertex,
|
||||
// Pixel shader stage
|
||||
Pixel = 1,
|
||||
Pixel,
|
||||
// Geometry shader stage
|
||||
Geometry = 2,
|
||||
Geometry,
|
||||
#if GPU_ALLOW_TESSELLATION_SHADERS
|
||||
// Hull shader stage
|
||||
Hull = 3,
|
||||
Hull,
|
||||
// Domain shader stage
|
||||
Domain = 4,
|
||||
Domain,
|
||||
#endif
|
||||
// Graphics pipeline stages count
|
||||
GraphicsStagesCount = 5,
|
||||
GraphicsStagesCount,
|
||||
// Compute pipeline slot
|
||||
Compute = 0,
|
||||
// The maximum amount of slots for all stages
|
||||
Max = 5,
|
||||
Max = GraphicsStagesCount,
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
||||
@@ -1686,10 +1686,10 @@ bool GPUDeviceVulkan::Init()
|
||||
|
||||
auto& limits = Limits;
|
||||
limits.HasCompute = GetShaderProfile() == ShaderProfile::Vulkan_SM5 && PhysicalDeviceLimits.maxComputeWorkGroupCount[0] >= GPU_MAX_CS_DISPATCH_THREAD_GROUPS && PhysicalDeviceLimits.maxComputeWorkGroupCount[1] >= GPU_MAX_CS_DISPATCH_THREAD_GROUPS;
|
||||
#if PLATFORM_MAC || PLATFORM_IOS
|
||||
limits.HasTessellation = false; // MoltenVK has artifacts when using tess
|
||||
#else
|
||||
#if GPU_ALLOW_TESSELLATION_SHADERS
|
||||
limits.HasTessellation = !!PhysicalDeviceFeatures.tessellationShader && PhysicalDeviceLimits.maxBoundDescriptorSets > (uint32_t)DescriptorSet::Domain;
|
||||
#else
|
||||
limits.HasTessellation = false;
|
||||
#endif
|
||||
#if PLATFORM_ANDROID || PLATFORM_IOS
|
||||
limits.HasGeometryShaders = false; // Don't even try GS on mobile
|
||||
|
||||
@@ -133,17 +133,17 @@ PipelineLayoutVulkan* GPUPipelineStateVulkan::GetLayout()
|
||||
return _layout;
|
||||
|
||||
DescriptorSetLayoutInfoVulkan descriptorSetLayoutInfo;
|
||||
|
||||
#define INIT_SHADER_STAGE(set, bit) \
|
||||
if (DescriptorInfoPerStage[DescriptorSet::set]) \
|
||||
descriptorSetLayoutInfo.AddBindingsForStage(bit, DescriptorSet::set, DescriptorInfoPerStage[DescriptorSet::set])
|
||||
INIT_SHADER_STAGE(Vertex, VK_SHADER_STAGE_VERTEX_BIT);
|
||||
#if GPU_ALLOW_TESSELLATION_SHADERS
|
||||
INIT_SHADER_STAGE(Hull, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT);
|
||||
INIT_SHADER_STAGE(Domain, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT);
|
||||
#endif
|
||||
INIT_SHADER_STAGE(Geometry, VK_SHADER_STAGE_GEOMETRY_BIT);
|
||||
INIT_SHADER_STAGE(Pixel, VK_SHADER_STAGE_FRAGMENT_BIT);
|
||||
#undef INIT_SHADER_STAGE
|
||||
|
||||
_layout = _device->GetOrCreateLayout(descriptorSetLayoutInfo);
|
||||
ASSERT(_layout);
|
||||
DescriptorSetsLayout = &_layout->DescriptorSetLayout;
|
||||
@@ -253,8 +253,10 @@ bool GPUPipelineStateVulkan::Init(const Description& desc)
|
||||
stage.pName = desc.type->GetName().Get(); \
|
||||
}
|
||||
INIT_SHADER_STAGE(VS, Vertex, VK_SHADER_STAGE_VERTEX_BIT);
|
||||
#if GPU_ALLOW_TESSELLATION_SHADERS
|
||||
INIT_SHADER_STAGE(HS, Hull, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT);
|
||||
INIT_SHADER_STAGE(DS, Domain, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT);
|
||||
#endif
|
||||
INIT_SHADER_STAGE(GS, Geometry, VK_SHADER_STAGE_GEOMETRY_BIT);
|
||||
INIT_SHADER_STAGE(PS, Pixel, VK_SHADER_STAGE_FRAGMENT_BIT);
|
||||
#undef INIT_SHADER_STAGE
|
||||
@@ -278,6 +280,7 @@ bool GPUPipelineStateVulkan::Init(const Description& desc)
|
||||
_descInputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST;
|
||||
_desc.pInputAssemblyState = &_descInputAssembly;
|
||||
|
||||
#if GPU_ALLOW_TESSELLATION_SHADERS
|
||||
// Tessellation
|
||||
if (desc.HS)
|
||||
{
|
||||
@@ -285,6 +288,7 @@ bool GPUPipelineStateVulkan::Init(const Description& desc)
|
||||
_descTessellation.patchControlPoints = desc.HS->GetControlPointsCount();
|
||||
_desc.pTessellationState = &_descTessellation;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Viewport
|
||||
RenderToolsVulkan::ZeroStruct(_descViewport, VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO);
|
||||
|
||||
@@ -93,7 +93,9 @@ private:
|
||||
VkGraphicsPipelineCreateInfo _desc;
|
||||
VkPipelineShaderStageCreateInfo _shaderStages[ShaderStage_Count - 1];
|
||||
VkPipelineInputAssemblyStateCreateInfo _descInputAssembly;
|
||||
#if GPU_ALLOW_TESSELLATION_SHADERS
|
||||
VkPipelineTessellationStateCreateInfo _descTessellation;
|
||||
#endif
|
||||
VkPipelineViewportStateCreateInfo _descViewport;
|
||||
VkPipelineDynamicStateCreateInfo _descDynamic;
|
||||
VkDynamicState _dynamicStates[3];
|
||||
|
||||
Reference in New Issue
Block a user