diff --git a/code/renderer/hlsl/clear.hlsl b/code/renderer/hlsl/clear.hlsl index 8aceff6..10f55f7 100644 --- a/code/renderer/hlsl/clear.hlsl +++ b/code/renderer/hlsl/clear.hlsl @@ -28,8 +28,8 @@ struct VOut VOut vs_main(uint id : SV_VertexID) { VOut output; - output.position.x = -1.0 + 2.0 * (float)(id / 2); - output.position.y = -1.0 + 2.0 * (float)(id % 2); + output.position.x = (float)(id / 2) * 4.0 - 1.0; + output.position.y = (float)(id % 2) * 4.0 - 1.0; output.position.z = 1.0; output.position.w = 1.0; diff --git a/code/renderer/tr_backend_d3d11.cpp b/code/renderer/tr_backend_d3d11.cpp index 29936c7..11969a3 100644 --- a/code/renderer/tr_backend_d3d11.cpp +++ b/code/renderer/tr_backend_d3d11.cpp @@ -357,8 +357,6 @@ struct Direct3D ID3D11RasterizerState* rasterStates[12]; int rasterStateIndex; - D3D11_PRIMITIVE_TOPOLOGY topology; - Pipeline pipelines[PID_COUNT]; PipelineId pipelineIndex; @@ -798,17 +796,6 @@ static void ApplySamplerState(UINT slot, textureWrap_t textureWrap, TextureMode d3d.samplerStateIndices[slot] = index; } -static void ApplyPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY topology) -{ - if(topology == d3d.topology) - { - return; - } - - d3ds.context->IASetPrimitiveTopology(topology); - d3d.topology = topology; -} - static void DrawIndexed(int indexCount) { if(d3d.splitBufferOffsets) @@ -842,12 +829,6 @@ static void ApplyPipeline(PipelineId index) index = PID_POST_PROCESS; } - const D3D11_PRIMITIVE_TOPOLOGY topology = - index == PID_CLEAR ? - D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP : - D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; - ApplyPrimitiveTopology(topology); - Pipeline* const pipeline = &d3d.pipelines[index]; if(pipeline->inputLayout) { @@ -1438,7 +1419,6 @@ static qbool GAL_Init() D3D11_CreateInputLayout(genericInputLayoutDesc, ARRAY_LEN(genericInputLayoutDesc), g_generic_vs, ARRAY_LEN(g_generic_vs), &d3d.pipelines[PID_GENERIC].inputLayout, "generic input layout"); d3ds.context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); - d3d.topology = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; const int maxVertexCount = SHADER_MAX_VERTEXES; const int maxIndexCount = SHADER_MAX_INDEXES; @@ -2638,7 +2618,7 @@ static void ClearViews(qbool shouldClearColor, const FLOAT* clearColor) d3d.clearPSData.color[2] = clearColor[2]; d3d.clearPSData.color[3] = shouldClearColor ? 1.0f : 0.0f; UploadPendingShaderData(); - d3ds.context->Draw(4, 0); + d3ds.context->Draw(3, 0); ApplyPipeline(PID_GENERIC); } }