mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Fixed build.
This commit is contained in:
@@ -2095,7 +2095,7 @@ namespace bgfx { namespace d3d11
|
||||
deviceCtx->PSSetConstantBuffers(0, 1, &program.m_fsh->m_buffer);
|
||||
|
||||
VertexBufferD3D11& vb = m_vertexBuffers[_blitter.m_vb->handle.idx];
|
||||
VertexLayout& layout = m_vertexLayouts[_blitter.m_vb->layout.idx];
|
||||
VertexLayout& layout = m_vertexLayouts[_blitter.m_vb->layoutHandle.idx];
|
||||
uint32_t stride = layout.m_stride;
|
||||
uint32_t offset = 0;
|
||||
deviceCtx->IASetVertexBuffers(0, 1, &vb.m_ptr, &stride, &offset);
|
||||
@@ -2589,8 +2589,8 @@ namespace bgfx { namespace d3d11
|
||||
}
|
||||
uint64_t layoutHash = (uint64_t(_program.m_vsh->m_hash)<<32) | murmur.end();
|
||||
|
||||
ID3D11InputLayout* layout = m_inputLayoutCache.find(layoutHash);
|
||||
if (NULL == layout)
|
||||
ID3D11InputLayout* inputLayout = m_inputLayoutCache.find(layoutHash);
|
||||
if (NULL == inputLayout)
|
||||
{
|
||||
D3D11_INPUT_ELEMENT_DESC vertexElements[Attrib::Count+1+BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT];
|
||||
D3D11_INPUT_ELEMENT_DESC* elem = vertexElements;
|
||||
@@ -2660,12 +2660,12 @@ namespace bgfx { namespace d3d11
|
||||
, num
|
||||
, _program.m_vsh->m_code->data
|
||||
, _program.m_vsh->m_code->size
|
||||
, &layout
|
||||
, &inputLayout
|
||||
) );
|
||||
m_inputLayoutCache.add(layoutHash, layout);
|
||||
m_inputLayoutCache.add(layoutHash, inputLayout);
|
||||
}
|
||||
|
||||
m_deviceCtx->IASetInputLayout(layout);
|
||||
m_deviceCtx->IASetInputLayout(inputLayout);
|
||||
}
|
||||
|
||||
void setInputLayout(const VertexLayout& _layout, const ProgramD3D11& _program, uint16_t _numInstanceData)
|
||||
@@ -3829,7 +3829,7 @@ namespace bgfx { namespace d3d11
|
||||
|
||||
void VertexBufferD3D11::create(uint32_t _size, void* _data, VertexLayoutHandle _layoutHandle, uint16_t _flags)
|
||||
{
|
||||
m_layout = _layoutHandle;
|
||||
m_layoutHandle = _layoutHandle;
|
||||
uint16_t stride = isValid(_layoutHandle)
|
||||
? s_renderD3D11->m_vertexLayouts[_layoutHandle.idx].m_stride
|
||||
: 0
|
||||
@@ -5893,16 +5893,16 @@ namespace bgfx { namespace d3d11
|
||||
streamMask >>= ntz;
|
||||
idx += ntz;
|
||||
|
||||
currentState.m_stream[idx].m_layout = draw.m_stream[idx].m_layout;
|
||||
currentState.m_stream[idx].m_handle = draw.m_stream[idx].m_handle;
|
||||
currentState.m_stream[idx].m_startVertex = draw.m_stream[idx].m_startVertex;
|
||||
currentState.m_stream[idx].m_layoutHandle = draw.m_stream[idx].m_layoutHandle;
|
||||
currentState.m_stream[idx].m_handle = draw.m_stream[idx].m_handle;
|
||||
currentState.m_stream[idx].m_startVertex = draw.m_stream[idx].m_startVertex;
|
||||
|
||||
const uint16_t handle = draw.m_stream[idx].m_handle.idx;
|
||||
const VertexBufferD3D11& vb = m_vertexBuffers[handle];
|
||||
const uint16_t decl = isValid(draw.m_stream[idx].m_layout)
|
||||
? draw.m_stream[idx].m_layout.idx
|
||||
: vb.m_layout.idx;
|
||||
const VertexLayout& layout = m_vertexLayouts[decl];
|
||||
const uint16_t layoutIdx = isValid(draw.m_stream[idx].m_layoutHandle)
|
||||
? draw.m_stream[idx].m_layoutHandle.idx
|
||||
: vb.m_layoutHandle.idx;
|
||||
const VertexLayout& layout = m_vertexLayouts[layoutIdx];
|
||||
const uint32_t stride = layout.m_stride;
|
||||
|
||||
buffers[numStreams] = vb.m_ptr;
|
||||
|
||||
@@ -1954,7 +1954,7 @@ namespace bgfx { namespace d3d12
|
||||
| BGFX_STATE_DEPTH_TEST_ALWAYS
|
||||
;
|
||||
|
||||
const VertexLayout* layouts[1] = { &m_vertexLayouts[_blitter.m_vb->layout.idx] };
|
||||
const VertexLayout* layouts[1] = { &m_vertexLayouts[_blitter.m_vb->layoutHandle.idx] };
|
||||
ID3D12PipelineState* pso = getPipelineState(state
|
||||
, packStencil(BGFX_STENCIL_DEFAULT, BGFX_STENCIL_DEFAULT)
|
||||
, 1
|
||||
@@ -1992,8 +1992,8 @@ namespace bgfx { namespace d3d12
|
||||
scratchBuffer.allocSrv(srvHandle, texture);
|
||||
m_commandList->SetGraphicsRootDescriptorTable(Rdt::SRV, srvHandle);
|
||||
|
||||
VertexBufferD3D12& vb = m_vertexBuffers[_blitter.m_vb->handle.idx];
|
||||
const VertexLayout& layout = m_vertexLayouts[_blitter.m_vb->layout.idx];
|
||||
VertexBufferD3D12& vb = m_vertexBuffers[_blitter.m_vb->handle.idx];
|
||||
const VertexLayout& layout = m_vertexLayouts[_blitter.m_vb->layoutHandle.idx];
|
||||
D3D12_VERTEX_BUFFER_VIEW viewDesc;
|
||||
viewDesc.BufferLocation = vb.m_gpuVA;
|
||||
viewDesc.StrideInBytes = layout.m_stride;
|
||||
@@ -3970,8 +3970,8 @@ namespace bgfx { namespace d3d12
|
||||
VertexBufferD3D12& vb = s_renderD3D12->m_vertexBuffers[handle];
|
||||
vb.setState(_commandList, D3D12_RESOURCE_STATE_GENERIC_READ);
|
||||
|
||||
uint16_t decl = !isValid(vb.m_layout) ? stream.m_layout.idx : vb.m_layout.idx;
|
||||
const VertexLayout& layout = s_renderD3D12->m_vertexLayouts[decl];
|
||||
const uint16_t layoutIdx = !isValid(vb.m_layoutHandle) ? stream.m_layoutHandle.idx : vb.m_layoutHandle.idx;
|
||||
const VertexLayout& layout = s_renderD3D12->m_vertexLayouts[layoutIdx];
|
||||
uint32_t stride = layout.m_stride;
|
||||
|
||||
D3D12_VERTEX_BUFFER_VIEW& vbv = _vbv[numStreams];
|
||||
@@ -4445,7 +4445,7 @@ namespace bgfx { namespace d3d12
|
||||
void VertexBufferD3D12::create(uint32_t _size, void* _data, VertexLayoutHandle _layoutHandle, uint16_t _flags)
|
||||
{
|
||||
BufferD3D12::create(_size, _data, _flags, true);
|
||||
m_layout = _layoutHandle;
|
||||
m_layoutHandle = _layoutHandle;
|
||||
}
|
||||
|
||||
void ShaderD3D12::create(const Memory* _mem)
|
||||
@@ -6268,16 +6268,16 @@ namespace bgfx { namespace d3d12
|
||||
streamMask >>= ntz;
|
||||
idx += ntz;
|
||||
|
||||
currentState.m_stream[idx].m_layout = draw.m_stream[idx].m_layout;
|
||||
currentState.m_stream[idx].m_handle = draw.m_stream[idx].m_handle;
|
||||
currentState.m_stream[idx].m_startVertex = draw.m_stream[idx].m_startVertex;
|
||||
currentState.m_stream[idx].m_layoutHandle = draw.m_stream[idx].m_layoutHandle;
|
||||
currentState.m_stream[idx].m_handle = draw.m_stream[idx].m_handle;
|
||||
currentState.m_stream[idx].m_startVertex = draw.m_stream[idx].m_startVertex;
|
||||
|
||||
uint16_t handle = draw.m_stream[idx].m_handle.idx;
|
||||
const VertexBufferD3D12& vb = m_vertexBuffers[handle];
|
||||
const uint16_t decl = isValid(draw.m_stream[idx].m_layout)
|
||||
? draw.m_stream[idx].m_layout.idx
|
||||
: vb.m_layout.idx;
|
||||
const VertexLayout& layout = m_vertexLayouts[decl];
|
||||
const uint16_t layoutIdx = isValid(draw.m_stream[idx].m_layoutHandle)
|
||||
? draw.m_stream[idx].m_layoutHandle.idx
|
||||
: vb.m_layoutHandle.idx;
|
||||
const VertexLayout& layout = m_vertexLayouts[layoutIdx];
|
||||
|
||||
layouts[numStreams] = &layout;
|
||||
}
|
||||
|
||||
@@ -1373,7 +1373,7 @@ namespace bgfx { namespace d3d9
|
||||
DX_CHECK(device->SetPixelShader(program.m_fsh->m_pixelShader) );
|
||||
|
||||
VertexBufferD3D9& vb = m_vertexBuffers[_blitter.m_vb->handle.idx];
|
||||
VertexLayout& layout = m_vertexLayouts[_blitter.m_vb->layout.idx];
|
||||
VertexLayout& layout = m_vertexLayouts[_blitter.m_vb->layoutHandle.idx];
|
||||
DX_CHECK(device->SetStreamSource(0, vb.m_ptr, 0, layout.m_stride) );
|
||||
setInputLayout(layout, 0);
|
||||
|
||||
@@ -2344,7 +2344,7 @@ namespace bgfx { namespace d3d9
|
||||
void VertexBufferD3D9::create(uint32_t _size, void* _data, VertexLayoutHandle _layoutHandle)
|
||||
{
|
||||
m_size = _size;
|
||||
m_layout = _layoutHandle;
|
||||
m_layoutHandle = _layoutHandle;
|
||||
|
||||
uint32_t usage = D3DUSAGE_WRITEONLY;
|
||||
D3DPOOL pool = s_renderD3D9->m_pool;
|
||||
@@ -4237,16 +4237,16 @@ namespace bgfx { namespace d3d9
|
||||
streamMask >>= ntz;
|
||||
idx += ntz;
|
||||
|
||||
currentState.m_stream[idx].m_layout = draw.m_stream[idx].m_layout;
|
||||
currentState.m_stream[idx].m_handle = draw.m_stream[idx].m_handle;
|
||||
currentState.m_stream[idx].m_startVertex = draw.m_stream[idx].m_startVertex;
|
||||
currentState.m_stream[idx].m_layoutHandle = draw.m_stream[idx].m_layoutHandle;
|
||||
currentState.m_stream[idx].m_handle = draw.m_stream[idx].m_handle;
|
||||
currentState.m_stream[idx].m_startVertex = draw.m_stream[idx].m_startVertex;
|
||||
|
||||
const uint16_t handle = draw.m_stream[idx].m_handle.idx;
|
||||
const VertexBufferD3D9& vb = m_vertexBuffers[handle];
|
||||
const uint16_t decl = isValid(draw.m_stream[idx].m_layout)
|
||||
? draw.m_stream[idx].m_layout.idx
|
||||
: vb.m_layout.idx;
|
||||
const VertexLayout& layout = m_vertexLayouts[decl];
|
||||
const uint16_t layoutIdx = isValid(draw.m_stream[idx].m_layoutHandle)
|
||||
? draw.m_stream[idx].m_layoutHandle.idx
|
||||
: vb.m_layoutHandle.idx;
|
||||
const VertexLayout& layout = m_vertexLayouts[layoutIdx];
|
||||
const uint32_t stride = layout.m_stride;
|
||||
|
||||
layouts[numStreams] = &layout;
|
||||
|
||||
Reference in New Issue
Block a user