1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-02 04:29:14 +01:00

[dxvk] Template Index parameter of commitGraphicsState

This is always constant anyway, so avoid some unnecessary code.
This commit is contained in:
Philip Rebohle 2019-07-14 19:57:50 +02:00
parent 8dfdda7a39
commit def05f007c
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 13 additions and 10 deletions

View File

@ -1493,7 +1493,7 @@ namespace dxvk {
uint32_t instanceCount, uint32_t instanceCount,
uint32_t firstVertex, uint32_t firstVertex,
uint32_t firstInstance) { uint32_t firstInstance) {
this->commitGraphicsState(false); this->commitGraphicsState<false>();
if (m_gpActivePipeline) { if (m_gpActivePipeline) {
m_cmd->cmdDraw( m_cmd->cmdDraw(
@ -1511,7 +1511,7 @@ namespace dxvk {
VkDeviceSize offset, VkDeviceSize offset,
uint32_t count, uint32_t count,
uint32_t stride) { uint32_t stride) {
this->commitGraphicsState(false); this->commitGraphicsState<false>();
if (m_gpActivePipeline) { if (m_gpActivePipeline) {
auto descriptor = m_state.id.argBuffer.getDescriptor(); auto descriptor = m_state.id.argBuffer.getDescriptor();
@ -1534,7 +1534,7 @@ namespace dxvk {
VkDeviceSize countOffset, VkDeviceSize countOffset,
uint32_t maxCount, uint32_t maxCount,
uint32_t stride) { uint32_t stride) {
this->commitGraphicsState(false); this->commitGraphicsState<false>();
if (m_gpActivePipeline) { if (m_gpActivePipeline) {
auto argDescriptor = m_state.id.argBuffer.getDescriptor(); auto argDescriptor = m_state.id.argBuffer.getDescriptor();
@ -1561,7 +1561,7 @@ namespace dxvk {
uint32_t firstIndex, uint32_t firstIndex,
uint32_t vertexOffset, uint32_t vertexOffset,
uint32_t firstInstance) { uint32_t firstInstance) {
this->commitGraphicsState(true); this->commitGraphicsState<true>();
if (m_gpActivePipeline) { if (m_gpActivePipeline) {
m_cmd->cmdDrawIndexed( m_cmd->cmdDrawIndexed(
@ -1580,7 +1580,7 @@ namespace dxvk {
VkDeviceSize offset, VkDeviceSize offset,
uint32_t count, uint32_t count,
uint32_t stride) { uint32_t stride) {
this->commitGraphicsState(true); this->commitGraphicsState<true>();
if (m_gpActivePipeline) { if (m_gpActivePipeline) {
auto descriptor = m_state.id.argBuffer.getDescriptor(); auto descriptor = m_state.id.argBuffer.getDescriptor();
@ -1603,7 +1603,7 @@ namespace dxvk {
VkDeviceSize countOffset, VkDeviceSize countOffset,
uint32_t maxCount, uint32_t maxCount,
uint32_t stride) { uint32_t stride) {
this->commitGraphicsState(true); this->commitGraphicsState<true>();
if (m_gpActivePipeline) { if (m_gpActivePipeline) {
auto argDescriptor = m_state.id.argBuffer.getDescriptor(); auto argDescriptor = m_state.id.argBuffer.getDescriptor();
@ -1628,7 +1628,7 @@ namespace dxvk {
const DxvkBufferSlice& counterBuffer, const DxvkBufferSlice& counterBuffer,
uint32_t counterDivisor, uint32_t counterDivisor,
uint32_t counterBias) { uint32_t counterBias) {
this->commitGraphicsState(false); this->commitGraphicsState<false>();
if (m_gpActivePipeline) { if (m_gpActivePipeline) {
auto physSlice = counterBuffer.getSliceHandle(); auto physSlice = counterBuffer.getSliceHandle();
@ -4045,7 +4045,8 @@ namespace dxvk {
} }
void DxvkContext::commitGraphicsState(bool indexed) { template<bool Indexed>
void DxvkContext::commitGraphicsState() {
if (m_flags.test(DxvkContextFlag::GpDirtyFramebuffer)) if (m_flags.test(DxvkContextFlag::GpDirtyFramebuffer))
this->updateFramebuffer(); this->updateFramebuffer();
@ -4055,7 +4056,7 @@ namespace dxvk {
if (m_flags.test(DxvkContextFlag::GpDirtyPipeline)) if (m_flags.test(DxvkContextFlag::GpDirtyPipeline))
this->updateGraphicsPipeline(); this->updateGraphicsPipeline();
if (m_flags.test(DxvkContextFlag::GpDirtyIndexBuffer) && indexed) if (m_flags.test(DxvkContextFlag::GpDirtyIndexBuffer) && Indexed)
this->updateIndexBufferBinding(); this->updateIndexBufferBinding();
if (m_flags.test(DxvkContextFlag::GpDirtyVertexBuffers)) if (m_flags.test(DxvkContextFlag::GpDirtyVertexBuffers))

View File

@ -1155,7 +1155,9 @@ namespace dxvk {
VkPipelineBindPoint bindPoint); VkPipelineBindPoint bindPoint);
void commitComputeState(); void commitComputeState();
void commitGraphicsState(bool indexed);
template<bool Indexed>
void commitGraphicsState();
void commitComputeInitBarriers(); void commitComputeInitBarriers();
void commitComputePostBarriers(); void commitComputePostBarriers();