2017-12-08 22:30:41 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "dxbc_common.h"
|
2017-12-18 16:41:05 +01:00
|
|
|
#include "dxbc_enums.h"
|
2017-12-08 22:30:41 +01:00
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Resource type
|
|
|
|
*
|
|
|
|
* The type of a shader resource. Used
|
|
|
|
* to determine the DXVK resource slot.
|
|
|
|
*/
|
|
|
|
enum DxbcBindingType : uint32_t {
|
|
|
|
ConstantBuffer = 0,
|
|
|
|
ShaderResource = 1,
|
|
|
|
ImageSampler = 2,
|
|
|
|
UnorderedAccessView = 3,
|
|
|
|
StreamOutputBuffer = 4,
|
2018-01-11 12:23:55 +01:00
|
|
|
UavCounter = 5,
|
2017-12-08 22:30:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Computes the DXVK resource slot for a binding
|
|
|
|
*
|
|
|
|
* \param [in] shaderStage The target shader stage
|
|
|
|
* \param [in] bindingType Type of the resource
|
|
|
|
* \param [in] bindingIndex Resource binding index
|
|
|
|
* \returns DXVK resource slot index
|
|
|
|
*/
|
|
|
|
uint32_t computeResourceSlotId(
|
|
|
|
DxbcProgramType shaderStage,
|
|
|
|
DxbcBindingType bindingType,
|
|
|
|
uint32_t bindingIndex);
|
|
|
|
|
2017-12-18 16:41:05 +01:00
|
|
|
/**
|
|
|
|
* \brief Primitive vertex count
|
|
|
|
*
|
|
|
|
* Calculates the number of vertices
|
|
|
|
* for a given primitive type.
|
|
|
|
*/
|
|
|
|
uint32_t primitiveVertexCount(
|
|
|
|
DxbcPrimitive primitive);
|
|
|
|
|
2017-12-08 22:30:41 +01:00
|
|
|
}
|