OSDN Git Service

Merge branch 'feature/#36529_SlimDXからSharpDXへの移行' into develop
[dtxmania/dtxmania.git] / SlimDXc_Jun2010(VC++2008) / source / direct3d11 / PixelShaderWrapper11.cpp
diff --git a/SlimDXc_Jun2010(VC++2008)/source/direct3d11/PixelShaderWrapper11.cpp b/SlimDXc_Jun2010(VC++2008)/source/direct3d11/PixelShaderWrapper11.cpp
deleted file mode 100644 (file)
index f78fa02..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/*\r
-* Copyright (c) 2007-2010 SlimDX Group\r
-* \r
-* Permission is hereby granted, free of charge, to any person obtaining a copy\r
-* of this software and associated documentation files (the "Software"), to deal\r
-* in the Software without restriction, including without limitation the rights\r
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-* copies of the Software, and to permit persons to whom the Software is\r
-* furnished to do so, subject to the following conditions:\r
-* \r
-* The above copyright notice and this permission notice shall be included in\r
-* all copies or substantial portions of the Software.\r
-* \r
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-* THE SOFTWARE.\r
-*/\r
-#include "stdafx.h"\r
-\r
-#include "../stack_array.h"\r
-\r
-#include "Buffer11.h"\r
-#include "SamplerState11.h"\r
-#include "ShaderResourceView11.h"\r
-#include "PixelShaderWrapper11.h"\r
-#include "PixelShader11.h"\r
-#include "ClassInstance11.h"\r
-\r
-using namespace System;\r
-\r
-namespace SlimDX\r
-{\r
-namespace Direct3D11\r
-{ \r
-       PixelShaderWrapper::PixelShaderWrapper( ID3D11DeviceContext* device )\r
-       {\r
-               if( device == 0 )\r
-                       throw gcnew ArgumentNullException( "device" );\r
-               deviceContext = device;\r
-       }\r
-\r
-       void PixelShaderWrapper::Set( PixelShader^ shader )\r
-       {\r
-               Set( shader, nullptr );\r
-       }\r
-\r
-       void PixelShaderWrapper::Set( PixelShader^ shader, array<ClassInstance^>^ classInstances )\r
-       {\r
-               ID3D11PixelShader *nativeShader = shader == nullptr ? NULL : shader->InternalPointer;\r
-               ID3D11ClassInstance** instancePtr = NULL;\r
-               stack_array<ID3D11ClassInstance*> instances;\r
-               UINT count = 0;\r
-\r
-               if( classInstances != nullptr && classInstances->Length > 0 )\r
-               {\r
-                       instances = stack_array<ID3D11ClassInstance*>( classInstances->Length );\r
-                       instancePtr = &instances[0];\r
-                       count = classInstances->Length;\r
-\r
-                       for( int i = 0; i < classInstances->Length; i++ )\r
-                               instances[i] = classInstances[i]->InternalPointer;\r
-               }\r
-\r
-               deviceContext->PSSetShader( nativeShader, instancePtr, count );\r
-       }\r
-\r
-       PixelShader^ PixelShaderWrapper::Get()\r
-       {\r
-               return Get( nullptr );\r
-       }\r
-\r
-       PixelShader^ PixelShaderWrapper::Get( array<ClassInstance^>^ classInstances )\r
-       {\r
-               ID3D11PixelShader *shader = NULL;\r
-               ID3D11ClassInstance** instancePtr = NULL;\r
-               stack_array<ID3D11ClassInstance*> instances;\r
-               UINT count = 0;\r
-\r
-               if( classInstances != nullptr && classInstances->Length > 0 )\r
-               {\r
-                       instances = stack_array<ID3D11ClassInstance*>( classInstances->Length );\r
-                       instancePtr = &instances[0];\r
-                       count = classInstances->Length;\r
-               }\r
-\r
-               deviceContext->PSGetShader( &shader, instancePtr, &count );\r
-\r
-               for( UINT i = 0; i < count; i++ )\r
-                       classInstances[i] = ClassInstance::FromPointer( instances[i] );\r
-\r
-               return shader == NULL ? nullptr : PixelShader::FromPointer( shader );\r
-       }\r
-\r
-       array<Buffer^>^ PixelShaderWrapper::GetConstantBuffers( int startSlot, int count )\r
-       {\r
-               array<Buffer^>^ buffers = gcnew array<Buffer^>( count );\r
-               stack_array<ID3D11Buffer*> results = stackalloc( ID3D11Buffer*, count );\r
-\r
-               deviceContext->PSGetConstantBuffers( startSlot, count, &results[0] );\r
-\r
-               for( int i = 0; i < count; i++ )\r
-                       buffers[i] = Buffer::FromPointer( results[i] );\r
-\r
-               return buffers;\r
-       }\r
-\r
-       array<SamplerState^>^ PixelShaderWrapper::GetSamplers( int startSlot, int count )\r
-       {\r
-               array<SamplerState^>^ samplers = gcnew array<SamplerState^>( count );\r
-               stack_array<ID3D11SamplerState*> results = stackalloc( ID3D11SamplerState*, count );\r
-\r
-               deviceContext->PSGetSamplers( startSlot, count, &results[0] );\r
-\r
-               for( int i = 0; i < count; i++ )\r
-                       samplers[i] = SamplerState::FromPointer( results[i] );\r
-\r
-               return samplers;\r
-       }\r
-\r
-       array<ShaderResourceView^>^ PixelShaderWrapper::GetShaderResources( int startSlot, int count )\r
-       {\r
-               array<ShaderResourceView^>^ resources = gcnew array<ShaderResourceView^>( count );\r
-               stack_array<ID3D11ShaderResourceView*> results = stackalloc( ID3D11ShaderResourceView*, count );\r
-\r
-               deviceContext->PSGetShaderResources( startSlot, count, &results[0] );\r
-\r
-               for( int i = 0; i < count; i++ )\r
-                       resources[i] = ShaderResourceView::FromPointer( results[i] );\r
-\r
-               return resources;\r
-       }\r
-\r
-       void PixelShaderWrapper::SetConstantBuffer( Buffer^ constantBuffer, int slot )\r
-       {\r
-               ID3D11Buffer *buffer = constantBuffer == nullptr ? NULL : constantBuffer->InternalPointer;\r
-               deviceContext->PSSetConstantBuffers( slot, 1, &buffer );\r
-       }\r
-\r
-       void PixelShaderWrapper::SetConstantBuffers( array<Buffer^>^ constantBuffers, int startSlot, int count )\r
-       {\r
-               if( count > constantBuffers->Length )\r
-                       throw gcnew ArgumentOutOfRangeException( "count" );\r
-\r
-               stack_array<ID3D11Buffer*> input = stackalloc( ID3D11Buffer*, count );\r
-               for( int i = 0; i < count; i++ )\r
-                       input[i] = constantBuffers[i] == nullptr ? NULL : constantBuffers[i]->InternalPointer;\r
-\r
-               deviceContext->PSSetConstantBuffers( startSlot, count, &input[0] );\r
-       }\r
-\r
-       void PixelShaderWrapper::SetSampler( SamplerState^ sampler, int slot )\r
-       {\r
-               ID3D11SamplerState *pointer = sampler == nullptr ? NULL : sampler->InternalPointer;\r
-               deviceContext->PSSetSamplers( slot, 1, &pointer );\r
-       }\r
-\r
-       void PixelShaderWrapper::SetSamplers( array<SamplerState^>^ samplers, int startSlot, int count )\r
-       {\r
-               if( count > samplers->Length )\r
-                       throw gcnew ArgumentOutOfRangeException( "count" );\r
-\r
-               stack_array<ID3D11SamplerState*> input = stackalloc( ID3D11SamplerState*, count );\r
-               for( int i = 0; i < count; i++ )\r
-                       input[i] = samplers[i] == nullptr ? NULL : samplers[i]->InternalPointer;\r
-\r
-               deviceContext->PSSetSamplers( startSlot, count, &input[0] );\r
-       }\r
-\r
-       void PixelShaderWrapper::SetShaderResource( ShaderResourceView^ resourceView, int slot )\r
-       {\r
-               ID3D11ShaderResourceView *resource = resourceView == nullptr ? NULL : resourceView->InternalPointer;\r
-               deviceContext->PSSetShaderResources( slot, 1, &resource );\r
-       }\r
-\r
-       void PixelShaderWrapper::SetShaderResources( array<ShaderResourceView^>^ resourceViews, int startSlot, int count )\r
-       {\r
-               if( count > resourceViews->Length )\r
-                       throw gcnew ArgumentOutOfRangeException( "count" );\r
-\r
-               stack_array<ID3D11ShaderResourceView*> input = stackalloc( ID3D11ShaderResourceView*, count );\r
-               for( int i = 0; i < count; i++ )\r
-                       input[i] = resourceViews[i] == nullptr ? NULL : resourceViews[i]->InternalPointer;\r
-\r
-               deviceContext->PSSetShaderResources( startSlot, count, &input[0] );\r
-       }\r
-}\r
-}\r