minor update

This commit is contained in:
Blaise Tine
2021-08-03 12:22:15 -07:00
parent c35434bd8f
commit b3aaac4903

View File

@@ -14,41 +14,41 @@ module VX_tex_format #(
always @(*) begin always @(*) begin
case (format) case (format)
`TEX_FORMAT_R5G6B5: begin `TEX_FORMAT_R5G6B5: begin
texel_out_r[07:00] = `TEX_COLOR_BITS'({texel_in[15:11],texel_in[15:13]}); texel_out_r[07:00] = {texel_in[15:11], texel_in[15:13]};
texel_out_r[15:08] = `TEX_COLOR_BITS'({texel_in[10:5],texel_in[10:9]}); texel_out_r[15:08] = {texel_in[10:5], texel_in[10:9]};
texel_out_r[23:16] = `TEX_COLOR_BITS'({texel_in[4:0],texel_in[4:2]}); texel_out_r[23:16] = {texel_in[4:0], texel_in[4:2]};
texel_out_r[31:24] = {`TEX_COLOR_BITS{1'b1}}; texel_out_r[31:24] = 8'hff;
end end
`TEX_FORMAT_R4G4B4A4: begin `TEX_FORMAT_R4G4B4A4: begin
texel_out_r[07:00] = `TEX_COLOR_BITS'({texel_in[11:8],texel_in[15:12]}); texel_out_r[07:00] = {texel_in[11:8], texel_in[15:12]};
texel_out_r[15:08] = `TEX_COLOR_BITS'({2{texel_in[7:4]}}); texel_out_r[15:08] = {2{texel_in[7:4]}};
texel_out_r[23:16] = `TEX_COLOR_BITS'({2{texel_in[3:0]}}); texel_out_r[23:16] = {2{texel_in[3:0]}};
texel_out_r[31:24] = `TEX_COLOR_BITS'({2{texel_in[15:12]}}); texel_out_r[31:24] = {2{texel_in[15:12]}};
end end
`TEX_FORMAT_L8A8: begin `TEX_FORMAT_L8A8: begin
texel_out_r[07:00] = `TEX_COLOR_BITS'(texel_in[7:0]); texel_out_r[07:00] = texel_in[7:0];
texel_out_r[15:08] = `TEX_COLOR_BITS'(texel_in[7:0]); texel_out_r[15:08] = texel_in[7:0];
texel_out_r[23:16] = `TEX_COLOR_BITS'(texel_in[7:0]); texel_out_r[23:16] = texel_in[7:0];
texel_out_r[31:24] = `TEX_COLOR_BITS'(texel_in[15:8]); texel_out_r[31:24] = texel_in[15:8];
end end
`TEX_FORMAT_A8: begin `TEX_FORMAT_A8: begin
texel_out_r[07:00] = `TEX_COLOR_BITS'(0); texel_out_r[07:00] = 0;
texel_out_r[15:08] = `TEX_COLOR_BITS'(0); texel_out_r[15:08] = 0;
texel_out_r[23:16] = `TEX_COLOR_BITS'(0); texel_out_r[23:16] = 0;
texel_out_r[31:24] = `TEX_COLOR_BITS'(texel_in[7:0]); texel_out_r[31:24] = texel_in[7:0];
end end
`TEX_FORMAT_L8: begin `TEX_FORMAT_L8: begin
texel_out_r[07:00] = `TEX_COLOR_BITS'(texel_in[7:0]); texel_out_r[07:00] = texel_in[7:0];
texel_out_r[15:08] = `TEX_COLOR_BITS'(texel_in[7:0]); texel_out_r[15:08] = texel_in[7:0];
texel_out_r[23:16] = `TEX_COLOR_BITS'(texel_in[7:0]); texel_out_r[23:16] = texel_in[7:0];
texel_out_r[31:24] = {`TEX_COLOR_BITS{1'b1}}; texel_out_r[31:24] = 8'hff;
end end
// `TEX_FORMAT_R8G8B8A8 // `TEX_FORMAT_R8G8B8A8
default: begin default: begin
texel_out_r[07:00] = `TEX_COLOR_BITS'(texel_in[7:0]); texel_out_r[07:00] = texel_in[7:0];
texel_out_r[15:08] = `TEX_COLOR_BITS'(texel_in[15:8]); texel_out_r[15:08] = texel_in[15:8];
texel_out_r[23:16] = `TEX_COLOR_BITS'(texel_in[23:16]); texel_out_r[23:16] = texel_in[23:16];
texel_out_r[31:24] = `TEX_COLOR_BITS'(texel_in[31:24]); texel_out_r[31:24] = texel_in[31:24];
end end
endcase endcase
end end