mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 21:30:19 -06:00
some fixes to my last commit and ....
modify shader generator to produce native sm 4.0 code. eliminate compatibility mode in dx11 so now all shader must work much better. please test. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5691 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -51,17 +51,26 @@ ID3D11InputLayout* VertexShaderCache::GetClearInputLayout() { return ClearLayout
|
||||
unsigned int vs_constant_offset_table[238];
|
||||
void SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4)
|
||||
{
|
||||
D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number] ] = f1;
|
||||
D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]+1] = f2;
|
||||
D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]+2] = f3;
|
||||
D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]+3] = f4;
|
||||
D3D::gfxstate->vscbufchanged = true;
|
||||
if(D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number] ] != f1
|
||||
|| D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]+1] != f2
|
||||
|| D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]+2] != f3
|
||||
|| D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]+3] != f4)
|
||||
{
|
||||
D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number] ] = f1;
|
||||
D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]+1] = f2;
|
||||
D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]+2] = f3;
|
||||
D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]+3] = f4;
|
||||
D3D::gfxstate->vscbufchanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
void SetVSConstant4fv(unsigned int const_number, const float* f)
|
||||
{
|
||||
memcpy(&D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]], f, sizeof(float)*4);
|
||||
D3D::gfxstate->vscbufchanged = true;
|
||||
if(memcmp(&D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]], f, sizeof(float)*4))
|
||||
{
|
||||
memcpy(&D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]], f, sizeof(float)*4);
|
||||
D3D::gfxstate->vscbufchanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const float* f)
|
||||
@ -69,14 +78,18 @@ void SetMultiVSConstant3fv(unsigned int const_number, unsigned int count, const
|
||||
for (unsigned int i = 0; i < count; i++)
|
||||
{
|
||||
memcpy(&D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number+i]], f+3*i, sizeof(float)*3);
|
||||
D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number+i]+3] = 0.f;
|
||||
D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number+i]+3] = 0.f;
|
||||
}
|
||||
D3D::gfxstate->vscbufchanged = true;
|
||||
}
|
||||
|
||||
void SetMultiVSConstant4fv(unsigned int const_number, unsigned int count, const float* f)
|
||||
{
|
||||
memcpy(&D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]], f, sizeof(float)*4*count);
|
||||
D3D::gfxstate->vscbufchanged = true;
|
||||
if(memcmp(&D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]], f, sizeof(float)*4*count))
|
||||
{
|
||||
memcpy(&D3D::gfxstate->vsconstants[vs_constant_offset_table[const_number]], f, sizeof(float)*4*count);
|
||||
D3D::gfxstate->vscbufchanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
// this class will load the precompiled shaders into our cache
|
||||
|
Reference in New Issue
Block a user