@@ -261,6 +261,8 @@ CRenderTarget::CRenderTarget()
261
261
const u32 SampleCount = options.msaa ? options.msaa_samples : 1u ;
262
262
const u32 BoundSamples = options.msaa_opt ? 1u : options.msaa_samples ;
263
263
264
+ const D3DFORMAT mainColorFormat = options.linear_space_rendering ? D3DFMT_HACK_R8G8B8A8_UNORM_SRGB : D3DFMT_A8R8G8B8;
265
+
264
266
#ifdef DEBUG
265
267
Msg (" MSAA samples = %d" , SampleCount);
266
268
if (options.msaa_opt )
@@ -327,7 +329,7 @@ CRenderTarget::CRenderTarget()
327
329
if (options.mrtmixdepth )
328
330
{
329
331
// NV50
330
- rt_Color.create (r2_RT_albedo, w, h, (D3DFORMAT) 666 , SampleCount);
332
+ rt_Color.create (r2_RT_albedo, w, h, mainColorFormat , SampleCount);
331
333
rt_Accumulator.create (r2_RT_accum, w, h, D3DFMT_A16B16G16R16F, SampleCount);
332
334
}
333
335
else
@@ -358,10 +360,10 @@ CRenderTarget::CRenderTarget()
358
360
}
359
361
360
362
// generic(LDR) RTs
361
- rt_Generic_0.create (r2_RT_generic0, w, h, (D3DFORMAT) 666 , 1 );
362
- rt_Generic_1.create (r2_RT_generic1, w, h, (D3DFORMAT) 666 , 1 );
363
+ rt_Generic_0.create (r2_RT_generic0, w, h, mainColorFormat , 1 );
364
+ rt_Generic_1.create (r2_RT_generic1, w, h, mainColorFormat , 1 );
363
365
#if defined(USE_DX11) || defined(USE_OGL)
364
- rt_Generic.create (r2_RT_generic, w, h, (D3DFORMAT) 666 , 1 );
366
+ rt_Generic.create (r2_RT_generic, w, h, mainColorFormat , 1 );
365
367
#endif
366
368
if (!options.msaa )
367
369
{
@@ -370,8 +372,8 @@ CRenderTarget::CRenderTarget()
370
372
}
371
373
else
372
374
{
373
- rt_Generic_0_r.create (r2_RT_generic0_r, w, h, (D3DFORMAT) 666 , SampleCount);
374
- rt_Generic_1_r.create (r2_RT_generic1_r, w, h, (D3DFORMAT) 666 , SampleCount);
375
+ rt_Generic_0_r.create (r2_RT_generic0_r, w, h, mainColorFormat , SampleCount);
376
+ rt_Generic_1_r.create (r2_RT_generic1_r, w, h, mainColorFormat , SampleCount);
375
377
}
376
378
// Igor: for volumetric lights
377
379
// rt_Generic_2.create (r2_RT_generic2,w,h,D3DFMT_A8R8G8B8 );
@@ -631,7 +633,7 @@ CRenderTarget::CRenderTarget()
631
633
632
634
// BLOOM
633
635
{
634
- D3DFORMAT fmt = (D3DFORMAT) 666 ; // D3DFMT_X8R8G8B8 ;
636
+ D3DFORMAT fmt = mainColorFormat ;
635
637
u32 w = BLOOM_size_X, h = BLOOM_size_Y;
636
638
constexpr u32 fvf_build = D3DFVF_XYZRHW | D3DFVF_TEX4 | D3DFVF_TEXCOORDSIZE2 (0 ) | D3DFVF_TEXCOORDSIZE2 (1 ) |
637
639
D3DFVF_TEXCOORDSIZE2 (2 ) | D3DFVF_TEXCOORDSIZE2 (3 );
0 commit comments