rhi: Remove color attachment pixel formats

Color attachment must always be an RGBA texture
This commit is contained in:
Eidolon 2023-03-24 16:11:11 -05:00
parent c31df8a0bb
commit 70c375f9db
6 changed files with 6 additions and 7 deletions

View file

@ -47,7 +47,7 @@ static const PipelineDesc kPalettedPipelineDescription = {
// 256x1 palette texture
SamplerName::kSampler1}},
std::nullopt,
{PixelFormat::kRGBA8, std::nullopt, {true, true, true, true}},
{std::nullopt, {true, true, true, true}},
PrimitiveType::kTriangles,
CullMode::kNone,
FaceWinding::kCounterClockwise,
@ -61,7 +61,7 @@ static const PipelineDesc kUnshadedPipelineDescription = {
{{// RGB/A texture
SamplerName::kSampler0}},
std::nullopt,
{PixelFormat::kRGBA8, std::nullopt, {true, true, true, true}},
{std::nullopt, {true, true, true, true}},
PrimitiveType::kTriangles,
CullMode::kNone,
FaceWinding::kCounterClockwise,

View file

@ -26,8 +26,7 @@ static const PipelineDesc kPipelineDesc = {
{{{{UniformName::kProjection}}, {{UniformName::kModelView, UniformName::kTexCoord0Transform}}}},
{{SamplerName::kSampler0}},
PipelineDepthStencilStateDesc {true, true, CompareFunc::kAlways, false, {}, {}},
{PixelFormat::kRGBA8,
BlendDesc {
{BlendDesc {
BlendFactor::kSourceAlpha,
BlendFactor::kOneMinusSourceAlpha,
BlendFunction::kAdd,

View file

@ -50,7 +50,7 @@ static const PipelineDesc kWipePipelineDesc = {
{{{{UniformName::kProjection, UniformName::kWipeColorizeMode, UniformName::kWipeEncoreSwizzle}}}},
{{SamplerName::kSampler0, SamplerName::kSampler1, SamplerName::kSampler2}},
std::nullopt,
{PixelFormat::kRGBA8, std::nullopt, {true, true, true, true}},
{std::nullopt, {true, true, true, true}},
PrimitiveType::kTriangles,
CullMode::kNone,
FaceWinding::kCounterClockwise,

View file

@ -345,7 +345,7 @@ static PipelineDesc make_pipeline_desc(TwodeePipelineKey key)
{{UniformName::kModelView, UniformName::kTexCoord0Transform, UniformName::kSampler0IsIndexedAlpha}}}},
{{SamplerName::kSampler0, SamplerName::kSampler1, SamplerName::kSampler2}},
std::nullopt,
{PixelFormat::kRGBA8, blend_desc, {true, true, true, true}},
{blend_desc, {true, true, true, true}},
key.lines ? PrimitiveType::kLines : PrimitiveType::kTriangles,
CullMode::kNone,
FaceWinding::kCounterClockwise,

View file

@ -1260,6 +1260,7 @@ void GlCoreRhi::begin_render_pass(Handle<GraphicsContext> ctx, const RenderPassB
SRB2_ASSERT(texture_slab_.is_valid(info.color_attachment));
auto& texture = texture_slab_[info.color_attachment];
SRB2_ASSERT(texture.desc.format == TextureFormat::kRGBA);
gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture.texture, 0);
GL_ASSERT;

View file

@ -397,7 +397,6 @@ struct PipelineDepthStencilStateDesc
struct PipelineColorStateDesc
{
PixelFormat format;
std::optional<BlendDesc> blend;
ColorMask color_mask;
};