Code: Alles auswählen
template<unsigned PartialStateMask, class shaderT,
void (_stdcall Direct3D::DeviceContext::*SetShaderP)(shaderT*, Direct3D::ClassInstance* const *, UINT),
void (_stdcall Direct3D::DeviceContext::*GetShaderP)(shaderT**, Direct3D::ClassInstance**, UINT*),
void (_stdcall Direct3D::DeviceContext::*SetConstantBuffersP)(UINT, UINT, Direct3D::Buffer* const *),
void (_stdcall Direct3D::DeviceContext::*GetConstantBuffersP)(UINT, UINT, Direct3D::Buffer**),
void (_stdcall Direct3D::DeviceContext::*SetShaderResourcesP)(UINT, UINT, Direct3D::ShaderResourceView* const *),
void (_stdcall Direct3D::DeviceContext::*GetShaderResourcesP)(UINT, UINT, Direct3D::ShaderResourceView**),
void (_stdcall Direct3D::DeviceContext::*SetSamplersP)(UINT, UINT, Direct3D::SamplerState* const *),
void (_stdcall Direct3D::DeviceContext::*GetSamplersP)(UINT, UINT, Direct3D::SamplerState**)>
class ShaderStageTraits {
// snip
};
typedef ShaderStageTraits<StateMask::VertexShader, Direct3D::VertexShader, &Direct3D::DeviceContext::VSSetShader, &Direct3D::DeviceContext::VSGetShader,
&Direct3D::DeviceContext::VSSetConstantBuffers, &Direct3D::DeviceContext::VSGetConstantBuffers,
&Direct3D::DeviceContext::VSSetShaderResources, &Direct3D::DeviceContext::VSGetShaderResources,
&Direct3D::DeviceContext::VSSetSamplers, &Direct3D::DeviceContext::VSGetSamplers>
VertexShaderStage;
// snip
template<class ShaderStage>
class ShaderStageStateManager {
// snip
};
typedef ShaderStageStateManager<VertexShaderStage> VertexShaderStageStateManager;
// snip
class StateManager {
VertexShaderStageStateManager vsManager;
PixelShaderStageStateManager psManager;
GeometryShaderStageStateManager gsManager;
HullShaderStageStateManager hsManager;
DomainShaderStageStateManager dsManager;
ComputeShaderStageStateManager csManager;
// snip
};
Edit: Ich glaub die wollen mir was (Bug Report ist draußen):
Eine Ausnahme (erste Chance) des Typs "System.NotImplementedException" ist in Microsoft.VisualStudio.Debugger.Engine.dll aufgetreten.