mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 02:41:49 +00:00
rhi: Remove color attachment pixel formats
Color attachment must always be an RGBA texture
This commit is contained in:
parent
c31df8a0bb
commit
70c375f9db
6 changed files with 6 additions and 7 deletions
|
|
@ -47,7 +47,7 @@ static const PipelineDesc kPalettedPipelineDescription = {
|
||||||
// 256x1 palette texture
|
// 256x1 palette texture
|
||||||
SamplerName::kSampler1}},
|
SamplerName::kSampler1}},
|
||||||
std::nullopt,
|
std::nullopt,
|
||||||
{PixelFormat::kRGBA8, std::nullopt, {true, true, true, true}},
|
{std::nullopt, {true, true, true, true}},
|
||||||
PrimitiveType::kTriangles,
|
PrimitiveType::kTriangles,
|
||||||
CullMode::kNone,
|
CullMode::kNone,
|
||||||
FaceWinding::kCounterClockwise,
|
FaceWinding::kCounterClockwise,
|
||||||
|
|
@ -61,7 +61,7 @@ static const PipelineDesc kUnshadedPipelineDescription = {
|
||||||
{{// RGB/A texture
|
{{// RGB/A texture
|
||||||
SamplerName::kSampler0}},
|
SamplerName::kSampler0}},
|
||||||
std::nullopt,
|
std::nullopt,
|
||||||
{PixelFormat::kRGBA8, std::nullopt, {true, true, true, true}},
|
{std::nullopt, {true, true, true, true}},
|
||||||
PrimitiveType::kTriangles,
|
PrimitiveType::kTriangles,
|
||||||
CullMode::kNone,
|
CullMode::kNone,
|
||||||
FaceWinding::kCounterClockwise,
|
FaceWinding::kCounterClockwise,
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,7 @@ static const PipelineDesc kPipelineDesc = {
|
||||||
{{{{UniformName::kProjection}}, {{UniformName::kModelView, UniformName::kTexCoord0Transform}}}},
|
{{{{UniformName::kProjection}}, {{UniformName::kModelView, UniformName::kTexCoord0Transform}}}},
|
||||||
{{SamplerName::kSampler0}},
|
{{SamplerName::kSampler0}},
|
||||||
PipelineDepthStencilStateDesc {true, true, CompareFunc::kAlways, false, {}, {}},
|
PipelineDepthStencilStateDesc {true, true, CompareFunc::kAlways, false, {}, {}},
|
||||||
{PixelFormat::kRGBA8,
|
{BlendDesc {
|
||||||
BlendDesc {
|
|
||||||
BlendFactor::kSourceAlpha,
|
BlendFactor::kSourceAlpha,
|
||||||
BlendFactor::kOneMinusSourceAlpha,
|
BlendFactor::kOneMinusSourceAlpha,
|
||||||
BlendFunction::kAdd,
|
BlendFunction::kAdd,
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ static const PipelineDesc kWipePipelineDesc = {
|
||||||
{{{{UniformName::kProjection, UniformName::kWipeColorizeMode, UniformName::kWipeEncoreSwizzle}}}},
|
{{{{UniformName::kProjection, UniformName::kWipeColorizeMode, UniformName::kWipeEncoreSwizzle}}}},
|
||||||
{{SamplerName::kSampler0, SamplerName::kSampler1, SamplerName::kSampler2}},
|
{{SamplerName::kSampler0, SamplerName::kSampler1, SamplerName::kSampler2}},
|
||||||
std::nullopt,
|
std::nullopt,
|
||||||
{PixelFormat::kRGBA8, std::nullopt, {true, true, true, true}},
|
{std::nullopt, {true, true, true, true}},
|
||||||
PrimitiveType::kTriangles,
|
PrimitiveType::kTriangles,
|
||||||
CullMode::kNone,
|
CullMode::kNone,
|
||||||
FaceWinding::kCounterClockwise,
|
FaceWinding::kCounterClockwise,
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,7 @@ static PipelineDesc make_pipeline_desc(TwodeePipelineKey key)
|
||||||
{{UniformName::kModelView, UniformName::kTexCoord0Transform, UniformName::kSampler0IsIndexedAlpha}}}},
|
{{UniformName::kModelView, UniformName::kTexCoord0Transform, UniformName::kSampler0IsIndexedAlpha}}}},
|
||||||
{{SamplerName::kSampler0, SamplerName::kSampler1, SamplerName::kSampler2}},
|
{{SamplerName::kSampler0, SamplerName::kSampler1, SamplerName::kSampler2}},
|
||||||
std::nullopt,
|
std::nullopt,
|
||||||
{PixelFormat::kRGBA8, blend_desc, {true, true, true, true}},
|
{blend_desc, {true, true, true, true}},
|
||||||
key.lines ? PrimitiveType::kLines : PrimitiveType::kTriangles,
|
key.lines ? PrimitiveType::kLines : PrimitiveType::kTriangles,
|
||||||
CullMode::kNone,
|
CullMode::kNone,
|
||||||
FaceWinding::kCounterClockwise,
|
FaceWinding::kCounterClockwise,
|
||||||
|
|
|
||||||
|
|
@ -1260,6 +1260,7 @@ void GlCoreRhi::begin_render_pass(Handle<GraphicsContext> ctx, const RenderPassB
|
||||||
|
|
||||||
SRB2_ASSERT(texture_slab_.is_valid(info.color_attachment));
|
SRB2_ASSERT(texture_slab_.is_valid(info.color_attachment));
|
||||||
auto& texture = texture_slab_[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_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture.texture, 0);
|
||||||
GL_ASSERT;
|
GL_ASSERT;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -397,7 +397,6 @@ struct PipelineDepthStencilStateDesc
|
||||||
|
|
||||||
struct PipelineColorStateDesc
|
struct PipelineColorStateDesc
|
||||||
{
|
{
|
||||||
PixelFormat format;
|
|
||||||
std::optional<BlendDesc> blend;
|
std::optional<BlendDesc> blend;
|
||||||
ColorMask color_mask;
|
ColorMask color_mask;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue