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 {
|
2018-02-01 20:15:25 +01:00
|
|
|
GpRenderPassBound, ///< Render pass is currently bound
|
|
|
|
GpDirtyPipeline, ///< Graphics pipeline binding is out of date
|
|
|
|
GpDirtyPipelineState, ///< Graphics pipeline needs to be recompiled
|
|
|
|
GpDirtyResources, ///< Graphics pipeline resource bindings are out of date
|
|
|
|
GpDirtyVertexBuffers, ///< Vertex buffer bindings are out of date
|
|
|
|
GpDirtyIndexBuffer, ///< Index buffer binding are out of date
|
|
|
|
GpEmulateInstanceFetchRate, ///< The current input layout uses fetch rates != 1
|
2017-11-17 19:49:44 +01:00
|
|
|
|
2018-02-01 20:15:25 +01:00
|
|
|
CpDirtyPipeline, ///< Compute pipeline binding are out of date
|
|
|
|
CpDirtyPipelineState, ///< Compute pipeline needs to be recompiled
|
|
|
|
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 {
|
2017-12-14 15:24:43 +01:00
|
|
|
DxvkBufferSlice indexBuffer;
|
2018-02-01 13:29:57 +01:00
|
|
|
VkIndexType indexType = VK_INDEX_TYPE_UINT32;
|
|
|
|
uint32_t bindingMask = 0;
|
2017-12-07 14:01:17 +01:00
|
|
|
|
2017-12-14 15:24:43 +01:00
|
|
|
std::array<DxvkBufferSlice,
|
2018-02-01 20:15:25 +01:00
|
|
|
DxvkLimits::MaxNumVertexBindings> vertexBuffers = { };
|
2017-12-07 21:47:38 +01:00
|
|
|
std::array<uint32_t,
|
2018-02-01 20:15:25 +01:00
|
|
|
DxvkLimits::MaxNumVertexBindings> vertexStrides = { };
|
|
|
|
std::array<uint32_t,
|
|
|
|
DxvkLimits::MaxNumVertexBindings> vertexFetchRates = { };
|
2017-11-18 10:42:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-11-20 13:21:27 +01:00
|
|
|
struct DxvkViewportState {
|
2018-02-01 20:15:25 +01:00
|
|
|
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 {
|
2018-01-10 20:40:10 +01:00
|
|
|
Rc<DxvkFramebuffer> framebuffer;
|
2017-12-08 00:51:10 +01:00
|
|
|
|
2018-02-01 20:15:25 +01:00
|
|
|
DxvkBlendConstants blendConstants = { 0.0f, 0.0f, 0.0f, 0.0f };
|
|
|
|
uint32_t stencilReference = 0;
|
2017-10-13 03:19:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-12-07 09:38:31 +01:00
|
|
|
struct DxvkShaderStage {
|
|
|
|
Rc<DxvkShader> shader;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct DxvkGraphicsPipelineState {
|
2018-01-10 11:44:40 +01:00
|
|
|
DxvkShaderStage vs;
|
|
|
|
DxvkShaderStage tcs;
|
|
|
|
DxvkShaderStage tes;
|
|
|
|
DxvkShaderStage gs;
|
|
|
|
DxvkShaderStage fs;
|
2018-02-01 20:15:25 +01:00
|
|
|
|
2018-01-10 20:40:10 +01:00
|
|
|
DxvkGraphicsPipelineStateInfo state;
|
2018-02-01 20:15:25 +01:00
|
|
|
Rc<DxvkGraphicsPipeline> pipeline;
|
2017-12-07 09:38:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct DxvkComputePipelineState {
|
2018-01-10 11:44:40 +01:00
|
|
|
DxvkBindingState bs;
|
2017-12-07 09:38:31 +01:00
|
|
|
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 01:06:48 +01:00
|
|
|
DxvkVertexInputState vi;
|
|
|
|
DxvkViewportState vp;
|
2017-11-17 19:49:44 +01:00
|
|
|
DxvkOutputMergerState om;
|
|
|
|
|
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
|
|
|
|
|
|
|
}
|