diff options
| author | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2011-06-10 19:16:09 +0000 |
|---|---|---|
| committer | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2011-06-10 19:16:09 +0000 |
| commit | e5210de9d5da0cdbe5b8a8171b21d9ab9c5a8d5c (patch) | |
| tree | 779ad09fcaba601fe2962e821bc7a35720a41a25 /Source/Core/VideoCommon | |
| parent | 3fceffd8c0af89bd1aee7badf1a85d30933dc299 (diff) | |
just a little cleanup to maintain minimal interfaces
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7591 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/PixelShaderGen.h | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/TextureConversionShader.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexShaderGen.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VideoCommon.h | 12 |
5 files changed, 15 insertions, 13 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index f1a3eded7f..530ecd54bb 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -380,7 +380,7 @@ static void BuildSwapModeTable() } } -const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType, u32 components, bool hlsl_sm_2_0 ) +const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType, u32 components) { setlocale(LC_NUMERIC, "C"); // Reset locale for compilation text[sizeof(text) - 1] = 0x7C; // canary @@ -460,7 +460,7 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType WRITE(p, " out float4 ocol0 : COLOR0,%s%s\n in float4 rawpos : %s,\n", dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND ? "\n out float4 ocol1 : COLOR1," : "", DepthTextureEnable ? "\n out float depth : DEPTH," : "", - ApiType == API_OPENGL ? "WPOS" : hlsl_sm_2_0 ? "POSITION" : "VPOS"); + ApiType & API_OPENGL ? "WPOS" : ApiType & API_D3D9_SM20 ? "POSITION" : "VPOS"); } else { diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.h b/Source/Core/VideoCommon/Src/PixelShaderGen.h index ad6533b4e6..b495703a13 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.h +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.h @@ -113,7 +113,7 @@ enum DSTALPHA_MODE DSTALPHA_DUAL_SOURCE_BLEND // Use dual-source blending }; -const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType, u32 components, bool hlsl_sm_2_0 = false); +const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType, u32 components); void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode); extern PIXELSHADERUID last_pixel_shader_uid; diff --git a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp index c24a11b180..c921a1a9fd 100644 --- a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp +++ b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp @@ -80,7 +80,7 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType) { WRITE(p,"uniform samplerRECT samp0 : register(s0);\n"); } - else if (ApiType == API_D3D9) + else if (ApiType & API_D3D9) { WRITE(p,"uniform sampler samp0 : register(s0);\n"); } @@ -150,7 +150,7 @@ void Write32BitSwizzler(char*& p, u32 format, API_TYPE ApiType) { WRITE(p,"uniform samplerRECT samp0 : register(s0);\n"); } - else if (ApiType == API_D3D9) + else if (ApiType & API_D3D9) { WRITE(p,"uniform sampler samp0 : register(s0);\n"); } @@ -209,7 +209,7 @@ void Write32BitSwizzler(char*& p, u32 format, API_TYPE ApiType) void WriteSampleColor(char*& p, const char* colorComp, const char* dest, API_TYPE ApiType) { const char* texSampleOpName; - if (ApiType == API_D3D9) + if (ApiType & API_D3D9) texSampleOpName = "tex2D"; else if (ApiType == API_D3D11) texSampleOpName = "tex0.Sample"; diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index 8f858f71ce..747b95c0da 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -112,7 +112,7 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type) _assert_(bpmem.genMode.numtexgens == xfregs.numTexGen.numTexGens); _assert_(bpmem.genMode.numcolchans == xfregs.numChan.numColorChans); - bool is_d3d = (api_type == API_D3D9 || api_type == API_D3D11); + bool is_d3d = (api_type & API_D3D9 || api_type == API_D3D11); u32 lightMask = 0; if (xfregs.numChan.numColorChans > 0) lightMask |= xfregs.color[0].GetFullLightMask() | xfregs.alpha[0].GetFullLightMask(); @@ -187,7 +187,7 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type) // transforms if (components & VB_HAS_POSMTXIDX) { - if (api_type == API_D3D9) + if (api_type & API_D3D9) { WRITE(p, "int4 indices = D3DCOLORtoUBYTE4(blend_indices);\n"); WRITE(p, "int posmtx = indices.x;\n"); diff --git a/Source/Core/VideoCommon/Src/VideoCommon.h b/Source/Core/VideoCommon/Src/VideoCommon.h index b0e01012fd..030c1f0b32 100644 --- a/Source/Core/VideoCommon/Src/VideoCommon.h +++ b/Source/Core/VideoCommon/Src/VideoCommon.h @@ -107,11 +107,13 @@ struct TargetRectangle : public MathUtil::Rectangle<int> typedef enum { - API_OPENGL, - API_D3D9, - API_D3D11, - API_GLSL, - API_NONE + API_OPENGL = 1, + API_D3D9_SM30 = 2, + API_D3D9_SM20 = 4, + API_D3D9 = 6, + API_D3D11 = 8, + API_GLSL = 16, + API_NONE = 32 } API_TYPE; inline u32 RGBA8ToRGBA6ToRGBA8(u32 src) |
