sampler refactor - complete

This commit is contained in:
turanszkij
2016-01-31 13:21:59 +01:00
parent 6acb1ec2c6
commit 17db53ed45
4 changed files with 10 additions and 11 deletions
-1
View File
@@ -1,7 +1,6 @@
#include "pointLightHF.hlsli"
Texture2D<float4> xTextureTex:register(t0);
SamplerState texSampler:register(s0);
struct VertextoPixel
{
-1
View File
@@ -2,7 +2,6 @@
#include "effectHF_VS.hlsli"
Texture2D noiseTex:register(t0);
SamplerState texSampler:register(s0);
PixelInputType main(Input input)
{
+9 -8
View File
@@ -33,7 +33,7 @@ bool wiRenderer::DX11 = false,wiRenderer::VSYNC=true,wiRenderer::DEFERREDCONTEXT
DeviceContext wiRenderer::deferredContexts[];
CommandList wiRenderer::commandLists[];
mutex wiRenderer::graphicsMutex;
Sampler wiRenderer::samplers[SSLOT_COUNT_PERSISTENT];
Sampler wiRenderer::samplers[SSLOT_COUNT];
map<DeviceContext,long> wiRenderer::drawCalls;
BufferResource wiRenderer::constantBuffers[CBTYPE_LAST];
@@ -1079,14 +1079,15 @@ void wiRenderer::SetUpStates()
Lock();
{
for (int i = 0; i < SSLOT_COUNT_PERSISTENT; ++i)
for (int i = 0; i < SSLOT_COUNT; ++i)
{
int slot = i + SSLOT_COUNT_ONDEMAND;
BindSamplerPS(samplers[i], slot, immediateContext);
BindSamplerVS(samplers[i], slot, immediateContext);
BindSamplerGS(samplers[i], slot, immediateContext);
BindSamplerDS(samplers[i], slot, immediateContext);
BindSamplerHS(samplers[i], slot, immediateContext);
if (samplers[i] == nullptr)
continue;
BindSamplerPS(samplers[i], i, immediateContext);
BindSamplerVS(samplers[i], i, immediateContext);
BindSamplerGS(samplers[i], i, immediateContext);
BindSamplerDS(samplers[i], i, immediateContext);
BindSamplerHS(samplers[i], i, immediateContext);
}
}
Unlock();
+1 -1
View File
@@ -81,7 +81,7 @@ public:
inline static void Lock(){ graphicsMutex.lock(); }
inline static void Unlock(){ graphicsMutex.unlock(); }
static Sampler samplers[SSLOT_COUNT_PERSISTENT];
static Sampler samplers[SSLOT_COUNT];
static int SCREENWIDTH,SCREENHEIGHT;