MCPcopy Create free account
hub / github.com/dolphin-emu/dolphin / WriteCC4Encoder

Function WriteCC4Encoder

Source/Core/VideoCommon/TextureConversionShader.cpp:422–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420}
421
422static void WriteCC4Encoder(char*& p, const char* comp,API_TYPE ApiType)
423{
424 WriteSwizzler(p, GX_CTF_RA4, ApiType);
425 WRITE(p, " float2 texSample;\n");
426 WRITE(p, " float4 color0;\n");
427 WRITE(p, " float4 color1;\n");
428
429 WriteSampleColor(p, comp, "texSample", 0, ApiType);
430 WRITE(p, " color0.b = texSample.x;\n");
431 WRITE(p, " color1.b = texSample.y;\n");
432
433 WriteSampleColor(p, comp, "texSample", 1, ApiType);
434 WRITE(p, " color0.g = texSample.x;\n");
435 WRITE(p, " color1.g = texSample.y;\n");
436
437 WriteSampleColor(p, comp, "texSample", 2, ApiType);
438 WRITE(p, " color0.r = texSample.x;\n");
439 WRITE(p, " color1.r = texSample.y;\n");
440
441 WriteSampleColor(p, comp, "texSample", 3, ApiType);
442 WRITE(p, " color0.a = texSample.x;\n");
443 WRITE(p, " color1.a = texSample.y;\n");
444
445 WriteToBitDepth(p, 4, "color0", "color0");
446 WriteToBitDepth(p, 4, "color1", "color1");
447
448 WRITE(p, " ocol0 = (color0 * 16.0 + color1) / 255.0;\n");
449 WriteEncoderEnd(p);
450}
451
452static void WriteCC8Encoder(char*& p, const char* comp, API_TYPE ApiType)
453{

Callers 1

GenerateEncodingShaderFunction · 0.85

Calls 4

WriteSwizzlerFunction · 0.85
WriteSampleColorFunction · 0.85
WriteToBitDepthFunction · 0.85
WriteEncoderEndFunction · 0.85

Tested by

no test coverage detected