mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-21 14:06:45 +00:00
Add support for VK_EXT_line_rasterization
This commit is contained in:
@@ -697,6 +697,11 @@ void VulkanPipelineStateViewer::clearState()
|
||||
ui->overestimationSize->setText(lit("0.0"));
|
||||
ui->multiview->setText(tr("Disabled"));
|
||||
|
||||
ui->stippleFactor->setText(QString());
|
||||
ui->stippleFactor->setPixmap(cross);
|
||||
ui->stipplePattern->setText(QString());
|
||||
ui->stipplePattern->setPixmap(cross);
|
||||
|
||||
ui->sampleCount->setText(lit("1"));
|
||||
ui->sampleShading->setPixmap(tick);
|
||||
ui->minSampleShading->setText(lit("0.0"));
|
||||
@@ -2138,6 +2143,21 @@ void VulkanPipelineStateViewer::setState()
|
||||
ui->overestimationSize->setText(
|
||||
Formatter::Format(state.rasterizer.extraPrimitiveOverestimationSize));
|
||||
|
||||
if(state.rasterizer.lineStippleFactor == 0)
|
||||
{
|
||||
ui->stippleFactor->setText(QString());
|
||||
ui->stippleFactor->setPixmap(cross);
|
||||
ui->stipplePattern->setText(QString());
|
||||
ui->stipplePattern->setPixmap(cross);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->stippleFactor->setPixmap(QPixmap());
|
||||
ui->stippleFactor->setText(ToQStr(state.rasterizer.lineStippleFactor));
|
||||
ui->stipplePattern->setPixmap(QPixmap());
|
||||
ui->stipplePattern->setText(QString::number(state.rasterizer.lineStipplePattern, 2));
|
||||
}
|
||||
|
||||
if(state.currentPass.renderpass.multiviews.isEmpty())
|
||||
{
|
||||
ui->multiview->setText(tr("Disabled"));
|
||||
|
||||
@@ -2147,7 +2147,7 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<item row="4" column="0">
|
||||
<spacer name="rastVSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -2163,7 +2163,7 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="9">
|
||||
<item row="3" column="5">
|
||||
<widget class="QLabel" name="rasterizerDiscard">
|
||||
<property name="text">
|
||||
<string/>
|
||||
@@ -2179,7 +2179,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<item row="3" column="4">
|
||||
<widget class="QLabel" name="rasterizerDiscardLabel">
|
||||
<property name="text">
|
||||
<string>Rasterizer Discard:</string>
|
||||
@@ -2192,6 +2192,68 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="stippleFactorLabel">
|
||||
<property name="text">
|
||||
<string>Line Stipple Factor:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="stippleFactor">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../../Resources/resources.qrc">:/cross.png</pixmap>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="stipplePatternLabel">
|
||||
<property name="text">
|
||||
<string>Stipple Pattern:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLabel" name="stipplePattern">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0000000000000000</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
|
||||
@@ -285,6 +285,19 @@ rdcstr DoStringise(const ConservativeRaster &el)
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
|
||||
template <>
|
||||
rdcstr DoStringise(const LineRaster &el)
|
||||
{
|
||||
BEGIN_ENUM_STRINGISE(LineRaster)
|
||||
{
|
||||
STRINGISE_ENUM_CLASS(Default);
|
||||
STRINGISE_ENUM_CLASS(Rectangular);
|
||||
STRINGISE_ENUM_CLASS(Bresenham);
|
||||
STRINGISE_ENUM_CLASS(RectangularSmooth);
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
|
||||
template <>
|
||||
rdcstr DoStringise(const FilterMode &el)
|
||||
{
|
||||
|
||||
@@ -2439,6 +2439,34 @@ enum class ConservativeRaster : uint32_t
|
||||
|
||||
DECLARE_REFLECTION_ENUM(ConservativeRaster);
|
||||
|
||||
DOCUMENT(R"(The line rasterization mode.
|
||||
|
||||
.. data:: Default
|
||||
|
||||
Default line rasterization mode as defined by the API specification.
|
||||
|
||||
.. data:: Rectangular
|
||||
|
||||
Lines are rasterized as rectangles extruded from the line.
|
||||
|
||||
.. data:: Bresenham
|
||||
|
||||
Lines are rasterized according to the bresenham line algorithm.
|
||||
|
||||
.. data:: RectangularSmooth
|
||||
|
||||
Lines are rasterized as rectangles extruded from the line with coverage falloff.
|
||||
)");
|
||||
enum class LineRaster : uint32_t
|
||||
{
|
||||
Default = 0,
|
||||
Rectangular,
|
||||
Bresenham,
|
||||
RectangularSmooth,
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_ENUM(LineRaster);
|
||||
|
||||
DOCUMENT(R"(The texture filtering mode for a given direction (minification, magnification, or
|
||||
between mips).
|
||||
|
||||
|
||||
@@ -715,6 +715,13 @@ See :data:`conservativeRasterizationMode`
|
||||
float slopeScaledDepthBias = 0.0f;
|
||||
DOCUMENT("The fixed line width in pixels.");
|
||||
float lineWidth = 0.0f;
|
||||
|
||||
DOCUMENT("The line rasterization mode.");
|
||||
LineRaster lineRasterMode = LineRaster::Default;
|
||||
DOCUMENT("The line stipple factor, or 0 if line stipple is disabled.");
|
||||
uint32_t lineStippleFactor = 0;
|
||||
DOCUMENT("The line stipple bit-pattern.");
|
||||
uint16_t lineStipplePattern = 0;
|
||||
};
|
||||
|
||||
DOCUMENT("Describes state of custom sample locations in the pipeline.");
|
||||
|
||||
@@ -585,6 +585,7 @@ enum class VulkanChunk : uint32_t
|
||||
DeviceMemoryRefs,
|
||||
vkResetQueryPoolEXT,
|
||||
ImageRefs,
|
||||
vkCmdSetLineStippleEXT,
|
||||
Max,
|
||||
};
|
||||
|
||||
@@ -777,6 +778,8 @@ DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceIDProperties);
|
||||
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceImageFormatInfo2);
|
||||
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceImagelessFramebufferFeaturesKHR);
|
||||
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceIndexTypeUint8FeaturesEXT);
|
||||
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceLineRasterizationFeaturesEXT);
|
||||
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceLineRasterizationPropertiesEXT);
|
||||
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceMaintenance3Properties);
|
||||
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceMemoryBudgetPropertiesEXT);
|
||||
DECLARE_REFLECTION_STRUCT(VkPhysicalDeviceMemoryPriorityFeaturesEXT);
|
||||
@@ -831,6 +834,7 @@ DECLARE_REFLECTION_STRUCT(VkPipelineLayoutCreateInfo);
|
||||
DECLARE_REFLECTION_STRUCT(VkPipelineMultisampleStateCreateInfo);
|
||||
DECLARE_REFLECTION_STRUCT(VkPipelineRasterizationConservativeStateCreateInfoEXT);
|
||||
DECLARE_REFLECTION_STRUCT(VkPipelineRasterizationDepthClipStateCreateInfoEXT);
|
||||
DECLARE_REFLECTION_STRUCT(VkPipelineRasterizationLineStateCreateInfoEXT);
|
||||
DECLARE_REFLECTION_STRUCT(VkPipelineRasterizationStateCreateInfo);
|
||||
DECLARE_REFLECTION_STRUCT(VkPipelineRasterizationStateStreamCreateInfoEXT);
|
||||
DECLARE_REFLECTION_STRUCT(VkPipelineSampleLocationsStateCreateInfoEXT);
|
||||
@@ -1029,6 +1033,8 @@ DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceIDProperties);
|
||||
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceImageFormatInfo2);
|
||||
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceImagelessFramebufferFeaturesKHR);
|
||||
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceIndexTypeUint8FeaturesEXT);
|
||||
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceLineRasterizationFeaturesEXT);
|
||||
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceLineRasterizationPropertiesEXT);
|
||||
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceMaintenance3Properties);
|
||||
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceMemoryBudgetPropertiesEXT);
|
||||
DECLARE_DESERIALISE_TYPE(VkPhysicalDeviceMemoryPriorityFeaturesEXT);
|
||||
@@ -1083,6 +1089,7 @@ DECLARE_DESERIALISE_TYPE(VkPipelineLayoutCreateInfo);
|
||||
DECLARE_DESERIALISE_TYPE(VkPipelineMultisampleStateCreateInfo);
|
||||
DECLARE_DESERIALISE_TYPE(VkPipelineRasterizationConservativeStateCreateInfoEXT);
|
||||
DECLARE_DESERIALISE_TYPE(VkPipelineRasterizationDepthClipStateCreateInfoEXT);
|
||||
DECLARE_DESERIALISE_TYPE(VkPipelineRasterizationLineStateCreateInfoEXT);
|
||||
DECLARE_DESERIALISE_TYPE(VkPipelineRasterizationStateCreateInfo);
|
||||
DECLARE_DESERIALISE_TYPE(VkPipelineRasterizationStateStreamCreateInfoEXT);
|
||||
DECLARE_DESERIALISE_TYPE(VkPipelineSampleLocationsStateCreateInfoEXT);
|
||||
@@ -1329,6 +1336,7 @@ DECLARE_REFLECTION_ENUM(VkImageUsageFlagBits);
|
||||
DECLARE_REFLECTION_ENUM(VkImageViewCreateFlagBits);
|
||||
DECLARE_REFLECTION_ENUM(VkImageViewType);
|
||||
DECLARE_REFLECTION_ENUM(VkIndexType);
|
||||
DECLARE_REFLECTION_ENUM(VkLineRasterizationModeEXT);
|
||||
DECLARE_REFLECTION_ENUM(VkLogicOp);
|
||||
DECLARE_REFLECTION_ENUM(VkMemoryAllocateFlagBits);
|
||||
DECLARE_REFLECTION_ENUM(VkMemoryHeapFlagBits);
|
||||
|
||||
@@ -708,6 +708,9 @@ static const VkExtensionProperties supportedExtensions[] = {
|
||||
{
|
||||
VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME, VK_EXT_INDEX_TYPE_UINT8_SPEC_VERSION,
|
||||
},
|
||||
{
|
||||
VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME, VK_EXT_LINE_RASTERIZATION_SPEC_VERSION,
|
||||
},
|
||||
{
|
||||
VK_EXT_MEMORY_BUDGET_EXTENSION_NAME, VK_EXT_MEMORY_BUDGET_SPEC_VERSION,
|
||||
},
|
||||
@@ -2946,6 +2949,9 @@ bool WrappedVulkan::ProcessChunk(ReadSerialiser &ser, VulkanChunk chunk)
|
||||
case VulkanChunk::vkResetQueryPoolEXT:
|
||||
return Serialise_vkResetQueryPoolEXT(ser, VK_NULL_HANDLE, VK_NULL_HANDLE, 0, 0);
|
||||
break;
|
||||
case VulkanChunk::vkCmdSetLineStippleEXT:
|
||||
return Serialise_vkCmdSetLineStippleEXT(ser, VK_NULL_HANDLE, 0, 0);
|
||||
break;
|
||||
case VulkanChunk::ImageRefs:
|
||||
{
|
||||
std::vector<ImgRefsPair> data;
|
||||
|
||||
@@ -2124,4 +2124,9 @@ public:
|
||||
VkDevice device, const VkPipelineExecutableInfoKHR *pExecutableInfo,
|
||||
uint32_t *pInternalRepresentationCount,
|
||||
VkPipelineExecutableInternalRepresentationKHR *pInternalRepresentations);
|
||||
|
||||
// VK_EXT_line_rasterization
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, vkCmdSetLineStippleEXT, VkCommandBuffer commandBuffer,
|
||||
uint32_t lineStippleFactor, uint16_t lineStipplePattern);
|
||||
};
|
||||
|
||||
@@ -390,7 +390,8 @@
|
||||
DeclExt(AMD_display_native_hdr); \
|
||||
DeclExt(EXT_depth_clip_enable); \
|
||||
DeclExt(KHR_pipeline_executable_properties); \
|
||||
DeclExt(AMD_negative_viewport_height);
|
||||
DeclExt(AMD_negative_viewport_height); \
|
||||
DeclExt(EXT_line_rasterization);
|
||||
|
||||
// for simplicity and since the check itself is platform agnostic,
|
||||
// these aren't protected in platform defines
|
||||
@@ -471,7 +472,8 @@
|
||||
CheckExt(AMD_display_native_hdr, VKXX); \
|
||||
CheckExt(EXT_depth_clip_enable, VKXX); \
|
||||
CheckExt(KHR_pipeline_executable_properties, VKXX); \
|
||||
CheckExt(AMD_negative_viewport_height, VKXX);
|
||||
CheckExt(AMD_negative_viewport_height, VKXX); \
|
||||
CheckExt(EXT_line_rasterization, VKXX);
|
||||
|
||||
#define HookInitVulkanInstanceExts() \
|
||||
HookInitExtension(KHR_surface, DestroySurfaceKHR); \
|
||||
@@ -614,6 +616,7 @@
|
||||
HookInitExtension(KHR_pipeline_executable_properties, GetPipelineExecutableStatisticsKHR); \
|
||||
HookInitExtension(KHR_pipeline_executable_properties, \
|
||||
GetPipelineExecutableInternalRepresentationsKHR); \
|
||||
HookInitExtension(EXT_line_rasterization, CmdSetLineStippleEXT); \
|
||||
HookInitDevice_PlatformSpecific()
|
||||
|
||||
#define DefineHooks() \
|
||||
@@ -1203,4 +1206,6 @@
|
||||
const VkPipelineExecutableInfoKHR *, pExecutableInfo, uint32_t *, \
|
||||
pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR *, \
|
||||
pInternalRepresentations); \
|
||||
HookDefine3(void, vkCmdSetLineStippleEXT, VkCommandBuffer, commandBuffer, uint32_t, \
|
||||
lineStippleFactor, uint16_t, lineStipplePattern); \
|
||||
HookDefine_PlatformSpecific()
|
||||
|
||||
@@ -404,6 +404,26 @@ void VulkanCreationInfo::Pipeline::Init(VulkanResourceManager *resourceMan, Vulk
|
||||
extraPrimitiveOverestimationSize = conservRast->extraPrimitiveOverestimationSize;
|
||||
}
|
||||
|
||||
// VkPipelineRasterizationLineStateCreateInfoEXT
|
||||
lineRasterMode = VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT;
|
||||
stippleEnabled = false;
|
||||
stippleFactor = stipplePattern = 0;
|
||||
|
||||
const VkPipelineRasterizationLineStateCreateInfoEXT *lineRasterState =
|
||||
(const VkPipelineRasterizationLineStateCreateInfoEXT *)FindNextStruct(
|
||||
pCreateInfo->pRasterizationState,
|
||||
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT);
|
||||
if(lineRasterState)
|
||||
{
|
||||
lineRasterMode = lineRasterState->lineRasterizationMode;
|
||||
stippleEnabled = lineRasterState->stippledLineEnable ? true : false;
|
||||
if(lineRasterState->stippledLineEnable)
|
||||
{
|
||||
stippleFactor = lineRasterState->lineStippleFactor;
|
||||
stipplePattern = lineRasterState->lineStipplePattern;
|
||||
}
|
||||
}
|
||||
|
||||
// VkPipelineMultisampleStateCreateInfo
|
||||
if(pCreateInfo->pMultisampleState)
|
||||
{
|
||||
|
||||
@@ -225,6 +225,12 @@ struct VulkanCreationInfo
|
||||
VkConservativeRasterizationModeEXT conservativeRasterizationMode;
|
||||
float extraPrimitiveOverestimationSize;
|
||||
|
||||
// VkPipelineRasterizationLineStateCreateInfoEXT
|
||||
VkLineRasterizationModeEXT lineRasterMode;
|
||||
bool stippleEnabled;
|
||||
uint32_t stippleFactor;
|
||||
uint16_t stipplePattern;
|
||||
|
||||
// VkPipelineMultisampleStateCreateInfo
|
||||
VkSampleCountFlagBits rasterizationSamples;
|
||||
bool sampleShadingEnable;
|
||||
|
||||
@@ -222,6 +222,10 @@ static void AppendModifiedChainedStruct(byte *&tempMem, VkStruct *outputStruct,
|
||||
VkPhysicalDeviceMultiviewFeatures); \
|
||||
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, \
|
||||
VkPhysicalDeviceMultiviewProperties); \
|
||||
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT, \
|
||||
VkPhysicalDeviceLineRasterizationFeaturesEXT) \
|
||||
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT, \
|
||||
VkPhysicalDeviceLineRasterizationPropertiesEXT) \
|
||||
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT, \
|
||||
VkPhysicalDevicePCIBusInfoPropertiesEXT); \
|
||||
COPY_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR, \
|
||||
@@ -305,6 +309,8 @@ static void AppendModifiedChainedStruct(byte *&tempMem, VkStruct *outputStruct,
|
||||
VkPipelineMultisampleStateCreateInfo); \
|
||||
COPY_STRUCT(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT, \
|
||||
VkPipelineRasterizationConservativeStateCreateInfoEXT); \
|
||||
COPY_STRUCT(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT, \
|
||||
VkPipelineRasterizationLineStateCreateInfoEXT) \
|
||||
COPY_STRUCT(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, \
|
||||
VkPipelineRasterizationStateCreateInfo); \
|
||||
COPY_STRUCT(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT, \
|
||||
@@ -541,8 +547,6 @@ static void AppendModifiedChainedStruct(byte *&tempMem, VkStruct *outputStruct,
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: \
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: \
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT: \
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: \
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: \
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: \
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: \
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: \
|
||||
@@ -560,7 +564,6 @@ static void AppendModifiedChainedStruct(byte *&tempMem, VkStruct *outputStruct,
|
||||
case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: \
|
||||
case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: \
|
||||
case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: \
|
||||
case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: \
|
||||
case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: \
|
||||
case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: \
|
||||
case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: \
|
||||
|
||||
@@ -727,6 +727,16 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, CompType typeHint, Floa
|
||||
rs->depthClampEnable = true;
|
||||
}
|
||||
|
||||
// disable line stipple
|
||||
VkPipelineRasterizationLineStateCreateInfoEXT *lineRasterState =
|
||||
(VkPipelineRasterizationLineStateCreateInfoEXT *)FindNextStruct(
|
||||
rs, VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT);
|
||||
|
||||
if(lineRasterState)
|
||||
{
|
||||
lineRasterState->stippledLineEnable = VK_FALSE;
|
||||
}
|
||||
|
||||
uint32_t patchedIndexCount = 0;
|
||||
GPUBuffer patchedIB;
|
||||
|
||||
|
||||
@@ -1307,6 +1307,30 @@ void VulkanReplay::SavePipelineState(uint32_t eventId)
|
||||
default: break;
|
||||
}
|
||||
|
||||
m_VulkanPipelineState.rasterizer.lineRasterMode = LineRaster::Default;
|
||||
|
||||
// "VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT is equivalent to
|
||||
// VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT if VkPhysicalDeviceLimits::strictLines is VK_TRUE"
|
||||
if(m_pDriver->GetDeviceProps().limits.strictLines)
|
||||
m_VulkanPipelineState.rasterizer.lineRasterMode = LineRaster::Rectangular;
|
||||
|
||||
switch(p.lineRasterMode)
|
||||
{
|
||||
case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT:
|
||||
m_VulkanPipelineState.rasterizer.lineRasterMode = LineRaster::Rectangular;
|
||||
break;
|
||||
case VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT:
|
||||
m_VulkanPipelineState.rasterizer.lineRasterMode = LineRaster::Bresenham;
|
||||
break;
|
||||
case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT:
|
||||
m_VulkanPipelineState.rasterizer.lineRasterMode = LineRaster::RectangularSmooth;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
m_VulkanPipelineState.rasterizer.lineStippleFactor = state.stippleFactor;
|
||||
m_VulkanPipelineState.rasterizer.lineStipplePattern = state.stipplePattern;
|
||||
|
||||
m_VulkanPipelineState.rasterizer.extraPrimitiveOverestimationSize =
|
||||
p.extraPrimitiveOverestimationSize;
|
||||
|
||||
|
||||
@@ -542,6 +542,14 @@ SERIALISE_VK_HANDLES();
|
||||
PNEXT_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT, \
|
||||
VkPhysicalDeviceIndexTypeUint8FeaturesEXT) \
|
||||
\
|
||||
/* VK_EXT_line_rasterization */ \
|
||||
PNEXT_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT, \
|
||||
VkPhysicalDeviceLineRasterizationFeaturesEXT) \
|
||||
PNEXT_STRUCT(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT, \
|
||||
VkPipelineRasterizationLineStateCreateInfoEXT) \
|
||||
PNEXT_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT, \
|
||||
VkPhysicalDeviceLineRasterizationPropertiesEXT) \
|
||||
\
|
||||
/* VK_EXT_memory_budget */ \
|
||||
PNEXT_STRUCT(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT, \
|
||||
VkPhysicalDeviceMemoryBudgetPropertiesEXT) \
|
||||
@@ -958,11 +966,6 @@ SERIALISE_VK_HANDLES();
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT) \
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT) \
|
||||
\
|
||||
/* VK_EXT_line_rasterization */ \
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT) \
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT) \
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT) \
|
||||
\
|
||||
/* VK_EXT_texture_compression_astc_hdr */ \
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT) \
|
||||
\
|
||||
@@ -6157,6 +6160,62 @@ void Deserialise(const VkPhysicalDeviceIndexTypeUint8FeaturesEXT &el)
|
||||
DeserialiseNext(el.pNext);
|
||||
}
|
||||
|
||||
template <typename SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, VkPhysicalDeviceLineRasterizationFeaturesEXT &el)
|
||||
{
|
||||
RDCASSERT(ser.IsReading() ||
|
||||
el.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT);
|
||||
SerialiseNext(ser, el.sType, el.pNext);
|
||||
|
||||
SERIALISE_MEMBER(rectangularLines);
|
||||
SERIALISE_MEMBER(bresenhamLines);
|
||||
SERIALISE_MEMBER(smoothLines);
|
||||
SERIALISE_MEMBER(stippledRectangularLines);
|
||||
SERIALISE_MEMBER(stippledBresenhamLines);
|
||||
SERIALISE_MEMBER(stippledSmoothLines);
|
||||
}
|
||||
|
||||
template <>
|
||||
void Deserialise(const VkPhysicalDeviceLineRasterizationFeaturesEXT &el)
|
||||
{
|
||||
DeserialiseNext(el.pNext);
|
||||
}
|
||||
|
||||
template <typename SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, VkPipelineRasterizationLineStateCreateInfoEXT &el)
|
||||
{
|
||||
RDCASSERT(ser.IsReading() ||
|
||||
el.sType == VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT);
|
||||
SerialiseNext(ser, el.sType, el.pNext);
|
||||
|
||||
SERIALISE_MEMBER(lineRasterizationMode);
|
||||
SERIALISE_MEMBER(stippledLineEnable);
|
||||
SERIALISE_MEMBER(lineStippleFactor);
|
||||
SERIALISE_MEMBER(lineStipplePattern);
|
||||
}
|
||||
|
||||
template <>
|
||||
void Deserialise(const VkPipelineRasterizationLineStateCreateInfoEXT &el)
|
||||
{
|
||||
DeserialiseNext(el.pNext);
|
||||
}
|
||||
|
||||
template <typename SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, VkPhysicalDeviceLineRasterizationPropertiesEXT &el)
|
||||
{
|
||||
RDCASSERT(ser.IsReading() ||
|
||||
el.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT);
|
||||
SerialiseNext(ser, el.sType, el.pNext);
|
||||
|
||||
SERIALISE_MEMBER(lineSubPixelPrecisionBits);
|
||||
}
|
||||
|
||||
template <>
|
||||
void Deserialise(const VkPhysicalDeviceLineRasterizationPropertiesEXT &el)
|
||||
{
|
||||
DeserialiseNext(el.pNext);
|
||||
}
|
||||
|
||||
template <typename SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, VkPhysicalDeviceMemoryPriorityFeaturesEXT &el)
|
||||
{
|
||||
@@ -7264,6 +7323,8 @@ INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceIDProperties);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceImageFormatInfo2);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceImagelessFramebufferFeaturesKHR);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceIndexTypeUint8FeaturesEXT);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceLineRasterizationFeaturesEXT);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceLineRasterizationPropertiesEXT);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceMaintenance3Properties);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceMemoryBudgetPropertiesEXT);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPhysicalDeviceMemoryPriorityFeaturesEXT);
|
||||
@@ -7316,6 +7377,7 @@ INSTANTIATE_SERIALISE_TYPE(VkPipelineLayoutCreateInfo);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPipelineMultisampleStateCreateInfo);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPipelineRasterizationConservativeStateCreateInfoEXT);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPipelineRasterizationDepthClipStateCreateInfoEXT);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPipelineRasterizationLineStateCreateInfoEXT);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPipelineRasterizationStateCreateInfo);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPipelineRasterizationStateStreamCreateInfoEXT);
|
||||
INSTANTIATE_SERIALISE_TYPE(VkPipelineSampleLocationsStateCreateInfoEXT);
|
||||
|
||||
@@ -484,6 +484,21 @@ void VulkanShaderCache::MakeGraphicsPipelineInfo(VkGraphicsPipelineCreateInfo &p
|
||||
rs.pNext = &depthClipState;
|
||||
}
|
||||
|
||||
static VkPipelineRasterizationLineStateCreateInfoEXT lineRasterState = {
|
||||
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT,
|
||||
};
|
||||
|
||||
if(m_pDriver->GetExtensions(GetRecord(m_Device)).ext_EXT_line_rasterization)
|
||||
{
|
||||
lineRasterState.lineRasterizationMode = pipeInfo.lineRasterMode;
|
||||
lineRasterState.stippledLineEnable = pipeInfo.stippleEnabled;
|
||||
lineRasterState.lineStippleFactor = pipeInfo.stippleFactor;
|
||||
lineRasterState.lineStipplePattern = pipeInfo.stipplePattern;
|
||||
|
||||
lineRasterState.pNext = rs.pNext;
|
||||
rs.pNext = &lineRasterState;
|
||||
}
|
||||
|
||||
static VkPipelineMultisampleStateCreateInfo msaa = {
|
||||
VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
|
||||
};
|
||||
|
||||
@@ -200,6 +200,9 @@ void VulkanRenderState::BindPipeline(VkCommandBuffer cmd, PipelineBinding bindin
|
||||
ObjDisp(cmd)->CmdSetDiscardRectangleEXT(Unwrap(cmd), 0, (uint32_t)discardRectangles.size(),
|
||||
&discardRectangles[0]);
|
||||
|
||||
if(dynamicStates[VkDynamicLineStippleEXT])
|
||||
ObjDisp(cmd)->CmdSetLineStippleEXT(Unwrap(cmd), stippleFactor, stipplePattern);
|
||||
|
||||
// only set push constant ranges that the layout uses
|
||||
for(size_t i = 0; i < pushRanges.size(); i++)
|
||||
ObjDisp(cmd)->CmdPushConstants(Unwrap(cmd), Unwrap(layout), pushRanges[i].stageFlags,
|
||||
|
||||
@@ -97,6 +97,9 @@ struct VulkanRenderState
|
||||
|
||||
std::vector<VkRect2D> discardRectangles;
|
||||
|
||||
uint32_t stippleFactor = 0;
|
||||
uint16_t stipplePattern = 0;
|
||||
|
||||
// this should be big enough for any implementation
|
||||
byte pushconsts[1024] = {};
|
||||
// the actual number of bytes that have been uploaded
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
template <>
|
||||
rdcstr DoStringise(const VulkanChunk &el)
|
||||
{
|
||||
RDCCOMPILE_ASSERT((uint32_t)VulkanChunk::Max == 1135, "Chunks changed without updating names");
|
||||
RDCCOMPILE_ASSERT((uint32_t)VulkanChunk::Max == 1136, "Chunks changed without updating names");
|
||||
|
||||
BEGIN_ENUM_STRINGISE(VulkanChunk)
|
||||
{
|
||||
@@ -167,6 +167,7 @@ rdcstr DoStringise(const VulkanChunk &el)
|
||||
STRINGISE_ENUM_CLASS_NAMED(DeviceMemoryRefs, "Internal: Device Memory References")
|
||||
STRINGISE_ENUM_CLASS(vkResetQueryPoolEXT);
|
||||
STRINGISE_ENUM_CLASS_NAMED(ImageRefs, "Image References")
|
||||
STRINGISE_ENUM_CLASS(vkCmdSetLineStippleEXT);
|
||||
STRINGISE_ENUM_CLASS_NAMED(Max, "Max Chunk");
|
||||
}
|
||||
END_ENUM_STRINGISE()
|
||||
@@ -2585,6 +2586,19 @@ rdcstr DoStringise(const VkPipelineExecutableStatisticFormatKHR &el)
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
|
||||
template <>
|
||||
rdcstr DoStringise(const VkLineRasterizationModeEXT &el)
|
||||
{
|
||||
BEGIN_ENUM_STRINGISE(VkLineRasterizationModeEXT);
|
||||
{
|
||||
STRINGISE_ENUM(VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT);
|
||||
STRINGISE_ENUM(VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT);
|
||||
STRINGISE_ENUM(VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT);
|
||||
STRINGISE_ENUM(VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT);
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
|
||||
template <>
|
||||
rdcstr DoStringise(const VkExtent3D &el)
|
||||
{
|
||||
|
||||
@@ -2078,6 +2078,11 @@ bool WrappedVulkan::Serialise_vkCmdBindPipeline(SerialiserType &ser, VkCommandBu
|
||||
{
|
||||
m_RenderState.discardRectangles = m_CreationInfo.m_Pipeline[liveid].discardRectangles;
|
||||
}
|
||||
if(!m_CreationInfo.m_Pipeline[liveid].dynamicStates[VkDynamicLineStippleEXT])
|
||||
{
|
||||
m_RenderState.stippleFactor = m_CreationInfo.m_Pipeline[liveid].stippleFactor;
|
||||
m_RenderState.stipplePattern = m_CreationInfo.m_Pipeline[liveid].stipplePattern;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2131,6 +2131,18 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
|
||||
CHECK_PHYS_EXT_FEATURE(pipelineExecutableInfo);
|
||||
}
|
||||
END_PHYS_EXT_CHECK();
|
||||
|
||||
BEGIN_PHYS_EXT_CHECK(VkPhysicalDeviceLineRasterizationFeaturesEXT,
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT);
|
||||
{
|
||||
CHECK_PHYS_EXT_FEATURE(rectangularLines);
|
||||
CHECK_PHYS_EXT_FEATURE(bresenhamLines);
|
||||
CHECK_PHYS_EXT_FEATURE(smoothLines);
|
||||
CHECK_PHYS_EXT_FEATURE(stippledRectangularLines);
|
||||
CHECK_PHYS_EXT_FEATURE(stippledBresenhamLines);
|
||||
CHECK_PHYS_EXT_FEATURE(stippledSmoothLines);
|
||||
}
|
||||
END_PHYS_EXT_CHECK();
|
||||
}
|
||||
|
||||
if(availFeatures.depthClamp)
|
||||
|
||||
@@ -742,6 +742,72 @@ void WrappedVulkan::vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer,
|
||||
}
|
||||
}
|
||||
|
||||
template <typename SerialiserType>
|
||||
bool WrappedVulkan::Serialise_vkCmdSetLineStippleEXT(SerialiserType &ser,
|
||||
VkCommandBuffer commandBuffer,
|
||||
uint32_t lineStippleFactor,
|
||||
uint16_t lineStipplePattern)
|
||||
{
|
||||
SERIALISE_ELEMENT(commandBuffer);
|
||||
SERIALISE_ELEMENT(lineStippleFactor);
|
||||
SERIALISE_ELEMENT(lineStipplePattern);
|
||||
|
||||
Serialise_DebugMessages(ser);
|
||||
|
||||
SERIALISE_CHECK_READ_ERRORS();
|
||||
|
||||
if(IsReplayingAndReading())
|
||||
{
|
||||
m_LastCmdBufferID = GetResourceManager()->GetOriginalID(GetResID(commandBuffer));
|
||||
|
||||
if(IsActiveReplaying(m_State))
|
||||
{
|
||||
if(InRerecordRange(m_LastCmdBufferID))
|
||||
{
|
||||
commandBuffer = RerecordCmdBuf(m_LastCmdBufferID);
|
||||
|
||||
if(ShouldUpdateRenderState(m_LastCmdBufferID))
|
||||
{
|
||||
m_RenderState.stippleFactor = lineStippleFactor;
|
||||
m_RenderState.stipplePattern = lineStipplePattern;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
commandBuffer = VK_NULL_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
if(commandBuffer != VK_NULL_HANDLE)
|
||||
ObjDisp(commandBuffer)
|
||||
->CmdSetLineStippleEXT(Unwrap(commandBuffer), lineStippleFactor, lineStipplePattern);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WrappedVulkan::vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer,
|
||||
uint32_t lineStippleFactor, uint16_t lineStipplePattern)
|
||||
{
|
||||
SCOPED_DBG_SINK();
|
||||
|
||||
SERIALISE_TIME_CALL(
|
||||
ObjDisp(commandBuffer)
|
||||
->CmdSetLineStippleEXT(Unwrap(commandBuffer), lineStippleFactor, lineStipplePattern));
|
||||
|
||||
if(IsCaptureMode(m_State))
|
||||
{
|
||||
VkResourceRecord *record = GetRecord(commandBuffer);
|
||||
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdSetLineStippleEXT);
|
||||
Serialise_vkCmdSetLineStippleEXT(ser, commandBuffer, lineStippleFactor, lineStipplePattern);
|
||||
|
||||
record->AddChunk(scope.Get());
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_FUNCTION_SERIALISED(void, vkCmdSetViewport, VkCommandBuffer commandBuffer,
|
||||
uint32_t firstViewport, uint32_t viewportCount,
|
||||
const VkViewport *pViewports);
|
||||
@@ -777,4 +843,7 @@ INSTANTIATE_FUNCTION_SERIALISED(void, vkCmdSetSampleLocationsEXT, VkCommandBuffe
|
||||
|
||||
INSTANTIATE_FUNCTION_SERIALISED(void, vkCmdSetDiscardRectangleEXT, VkCommandBuffer commandBuffer,
|
||||
uint32_t firstDiscardRectangle, uint32_t discardRectangleCount,
|
||||
const VkRect2D *pDiscardRectangles);
|
||||
const VkRect2D *pDiscardRectangles);
|
||||
|
||||
INSTANTIATE_FUNCTION_SERIALISED(void, vkCmdSetLineStippleEXT, VkCommandBuffer commandBuffer,
|
||||
uint32_t lineStippleFactor, uint16_t lineStipplePattern);
|
||||
@@ -1994,7 +1994,11 @@ void DoSerialise(SerialiserType &ser, VKPipe::Rasterizer &el)
|
||||
SERIALISE_MEMBER(slopeScaledDepthBias);
|
||||
SERIALISE_MEMBER(lineWidth);
|
||||
|
||||
SIZE_CHECK(36);
|
||||
SERIALISE_MEMBER(lineRasterMode);
|
||||
SERIALISE_MEMBER(lineStippleFactor);
|
||||
SERIALISE_MEMBER(lineStipplePattern);
|
||||
|
||||
SIZE_CHECK(48);
|
||||
}
|
||||
|
||||
template <typename SerialiserType>
|
||||
@@ -2179,7 +2183,7 @@ void DoSerialise(SerialiserType &ser, VKPipe::State &el)
|
||||
|
||||
SERIALISE_MEMBER(conditionalRendering);
|
||||
|
||||
SIZE_CHECK(1904);
|
||||
SIZE_CHECK(1912);
|
||||
}
|
||||
|
||||
#pragma endregion Vulkan pipeline state
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
volk from https://github.com/zeux/volk at commit 4ade66bd2b96a004545ad0be13c439a2faa2f552
|
||||
volk from https://github.com/zeux/volk at commit 4cdddd9b251151a1e84cfcabc183f741ada1a358
|
||||
|
||||
Vendored
+148
-2
@@ -2,7 +2,14 @@
|
||||
#include "volk.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
typedef const char* LPCSTR;
|
||||
typedef struct HINSTANCE__* HINSTANCE;
|
||||
typedef HINSTANCE HMODULE;
|
||||
#ifdef _WIN64
|
||||
typedef __int64 (__stdcall* FARPROC)(void);
|
||||
#else
|
||||
typedef int (__stdcall* FARPROC)(void);
|
||||
#endif
|
||||
#else
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
@@ -11,6 +18,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllimport) HMODULE __stdcall LoadLibraryA(LPCSTR);
|
||||
__declspec(dllimport) FARPROC __stdcall GetProcAddress(HMODULE, LPCSTR);
|
||||
#endif
|
||||
|
||||
static void volkGenLoadLoader(void* context, PFN_vkVoidFunction (*load)(void*, const char*));
|
||||
static void volkGenLoadInstance(void* context, PFN_vkVoidFunction (*load)(void*, const char*));
|
||||
static void volkGenLoadDevice(void* context, PFN_vkVoidFunction (*load)(void*, const char*));
|
||||
@@ -33,7 +45,8 @@ VkResult volkInitialize(void)
|
||||
if (!module)
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
|
||||
vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)GetProcAddress(module, "vkGetInstanceProcAddr");
|
||||
// note: function pointer is cast through void function pointer to silence cast-function-type warning on gcc8
|
||||
vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)(void(*)(void))GetProcAddress(module, "vkGetInstanceProcAddr");
|
||||
#elif defined(__APPLE__)
|
||||
void* module = dlopen("libvulkan.dylib", RTLD_NOW | RTLD_LOCAL);
|
||||
if (!module)
|
||||
@@ -164,12 +177,24 @@ static void volkGenLoadInstance(void* context, PFN_vkVoidFunction (*load)(void*,
|
||||
#if defined(VK_EXT_display_surface_counter)
|
||||
vkGetPhysicalDeviceSurfaceCapabilities2EXT = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT)load(context, "vkGetPhysicalDeviceSurfaceCapabilities2EXT");
|
||||
#endif /* defined(VK_EXT_display_surface_counter) */
|
||||
#if defined(VK_EXT_full_screen_exclusive)
|
||||
vkGetPhysicalDeviceSurfacePresentModes2EXT = (PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT)load(context, "vkGetPhysicalDeviceSurfacePresentModes2EXT");
|
||||
#endif /* defined(VK_EXT_full_screen_exclusive) */
|
||||
#if defined(VK_EXT_headless_surface)
|
||||
vkCreateHeadlessSurfaceEXT = (PFN_vkCreateHeadlessSurfaceEXT)load(context, "vkCreateHeadlessSurfaceEXT");
|
||||
#endif /* defined(VK_EXT_headless_surface) */
|
||||
#if defined(VK_EXT_metal_surface)
|
||||
vkCreateMetalSurfaceEXT = (PFN_vkCreateMetalSurfaceEXT)load(context, "vkCreateMetalSurfaceEXT");
|
||||
#endif /* defined(VK_EXT_metal_surface) */
|
||||
#if defined(VK_EXT_sample_locations)
|
||||
vkGetPhysicalDeviceMultisamplePropertiesEXT = (PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT)load(context, "vkGetPhysicalDeviceMultisamplePropertiesEXT");
|
||||
#endif /* defined(VK_EXT_sample_locations) */
|
||||
#if defined(VK_FUCHSIA_imagepipe_surface)
|
||||
vkCreateImagePipeSurfaceFUCHSIA = (PFN_vkCreateImagePipeSurfaceFUCHSIA)load(context, "vkCreateImagePipeSurfaceFUCHSIA");
|
||||
#endif /* defined(VK_FUCHSIA_imagepipe_surface) */
|
||||
#if defined(VK_GGP_stream_descriptor_surface)
|
||||
vkCreateStreamDescriptorSurfaceGGP = (PFN_vkCreateStreamDescriptorSurfaceGGP)load(context, "vkCreateStreamDescriptorSurfaceGGP");
|
||||
#endif /* defined(VK_GGP_stream_descriptor_surface) */
|
||||
#if defined(VK_KHR_android_surface)
|
||||
vkCreateAndroidSurfaceKHR = (PFN_vkCreateAndroidSurfaceKHR)load(context, "vkCreateAndroidSurfaceKHR");
|
||||
#endif /* defined(VK_KHR_android_surface) */
|
||||
@@ -251,6 +276,9 @@ static void volkGenLoadInstance(void* context, PFN_vkVoidFunction (*load)(void*,
|
||||
#if defined(VK_NV_cooperative_matrix)
|
||||
vkGetPhysicalDeviceCooperativeMatrixPropertiesNV = (PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV)load(context, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV");
|
||||
#endif /* defined(VK_NV_cooperative_matrix) */
|
||||
#if defined(VK_NV_coverage_reduction_mode)
|
||||
vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV = (PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV)load(context, "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV");
|
||||
#endif /* defined(VK_NV_coverage_reduction_mode) */
|
||||
#if defined(VK_NV_external_memory_capabilities)
|
||||
vkGetPhysicalDeviceExternalImageFormatPropertiesNV = (PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV)load(context, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV");
|
||||
#endif /* defined(VK_NV_external_memory_capabilities) */
|
||||
@@ -406,6 +434,9 @@ static void volkGenLoadDevice(void* context, PFN_vkVoidFunction (*load)(void*, c
|
||||
#if defined(VK_AMD_buffer_marker)
|
||||
vkCmdWriteBufferMarkerAMD = (PFN_vkCmdWriteBufferMarkerAMD)load(context, "vkCmdWriteBufferMarkerAMD");
|
||||
#endif /* defined(VK_AMD_buffer_marker) */
|
||||
#if defined(VK_AMD_display_native_hdr)
|
||||
vkSetLocalDimmingAMD = (PFN_vkSetLocalDimmingAMD)load(context, "vkSetLocalDimmingAMD");
|
||||
#endif /* defined(VK_AMD_display_native_hdr) */
|
||||
#if defined(VK_AMD_draw_indirect_count)
|
||||
vkCmdDrawIndexedIndirectCountAMD = (PFN_vkCmdDrawIndexedIndirectCountAMD)load(context, "vkCmdDrawIndexedIndirectCountAMD");
|
||||
vkCmdDrawIndirectCountAMD = (PFN_vkCmdDrawIndirectCountAMD)load(context, "vkCmdDrawIndirectCountAMD");
|
||||
@@ -456,12 +487,22 @@ static void volkGenLoadDevice(void* context, PFN_vkVoidFunction (*load)(void*, c
|
||||
#if defined(VK_EXT_external_memory_host)
|
||||
vkGetMemoryHostPointerPropertiesEXT = (PFN_vkGetMemoryHostPointerPropertiesEXT)load(context, "vkGetMemoryHostPointerPropertiesEXT");
|
||||
#endif /* defined(VK_EXT_external_memory_host) */
|
||||
#if defined(VK_EXT_full_screen_exclusive)
|
||||
vkAcquireFullScreenExclusiveModeEXT = (PFN_vkAcquireFullScreenExclusiveModeEXT)load(context, "vkAcquireFullScreenExclusiveModeEXT");
|
||||
vkReleaseFullScreenExclusiveModeEXT = (PFN_vkReleaseFullScreenExclusiveModeEXT)load(context, "vkReleaseFullScreenExclusiveModeEXT");
|
||||
#endif /* defined(VK_EXT_full_screen_exclusive) */
|
||||
#if defined(VK_EXT_hdr_metadata)
|
||||
vkSetHdrMetadataEXT = (PFN_vkSetHdrMetadataEXT)load(context, "vkSetHdrMetadataEXT");
|
||||
#endif /* defined(VK_EXT_hdr_metadata) */
|
||||
#if defined(VK_EXT_host_query_reset)
|
||||
vkResetQueryPoolEXT = (PFN_vkResetQueryPoolEXT)load(context, "vkResetQueryPoolEXT");
|
||||
#endif /* defined(VK_EXT_host_query_reset) */
|
||||
#if defined(VK_EXT_image_drm_format_modifier)
|
||||
vkGetImageDrmFormatModifierPropertiesEXT = (PFN_vkGetImageDrmFormatModifierPropertiesEXT)load(context, "vkGetImageDrmFormatModifierPropertiesEXT");
|
||||
#endif /* defined(VK_EXT_image_drm_format_modifier) */
|
||||
#if defined(VK_EXT_line_rasterization)
|
||||
vkCmdSetLineStippleEXT = (PFN_vkCmdSetLineStippleEXT)load(context, "vkCmdSetLineStippleEXT");
|
||||
#endif /* defined(VK_EXT_line_rasterization) */
|
||||
#if defined(VK_EXT_sample_locations)
|
||||
vkCmdSetSampleLocationsEXT = (PFN_vkCmdSetSampleLocationsEXT)load(context, "vkCmdSetSampleLocationsEXT");
|
||||
#endif /* defined(VK_EXT_sample_locations) */
|
||||
@@ -483,6 +524,17 @@ static void volkGenLoadDevice(void* context, PFN_vkVoidFunction (*load)(void*, c
|
||||
vkGetPastPresentationTimingGOOGLE = (PFN_vkGetPastPresentationTimingGOOGLE)load(context, "vkGetPastPresentationTimingGOOGLE");
|
||||
vkGetRefreshCycleDurationGOOGLE = (PFN_vkGetRefreshCycleDurationGOOGLE)load(context, "vkGetRefreshCycleDurationGOOGLE");
|
||||
#endif /* defined(VK_GOOGLE_display_timing) */
|
||||
#if defined(VK_INTEL_performance_query)
|
||||
vkAcquirePerformanceConfigurationINTEL = (PFN_vkAcquirePerformanceConfigurationINTEL)load(context, "vkAcquirePerformanceConfigurationINTEL");
|
||||
vkCmdSetPerformanceMarkerINTEL = (PFN_vkCmdSetPerformanceMarkerINTEL)load(context, "vkCmdSetPerformanceMarkerINTEL");
|
||||
vkCmdSetPerformanceOverrideINTEL = (PFN_vkCmdSetPerformanceOverrideINTEL)load(context, "vkCmdSetPerformanceOverrideINTEL");
|
||||
vkCmdSetPerformanceStreamMarkerINTEL = (PFN_vkCmdSetPerformanceStreamMarkerINTEL)load(context, "vkCmdSetPerformanceStreamMarkerINTEL");
|
||||
vkGetPerformanceParameterINTEL = (PFN_vkGetPerformanceParameterINTEL)load(context, "vkGetPerformanceParameterINTEL");
|
||||
vkInitializePerformanceApiINTEL = (PFN_vkInitializePerformanceApiINTEL)load(context, "vkInitializePerformanceApiINTEL");
|
||||
vkQueueSetPerformanceConfigurationINTEL = (PFN_vkQueueSetPerformanceConfigurationINTEL)load(context, "vkQueueSetPerformanceConfigurationINTEL");
|
||||
vkReleasePerformanceConfigurationINTEL = (PFN_vkReleasePerformanceConfigurationINTEL)load(context, "vkReleasePerformanceConfigurationINTEL");
|
||||
vkUninitializePerformanceApiINTEL = (PFN_vkUninitializePerformanceApiINTEL)load(context, "vkUninitializePerformanceApiINTEL");
|
||||
#endif /* defined(VK_INTEL_performance_query) */
|
||||
#if defined(VK_KHR_bind_memory2)
|
||||
vkBindBufferMemory2KHR = (PFN_vkBindBufferMemory2KHR)load(context, "vkBindBufferMemory2KHR");
|
||||
vkBindImageMemory2KHR = (PFN_vkBindImageMemory2KHR)load(context, "vkBindImageMemory2KHR");
|
||||
@@ -545,6 +597,11 @@ static void volkGenLoadDevice(void* context, PFN_vkVoidFunction (*load)(void*, c
|
||||
#if defined(VK_KHR_maintenance3)
|
||||
vkGetDescriptorSetLayoutSupportKHR = (PFN_vkGetDescriptorSetLayoutSupportKHR)load(context, "vkGetDescriptorSetLayoutSupportKHR");
|
||||
#endif /* defined(VK_KHR_maintenance3) */
|
||||
#if defined(VK_KHR_pipeline_executable_properties)
|
||||
vkGetPipelineExecutableInternalRepresentationsKHR = (PFN_vkGetPipelineExecutableInternalRepresentationsKHR)load(context, "vkGetPipelineExecutableInternalRepresentationsKHR");
|
||||
vkGetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR)load(context, "vkGetPipelineExecutablePropertiesKHR");
|
||||
vkGetPipelineExecutableStatisticsKHR = (PFN_vkGetPipelineExecutableStatisticsKHR)load(context, "vkGetPipelineExecutableStatisticsKHR");
|
||||
#endif /* defined(VK_KHR_pipeline_executable_properties) */
|
||||
#if defined(VK_KHR_push_descriptor)
|
||||
vkCmdPushDescriptorSetKHR = (PFN_vkCmdPushDescriptorSetKHR)load(context, "vkCmdPushDescriptorSetKHR");
|
||||
#endif /* defined(VK_KHR_push_descriptor) */
|
||||
@@ -572,6 +629,9 @@ static void volkGenLoadDevice(void* context, PFN_vkVoidFunction (*load)(void*, c
|
||||
vkRegisterObjectsNVX = (PFN_vkRegisterObjectsNVX)load(context, "vkRegisterObjectsNVX");
|
||||
vkUnregisterObjectsNVX = (PFN_vkUnregisterObjectsNVX)load(context, "vkUnregisterObjectsNVX");
|
||||
#endif /* defined(VK_NVX_device_generated_commands) */
|
||||
#if defined(VK_NVX_image_view_handle)
|
||||
vkGetImageViewHandleNVX = (PFN_vkGetImageViewHandleNVX)load(context, "vkGetImageViewHandleNVX");
|
||||
#endif /* defined(VK_NVX_image_view_handle) */
|
||||
#if defined(VK_NV_clip_space_w_scaling)
|
||||
vkCmdSetViewportWScalingNV = (PFN_vkCmdSetViewportWScalingNV)load(context, "vkCmdSetViewportWScalingNV");
|
||||
#endif /* defined(VK_NV_clip_space_w_scaling) */
|
||||
@@ -609,6 +669,9 @@ static void volkGenLoadDevice(void* context, PFN_vkVoidFunction (*load)(void*, c
|
||||
vkCmdSetCoarseSampleOrderNV = (PFN_vkCmdSetCoarseSampleOrderNV)load(context, "vkCmdSetCoarseSampleOrderNV");
|
||||
vkCmdSetViewportShadingRatePaletteNV = (PFN_vkCmdSetViewportShadingRatePaletteNV)load(context, "vkCmdSetViewportShadingRatePaletteNV");
|
||||
#endif /* defined(VK_NV_shading_rate_image) */
|
||||
#if (defined(VK_EXT_full_screen_exclusive) && defined(VK_KHR_device_group)) || (defined(VK_EXT_full_screen_exclusive) && defined(VK_VERSION_1_1))
|
||||
vkGetDeviceGroupSurfacePresentModes2EXT = (PFN_vkGetDeviceGroupSurfacePresentModes2EXT)load(context, "vkGetDeviceGroupSurfacePresentModes2EXT");
|
||||
#endif /* (defined(VK_EXT_full_screen_exclusive) && defined(VK_KHR_device_group)) || (defined(VK_EXT_full_screen_exclusive) && defined(VK_VERSION_1_1)) */
|
||||
#if (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && defined(VK_VERSION_1_1))
|
||||
vkCmdPushDescriptorSetWithTemplateKHR = (PFN_vkCmdPushDescriptorSetWithTemplateKHR)load(context, "vkCmdPushDescriptorSetWithTemplateKHR");
|
||||
#endif /* (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && defined(VK_VERSION_1_1)) */
|
||||
@@ -768,6 +831,9 @@ static void volkGenLoadDeviceTable(struct VolkDeviceTable* table, void* context,
|
||||
#if defined(VK_AMD_buffer_marker)
|
||||
table->vkCmdWriteBufferMarkerAMD = (PFN_vkCmdWriteBufferMarkerAMD)load(context, "vkCmdWriteBufferMarkerAMD");
|
||||
#endif /* defined(VK_AMD_buffer_marker) */
|
||||
#if defined(VK_AMD_display_native_hdr)
|
||||
table->vkSetLocalDimmingAMD = (PFN_vkSetLocalDimmingAMD)load(context, "vkSetLocalDimmingAMD");
|
||||
#endif /* defined(VK_AMD_display_native_hdr) */
|
||||
#if defined(VK_AMD_draw_indirect_count)
|
||||
table->vkCmdDrawIndexedIndirectCountAMD = (PFN_vkCmdDrawIndexedIndirectCountAMD)load(context, "vkCmdDrawIndexedIndirectCountAMD");
|
||||
table->vkCmdDrawIndirectCountAMD = (PFN_vkCmdDrawIndirectCountAMD)load(context, "vkCmdDrawIndirectCountAMD");
|
||||
@@ -818,12 +884,22 @@ static void volkGenLoadDeviceTable(struct VolkDeviceTable* table, void* context,
|
||||
#if defined(VK_EXT_external_memory_host)
|
||||
table->vkGetMemoryHostPointerPropertiesEXT = (PFN_vkGetMemoryHostPointerPropertiesEXT)load(context, "vkGetMemoryHostPointerPropertiesEXT");
|
||||
#endif /* defined(VK_EXT_external_memory_host) */
|
||||
#if defined(VK_EXT_full_screen_exclusive)
|
||||
table->vkAcquireFullScreenExclusiveModeEXT = (PFN_vkAcquireFullScreenExclusiveModeEXT)load(context, "vkAcquireFullScreenExclusiveModeEXT");
|
||||
table->vkReleaseFullScreenExclusiveModeEXT = (PFN_vkReleaseFullScreenExclusiveModeEXT)load(context, "vkReleaseFullScreenExclusiveModeEXT");
|
||||
#endif /* defined(VK_EXT_full_screen_exclusive) */
|
||||
#if defined(VK_EXT_hdr_metadata)
|
||||
table->vkSetHdrMetadataEXT = (PFN_vkSetHdrMetadataEXT)load(context, "vkSetHdrMetadataEXT");
|
||||
#endif /* defined(VK_EXT_hdr_metadata) */
|
||||
#if defined(VK_EXT_host_query_reset)
|
||||
table->vkResetQueryPoolEXT = (PFN_vkResetQueryPoolEXT)load(context, "vkResetQueryPoolEXT");
|
||||
#endif /* defined(VK_EXT_host_query_reset) */
|
||||
#if defined(VK_EXT_image_drm_format_modifier)
|
||||
table->vkGetImageDrmFormatModifierPropertiesEXT = (PFN_vkGetImageDrmFormatModifierPropertiesEXT)load(context, "vkGetImageDrmFormatModifierPropertiesEXT");
|
||||
#endif /* defined(VK_EXT_image_drm_format_modifier) */
|
||||
#if defined(VK_EXT_line_rasterization)
|
||||
table->vkCmdSetLineStippleEXT = (PFN_vkCmdSetLineStippleEXT)load(context, "vkCmdSetLineStippleEXT");
|
||||
#endif /* defined(VK_EXT_line_rasterization) */
|
||||
#if defined(VK_EXT_sample_locations)
|
||||
table->vkCmdSetSampleLocationsEXT = (PFN_vkCmdSetSampleLocationsEXT)load(context, "vkCmdSetSampleLocationsEXT");
|
||||
#endif /* defined(VK_EXT_sample_locations) */
|
||||
@@ -845,6 +921,17 @@ static void volkGenLoadDeviceTable(struct VolkDeviceTable* table, void* context,
|
||||
table->vkGetPastPresentationTimingGOOGLE = (PFN_vkGetPastPresentationTimingGOOGLE)load(context, "vkGetPastPresentationTimingGOOGLE");
|
||||
table->vkGetRefreshCycleDurationGOOGLE = (PFN_vkGetRefreshCycleDurationGOOGLE)load(context, "vkGetRefreshCycleDurationGOOGLE");
|
||||
#endif /* defined(VK_GOOGLE_display_timing) */
|
||||
#if defined(VK_INTEL_performance_query)
|
||||
table->vkAcquirePerformanceConfigurationINTEL = (PFN_vkAcquirePerformanceConfigurationINTEL)load(context, "vkAcquirePerformanceConfigurationINTEL");
|
||||
table->vkCmdSetPerformanceMarkerINTEL = (PFN_vkCmdSetPerformanceMarkerINTEL)load(context, "vkCmdSetPerformanceMarkerINTEL");
|
||||
table->vkCmdSetPerformanceOverrideINTEL = (PFN_vkCmdSetPerformanceOverrideINTEL)load(context, "vkCmdSetPerformanceOverrideINTEL");
|
||||
table->vkCmdSetPerformanceStreamMarkerINTEL = (PFN_vkCmdSetPerformanceStreamMarkerINTEL)load(context, "vkCmdSetPerformanceStreamMarkerINTEL");
|
||||
table->vkGetPerformanceParameterINTEL = (PFN_vkGetPerformanceParameterINTEL)load(context, "vkGetPerformanceParameterINTEL");
|
||||
table->vkInitializePerformanceApiINTEL = (PFN_vkInitializePerformanceApiINTEL)load(context, "vkInitializePerformanceApiINTEL");
|
||||
table->vkQueueSetPerformanceConfigurationINTEL = (PFN_vkQueueSetPerformanceConfigurationINTEL)load(context, "vkQueueSetPerformanceConfigurationINTEL");
|
||||
table->vkReleasePerformanceConfigurationINTEL = (PFN_vkReleasePerformanceConfigurationINTEL)load(context, "vkReleasePerformanceConfigurationINTEL");
|
||||
table->vkUninitializePerformanceApiINTEL = (PFN_vkUninitializePerformanceApiINTEL)load(context, "vkUninitializePerformanceApiINTEL");
|
||||
#endif /* defined(VK_INTEL_performance_query) */
|
||||
#if defined(VK_KHR_bind_memory2)
|
||||
table->vkBindBufferMemory2KHR = (PFN_vkBindBufferMemory2KHR)load(context, "vkBindBufferMemory2KHR");
|
||||
table->vkBindImageMemory2KHR = (PFN_vkBindImageMemory2KHR)load(context, "vkBindImageMemory2KHR");
|
||||
@@ -907,6 +994,11 @@ static void volkGenLoadDeviceTable(struct VolkDeviceTable* table, void* context,
|
||||
#if defined(VK_KHR_maintenance3)
|
||||
table->vkGetDescriptorSetLayoutSupportKHR = (PFN_vkGetDescriptorSetLayoutSupportKHR)load(context, "vkGetDescriptorSetLayoutSupportKHR");
|
||||
#endif /* defined(VK_KHR_maintenance3) */
|
||||
#if defined(VK_KHR_pipeline_executable_properties)
|
||||
table->vkGetPipelineExecutableInternalRepresentationsKHR = (PFN_vkGetPipelineExecutableInternalRepresentationsKHR)load(context, "vkGetPipelineExecutableInternalRepresentationsKHR");
|
||||
table->vkGetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR)load(context, "vkGetPipelineExecutablePropertiesKHR");
|
||||
table->vkGetPipelineExecutableStatisticsKHR = (PFN_vkGetPipelineExecutableStatisticsKHR)load(context, "vkGetPipelineExecutableStatisticsKHR");
|
||||
#endif /* defined(VK_KHR_pipeline_executable_properties) */
|
||||
#if defined(VK_KHR_push_descriptor)
|
||||
table->vkCmdPushDescriptorSetKHR = (PFN_vkCmdPushDescriptorSetKHR)load(context, "vkCmdPushDescriptorSetKHR");
|
||||
#endif /* defined(VK_KHR_push_descriptor) */
|
||||
@@ -934,6 +1026,9 @@ static void volkGenLoadDeviceTable(struct VolkDeviceTable* table, void* context,
|
||||
table->vkRegisterObjectsNVX = (PFN_vkRegisterObjectsNVX)load(context, "vkRegisterObjectsNVX");
|
||||
table->vkUnregisterObjectsNVX = (PFN_vkUnregisterObjectsNVX)load(context, "vkUnregisterObjectsNVX");
|
||||
#endif /* defined(VK_NVX_device_generated_commands) */
|
||||
#if defined(VK_NVX_image_view_handle)
|
||||
table->vkGetImageViewHandleNVX = (PFN_vkGetImageViewHandleNVX)load(context, "vkGetImageViewHandleNVX");
|
||||
#endif /* defined(VK_NVX_image_view_handle) */
|
||||
#if defined(VK_NV_clip_space_w_scaling)
|
||||
table->vkCmdSetViewportWScalingNV = (PFN_vkCmdSetViewportWScalingNV)load(context, "vkCmdSetViewportWScalingNV");
|
||||
#endif /* defined(VK_NV_clip_space_w_scaling) */
|
||||
@@ -971,6 +1066,9 @@ static void volkGenLoadDeviceTable(struct VolkDeviceTable* table, void* context,
|
||||
table->vkCmdSetCoarseSampleOrderNV = (PFN_vkCmdSetCoarseSampleOrderNV)load(context, "vkCmdSetCoarseSampleOrderNV");
|
||||
table->vkCmdSetViewportShadingRatePaletteNV = (PFN_vkCmdSetViewportShadingRatePaletteNV)load(context, "vkCmdSetViewportShadingRatePaletteNV");
|
||||
#endif /* defined(VK_NV_shading_rate_image) */
|
||||
#if (defined(VK_EXT_full_screen_exclusive) && defined(VK_KHR_device_group)) || (defined(VK_EXT_full_screen_exclusive) && defined(VK_VERSION_1_1))
|
||||
table->vkGetDeviceGroupSurfacePresentModes2EXT = (PFN_vkGetDeviceGroupSurfacePresentModes2EXT)load(context, "vkGetDeviceGroupSurfacePresentModes2EXT");
|
||||
#endif /* (defined(VK_EXT_full_screen_exclusive) && defined(VK_KHR_device_group)) || (defined(VK_EXT_full_screen_exclusive) && defined(VK_VERSION_1_1)) */
|
||||
#if (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && defined(VK_VERSION_1_1))
|
||||
table->vkCmdPushDescriptorSetWithTemplateKHR = (PFN_vkCmdPushDescriptorSetWithTemplateKHR)load(context, "vkCmdPushDescriptorSetWithTemplateKHR");
|
||||
#endif /* (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && defined(VK_VERSION_1_1)) */
|
||||
@@ -1161,6 +1259,9 @@ PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate;
|
||||
#if defined(VK_AMD_buffer_marker)
|
||||
PFN_vkCmdWriteBufferMarkerAMD vkCmdWriteBufferMarkerAMD;
|
||||
#endif /* defined(VK_AMD_buffer_marker) */
|
||||
#if defined(VK_AMD_display_native_hdr)
|
||||
PFN_vkSetLocalDimmingAMD vkSetLocalDimmingAMD;
|
||||
#endif /* defined(VK_AMD_display_native_hdr) */
|
||||
#if defined(VK_AMD_draw_indirect_count)
|
||||
PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD;
|
||||
PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD;
|
||||
@@ -1230,12 +1331,29 @@ PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabil
|
||||
#if defined(VK_EXT_external_memory_host)
|
||||
PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT;
|
||||
#endif /* defined(VK_EXT_external_memory_host) */
|
||||
#if defined(VK_EXT_full_screen_exclusive)
|
||||
PFN_vkAcquireFullScreenExclusiveModeEXT vkAcquireFullScreenExclusiveModeEXT;
|
||||
PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT vkGetPhysicalDeviceSurfacePresentModes2EXT;
|
||||
PFN_vkReleaseFullScreenExclusiveModeEXT vkReleaseFullScreenExclusiveModeEXT;
|
||||
#endif /* defined(VK_EXT_full_screen_exclusive) */
|
||||
#if defined(VK_EXT_hdr_metadata)
|
||||
PFN_vkSetHdrMetadataEXT vkSetHdrMetadataEXT;
|
||||
#endif /* defined(VK_EXT_hdr_metadata) */
|
||||
#if defined(VK_EXT_headless_surface)
|
||||
PFN_vkCreateHeadlessSurfaceEXT vkCreateHeadlessSurfaceEXT;
|
||||
#endif /* defined(VK_EXT_headless_surface) */
|
||||
#if defined(VK_EXT_host_query_reset)
|
||||
PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT;
|
||||
#endif /* defined(VK_EXT_host_query_reset) */
|
||||
#if defined(VK_EXT_image_drm_format_modifier)
|
||||
PFN_vkGetImageDrmFormatModifierPropertiesEXT vkGetImageDrmFormatModifierPropertiesEXT;
|
||||
#endif /* defined(VK_EXT_image_drm_format_modifier) */
|
||||
#if defined(VK_EXT_line_rasterization)
|
||||
PFN_vkCmdSetLineStippleEXT vkCmdSetLineStippleEXT;
|
||||
#endif /* defined(VK_EXT_line_rasterization) */
|
||||
#if defined(VK_EXT_metal_surface)
|
||||
PFN_vkCreateMetalSurfaceEXT vkCreateMetalSurfaceEXT;
|
||||
#endif /* defined(VK_EXT_metal_surface) */
|
||||
#if defined(VK_EXT_sample_locations)
|
||||
PFN_vkCmdSetSampleLocationsEXT vkCmdSetSampleLocationsEXT;
|
||||
PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT vkGetPhysicalDeviceMultisamplePropertiesEXT;
|
||||
@@ -1257,10 +1375,24 @@ PFN_vkMergeValidationCachesEXT vkMergeValidationCachesEXT;
|
||||
#if defined(VK_FUCHSIA_imagepipe_surface)
|
||||
PFN_vkCreateImagePipeSurfaceFUCHSIA vkCreateImagePipeSurfaceFUCHSIA;
|
||||
#endif /* defined(VK_FUCHSIA_imagepipe_surface) */
|
||||
#if defined(VK_GGP_stream_descriptor_surface)
|
||||
PFN_vkCreateStreamDescriptorSurfaceGGP vkCreateStreamDescriptorSurfaceGGP;
|
||||
#endif /* defined(VK_GGP_stream_descriptor_surface) */
|
||||
#if defined(VK_GOOGLE_display_timing)
|
||||
PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE;
|
||||
PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE;
|
||||
#endif /* defined(VK_GOOGLE_display_timing) */
|
||||
#if defined(VK_INTEL_performance_query)
|
||||
PFN_vkAcquirePerformanceConfigurationINTEL vkAcquirePerformanceConfigurationINTEL;
|
||||
PFN_vkCmdSetPerformanceMarkerINTEL vkCmdSetPerformanceMarkerINTEL;
|
||||
PFN_vkCmdSetPerformanceOverrideINTEL vkCmdSetPerformanceOverrideINTEL;
|
||||
PFN_vkCmdSetPerformanceStreamMarkerINTEL vkCmdSetPerformanceStreamMarkerINTEL;
|
||||
PFN_vkGetPerformanceParameterINTEL vkGetPerformanceParameterINTEL;
|
||||
PFN_vkInitializePerformanceApiINTEL vkInitializePerformanceApiINTEL;
|
||||
PFN_vkQueueSetPerformanceConfigurationINTEL vkQueueSetPerformanceConfigurationINTEL;
|
||||
PFN_vkReleasePerformanceConfigurationINTEL vkReleasePerformanceConfigurationINTEL;
|
||||
PFN_vkUninitializePerformanceApiINTEL vkUninitializePerformanceApiINTEL;
|
||||
#endif /* defined(VK_INTEL_performance_query) */
|
||||
#if defined(VK_KHR_android_surface)
|
||||
PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR;
|
||||
#endif /* defined(VK_KHR_android_surface) */
|
||||
@@ -1366,6 +1498,11 @@ PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR;
|
||||
#if defined(VK_KHR_maintenance3)
|
||||
PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR;
|
||||
#endif /* defined(VK_KHR_maintenance3) */
|
||||
#if defined(VK_KHR_pipeline_executable_properties)
|
||||
PFN_vkGetPipelineExecutableInternalRepresentationsKHR vkGetPipelineExecutableInternalRepresentationsKHR;
|
||||
PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR;
|
||||
PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR;
|
||||
#endif /* defined(VK_KHR_pipeline_executable_properties) */
|
||||
#if defined(VK_KHR_push_descriptor)
|
||||
PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR;
|
||||
#endif /* defined(VK_KHR_push_descriptor) */
|
||||
@@ -1426,12 +1563,18 @@ PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX vkGetPhysicalDeviceGenerat
|
||||
PFN_vkRegisterObjectsNVX vkRegisterObjectsNVX;
|
||||
PFN_vkUnregisterObjectsNVX vkUnregisterObjectsNVX;
|
||||
#endif /* defined(VK_NVX_device_generated_commands) */
|
||||
#if defined(VK_NVX_image_view_handle)
|
||||
PFN_vkGetImageViewHandleNVX vkGetImageViewHandleNVX;
|
||||
#endif /* defined(VK_NVX_image_view_handle) */
|
||||
#if defined(VK_NV_clip_space_w_scaling)
|
||||
PFN_vkCmdSetViewportWScalingNV vkCmdSetViewportWScalingNV;
|
||||
#endif /* defined(VK_NV_clip_space_w_scaling) */
|
||||
#if defined(VK_NV_cooperative_matrix)
|
||||
PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV vkGetPhysicalDeviceCooperativeMatrixPropertiesNV;
|
||||
#endif /* defined(VK_NV_cooperative_matrix) */
|
||||
#if defined(VK_NV_coverage_reduction_mode)
|
||||
PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV;
|
||||
#endif /* defined(VK_NV_coverage_reduction_mode) */
|
||||
#if defined(VK_NV_device_diagnostic_checkpoints)
|
||||
PFN_vkCmdSetCheckpointNV vkCmdSetCheckpointNV;
|
||||
PFN_vkGetQueueCheckpointDataNV vkGetQueueCheckpointDataNV;
|
||||
@@ -1469,6 +1612,9 @@ PFN_vkCmdBindShadingRateImageNV vkCmdBindShadingRateImageNV;
|
||||
PFN_vkCmdSetCoarseSampleOrderNV vkCmdSetCoarseSampleOrderNV;
|
||||
PFN_vkCmdSetViewportShadingRatePaletteNV vkCmdSetViewportShadingRatePaletteNV;
|
||||
#endif /* defined(VK_NV_shading_rate_image) */
|
||||
#if (defined(VK_EXT_full_screen_exclusive) && defined(VK_KHR_device_group)) || (defined(VK_EXT_full_screen_exclusive) && defined(VK_VERSION_1_1))
|
||||
PFN_vkGetDeviceGroupSurfacePresentModes2EXT vkGetDeviceGroupSurfacePresentModes2EXT;
|
||||
#endif /* (defined(VK_EXT_full_screen_exclusive) && defined(VK_KHR_device_group)) || (defined(VK_EXT_full_screen_exclusive) && defined(VK_VERSION_1_1)) */
|
||||
#if (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && defined(VK_VERSION_1_1))
|
||||
PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR;
|
||||
#endif /* (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && defined(VK_VERSION_1_1)) */
|
||||
|
||||
Vendored
+104
-2
@@ -14,7 +14,7 @@
|
||||
#endif
|
||||
|
||||
/* VOLK_GENERATE_VERSION */
|
||||
#define VOLK_HEADER_VERSION 101
|
||||
#define VOLK_HEADER_VERSION 119
|
||||
/* VOLK_GENERATE_VERSION */
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
@@ -22,7 +22,26 @@
|
||||
#endif
|
||||
|
||||
#ifndef VULKAN_H_
|
||||
# include <vulkan/vulkan.h>
|
||||
# ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||
# include <vulkan/vk_platform.h>
|
||||
# include <vulkan/vulkan_core.h>
|
||||
|
||||
/* When VK_USE_PLATFORM_WIN32_KHR is defined, instead of including vulkan.h directly, we include individual parts of the SDK
|
||||
* This is necessary to avoid including <windows.h> which is very heavy - it takes 200ms to parse without WIN32_LEAN_AND_MEAN
|
||||
* and 100ms to parse with it. vulkan_win32.h only needs a few symbols that are easy to redefine ourselves.
|
||||
*/
|
||||
typedef unsigned long DWORD;
|
||||
typedef const wchar_t* LPCWSTR;
|
||||
typedef void* HANDLE;
|
||||
typedef struct HINSTANCE__* HINSTANCE;
|
||||
typedef struct HWND__* HWND;
|
||||
typedef struct HMONITOR__* HMONITOR;
|
||||
typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES;
|
||||
|
||||
# include <vulkan/vulkan_win32.h>
|
||||
# else
|
||||
# include <vulkan/vulkan.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -221,6 +240,9 @@ struct VolkDeviceTable
|
||||
#if defined(VK_AMD_buffer_marker)
|
||||
PFN_vkCmdWriteBufferMarkerAMD vkCmdWriteBufferMarkerAMD;
|
||||
#endif /* defined(VK_AMD_buffer_marker) */
|
||||
#if defined(VK_AMD_display_native_hdr)
|
||||
PFN_vkSetLocalDimmingAMD vkSetLocalDimmingAMD;
|
||||
#endif /* defined(VK_AMD_display_native_hdr) */
|
||||
#if defined(VK_AMD_draw_indirect_count)
|
||||
PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD;
|
||||
PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD;
|
||||
@@ -271,12 +293,22 @@ struct VolkDeviceTable
|
||||
#if defined(VK_EXT_external_memory_host)
|
||||
PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT;
|
||||
#endif /* defined(VK_EXT_external_memory_host) */
|
||||
#if defined(VK_EXT_full_screen_exclusive)
|
||||
PFN_vkAcquireFullScreenExclusiveModeEXT vkAcquireFullScreenExclusiveModeEXT;
|
||||
PFN_vkReleaseFullScreenExclusiveModeEXT vkReleaseFullScreenExclusiveModeEXT;
|
||||
#endif /* defined(VK_EXT_full_screen_exclusive) */
|
||||
#if defined(VK_EXT_hdr_metadata)
|
||||
PFN_vkSetHdrMetadataEXT vkSetHdrMetadataEXT;
|
||||
#endif /* defined(VK_EXT_hdr_metadata) */
|
||||
#if defined(VK_EXT_host_query_reset)
|
||||
PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT;
|
||||
#endif /* defined(VK_EXT_host_query_reset) */
|
||||
#if defined(VK_EXT_image_drm_format_modifier)
|
||||
PFN_vkGetImageDrmFormatModifierPropertiesEXT vkGetImageDrmFormatModifierPropertiesEXT;
|
||||
#endif /* defined(VK_EXT_image_drm_format_modifier) */
|
||||
#if defined(VK_EXT_line_rasterization)
|
||||
PFN_vkCmdSetLineStippleEXT vkCmdSetLineStippleEXT;
|
||||
#endif /* defined(VK_EXT_line_rasterization) */
|
||||
#if defined(VK_EXT_sample_locations)
|
||||
PFN_vkCmdSetSampleLocationsEXT vkCmdSetSampleLocationsEXT;
|
||||
#endif /* defined(VK_EXT_sample_locations) */
|
||||
@@ -298,6 +330,17 @@ struct VolkDeviceTable
|
||||
PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE;
|
||||
PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE;
|
||||
#endif /* defined(VK_GOOGLE_display_timing) */
|
||||
#if defined(VK_INTEL_performance_query)
|
||||
PFN_vkAcquirePerformanceConfigurationINTEL vkAcquirePerformanceConfigurationINTEL;
|
||||
PFN_vkCmdSetPerformanceMarkerINTEL vkCmdSetPerformanceMarkerINTEL;
|
||||
PFN_vkCmdSetPerformanceOverrideINTEL vkCmdSetPerformanceOverrideINTEL;
|
||||
PFN_vkCmdSetPerformanceStreamMarkerINTEL vkCmdSetPerformanceStreamMarkerINTEL;
|
||||
PFN_vkGetPerformanceParameterINTEL vkGetPerformanceParameterINTEL;
|
||||
PFN_vkInitializePerformanceApiINTEL vkInitializePerformanceApiINTEL;
|
||||
PFN_vkQueueSetPerformanceConfigurationINTEL vkQueueSetPerformanceConfigurationINTEL;
|
||||
PFN_vkReleasePerformanceConfigurationINTEL vkReleasePerformanceConfigurationINTEL;
|
||||
PFN_vkUninitializePerformanceApiINTEL vkUninitializePerformanceApiINTEL;
|
||||
#endif /* defined(VK_INTEL_performance_query) */
|
||||
#if defined(VK_KHR_bind_memory2)
|
||||
PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR;
|
||||
PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR;
|
||||
@@ -360,6 +403,11 @@ struct VolkDeviceTable
|
||||
#if defined(VK_KHR_maintenance3)
|
||||
PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR;
|
||||
#endif /* defined(VK_KHR_maintenance3) */
|
||||
#if defined(VK_KHR_pipeline_executable_properties)
|
||||
PFN_vkGetPipelineExecutableInternalRepresentationsKHR vkGetPipelineExecutableInternalRepresentationsKHR;
|
||||
PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR;
|
||||
PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR;
|
||||
#endif /* defined(VK_KHR_pipeline_executable_properties) */
|
||||
#if defined(VK_KHR_push_descriptor)
|
||||
PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR;
|
||||
#endif /* defined(VK_KHR_push_descriptor) */
|
||||
@@ -387,6 +435,9 @@ struct VolkDeviceTable
|
||||
PFN_vkRegisterObjectsNVX vkRegisterObjectsNVX;
|
||||
PFN_vkUnregisterObjectsNVX vkUnregisterObjectsNVX;
|
||||
#endif /* defined(VK_NVX_device_generated_commands) */
|
||||
#if defined(VK_NVX_image_view_handle)
|
||||
PFN_vkGetImageViewHandleNVX vkGetImageViewHandleNVX;
|
||||
#endif /* defined(VK_NVX_image_view_handle) */
|
||||
#if defined(VK_NV_clip_space_w_scaling)
|
||||
PFN_vkCmdSetViewportWScalingNV vkCmdSetViewportWScalingNV;
|
||||
#endif /* defined(VK_NV_clip_space_w_scaling) */
|
||||
@@ -424,6 +475,9 @@ struct VolkDeviceTable
|
||||
PFN_vkCmdSetCoarseSampleOrderNV vkCmdSetCoarseSampleOrderNV;
|
||||
PFN_vkCmdSetViewportShadingRatePaletteNV vkCmdSetViewportShadingRatePaletteNV;
|
||||
#endif /* defined(VK_NV_shading_rate_image) */
|
||||
#if (defined(VK_EXT_full_screen_exclusive) && defined(VK_KHR_device_group)) || (defined(VK_EXT_full_screen_exclusive) && defined(VK_VERSION_1_1))
|
||||
PFN_vkGetDeviceGroupSurfacePresentModes2EXT vkGetDeviceGroupSurfacePresentModes2EXT;
|
||||
#endif /* (defined(VK_EXT_full_screen_exclusive) && defined(VK_KHR_device_group)) || (defined(VK_EXT_full_screen_exclusive) && defined(VK_VERSION_1_1)) */
|
||||
#if (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && defined(VK_VERSION_1_1))
|
||||
PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR;
|
||||
#endif /* (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && defined(VK_VERSION_1_1)) */
|
||||
@@ -610,6 +664,9 @@ extern PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate;
|
||||
#if defined(VK_AMD_buffer_marker)
|
||||
extern PFN_vkCmdWriteBufferMarkerAMD vkCmdWriteBufferMarkerAMD;
|
||||
#endif /* defined(VK_AMD_buffer_marker) */
|
||||
#if defined(VK_AMD_display_native_hdr)
|
||||
extern PFN_vkSetLocalDimmingAMD vkSetLocalDimmingAMD;
|
||||
#endif /* defined(VK_AMD_display_native_hdr) */
|
||||
#if defined(VK_AMD_draw_indirect_count)
|
||||
extern PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD;
|
||||
extern PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD;
|
||||
@@ -679,12 +736,29 @@ extern PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurface
|
||||
#if defined(VK_EXT_external_memory_host)
|
||||
extern PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT;
|
||||
#endif /* defined(VK_EXT_external_memory_host) */
|
||||
#if defined(VK_EXT_full_screen_exclusive)
|
||||
extern PFN_vkAcquireFullScreenExclusiveModeEXT vkAcquireFullScreenExclusiveModeEXT;
|
||||
extern PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT vkGetPhysicalDeviceSurfacePresentModes2EXT;
|
||||
extern PFN_vkReleaseFullScreenExclusiveModeEXT vkReleaseFullScreenExclusiveModeEXT;
|
||||
#endif /* defined(VK_EXT_full_screen_exclusive) */
|
||||
#if defined(VK_EXT_hdr_metadata)
|
||||
extern PFN_vkSetHdrMetadataEXT vkSetHdrMetadataEXT;
|
||||
#endif /* defined(VK_EXT_hdr_metadata) */
|
||||
#if defined(VK_EXT_headless_surface)
|
||||
extern PFN_vkCreateHeadlessSurfaceEXT vkCreateHeadlessSurfaceEXT;
|
||||
#endif /* defined(VK_EXT_headless_surface) */
|
||||
#if defined(VK_EXT_host_query_reset)
|
||||
extern PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT;
|
||||
#endif /* defined(VK_EXT_host_query_reset) */
|
||||
#if defined(VK_EXT_image_drm_format_modifier)
|
||||
extern PFN_vkGetImageDrmFormatModifierPropertiesEXT vkGetImageDrmFormatModifierPropertiesEXT;
|
||||
#endif /* defined(VK_EXT_image_drm_format_modifier) */
|
||||
#if defined(VK_EXT_line_rasterization)
|
||||
extern PFN_vkCmdSetLineStippleEXT vkCmdSetLineStippleEXT;
|
||||
#endif /* defined(VK_EXT_line_rasterization) */
|
||||
#if defined(VK_EXT_metal_surface)
|
||||
extern PFN_vkCreateMetalSurfaceEXT vkCreateMetalSurfaceEXT;
|
||||
#endif /* defined(VK_EXT_metal_surface) */
|
||||
#if defined(VK_EXT_sample_locations)
|
||||
extern PFN_vkCmdSetSampleLocationsEXT vkCmdSetSampleLocationsEXT;
|
||||
extern PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT vkGetPhysicalDeviceMultisamplePropertiesEXT;
|
||||
@@ -706,10 +780,24 @@ extern PFN_vkMergeValidationCachesEXT vkMergeValidationCachesEXT;
|
||||
#if defined(VK_FUCHSIA_imagepipe_surface)
|
||||
extern PFN_vkCreateImagePipeSurfaceFUCHSIA vkCreateImagePipeSurfaceFUCHSIA;
|
||||
#endif /* defined(VK_FUCHSIA_imagepipe_surface) */
|
||||
#if defined(VK_GGP_stream_descriptor_surface)
|
||||
extern PFN_vkCreateStreamDescriptorSurfaceGGP vkCreateStreamDescriptorSurfaceGGP;
|
||||
#endif /* defined(VK_GGP_stream_descriptor_surface) */
|
||||
#if defined(VK_GOOGLE_display_timing)
|
||||
extern PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE;
|
||||
extern PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE;
|
||||
#endif /* defined(VK_GOOGLE_display_timing) */
|
||||
#if defined(VK_INTEL_performance_query)
|
||||
extern PFN_vkAcquirePerformanceConfigurationINTEL vkAcquirePerformanceConfigurationINTEL;
|
||||
extern PFN_vkCmdSetPerformanceMarkerINTEL vkCmdSetPerformanceMarkerINTEL;
|
||||
extern PFN_vkCmdSetPerformanceOverrideINTEL vkCmdSetPerformanceOverrideINTEL;
|
||||
extern PFN_vkCmdSetPerformanceStreamMarkerINTEL vkCmdSetPerformanceStreamMarkerINTEL;
|
||||
extern PFN_vkGetPerformanceParameterINTEL vkGetPerformanceParameterINTEL;
|
||||
extern PFN_vkInitializePerformanceApiINTEL vkInitializePerformanceApiINTEL;
|
||||
extern PFN_vkQueueSetPerformanceConfigurationINTEL vkQueueSetPerformanceConfigurationINTEL;
|
||||
extern PFN_vkReleasePerformanceConfigurationINTEL vkReleasePerformanceConfigurationINTEL;
|
||||
extern PFN_vkUninitializePerformanceApiINTEL vkUninitializePerformanceApiINTEL;
|
||||
#endif /* defined(VK_INTEL_performance_query) */
|
||||
#if defined(VK_KHR_android_surface)
|
||||
extern PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR;
|
||||
#endif /* defined(VK_KHR_android_surface) */
|
||||
@@ -815,6 +903,11 @@ extern PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR;
|
||||
#if defined(VK_KHR_maintenance3)
|
||||
extern PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR;
|
||||
#endif /* defined(VK_KHR_maintenance3) */
|
||||
#if defined(VK_KHR_pipeline_executable_properties)
|
||||
extern PFN_vkGetPipelineExecutableInternalRepresentationsKHR vkGetPipelineExecutableInternalRepresentationsKHR;
|
||||
extern PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR;
|
||||
extern PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR;
|
||||
#endif /* defined(VK_KHR_pipeline_executable_properties) */
|
||||
#if defined(VK_KHR_push_descriptor)
|
||||
extern PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR;
|
||||
#endif /* defined(VK_KHR_push_descriptor) */
|
||||
@@ -875,12 +968,18 @@ extern PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX vkGetPhysicalDevice
|
||||
extern PFN_vkRegisterObjectsNVX vkRegisterObjectsNVX;
|
||||
extern PFN_vkUnregisterObjectsNVX vkUnregisterObjectsNVX;
|
||||
#endif /* defined(VK_NVX_device_generated_commands) */
|
||||
#if defined(VK_NVX_image_view_handle)
|
||||
extern PFN_vkGetImageViewHandleNVX vkGetImageViewHandleNVX;
|
||||
#endif /* defined(VK_NVX_image_view_handle) */
|
||||
#if defined(VK_NV_clip_space_w_scaling)
|
||||
extern PFN_vkCmdSetViewportWScalingNV vkCmdSetViewportWScalingNV;
|
||||
#endif /* defined(VK_NV_clip_space_w_scaling) */
|
||||
#if defined(VK_NV_cooperative_matrix)
|
||||
extern PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV vkGetPhysicalDeviceCooperativeMatrixPropertiesNV;
|
||||
#endif /* defined(VK_NV_cooperative_matrix) */
|
||||
#if defined(VK_NV_coverage_reduction_mode)
|
||||
extern PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV;
|
||||
#endif /* defined(VK_NV_coverage_reduction_mode) */
|
||||
#if defined(VK_NV_device_diagnostic_checkpoints)
|
||||
extern PFN_vkCmdSetCheckpointNV vkCmdSetCheckpointNV;
|
||||
extern PFN_vkGetQueueCheckpointDataNV vkGetQueueCheckpointDataNV;
|
||||
@@ -918,6 +1017,9 @@ extern PFN_vkCmdBindShadingRateImageNV vkCmdBindShadingRateImageNV;
|
||||
extern PFN_vkCmdSetCoarseSampleOrderNV vkCmdSetCoarseSampleOrderNV;
|
||||
extern PFN_vkCmdSetViewportShadingRatePaletteNV vkCmdSetViewportShadingRatePaletteNV;
|
||||
#endif /* defined(VK_NV_shading_rate_image) */
|
||||
#if (defined(VK_EXT_full_screen_exclusive) && defined(VK_KHR_device_group)) || (defined(VK_EXT_full_screen_exclusive) && defined(VK_VERSION_1_1))
|
||||
extern PFN_vkGetDeviceGroupSurfacePresentModes2EXT vkGetDeviceGroupSurfacePresentModes2EXT;
|
||||
#endif /* (defined(VK_EXT_full_screen_exclusive) && defined(VK_KHR_device_group)) || (defined(VK_EXT_full_screen_exclusive) && defined(VK_VERSION_1_1)) */
|
||||
#if (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && defined(VK_VERSION_1_1))
|
||||
extern PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR;
|
||||
#endif /* (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && defined(VK_VERSION_1_1)) */
|
||||
|
||||
@@ -16,6 +16,7 @@ set(VULKAN_SRC
|
||||
vk/vk_imageless_framebuffer.cpp
|
||||
vk/vk_indirect.cpp
|
||||
vk/vk_int8_ibuffer.cpp
|
||||
vk/vk_line_raster.cpp
|
||||
vk/vk_multi_thread_windows.cpp
|
||||
vk/vk_overlay_test.cpp
|
||||
vk/vk_resource_lifetimes.cpp
|
||||
|
||||
@@ -211,6 +211,7 @@
|
||||
<ClCompile Include="vk\vk_imageless_framebuffer.cpp" />
|
||||
<ClCompile Include="vk\vk_image_layouts.cpp" />
|
||||
<ClCompile Include="vk\vk_int8_ibuffer.cpp" />
|
||||
<ClCompile Include="vk\vk_line_raster.cpp" />
|
||||
<ClCompile Include="vk\vk_multi_thread_windows.cpp" />
|
||||
<ClCompile Include="vk\vk_vertex_attr_zoo.cpp" />
|
||||
<ClCompile Include="vk\vk_buffer_address.cpp" />
|
||||
|
||||
@@ -315,6 +315,9 @@
|
||||
<ClCompile Include="vk\vk_imageless_framebuffer.cpp">
|
||||
<Filter>Vulkan\demos</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="vk\vk_line_raster.cpp">
|
||||
<Filter>Vulkan\demos</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="D3D11">
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
/******************************************************************************
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018-2019 Baldur Karlsson
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#include "vk_test.h"
|
||||
|
||||
TEST(VK_Line_Raster, VulkanGraphicsTest)
|
||||
{
|
||||
static constexpr const char *Description =
|
||||
"Test using VK_EXT_line_rasterization to do funky rasterization of lines";
|
||||
|
||||
const std::string vertex = R"EOSHADER(
|
||||
#version 420 core
|
||||
|
||||
layout(location = 0) in vec3 Position;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4(Position.xyz*vec3(1,-1,1), 1);
|
||||
}
|
||||
|
||||
)EOSHADER";
|
||||
|
||||
const std::string pixel = R"EOSHADER(
|
||||
#version 420 core
|
||||
|
||||
layout(location = 0, index = 0) out vec4 Color;
|
||||
|
||||
void main()
|
||||
{
|
||||
Color = vec4(0,1,1,1);
|
||||
}
|
||||
|
||||
)EOSHADER";
|
||||
|
||||
struct A2V
|
||||
{
|
||||
Vec3f pos;
|
||||
};
|
||||
|
||||
void Prepare(int argc, char **argv)
|
||||
{
|
||||
devExts.push_back(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME);
|
||||
|
||||
features.wideLines = VK_TRUE;
|
||||
|
||||
VulkanGraphicsTest::Prepare(argc, argv);
|
||||
|
||||
static VkPhysicalDeviceLineRasterizationFeaturesEXT lineraster = {
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT,
|
||||
};
|
||||
|
||||
getPhysFeatures2(&lineraster);
|
||||
|
||||
// enable all features that are available
|
||||
devInfoNext = &lineraster;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
// initialise, create window, create context, etc
|
||||
if(!Init())
|
||||
return 3;
|
||||
|
||||
VkPipelineLayout layout = createPipelineLayout(vkh::PipelineLayoutCreateInfo());
|
||||
|
||||
vkh::GraphicsPipelineCreateInfo pipeCreateInfo;
|
||||
|
||||
pipeCreateInfo.layout = layout;
|
||||
pipeCreateInfo.renderPass = mainWindow->rp;
|
||||
|
||||
pipeCreateInfo.vertexInputState.vertexBindingDescriptions = {vkh::vertexBind(0, A2V)};
|
||||
pipeCreateInfo.vertexInputState.vertexAttributeDescriptions = {
|
||||
vkh::vertexAttr(0, 0, A2V, pos),
|
||||
};
|
||||
|
||||
pipeCreateInfo.inputAssemblyState.topology = VK_PRIMITIVE_TOPOLOGY_LINE_LIST;
|
||||
|
||||
// if the feature is supported (which we checked) this is within the minimum supported range
|
||||
pipeCreateInfo.rasterizationState.lineWidth = 6.0f;
|
||||
|
||||
pipeCreateInfo.stages = {
|
||||
CompileShaderModule(vertex, ShaderLang::glsl, ShaderStage::vert, "main"),
|
||||
CompileShaderModule(pixel, ShaderLang::glsl, ShaderStage::frag, "main"),
|
||||
};
|
||||
|
||||
VkPipelineRasterizationLineStateCreateInfoEXT lineRasterSetup = {
|
||||
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT,
|
||||
};
|
||||
|
||||
pipeCreateInfo.rasterizationState.pNext = &lineRasterSetup;
|
||||
|
||||
A2V linePoints[2] = {
|
||||
{Vec3f(0.9f, 0.9f, 0.0f)}, {Vec3f(-0.9f, -0.9f, 0.0f)},
|
||||
};
|
||||
|
||||
AllocatedBuffer vb(
|
||||
allocator, vkh::BufferCreateInfo(sizeof(linePoints), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT |
|
||||
VK_BUFFER_USAGE_TRANSFER_DST_BIT),
|
||||
VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU}));
|
||||
|
||||
vb.upload(linePoints);
|
||||
|
||||
struct Test
|
||||
{
|
||||
VkPipeline pipe;
|
||||
uint32_t stippleFactor;
|
||||
uint16_t stipplePattern;
|
||||
};
|
||||
|
||||
std::vector<Test> tests;
|
||||
|
||||
static VkPhysicalDeviceLineRasterizationFeaturesEXT lineRasterFeatures = {
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT,
|
||||
};
|
||||
|
||||
getPhysFeatures2(&lineRasterFeatures);
|
||||
|
||||
lineRasterSetup.stippledLineEnable = VK_FALSE;
|
||||
lineRasterSetup.lineRasterizationMode = VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT;
|
||||
tests.push_back({createGraphicsPipeline(pipeCreateInfo)});
|
||||
tests.push_back({VK_NULL_HANDLE});
|
||||
tests.push_back({VK_NULL_HANDLE});
|
||||
tests.push_back({VK_NULL_HANDLE});
|
||||
|
||||
if(lineRasterFeatures.rectangularLines)
|
||||
{
|
||||
lineRasterSetup.lineRasterizationMode = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT;
|
||||
tests.push_back({createGraphicsPipeline(pipeCreateInfo)});
|
||||
}
|
||||
else
|
||||
{
|
||||
tests.push_back({VK_NULL_HANDLE});
|
||||
}
|
||||
|
||||
if(lineRasterFeatures.bresenhamLines)
|
||||
{
|
||||
lineRasterSetup.lineRasterizationMode = VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT;
|
||||
tests.push_back({createGraphicsPipeline(pipeCreateInfo)});
|
||||
}
|
||||
else
|
||||
{
|
||||
tests.push_back({VK_NULL_HANDLE});
|
||||
}
|
||||
|
||||
if(lineRasterFeatures.smoothLines)
|
||||
{
|
||||
lineRasterSetup.lineRasterizationMode = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT;
|
||||
tests.push_back({createGraphicsPipeline(pipeCreateInfo)});
|
||||
}
|
||||
else
|
||||
{
|
||||
tests.push_back({VK_NULL_HANDLE});
|
||||
}
|
||||
|
||||
// dummy, to push to the next row
|
||||
tests.push_back({VK_NULL_HANDLE});
|
||||
|
||||
lineRasterSetup.stippledLineEnable = VK_TRUE;
|
||||
pipeCreateInfo.dynamicState.dynamicStates.push_back(VK_DYNAMIC_STATE_LINE_STIPPLE_EXT);
|
||||
|
||||
if(lineRasterFeatures.rectangularLines && lineRasterFeatures.stippledRectangularLines)
|
||||
{
|
||||
lineRasterSetup.lineRasterizationMode = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT;
|
||||
tests.push_back({createGraphicsPipeline(pipeCreateInfo), 2, 0xC3C3U});
|
||||
}
|
||||
else
|
||||
{
|
||||
tests.push_back({VK_NULL_HANDLE});
|
||||
}
|
||||
|
||||
if(lineRasterFeatures.bresenhamLines && lineRasterFeatures.stippledBresenhamLines)
|
||||
{
|
||||
lineRasterSetup.lineRasterizationMode = VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT;
|
||||
tests.push_back({createGraphicsPipeline(pipeCreateInfo), 2, 0x1F1FU});
|
||||
}
|
||||
else
|
||||
{
|
||||
tests.push_back({VK_NULL_HANDLE});
|
||||
}
|
||||
|
||||
if(lineRasterFeatures.smoothLines && lineRasterFeatures.stippledSmoothLines)
|
||||
{
|
||||
lineRasterSetup.lineRasterizationMode = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT;
|
||||
tests.push_back({createGraphicsPipeline(pipeCreateInfo), 2, 0xC3C3U});
|
||||
}
|
||||
else
|
||||
{
|
||||
tests.push_back({VK_NULL_HANDLE});
|
||||
}
|
||||
|
||||
while(Running())
|
||||
{
|
||||
VkCommandBuffer cmd = GetCommandBuffer();
|
||||
|
||||
vkBeginCommandBuffer(cmd, vkh::CommandBufferBeginInfo());
|
||||
|
||||
VkImage swapimg =
|
||||
StartUsingBackbuffer(cmd, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL);
|
||||
|
||||
vkCmdClearColorImage(cmd, swapimg, VK_IMAGE_LAYOUT_GENERAL,
|
||||
vkh::ClearColorValue(0.4f, 0.5f, 0.6f, 1.0f), 1,
|
||||
vkh::ImageSubresourceRange());
|
||||
|
||||
vkCmdBeginRenderPass(
|
||||
cmd, vkh::RenderPassBeginInfo(mainWindow->rp, mainWindow->GetFB(), mainWindow->scissor),
|
||||
VK_SUBPASS_CONTENTS_INLINE);
|
||||
|
||||
vkCmdSetScissor(cmd, 0, 1, &mainWindow->scissor);
|
||||
vkh::cmdBindVertexBuffers(cmd, 0, {vb.buffer}, {0});
|
||||
|
||||
VkViewport view = mainWindow->viewport;
|
||||
view.width /= 4.0f;
|
||||
view.height /= 4.0f;
|
||||
|
||||
for(const Test &t : tests)
|
||||
{
|
||||
if(t.pipe != VK_NULL_HANDLE)
|
||||
{
|
||||
vkCmdSetViewport(cmd, 0, 1, &view);
|
||||
vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, t.pipe);
|
||||
|
||||
if(t.stipplePattern)
|
||||
vkCmdSetLineStippleEXT(cmd, t.stippleFactor, t.stipplePattern);
|
||||
|
||||
vkCmdDraw(cmd, 2, 1, 0, 0);
|
||||
}
|
||||
|
||||
view.x += view.width;
|
||||
if(view.x >= mainWindow->viewport.width)
|
||||
{
|
||||
view.x = 0.0f;
|
||||
view.y += view.height;
|
||||
}
|
||||
}
|
||||
|
||||
vkCmdEndRenderPass(cmd);
|
||||
|
||||
FinishUsingBackbuffer(cmd, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL);
|
||||
|
||||
vkEndCommandBuffer(cmd);
|
||||
|
||||
Submit(0, 1, {cmd});
|
||||
|
||||
Present();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
REGISTER_TEST();
|
||||
@@ -0,0 +1,89 @@
|
||||
import rdtest
|
||||
import renderdoc as rd
|
||||
|
||||
|
||||
class VK_Line_Raster(rdtest.TestCase):
|
||||
demos_test_name = 'VK_Line_Raster'
|
||||
|
||||
# Line segments are relative to 100x75 framebuffers. We sample in each corner (adjusted to be sure even with
|
||||
# slightly varying rasterization we should sample in the line endpoint) and in the middle
|
||||
points = [
|
||||
[ 6, 69 ],
|
||||
[ 50, 36 ],
|
||||
[ 93, 5 ],
|
||||
]
|
||||
|
||||
view = [ 100, 75 ]
|
||||
|
||||
def sample(self, row, col):
|
||||
ret = []
|
||||
for p in self.points:
|
||||
x = self.view[0] * col + p[0]
|
||||
y = self.view[1] * row + p[1]
|
||||
|
||||
picked: rd.PixelValue = self.out.PickPixel(self.tex.resourceId, False, x, y, 0, 0, 0)
|
||||
ret.append(rdtest.value_compare(picked.floatValue, [0.0, 1.0, 1.0, 1.0]))
|
||||
return ret
|
||||
|
||||
def check_capture(self):
|
||||
draw = self.get_last_draw()
|
||||
|
||||
self.check(draw is not None)
|
||||
|
||||
draw = draw.previous
|
||||
|
||||
self.controller.SetFrameEvent(draw.eventId, False)
|
||||
|
||||
# Make an output so we can pick pixels
|
||||
self.out: rd.ReplayOutput = self.controller.CreateOutput(rd.CreateHeadlessWindowingData(100, 100), rd.ReplayOutputType.Texture)
|
||||
|
||||
pipe: rd.PipeState = self.controller.GetPipelineState()
|
||||
|
||||
self.tex = rd.TextureDisplay()
|
||||
self.tex.resourceId = pipe.GetOutputTargets()[0].resourceId
|
||||
self.out.SetTextureDisplay(self.tex)
|
||||
|
||||
texdetails = self.get_texture(self.tex.resourceId)
|
||||
|
||||
# Top left we expect a regular line segment.
|
||||
s = self.sample(0, 0)
|
||||
|
||||
# All points should be the line color
|
||||
if not rdtest.value_compare(s, [True, True, True]):
|
||||
raise rdtest.TestFailureException("Normal line picked values {} doesn't match expectation".format(s))
|
||||
|
||||
# Next row is unstippled. The lines should either be all present, or not present
|
||||
names = ["Rectangle", "Bresenham", "Rectangle Round"]
|
||||
for col in [0, 1, 2]:
|
||||
s = self.sample(1, col)
|
||||
|
||||
n = "Unstippled {}".format(names[col])
|
||||
|
||||
if s[0]:
|
||||
if not rdtest.value_compare(s, [True, True, True]):
|
||||
raise rdtest.TestFailureException("{} picked values {} doesn't match expectation".format(n, s))
|
||||
rdtest.log.success("{} line looks as expected".format(n))
|
||||
else:
|
||||
if not rdtest.value_compare(s, [False, False, False]):
|
||||
raise rdtest.TestFailureException("{} picked values {} doesn't match expectation".format(n, s))
|
||||
rdtest.log.success("{} line not supported".format(n))
|
||||
|
||||
# Final row is stippled. The lines should be present on each end, and not present in the middle
|
||||
# (or not present at all)
|
||||
for col in [0, 1, 2]:
|
||||
s = self.sample(2, col)
|
||||
|
||||
n = "Stippled {}".format(names[col])
|
||||
|
||||
if s[0]:
|
||||
if not rdtest.value_compare(s, [True, False, True]):
|
||||
raise rdtest.TestFailureException("{} picked values {} doesn't match expectation".format(n, s))
|
||||
rdtest.log.success("{} line looks as expected".format(n))
|
||||
else:
|
||||
if not rdtest.value_compare(s, [False, False, False]):
|
||||
raise rdtest.TestFailureException("{} picked values {} doesn't match expectation".format(n, s))
|
||||
rdtest.log.success("{} line not supported".format(n))
|
||||
|
||||
rdtest.log.success("All lines look as expected")
|
||||
|
||||
self.out.Shutdown()
|
||||
Reference in New Issue
Block a user