PixelShaderPtr CompileAndCreatePixelShader(const std::string& code, const D3D_SHADER_MACRO* pDefines, const char* pEntry) { D3DBlob blob; if (CompileShader(DX11::D3D::ShaderType::Pixel, code, blob, pDefines, pEntry)) { return CreatePixelShaderFromByteCode(blob); } return nullptr; }
ID3D11PixelShader* CompileAndCreatePixelShader(const std::string& code) { D3DBlob* blob = nullptr; CompilePixelShader(code, &blob); if (blob) { ID3D11PixelShader* p_shader = CreatePixelShaderFromByteCode(blob); blob->Release(); return p_shader; } return nullptr; }
ID3D11PixelShader* CompileAndCreatePixelShader(const char* code, unsigned int len) { D3DBlob* blob = NULL; CompilePixelShader(code, len, &blob); if (blob) { ID3D11PixelShader* p_shader = CreatePixelShaderFromByteCode(blob); blob->Release(); return p_shader; } return NULL; }
ID3D11PixelShader* CompileAndCreatePixelShader(const char* code, unsigned int len, const D3D_SHADER_MACRO* pDefines) { D3DBlob* blob = NULL; CompilePixelShader(code, len, &blob, pDefines); if (blob) { ID3D11PixelShader* p_shader = CreatePixelShaderFromByteCode(blob); blob->Release(); return p_shader; } PanicAlert("Failed to compile and create pixel shader, %s %d\n", __FILE__, __LINE__); return NULL; }