mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-30 11:52:11 +01:00
[dxvk] Added limit constants
This commit is contained in:
parent
764220db98
commit
921abce1b3
@ -2,27 +2,11 @@
|
|||||||
|
|
||||||
#include "dxvk_compute.h"
|
#include "dxvk_compute.h"
|
||||||
#include "dxvk_framebuffer.h"
|
#include "dxvk_framebuffer.h"
|
||||||
|
#include "dxvk_limits.h"
|
||||||
#include "dxvk_shader.h"
|
#include "dxvk_shader.h"
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Limits of the DXVK API
|
|
||||||
*
|
|
||||||
* Stores the number of binding slots
|
|
||||||
* available for all resource types.
|
|
||||||
*/
|
|
||||||
enum DxvkLimits : size_t {
|
|
||||||
MaxNumRenderTargets = 8,
|
|
||||||
MaxNumUniformBuffers = 16,
|
|
||||||
MaxNumSampledImages = 16,
|
|
||||||
MaxNumStorageBuffers = 128,
|
|
||||||
MaxNumStorageImages = 128,
|
|
||||||
MaxNumVertexBuffers = 32,
|
|
||||||
MaxNumOutputStreams = 4,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Graphics pipeline state flags
|
* \brief Graphics pipeline state flags
|
||||||
*
|
*
|
||||||
|
@ -9,7 +9,7 @@ namespace dxvk {
|
|||||||
DxvkRenderPassFormat DxvkRenderTargets::renderPassFormat() const {
|
DxvkRenderPassFormat DxvkRenderTargets::renderPassFormat() const {
|
||||||
DxvkRenderPassFormat result;
|
DxvkRenderPassFormat result;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < MaxNumColorTargets; i++) {
|
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
|
||||||
if (m_colorTargets.at(i) != nullptr) {
|
if (m_colorTargets.at(i) != nullptr) {
|
||||||
result.setColorFormat(i, m_colorTargets.at(i)->info().format);
|
result.setColorFormat(i, m_colorTargets.at(i)->info().format);
|
||||||
result.setSampleCount(m_colorTargets.at(i)->imageInfo().sampleCount);
|
result.setSampleCount(m_colorTargets.at(i)->imageInfo().sampleCount);
|
||||||
@ -31,7 +31,7 @@ namespace dxvk {
|
|||||||
if (m_depthTarget != nullptr)
|
if (m_depthTarget != nullptr)
|
||||||
result.push_back(m_depthTarget->handle());
|
result.push_back(m_depthTarget->handle());
|
||||||
|
|
||||||
for (uint32_t i = 0; i < MaxNumColorTargets; i++) {
|
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
|
||||||
if (m_colorTargets.at(i) != nullptr)
|
if (m_colorTargets.at(i) != nullptr)
|
||||||
result.push_back(m_colorTargets.at(i)->handle());
|
result.push_back(m_colorTargets.at(i)->handle());
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ namespace dxvk {
|
|||||||
if (m_depthTarget != nullptr)
|
if (m_depthTarget != nullptr)
|
||||||
return this->renderTargetSize(m_depthTarget);
|
return this->renderTargetSize(m_depthTarget);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < MaxNumColorTargets; i++) {
|
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
|
||||||
if (m_colorTargets.at(i) != nullptr)
|
if (m_colorTargets.at(i) != nullptr)
|
||||||
return this->renderTargetSize(m_colorTargets.at(i));
|
return this->renderTargetSize(m_colorTargets.at(i));
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::array<Rc<DxvkImageView>, MaxNumColorTargets> m_colorTargets;
|
std::array<Rc<DxvkImageView>, MaxNumRenderTargets> m_colorTargets;
|
||||||
Rc<DxvkImageView> m_depthTarget;
|
Rc<DxvkImageView> m_depthTarget;
|
||||||
|
|
||||||
DxvkFramebufferSize renderTargetSize(
|
DxvkFramebufferSize renderTargetSize(
|
||||||
|
15
src/dxvk/dxvk_limits.h
Normal file
15
src/dxvk/dxvk_limits.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace dxvk {
|
||||||
|
|
||||||
|
enum DxvkLimits : size_t {
|
||||||
|
MaxNumRenderTargets = 8,
|
||||||
|
MaxNumUniformBuffers = 16,
|
||||||
|
MaxNumSampledImages = 16,
|
||||||
|
MaxNumStorageBuffers = 128,
|
||||||
|
MaxNumStorageImages = 128,
|
||||||
|
MaxNumVertexBuffers = 32,
|
||||||
|
MaxNumOutputStreams = 4,
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -3,7 +3,7 @@
|
|||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
DxvkRenderPassFormat::DxvkRenderPassFormat() {
|
DxvkRenderPassFormat::DxvkRenderPassFormat() {
|
||||||
for (uint32_t i = 0; i < MaxNumColorTargets; i++)
|
for (uint32_t i = 0; i < MaxNumRenderTargets; i++)
|
||||||
m_color.at(i) = VK_FORMAT_UNDEFINED;
|
m_color.at(i) = VK_FORMAT_UNDEFINED;
|
||||||
m_depth = VK_FORMAT_UNDEFINED;
|
m_depth = VK_FORMAT_UNDEFINED;
|
||||||
m_samples = VK_SAMPLE_COUNT_1_BIT;
|
m_samples = VK_SAMPLE_COUNT_1_BIT;
|
||||||
@ -15,7 +15,7 @@ namespace dxvk {
|
|||||||
std::hash<VkFormat> fhash;
|
std::hash<VkFormat> fhash;
|
||||||
std::hash<VkSampleCountFlagBits> shash;
|
std::hash<VkSampleCountFlagBits> shash;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < MaxNumColorTargets; i++)
|
for (uint32_t i = 0; i < MaxNumRenderTargets; i++)
|
||||||
result.add(fhash(m_color.at(i)));
|
result.add(fhash(m_color.at(i)));
|
||||||
|
|
||||||
result.add(fhash(m_depth));
|
result.add(fhash(m_depth));
|
||||||
@ -27,7 +27,7 @@ namespace dxvk {
|
|||||||
bool DxvkRenderPassFormat::operator == (const DxvkRenderPassFormat& other) const {
|
bool DxvkRenderPassFormat::operator == (const DxvkRenderPassFormat& other) const {
|
||||||
bool equal = m_depth == other.m_depth
|
bool equal = m_depth == other.m_depth
|
||||||
&& m_samples == other.m_samples;
|
&& m_samples == other.m_samples;
|
||||||
for (uint32_t i = 0; i < MaxNumColorTargets && !equal; i++)
|
for (uint32_t i = 0; i < MaxNumRenderTargets && !equal; i++)
|
||||||
equal = m_color.at(i) == other.m_color.at(i);
|
equal = m_color.at(i) == other.m_color.at(i);
|
||||||
return equal;
|
return equal;
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ namespace dxvk {
|
|||||||
std::vector<VkAttachmentDescription> attachments;
|
std::vector<VkAttachmentDescription> attachments;
|
||||||
|
|
||||||
VkAttachmentReference depthRef;
|
VkAttachmentReference depthRef;
|
||||||
std::array<VkAttachmentReference, MaxNumColorTargets> colorRef;
|
std::array<VkAttachmentReference, MaxNumRenderTargets> colorRef;
|
||||||
|
|
||||||
// Render passes may not require the previous
|
// Render passes may not require the previous
|
||||||
// contents of the attachments to be preserved.
|
// contents of the attachments to be preserved.
|
||||||
@ -76,7 +76,7 @@ namespace dxvk {
|
|||||||
attachments.push_back(desc);
|
attachments.push_back(desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t i = 0; i < MaxNumColorTargets; i++) {
|
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
|
||||||
colorRef.at(i).attachment = VK_ATTACHMENT_UNUSED;
|
colorRef.at(i).attachment = VK_ATTACHMENT_UNUSED;
|
||||||
colorRef.at(i).layout = VK_IMAGE_LAYOUT_UNDEFINED;
|
colorRef.at(i).layout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||||
|
|
||||||
|
@ -5,11 +5,10 @@
|
|||||||
|
|
||||||
#include "dxvk_hash.h"
|
#include "dxvk_hash.h"
|
||||||
#include "dxvk_include.h"
|
#include "dxvk_include.h"
|
||||||
|
#include "dxvk_limits.h"
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
constexpr uint32_t MaxNumColorTargets = 8;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Render pass format
|
* \brief Render pass format
|
||||||
*
|
*
|
||||||
@ -92,7 +91,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::array<VkFormat, MaxNumColorTargets> m_color;
|
std::array<VkFormat, MaxNumRenderTargets> m_color;
|
||||||
VkFormat m_depth;
|
VkFormat m_depth;
|
||||||
VkSampleCountFlagBits m_samples;
|
VkSampleCountFlagBits m_samples;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user