mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/graphicsdriver/directx: reduce unnecessary settings of pipelines
This commit is contained in:
parent
c22957f678
commit
f23dd72fb4
@ -285,6 +285,14 @@ func (p *pipelineStates) drawTriangles(device *_ID3D12Device, commandList *_ID3D
|
|||||||
}
|
}
|
||||||
commandList.SetGraphicsRootDescriptorTable(2, sh)
|
commandList.SetGraphicsRootDescriptorTable(2, sh)
|
||||||
|
|
||||||
|
if !evenOdd {
|
||||||
|
s, err := shader.pipelineState(blend, noStencil, screen)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
commandList.SetPipelineState(s)
|
||||||
|
}
|
||||||
|
|
||||||
for _, dstRegion := range dstRegions {
|
for _, dstRegion := range dstRegions {
|
||||||
commandList.RSSetScissorRects([]_D3D12_RECT{
|
commandList.RSSetScissorRects([]_D3D12_RECT{
|
||||||
{
|
{
|
||||||
@ -309,11 +317,6 @@ func (p *pipelineStates) drawTriangles(device *_ID3D12Device, commandList *_ID3D
|
|||||||
commandList.SetPipelineState(s)
|
commandList.SetPipelineState(s)
|
||||||
commandList.DrawIndexedInstanced(uint32(dstRegion.IndexCount), 1, uint32(indexOffset), 0, 0)
|
commandList.DrawIndexedInstanced(uint32(dstRegion.IndexCount), 1, uint32(indexOffset), 0, 0)
|
||||||
} else {
|
} else {
|
||||||
s, err := shader.pipelineState(blend, noStencil, screen)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
commandList.SetPipelineState(s)
|
|
||||||
commandList.DrawIndexedInstanced(uint32(dstRegion.IndexCount), 1, uint32(indexOffset), 0, 0)
|
commandList.DrawIndexedInstanced(uint32(dstRegion.IndexCount), 1, uint32(indexOffset), 0, 0)
|
||||||
}
|
}
|
||||||
indexOffset += dstRegion.IndexCount
|
indexOffset += dstRegion.IndexCount
|
||||||
|
Loading…
Reference in New Issue
Block a user