2017-10-10 23:32:13 +02:00
|
|
|
#pragma once
|
|
|
|
|
2017-10-15 17:56:06 +02:00
|
|
|
#include "dxvk_buffer.h"
|
2017-10-13 03:19:23 +02:00
|
|
|
#include "dxvk_compute.h"
|
2017-11-20 13:21:27 +01:00
|
|
|
#include "dxvk_constant_state.h"
|
2017-10-11 23:29:05 +02:00
|
|
|
#include "dxvk_framebuffer.h"
|
2017-11-17 19:49:44 +01:00
|
|
|
#include "dxvk_graphics.h"
|
2017-10-15 17:56:06 +02:00
|
|
|
#include "dxvk_image.h"
|
2017-10-14 13:37:40 +02:00
|
|
|
#include "dxvk_limits.h"
|
2017-12-07 09:38:31 +01:00
|
|
|
#include "dxvk_pipelayout.h"
|
2017-12-03 20:23:26 +01:00
|
|
|
#include "dxvk_sampler.h"
|
2017-10-11 23:29:05 +02:00
|
|
|
#include "dxvk_shader.h"
|
2017-10-10 23:32:13 +02:00
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
2017-10-13 03:19:23 +02:00
|
|
|
/**
|
|
|
|
* \brief Graphics pipeline state flags
|
|
|
|
*
|
|
|
|
* Stores some information on which state of the
|
|
|
|
* graphics pipeline has changed and/or needs to
|
|
|
|
* be updated.
|
|
|
|
*/
|
2017-11-17 19:49:44 +01:00
|
|
|
enum class DxvkContextFlag : uint64_t {
|
|
|
|
GpRenderPassBound, ///< Render pass is currently bound
|
2017-12-07 09:44:45 +01:00
|
|
|
GpDirtyPipeline, ///< Graphics pipeline binding is out of date
|
|
|
|
GpDirtyPipelineState, ///< Graphics pipeline needs to be recompiled
|
2017-11-20 13:21:27 +01:00
|
|
|
GpDirtyDynamicState, ///< Dynamic state needs to be reapplied
|
2017-11-17 19:49:44 +01:00
|
|
|
GpDirtyResources, ///< Graphics pipeline resource bindings are out of date
|
|
|
|
GpDirtyVertexBuffers, ///< Vertex buffer bindings are out of date
|
2017-11-18 10:42:27 +01:00
|
|
|
GpDirtyIndexBuffer, ///< Index buffer binding are out of date
|
2017-11-17 19:49:44 +01:00
|
|
|
|
|
|
|
CpDirtyPipeline, ///< Compute pipeline binding are out of date
|
|
|
|
CpDirtyResources, ///< Compute pipeline resource bindings are out of date
|
2017-10-13 03:19:23 +02:00
|
|
|
};
|
|
|
|
|
2017-11-17 19:49:44 +01:00
|
|
|
using DxvkContextFlags = Flags<DxvkContextFlag>;
|
2017-10-13 03:19:23 +02:00
|
|
|
|
|
|
|
|
2017-11-20 13:21:27 +01:00
|
|
|
struct DxvkVertexInputState {
|
|
|
|
DxvkBufferBinding indexBuffer;
|
2017-12-07 14:01:17 +01:00
|
|
|
VkIndexType indexType = VK_INDEX_TYPE_UINT32;
|
|
|
|
|
2017-11-20 13:21:27 +01:00
|
|
|
std::array<DxvkBufferBinding,
|
|
|
|
DxvkLimits::MaxNumVertexBindings> vertexBuffers;
|
2017-12-07 21:47:38 +01:00
|
|
|
std::array<uint32_t,
|
|
|
|
DxvkLimits::MaxNumVertexBindings> vertexStrides;
|
2017-11-18 10:42:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-11-20 13:21:27 +01:00
|
|
|
struct DxvkViewportState {
|
|
|
|
uint32_t viewportCount = 0;
|
|
|
|
std::array<VkViewport, DxvkLimits::MaxNumViewports> viewports;
|
|
|
|
std::array<VkRect2D, DxvkLimits::MaxNumViewports> scissorRects;
|
2017-11-18 10:42:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-11-17 19:49:44 +01:00
|
|
|
struct DxvkOutputMergerState {
|
2017-12-08 00:02:43 +01:00
|
|
|
uint32_t sampleMask = 0xFFFFFFFFu;
|
2017-11-17 19:49:44 +01:00
|
|
|
Rc<DxvkFramebuffer> framebuffer;
|
2017-12-08 00:51:10 +01:00
|
|
|
|
|
|
|
std::array<DxvkBlendMode, DxvkLimits::MaxNumRenderTargets> blendModes;
|
2017-10-13 03:19:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-12-07 09:38:31 +01:00
|
|
|
struct DxvkShaderStage {
|
|
|
|
Rc<DxvkShader> shader;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct DxvkGraphicsPipelineState {
|
|
|
|
DxvkShaderStage vs;
|
|
|
|
DxvkShaderStage tcs;
|
|
|
|
DxvkShaderStage tes;
|
|
|
|
DxvkShaderStage gs;
|
|
|
|
DxvkShaderStage fs;
|
|
|
|
|
|
|
|
Rc<DxvkGraphicsPipeline> pipeline;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct DxvkComputePipelineState {
|
|
|
|
DxvkShaderStage cs;
|
|
|
|
Rc<DxvkComputePipeline> pipeline;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-10-13 03:19:23 +02:00
|
|
|
/**
|
2017-11-17 19:49:44 +01:00
|
|
|
* \brief Pipeline state
|
2017-10-13 03:19:23 +02:00
|
|
|
*
|
2017-11-17 19:49:44 +01:00
|
|
|
* Stores all bound shaders, resources,
|
|
|
|
* and constant pipeline state objects.
|
2017-10-13 03:19:23 +02:00
|
|
|
*/
|
2017-10-11 23:29:05 +02:00
|
|
|
struct DxvkContextState {
|
2017-12-08 00:02:43 +01:00
|
|
|
DxvkInputAssemblyState ia;
|
2017-12-08 00:44:58 +01:00
|
|
|
DxvkInputLayout il;
|
2017-12-08 00:02:43 +01:00
|
|
|
DxvkRasterizerState rs;
|
|
|
|
DxvkMultisampleState ms;
|
|
|
|
DxvkDepthStencilState ds;
|
2017-12-08 00:51:10 +01:00
|
|
|
DxvkLogicOpState lo;
|
2017-12-08 00:02:43 +01:00
|
|
|
|
2017-11-18 10:42:27 +01:00
|
|
|
DxvkVertexInputState vi;
|
2017-11-20 13:21:27 +01:00
|
|
|
DxvkViewportState vp;
|
2017-11-17 19:49:44 +01:00
|
|
|
DxvkOutputMergerState om;
|
2017-11-20 13:21:27 +01:00
|
|
|
DxvkConstantStateObjects co;
|
2017-11-17 19:49:44 +01:00
|
|
|
|
2017-12-07 09:38:31 +01:00
|
|
|
DxvkGraphicsPipelineState gp;
|
|
|
|
DxvkComputePipelineState cp;
|
2017-10-11 23:29:05 +02:00
|
|
|
};
|
2017-10-10 23:32:13 +02:00
|
|
|
|
|
|
|
}
|