mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-29 17:52:18 +01:00
[dxvk] DxvkBufferBinding -> DxvkBufferSlice
This commit is contained in:
parent
2ad5f49f3e
commit
40241e0b22
@ -628,12 +628,12 @@ namespace dxvk {
|
||||
binding.stride = pStrides[i];
|
||||
}
|
||||
|
||||
DxvkBufferBinding dxvkBinding;
|
||||
DxvkBufferSlice dxvkBinding;
|
||||
|
||||
if (binding.buffer != nullptr) {
|
||||
Rc<DxvkBuffer> dxvkBuffer = binding.buffer->GetDXVKBuffer();
|
||||
|
||||
dxvkBinding = DxvkBufferBinding(
|
||||
dxvkBinding = DxvkBufferSlice(
|
||||
dxvkBuffer, binding.offset,
|
||||
dxvkBuffer->info().size - binding.offset);
|
||||
}
|
||||
@ -655,12 +655,12 @@ namespace dxvk {
|
||||
binding.format = Format;
|
||||
m_state.ia.indexBuffer = binding;
|
||||
|
||||
DxvkBufferBinding dxvkBinding;
|
||||
DxvkBufferSlice dxvkBinding;
|
||||
|
||||
if (binding.buffer != nullptr) {
|
||||
Rc<DxvkBuffer> dxvkBuffer = binding.buffer->GetDXVKBuffer();
|
||||
|
||||
dxvkBinding = DxvkBufferBinding(
|
||||
dxvkBinding = DxvkBufferSlice(
|
||||
dxvkBuffer, binding.offset,
|
||||
dxvkBuffer->info().size - binding.offset);
|
||||
}
|
||||
@ -1462,10 +1462,10 @@ namespace dxvk {
|
||||
pBindings->at(StartSlot + i) = buffer;
|
||||
|
||||
// Figure out which part of the buffer to bind
|
||||
DxvkBufferBinding bindingInfo;
|
||||
DxvkBufferSlice bindingInfo;
|
||||
|
||||
if (buffer != nullptr) {
|
||||
bindingInfo = DxvkBufferBinding(
|
||||
bindingInfo = DxvkBufferSlice(
|
||||
buffer->GetDXVKBuffer(),
|
||||
0, VK_WHOLE_SIZE);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ namespace dxvk {
|
||||
Rc<DxvkSampler> sampler;
|
||||
Rc<DxvkImageView> imageView;
|
||||
Rc<DxvkBufferView> bufferView;
|
||||
DxvkBufferBinding bufferSlice;
|
||||
DxvkBufferSlice bufferSlice;
|
||||
};
|
||||
|
||||
|
||||
|
@ -157,18 +157,18 @@ namespace dxvk {
|
||||
|
||||
|
||||
/**
|
||||
* \brief Buffer binding
|
||||
* \brief Buffer slice
|
||||
*
|
||||
* Stores the buffer and the sub-range of the buffer
|
||||
* to bind. Bindings are considered equal if all three
|
||||
* parameters are the same.
|
||||
* Stores the buffer and a sub-range of the buffer.
|
||||
* Slices are considered equal if the buffer and
|
||||
* the buffer range are the same.
|
||||
*/
|
||||
class DxvkBufferBinding {
|
||||
class DxvkBufferSlice {
|
||||
|
||||
public:
|
||||
|
||||
DxvkBufferBinding() { }
|
||||
DxvkBufferBinding(
|
||||
DxvkBufferSlice() { }
|
||||
DxvkBufferSlice(
|
||||
const Rc<DxvkBuffer>& buffer,
|
||||
VkDeviceSize rangeOffset,
|
||||
VkDeviceSize rangeLength)
|
||||
@ -202,13 +202,13 @@ namespace dxvk {
|
||||
return info;
|
||||
}
|
||||
|
||||
bool operator == (const DxvkBufferBinding& other) const {
|
||||
bool operator == (const DxvkBufferSlice& other) const {
|
||||
return this->m_buffer == other.m_buffer
|
||||
&& this->m_offset == other.m_offset
|
||||
&& this->m_length == other.m_length;
|
||||
}
|
||||
|
||||
bool operator != (const DxvkBufferBinding& other) const {
|
||||
bool operator != (const DxvkBufferSlice& other) const {
|
||||
return this->m_buffer != other.m_buffer
|
||||
|| this->m_offset != other.m_offset
|
||||
|| this->m_length != other.m_length;
|
||||
|
@ -57,7 +57,7 @@ namespace dxvk {
|
||||
|
||||
|
||||
void DxvkContext::bindIndexBuffer(
|
||||
const DxvkBufferBinding& buffer,
|
||||
const DxvkBufferSlice& buffer,
|
||||
VkIndexType indexType) {
|
||||
if (m_state.vi.indexBuffer != buffer
|
||||
|| m_state.vi.indexType != indexType) {
|
||||
@ -72,7 +72,7 @@ namespace dxvk {
|
||||
void DxvkContext::bindResourceBuffer(
|
||||
VkPipelineBindPoint pipe,
|
||||
uint32_t slot,
|
||||
const DxvkBufferBinding& buffer) {
|
||||
const DxvkBufferSlice& buffer) {
|
||||
auto rc = this->getShaderResourceSlots(pipe);
|
||||
|
||||
if (rc->getShaderResource(slot).bufferSlice != buffer) {
|
||||
@ -186,7 +186,7 @@ namespace dxvk {
|
||||
|
||||
void DxvkContext::bindVertexBuffer(
|
||||
uint32_t binding,
|
||||
const DxvkBufferBinding& buffer,
|
||||
const DxvkBufferSlice& buffer,
|
||||
uint32_t stride) {
|
||||
if (m_state.vi.vertexBuffers.at(binding) != buffer) {
|
||||
m_state.vi.vertexBuffers.at(binding) = buffer;
|
||||
@ -918,7 +918,7 @@ namespace dxvk {
|
||||
m_flags.clr(DxvkContextFlag::GpDirtyVertexBuffers);
|
||||
|
||||
for (uint32_t i = 0; i < m_state.vi.vertexBuffers.size(); i++) {
|
||||
const DxvkBufferBinding vbo = m_state.vi.vertexBuffers.at(i);
|
||||
const DxvkBufferSlice vbo = m_state.vi.vertexBuffers.at(i);
|
||||
|
||||
VkBuffer handle = vbo.bufferHandle();
|
||||
VkDeviceSize offset = vbo.bufferOffset();
|
||||
|
@ -63,7 +63,7 @@ namespace dxvk {
|
||||
* \param [in] indexType Index type
|
||||
*/
|
||||
void bindIndexBuffer(
|
||||
const DxvkBufferBinding& buffer,
|
||||
const DxvkBufferSlice& buffer,
|
||||
VkIndexType indexType);
|
||||
|
||||
/**
|
||||
@ -77,7 +77,7 @@ namespace dxvk {
|
||||
void bindResourceBuffer(
|
||||
VkPipelineBindPoint pipe,
|
||||
uint32_t slot,
|
||||
const DxvkBufferBinding& buffer);
|
||||
const DxvkBufferSlice& buffer);
|
||||
|
||||
/**
|
||||
* \brief Binds texel buffer view
|
||||
@ -140,7 +140,7 @@ namespace dxvk {
|
||||
*/
|
||||
void bindVertexBuffer(
|
||||
uint32_t binding,
|
||||
const DxvkBufferBinding& buffer,
|
||||
const DxvkBufferSlice& buffer,
|
||||
uint32_t stride);
|
||||
|
||||
/**
|
||||
|
@ -37,10 +37,10 @@ namespace dxvk {
|
||||
|
||||
|
||||
struct DxvkVertexInputState {
|
||||
DxvkBufferBinding indexBuffer;
|
||||
VkIndexType indexType = VK_INDEX_TYPE_UINT32;
|
||||
DxvkBufferSlice indexBuffer;
|
||||
VkIndexType indexType = VK_INDEX_TYPE_UINT32;
|
||||
|
||||
std::array<DxvkBufferBinding,
|
||||
std::array<DxvkBufferSlice,
|
||||
DxvkLimits::MaxNumVertexBindings> vertexBuffers;
|
||||
std::array<uint32_t,
|
||||
DxvkLimits::MaxNumVertexBindings> vertexStrides;
|
||||
|
Loading…
x
Reference in New Issue
Block a user