2017-10-11 23:28:06 +02:00
|
|
|
#pragma once
|
|
|
|
|
2017-10-14 13:44:38 +02:00
|
|
|
#include <vector>
|
|
|
|
|
2017-10-11 23:28:06 +02:00
|
|
|
#include "dxvk_include.h"
|
|
|
|
|
2017-10-18 09:50:30 +02:00
|
|
|
#include "../spirv/spirv_code_buffer.h"
|
2017-10-11 23:28:06 +02:00
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
2017-10-14 13:44:38 +02:00
|
|
|
/**
|
|
|
|
* \brief Shader resource type
|
|
|
|
*
|
|
|
|
* Enumerates the types of resources
|
|
|
|
* that can be accessed by shaders.
|
|
|
|
*/
|
|
|
|
enum class DxvkResourceType : uint32_t {
|
2017-11-18 10:42:27 +01:00
|
|
|
ImageSampler = VK_DESCRIPTOR_TYPE_SAMPLER,
|
|
|
|
SampledImage = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
|
|
|
|
StorageImage = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
|
|
|
|
UniformBuffer = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
|
|
|
|
StorageBuffer = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
|
|
|
|
UniformTexelBuffer = VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER,
|
|
|
|
StorageTexelBuffer = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER,
|
2017-10-14 13:44:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-10-11 23:28:06 +02:00
|
|
|
/**
|
|
|
|
* \brief Shader module
|
|
|
|
*
|
|
|
|
* Manages a Vulkan shader module. This will not
|
|
|
|
* perform any sort of shader compilation. Instead,
|
|
|
|
* the context will create pipeline objects on the
|
|
|
|
* fly when executing draw calls.
|
|
|
|
*/
|
|
|
|
class DxvkShader : public RcObject {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
DxvkShader(
|
2017-10-14 23:52:47 +02:00
|
|
|
VkShaderStageFlagBits stage,
|
2017-11-18 10:42:27 +01:00
|
|
|
SpirvCodeBuffer&& code);
|
2017-10-11 23:28:06 +02:00
|
|
|
~DxvkShader();
|
|
|
|
|
|
|
|
/**
|
2017-10-14 23:52:47 +02:00
|
|
|
* \brief Retrieves shader code
|
2017-11-18 10:42:27 +01:00
|
|
|
* \returns Shader code buffer
|
2017-10-11 23:28:06 +02:00
|
|
|
*/
|
2017-11-18 10:42:27 +01:00
|
|
|
const SpirvCodeBuffer& code() const {
|
|
|
|
return m_code;
|
|
|
|
}
|
2017-10-11 23:28:06 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2017-10-14 23:52:47 +02:00
|
|
|
VkShaderStageFlagBits m_stage;
|
2017-10-18 10:36:47 +02:00
|
|
|
SpirvCodeBuffer m_code;
|
2017-10-14 23:52:47 +02:00
|
|
|
|
2017-10-11 23:28:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|