mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-05 23:58:59 +00:00
ShaderGeneration: Get rid of static buffers
This commit is contained in:
parent
be8410dcad
commit
8ce3a4aa70
11 changed files with 63 additions and 118 deletions
|
@ -5,16 +5,12 @@
|
|||
#include <cmath>
|
||||
|
||||
#include "VideoCommon/BPMemory.h"
|
||||
#include "VideoCommon/CPMemory.h"
|
||||
#include "VideoCommon/DriverDetails.h"
|
||||
#include "VideoCommon/LightingShaderGen.h"
|
||||
#include "VideoCommon/NativeVertexFormat.h"
|
||||
#include "VideoCommon/VertexLoaderManager.h"
|
||||
#include "VideoCommon/VertexShaderGen.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
static char text[16768];
|
||||
|
||||
template<class T>
|
||||
static inline T GenerateVertexShader(API_TYPE api_type)
|
||||
{
|
||||
|
@ -26,12 +22,6 @@ static inline T GenerateVertexShader(API_TYPE api_type)
|
|||
if (uid_data == nullptr)
|
||||
uid_data = &dummy_data;
|
||||
|
||||
out.SetBuffer(text);
|
||||
const bool is_writing_shadercode = (out.GetBuffer() != nullptr);
|
||||
|
||||
if (is_writing_shadercode)
|
||||
text[sizeof(text) - 1] = 0x7C; // canary
|
||||
|
||||
_assert_(bpmem.genMode.numtexgens == xfmem.numTexGen.numTexGens);
|
||||
_assert_(bpmem.genMode.numcolchans == xfmem.numChan.numColorChans);
|
||||
|
||||
|
@ -390,12 +380,6 @@ static inline T GenerateVertexShader(API_TYPE api_type)
|
|||
}
|
||||
out.Write("}\n");
|
||||
|
||||
if (is_writing_shadercode)
|
||||
{
|
||||
if (text[sizeof(text) - 1] != 0x7C)
|
||||
PanicAlert("VertexShader generator - buffer too small, canary has been eaten!");
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue