mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-27 04:54:15 +01:00
[dxbc] Enabled SPV_KHR_shader_draw_parameters for vertex shaders
This commit is contained in:
parent
5ce975eed9
commit
7f5fa18d0b
@ -606,7 +606,9 @@ namespace dxvk {
|
||||
// Store descriptor info for the shader interface
|
||||
DxvkResourceSlot resource;
|
||||
resource.slot = bindingId;
|
||||
resource.type = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
|
||||
resource.type = resourceType == DxbcResourceDim::Buffer
|
||||
? VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER
|
||||
: VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
|
||||
m_resourceSlots.push_back(resource);
|
||||
}
|
||||
|
||||
@ -2716,6 +2718,9 @@ namespace dxvk {
|
||||
void DxbcCompiler::emitVsInit() {
|
||||
m_module.enableCapability(spv::CapabilityClipDistance);
|
||||
m_module.enableCapability(spv::CapabilityCullDistance);
|
||||
m_module.enableCapability(spv::CapabilityDrawParameters);
|
||||
|
||||
m_module.enableExtension("SPV_KHR_shader_draw_parameters");
|
||||
|
||||
// Declare the per-vertex output block. This is where
|
||||
// the vertex shader will write the vertex position.
|
||||
|
@ -149,6 +149,9 @@ namespace dxvk {
|
||||
Rc<DxvkDevice> DxvkAdapter::createDevice(const VkPhysicalDeviceFeatures& enabledFeatures) {
|
||||
auto enabledExtensions = this->enableExtensions();
|
||||
|
||||
Logger::info("Enabled device extensions:");
|
||||
this->logNameList(enabledExtensions);
|
||||
|
||||
float queuePriority = 1.0f;
|
||||
std::vector<VkDeviceQueueCreateInfo> queueInfos;
|
||||
|
||||
@ -198,6 +201,7 @@ namespace dxvk {
|
||||
vk::NameList DxvkAdapter::enableExtensions() {
|
||||
std::vector<const char*> extOptional = { };
|
||||
std::vector<const char*> extRequired = {
|
||||
VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME,
|
||||
VK_KHR_SWAPCHAIN_EXTENSION_NAME,
|
||||
VK_KHR_MAINTENANCE1_EXTENSION_NAME,
|
||||
};
|
||||
@ -220,4 +224,10 @@ namespace dxvk {
|
||||
return extensionsEnabled;
|
||||
}
|
||||
|
||||
|
||||
void DxvkAdapter::logNameList(const vk::NameList& names) {
|
||||
for (uint32_t i = 0; i < names.count(); i++)
|
||||
Logger::info(str::format(" ", names.name(i)));
|
||||
}
|
||||
|
||||
}
|
@ -147,6 +147,8 @@ namespace dxvk {
|
||||
|
||||
vk::NameList enableExtensions();
|
||||
|
||||
static void logNameList(const vk::NameList& names);
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -16,6 +16,7 @@ namespace dxvk {
|
||||
SpirvCodeBuffer result;
|
||||
result.putHeader(m_id);
|
||||
result.append(m_capabilities);
|
||||
result.append(m_extensions);
|
||||
result.append(m_instExt);
|
||||
result.append(m_memoryModel);
|
||||
result.append(m_entryPoints);
|
||||
@ -48,6 +49,13 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void SpirvModule::enableExtension(
|
||||
const char* extensionName) {
|
||||
m_extensions.putIns (spv::OpExtension, 1 + m_extensions.strLen(extensionName));
|
||||
m_extensions.putStr (extensionName);
|
||||
}
|
||||
|
||||
|
||||
void SpirvModule::addEntryPoint(
|
||||
uint32_t entryPointId,
|
||||
spv::ExecutionModel executionModel,
|
||||
|
@ -39,6 +39,9 @@ namespace dxvk {
|
||||
void enableCapability(
|
||||
spv::Capability capability);
|
||||
|
||||
void enableExtension(
|
||||
const char* extensionName);
|
||||
|
||||
void addEntryPoint(
|
||||
uint32_t entryPointId,
|
||||
spv::ExecutionModel executionModel,
|
||||
@ -659,6 +662,7 @@ namespace dxvk {
|
||||
uint32_t m_instExtGlsl450 = 0;
|
||||
|
||||
SpirvCodeBuffer m_capabilities;
|
||||
SpirvCodeBuffer m_extensions;
|
||||
SpirvCodeBuffer m_instExt;
|
||||
SpirvCodeBuffer m_memoryModel;
|
||||
SpirvCodeBuffer m_entryPoints;
|
||||
|
Loading…
x
Reference in New Issue
Block a user